Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

A mirror of the checkstyle linting tool for use in pre-commit hooks

License

Notifications You must be signed in to change notification settings

rgraue/pre-commit-mirror-checkstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pre-commit-mirror-checkstyle

Archived and moved to slalombuild/pre-commit-mirror-checkstyle

A mirror of the checkstyle linting tool for use in pre-commit hooks

Usage

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

Options

Config -c

  • Specify the config to be used by checkstyle. google or sun only. Points to google_checks and sun_checks respectively.

Strict -s

  • Specify whether to fail on [WARN] (warnings) as well during linting. Default False

Notes

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.