Archived and moved to slalombuild/pre-commit-mirror-checkstyle
A mirror of the checkstyle linting tool for use in pre-commit hooks
Add the following code to your repo's .pre-commit-config.yaml
- hooks:
- id: checkstyle-java
repo: https://github.com/rgraue/pre-commit-mirror-checkstyle
rev: v0.1.15
Config -c
- Specify the config to be used by checkstyle.
google
orsun
only. Points to google_checks and sun_checks respectively.
Strict -s
- Specify whether to fail on
[WARN]
(warnings) as well during linting. Default False
pre-commit
does not officially support java hooks. Java must be installed locally, and checkstyle jar and subsequent files will be saved under ~/.cache/pre-commit/checkstyle
. Files and configs will be installed during first run of hook.