Skip to content

Commit

Permalink
Align git hooks and order checks (#1258)
Browse files Browse the repository at this point in the history
Update git hooks as defined with husky so that:

- different hooks check similar things
- command ordering makes more semantic sense
  • Loading branch information
ericcornelissen authored Oct 24, 2023
1 parent fd5139a commit c171070
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions script/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ if [ -z "$(IS_MERGING)" ]; then
fi

# Checks
npm run vet
npm run license-check
npm run lint
npm run format
git update-index --again
npm run transpile
npm run vet

if command -v gitleaks > /dev/null; then
gitleaks protect
fi

npm run format
git update-index --again

# Post
if [ -n "$(DID_STASH)" ]; then
git stash pop --quiet
Expand Down
3 changes: 2 additions & 1 deletion script/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ if [ -z "$(IS_MERGING)" ]; then
fi

# Checks
npm run license-check
npm run format:check
npm run license-check
npm run lint
npm run test:unit
npm run transpile
npm run vet

if command -v gitleaks > /dev/null; then
gitleaks protect
Expand Down

0 comments on commit c171070

Please sign in to comment.