Skip to content

Commit

Permalink
Add pre-commit to run spotlessApply automatically before git commit (#…
Browse files Browse the repository at this point in the history
…331)

* Test

* WIP

* Test

* Test

* Test

* Test

* Test

* Test

* Test

* test

* Update README

* Test

* Test

* pre-push

* Test

* Test

* Test

* Test

* Test

* Test

* Testr

* Test
  • Loading branch information
ruixhuang authored May 3, 2024
1 parent 56aec55 commit 243b71d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
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

0 comments on commit 243b71d

Please sign in to comment.