Skip to content

slalombuild/pre-commit-mirror-checkstyle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.1

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.