Arduino Lint: What It Is, How to Install It and Use It

by MrDIYLab in Circuits > Arduino

1151 Views, 0 Favorites, 0 Comments

Arduino Lint: What It Is, How to Install It and Use It

arduino lint (1).png

This video provides an overview of Arduino Lint, shows you a quick installation and tells you how to get started!

Watch the Tutorial Video

Arduino Lint: What it is, How to Install it & Use it

Feel free to add your questions in the comment section of the YouTube video.

What It Is

Screen Shot 2021-01-30 at 1.25.48 PM.png

Arduino Lint is a command line tool that's not part of the arduino IDE. You can install it on your computer to check for common problems with your arduino projects.

Its focus is on the structure, so don't confuse it with code structure because it's different. It also checks the metadata, for example, if you are missing the LICENSE file. And it also checks the configuration of arduino projects, like if it finds prohibited characters and file names again.

It does not check your actual code for potential bugs. Think of it as checking the metadata or the 'user experience' around your project.

Install It

Screen Shot 2021-01-30 at 1.22.43 PM.png
Screen Shot 2021-01-30 at 1.22.38 PM.png

To install it follow the instructions on the Arduino Lint installation page. You can either install it using a script which i'm going to use or you can download a pre-built binary.

The script does a good job at checking your Operating System, getting the right version for you, and installing it in the current folder ... and i believe it also handles updates.

Use It

Screen Shot 2021-01-30 at 1.22.31 PM.png
Screen Shot 2021-01-30 at 1.22.49 PM.png
Screen Shot 2021-01-30 at 1.22.58 PM.png

The full list of commands can be found on the Arduino Lint command reference page or by typing 'arduino-lint --help'. The simplest form of the command is to pass it the full path of the arduino project.

For example, in my project it's telling me that i have 2 warnings: a missing README file and a missing LICENSE file. So i have 2 warnings and no errors so i'm getting a PASS since i don't have any errors.


It's that simple!

.. and if you want to take this further, you can use their GitHub CI integrations to automate this test.

Done

I highly encourage you to give it a try or at least visit their GitHub project page and read through it.

You should now be armed with the basic understanding of what Arduino Lint does and how install and use it.

I recommend checking out my Arduino projects on my other instructables and on my YouTube channel.

If you found this useful, please consider subscribing to my YouTube channel - It helps a lot.
If you are interested in supporting my work, you can check my website.