7. Ignore test files
First, we will pass the analysis if the file is a test file. We will skip the analysis if the file starts with test_
or ends with _test.py
.
Therefore, we add the following code at the beginning of the visit function. This code exists the visit function if the test matches the patterns in the condition.
1if (filename.includes("_test.py") || filename.includes("test_")) {
2 return;
3}
Let's go!
Start interacting with the tutorial!
my-new-rule.js