Tutorials

Create Pattern Rules

BackNext

3. Define your pattern

Pattern: assert ${something} With this pattern, the analyzer will catch every line that looks like assert followed by some text. It captures the text in a variable called something, and you can check the value of this variable in the visit function.

1assert ${something}

The pattern above will match the following text and the variable something will have the value myVariable:

1assert myVariable

But will not match:

1doSomething myVariable

Let's go!

Start interacting with the tutorial!

Rule type

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.