Calling pylint
from the pre-commit hooks, rather than individual GitHub workflow steps. Allows it to be called on a contributor's computer before being pushed to GitHub and failing a test build
The changes are relatively simple. It only requires adding two (2) new hooks against a placeholder local
repo. The two separate calls in the included file have to do with the different calls and parameters currently in the workflow. The separate calls are as follows, and match the current process within the .github/workflows/build.yml
configuration:
-
The
pylint
execution with the configuration values within the.pylintrc
file, without exception. This is for all files and/or directories (and their contents) which start withadafruit_
and end in.py
. Following the default naming patterns, particularly when using Cookiecutter and the Adafruit Cookiecutter template, should catch and lint all library-only files, and not the examples or other files. -
The
pylint
execution with with the configuration from the.pylingrc
file, but with some rules or checkes disabled for the example scripts. That means that linting is only performed on*.py
files within the/examples/
directory, if there is such a directory. The difference with the library rules are that the following rules/checks are disabled:
- missing-docstring
- invalid-name
- bad-whitespace