A.12 Linting
A linter is an application that scans your code looking for errors or variations from stylistic conventions. Many IDEs like Visual Studio Code have built-in support for one or more linters. [VSL] A linter does static analysis in that it does not run your code and only looks at what you have written.
A linter usually has three classes of messages:
- Informational – “You might want to know about this, but you will likely get annoyed if I keep telling you.”
- Warning – “You did something here that might cause problems, or you are not following formatting conventions. Don’t procrastinate, and take a look now.”
- Error – “Fix this. Now.”
A good Python linter to start with is pylint. Install it via:
pip install pylint
Once you have it installed, issuing pylint --help
from the operating...