Some custom gradle hooks for pre-commit.
See also: https://github.com/pre-commit/pre-commit-hooks
Add this to your .pre-commit-config.yaml
- repo: https://github.com/jguttman94/pre-commit-gradle
rev: v0.2.1 # Use the ref you want to point at
hooks:
- id: gradle-check
# - id: ...
gradle-check
- Run gradle unit test tasks
args: ['-w', --wrapper]
.args: ['-o', --output]
.gradle-build
- Run gradle build tasks
args: ['-w', --wrapper]
.args: ['-o', --output]
.gradle-spotless
- Run gradle spotless tasks for java linting
args: ['-w', --wrapper]
.args: ['-o', --output]
.gradle-task
- Run any arbitrary gradle commands
args: ['clean build bootRun']
args: ['-w', --wrapper]
.args: ['-o', --output]
.