Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Improve the pre-commit hook from the airbyte-webapp. Since our CI checks on proper formatting the hook is just a convenience to fail early, but not required to execute. So we should not fail committing if the devs system does not fulfill the requirements to execute it (e.g. we've have seen some backend engineers having older
node
versions installed, which cause the hook to fail on their systems).How
The script now checks if
npx
is installed at all (might not e.g. if you commit form an IDE, and don't have it in the PATH there), and if the major version of it is at least 8, since before that--no
wasn't supported.Testing
I would appreciate, if this could be reviewed by someone with OS X, since I only tested it on Linux. To test, please check this out, be in the repository root and execute
airbyte-webapp/.husky/pre-commit
from a shell and see if you get the "No staged files found" output.