Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.96 KB

checkstyle-jar.md

File metadata and controls

60 lines (42 loc) · 1.96 KB

pre-commit-hooks logo

Handy Git hooks to integrate with pre-commit framework.


Table of contents


Summary

Description

Uses CheckStyle linter against Java source codes. Contrary to other implementations this one requires CheckStyle JAR file (can be downloaded from official release section) to be given, instead of using system-wide available application. This hook expects java binary to be in $PATH.

Note, you must configure this hook before use. JAR file can be downloaded from their official Checkstyle releases section.

Arguments

  • --jar-url full URL to downloadable Checkstyle JAR file. If specified, and there's no cached JAR file found, the JAR file will be automatically downloaded and cached locally. If not give, will try to download recent version automatically.
  • --jar path to the Checkstyle JAR file. If not specified, looks for checkstyle-10.4-all.jar in project directory.
  • --cache path to cache directory where downloaded JAR should be stored (defaults to ~/.cache/pre-commit/).
  • --config path to Checkstyle config file to use. Alternatively you can use /google_checks.xml and /sun_checks.xml to use Checkstyle's built-in styles.

Examples

- repo: https://github.com/MarcinOrlowski/pre-commit-hooks
  rev: main
  hooks:
    - id: checkstyle-jar
      args: [ '--jar=/path/to/checkstyle.jar' ]