4. Write your rule
Now, it's time to write your rule! When there is a match for your pattern, the function visit is invoked by the static analyzer. This function is the one that reports errors in your code.
Let's first look at the function signature of the analysis rule:
function visit(pattern, filename, code)
- pattern: this value represent the pattern that matches.
- filename: the filename being analyzed. For example, if the user edits the file foo/bar.py in their IDE, the value "foo/bar.py" will be passed for filename.
- code: the code as a text.
Start interacting with the tutorial!