|
| 1 | +**Arduino Lint** inspects Arduino projects for common problems. This is done by checking the project against a series of |
| 2 | +"rules", each of which is targeted to detecting a specific potential issue. Only the rules of relevance to the project |
| 3 | +being linted are applied. |
| 4 | + |
| 5 | +## Rule documentation |
| 6 | + |
| 7 | +Additional information is available for each of the **Arduino Lint** rules, organized by project type: |
| 8 | + |
| 9 | +- [Sketch](rules/sketch.md) |
| 10 | +- [Library](rules/library.md) |
| 11 | +- [Boards platform](rules/platform.md) |
| 12 | +- [Package index](rules/package-index.md) |
| 13 | + |
| 14 | +## Rule ID |
| 15 | + |
| 16 | +In order to allow particular rules to be referenced unequivocally, each has been assigned a permanent unique |
| 17 | +identification code (e.g., `SS001`). |
| 18 | + |
| 19 | +## Rule level |
| 20 | + |
| 21 | +In addition to checking for critical flaws, **Arduino Lint** also advocates for best practices in Arduino projects. For |
| 22 | +this reason, not all rule violations are treated as fatal linting errors. |
| 23 | + |
| 24 | +A violation of a rule is assigned a level according to its severity. In cases where a rule violation indicates a serious |
| 25 | +problem with the project, the violation is treated as an error, and will result in a non-zero exit status from the |
| 26 | +`arduino-lint` command. In cases where the violation indicates a possible problem, or where the rule is a recommendation |
| 27 | +for an optional improvement to enhance the project user's experience, the violation is treated as a warning. It is hoped |
| 28 | +that these warning-level violations will be given consideration by the user, but they do not affect the `arduino-lint` |
| 29 | +exit status. |
| 30 | + |
| 31 | +Of the hundreds of rules provided by **Arduino Lint**, only the ones relevant to the current target project are applied, |
| 32 | +with the rest disabled. |
| 33 | + |
| 34 | +The rule levels and enabled subset of rules is dependent on the target project type and how the user has configured |
| 35 | +Arduino Lint via the [command line flags](commands/arduino-lint.md) and |
| 36 | +[environment variables](index.md#environment-variables). |
| 37 | + |
| 38 | +## Projects and "superprojects" |
| 39 | + |
| 40 | +Arduino projects may contain other Arduino projects as subprojects. For example, the libraries |
| 41 | +[bundled](https://arduino.github.io/arduino-cli/latest/platform-specification/#platform-bundled-libraries) with an |
| 42 | +Arduino boards platform. These subprojects may, in turn, contain their own subprojects, such as the example sketches |
| 43 | +included with a platform bundled library. |
| 44 | + |
| 45 | +**Arduino Lint** also lints any subprojects the target project might contain. The type of the top level "superproject" |
| 46 | +is a factor in the configuration of some rules. For example, there is no need to take Library Manager requirements into |
| 47 | +consideration in the case of a platform bundled library, since it will never be distributed via that system. |
0 commit comments