Tutorials

Create AST Rules

BackNext

11. Test your rule

Click the Run all button to test your rule. Select between No error and Has error radio buttons on the test to try different outputs.

When your test case expect an error our custom rule engine will show a code annotation with potential fixes.

To apply a fix hover the code annotation and click on the “Apply fix” button.

Oops!

You must run the tests.

my-new-rule

program.py

print("bla")

program_2.py

print("foo")

program_test.py

print("foo")
Codiga Logo
Codiga Hub
  • Rulesets
  • Playground
  • Snippets
  • Cookbooks
soc-2 icon

We are SOC-2 Compliance Certified

G2 high performer medal

Codiga – All rights reserved 2022.