Skip to content

🪟 🔧 Improve pre-commit hook #18903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion airbyte-webapp/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
cd airbyte-webapp && npx --no lint-staged
# Only run this pre-commit hook when npx is actually in the path.
# Since CI will fail on misformated frontend code we consider this hook optional
# and don't want to fail if the system doesn't have the requirements to run it.
if command -v npx &> /dev/null; then
# Only run if `npx` is at least version 8, since earlier versions didn't support the --no flag
npxMajorVersion=$(npx --version | cut -d. -f1)
if [ "$npxMajorVersion" -ge "8" ]; then
cd airbyte-webapp && npx --no lint-staged
fi
fi