super-linter
super-linter copied to clipboard
Add pre-commit to run as a standalone linter
Is your feature request related to a problem? Please describe.
Pre-commit has quite a few useful (Python-based) hooks: https://github.com/pre-commit/pre-commit-hooks
We could (relatively) easily integrate it because it supports a standalone mode. Example:
pre-commit run --all-files
Describe the solution you'd like
Run pre-commit as part of super-linter
Additional context
We could also deprecate bash-exec
and git-merge-conflict-markers
, and rely on those pre-commit hooks instead.
@lindluni What do you think?
I love this idea! Especially to replace bash-exec, but it would be great to pick up at least some of their out of the box hooks.
Using pre-commit would also open a way of eventually offloading some tasks. For example, instead of maintaining linter installation, we might leverage pre-commit hooks because pre-commit already knows how to install (some) things.
This might be a bit off topic, so happy to create another PR if you want to tackle it separately...
Would you also consider adding a pre-commit-hook for super-linter? This way we wouldn't have to define various linters for each repo but we could only use super-linter in the pre-commit-config.yaml file.