Skip to content

Commit

Permalink
precommit, pre push
Browse files Browse the repository at this point in the history
  • Loading branch information
AnuchitO committed Mar 22, 2024
1 parent 9daa450 commit a9675a1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: detect-private-key
- id: end-of-file-fixer
verbose: true
- id: check-yaml

- repo: local
hooks:
- id: run-spotless-format
name: run spotless format-check
language: system
entry: bash -c 'cd kbazaar && make format-check'
pass_filenames: false
stages: [pre-commit]
9 changes: 9 additions & 0 deletions .pre-push-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default_stages: [push]
repos:
- repo: local
hooks:
- id: run-unit-tests
name: run unit tests
language: system
entry: bash -c 'cd kbazaar && make test'
pass_filenames: false
6 changes: 5 additions & 1 deletion kbazaar/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
build: clean
./gradlew build

setup:
pre-commit install --hook-type pre-commit --config .pre-commit-config.yaml
pre-commit install --hook-type pre-push --config .pre-push-config.yaml

clean:
./gradlew clean

Expand Down Expand Up @@ -29,4 +33,4 @@ docker-build:
docker build -t kbazaar .

docker-run:
docker run -p 8080:8080 kbazaar
docker run -p 8080:8080 kbazaar

0 comments on commit a9675a1

Please sign in to comment.