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

🪟 🔧 Improve pre-commit hook #18903

merged 1 commit into from
Nov 4, 2022

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Nov 3, 2022

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.

@timroes timroes added area/frontend Related to the Airbyte webapp ui/tooling labels Nov 3, 2022
@timroes timroes requested a review from a team as a code owner November 3, 2022 10:26
@github-actions github-actions bot removed the area/frontend Related to the Airbyte webapp label Nov 3, 2022
@timroes timroes added the area/frontend Related to the Airbyte webapp label Nov 3, 2022
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested this locally on OS X as per the PR description, and I got the correct message:
Screen Shot 2022-11-03 at 6 45 43 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants