The linting of code/documentation can be categorized as dealing with formatting, syntax, or semantics. Once the rules for a given project are defined, many of these rules can be checked automatically with tooling.
pre-commit tool is a very useful, open source, well maintained, and popular tool/framework to help automate linting checks in general. It provides some of the following key features:
-
a great number of support hooks for linting
-
including direct support by many of the maintainers of best in class linters (ex: python linter black)
-
hook plugins allow adding these and versioning to control updates
-
-
support for creating new custom hooks easily
-
can be run before
git commit
(i.e. "pre-commit") so authors can detect and fix problems sooner in the workflow -
can also be run in continuous integration (CI) to ensure checks are run for every pull request