A docker based pre-commit hook for Java checkstyle
This hook will create a folder named .pre-commit
in you working directory, where the used checkstyle jar file will be located.
Changing the first argument of the hook allows to select a different version.
Make sure to add the cache folder to you gitignore file:
.pre-commit
- repo: https://github.com/HotSprings-GmbH/pre-commit-checkstyle
rev: "" # A Tag or commit hash
hooks:
- id: checkstyle
args:
- "8.41" # the checkstyle version
- "-c=checkstyle.xml" # configure checkstyle
stages:
- commit
This hook uses the latest provided version of checkstyle.