Arduino Lint (original) (raw)

Home

Arduino Lint is a command line tool that checks for common problems with Arduinoprojects.

Its focus is on the structure, metadata, and configuration of Arduino projects, rather than the code. Rulescover specification compliance, Library Manager submission requirements, and best practices.

Installation

See the installation instructions.

Getting started

Once installed, you only need to open a terminal at your project folder and run the command:

This will automatically detect the project type and check it against the relevant rules.

The default configuration of Arduino Lint provides for the most common use case, but you have the option of changing settings via command line flags:

Compliance setting

The --compliance flag allows you to configure the strictness of the applied rules. The three compliance level values accepted by this flag are:

Library Manager setting

Arduino Library Manageris the best way to provide installation and updates of Arduino libraries. In order to be accepted for inclusion in Library Manager, a library is required to meetsome requirements.

Arduino Lint provides checks for these requirements as well, controlled by the --library-manager flag.

The Library Manager submission-specific rules are enabled via --library-manager submit. Even if your library isn't yet ready to be added to Library Manager, it's a good idea to use this setting to ensure no incompatibilities are introduced.

Once your library is in the Library Manager index, each release is automatically picked up and made available to the Arduino community. Releases are also subject to special rules. The command arduino-lint --library-manager update will tell you whether your library is compliant with these rules.

Integration

The --format flag configures the format of arduino-lint's output. The default --format text setting provides human readable output. For automation or integration with other tools, the machine readable output provided by --format jsonmay be more convenient. This setting exposes every detail of the rules that were applied.

The --report-file flag causes arduino-lint to write the JSON output to the specified file.

Environment variables

Additional configuration options intended for internal use or development can be set via environment variables:

Continuous integration

Arduino Lint would be a great addition to yourcontinuous integration system. Running the tool after each change to the project can allow you to identify any problems that were introduced.

This is easily done by using the arduino/arduino-lint-action GitHub Actions action:https://github.com/arduino/arduino-lint-action

Add a simple workflow file to the repository of your Arduino project and GitHub will automatically run Arduino Lint on every pull request and push.

Support and feedback

You can discuss or get assistance with using Arduino Lint on theArduino Forum.

Feedback is welcome! Please submit feature requests or bug reports to theissue tracker.