Skip to content

Commit

Permalink
chore: Move pre-commit commands to pre-push (#17996)
Browse files Browse the repository at this point in the history
* chore: Move pre-commit commands to pre-push

* Is this fast

* Removed test commit

* Adding logging
  • Loading branch information
keithwillcode authored Dec 4, 2024
1 parent 3dff77f commit f63c06d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .husky/pre-commit

This file was deleted.

22 changes: 22 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

set -e

echo "Info: Running lint-staged"
yarn lint-staged

echo "Info: Running app-store:build"
yarn app-store:build && git add packages/app-store/*.generated.*

git stash -q --keep-index

# Check for new file changes after running the above commands
if ! git diff --cached --quiet; then
echo "Error: The build process modified files. Please commit the changes and try again."
git stash pop -q
exit 1
fi

# Restore stashed changes if nothing went wrong.
git stash pop -q
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ git checkout HEAD~1 yarn.lock
git commit -m "Revert yarn.lock changes"
```

_NB_: You may have to bypass the pre-commit hook with by appending `--no-verify` to the git commit
If you've pushed the commit with the `yarn.lock`:

1. Correct the commit locally using the above method.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"lint:report": "turbo run lint:report",
"lint": "turbo run lint",
"postinstall": "husky install && turbo run post-install",
"pre-commit": "lint-staged",
"predev": "echo 'Checking env files'",
"prisma": "yarn workspace @calcom/prisma prisma",
"start": "turbo run start --scope=\"@calcom/web\"",
Expand Down

0 comments on commit f63c06d

Please sign in to comment.