Expand description
The example project of each rule: a small project that makes the rule report a finding.
The files are in crates/api/rule-examples/<rule>/, where <rule> is the
rule id without its namespace prefix:
files/holds the project. For a rule of theauditcommand, it holds the project after the change.base/holds the project before the change. Only anauditrule has it. A file ofbase/thatfiles/does not have stays as it is.example.jsonis optional.argsare the arguments after the command that the finding needs.hiddenlists the files that a reader does not need to understand the finding, such as a plainpackage.json.
explain_examples_table.rs embeds the files. The CLI integration test rule_example_tests
runs fallow on each project and checks that the rule reports it, so an
example cannot go stale.
Structs§
- Example
File - One file of an example project.
- Rule
Example - The example project of one rule.
Functions§
- rule_
example - The example project of
rule.Nonewhen the rule needs data that a small project does not have, such as production runtime data. - rule_
examples - Every example project, in order of rule id.