Skip to content

Commit

Permalink
Add backend linting to husky pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Oct 12, 2023
1 parent c394500 commit ea02b8c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,7 @@ logs-db:

# ALIASES

.PHONY: dev lint-back

dev: dev-run-back-with-infra
lint-back: dev-lint-backend
2 changes: 1 addition & 1 deletion backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
<dependency>
<groupId>com.pinterest</groupId>
<artifactId>ktlint</artifactId>
<version>0.48.2</version>
<version>0.50.0</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
Expand Down
8 changes: 8 additions & 0 deletions frontend/.husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@

[ -n "$CI" ] && exit 0

case "$PWD" in
*"/frontend"*)
echo "Error: You must stage & commit from the workspace root directory."
exit 1
;;
esac

make lint-back
npx lint-staged --cwd ./frontend

0 comments on commit ea02b8c

Please sign in to comment.