Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit to run spotlessApply automatically before git commit #331

Merged
merged 22 commits into from
May 3, 2024
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

default_install_hook_types:
[pre-push]

repos:
- repo: local
hooks:
- id: spotless-apply
name: spotless-apply
entry: ./run_spotless_apply.sh
language: script
stages: [pre-push]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ Integration tests can be written to call Abacus from non-Kotlin code (i.e., Swif

> ./bump_version.sh

# Auto-lint

Enable pre-commit to auto-lint/auto-format your changes before git commit:

> brew install pre-commit
> pre-commit install

# How to use

```
Expand Down
5 changes: 5 additions & 0 deletions run_spotless_apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

./gradlew spotlessApply

exit 0