Skip to content
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

Husky pre-commit hooks for tests #601

Open
OmkarPh opened this issue Sep 4, 2023 · 3 comments · Fixed by #591
Open

Husky pre-commit hooks for tests #601

OmkarPh opened this issue Sep 4, 2023 · 3 comments · Fixed by #591

Comments

@OmkarPh
Copy link
Collaborator

OmkarPh commented Sep 4, 2023

Description

Having a pre-commit hook should be beneficial to avoid committing failing-test code

Similar to pre-commit in python,
We have husky for javascript projects - https://www.npmjs.com/package/husky

Configuration:
With the configuration in place, the pre-commit hooks are setup automatically on npm install and run on attempting a commit
No special action is required by the developers

For example:

@OmkarPh OmkarPh mentioned this issue Sep 9, 2023
@OmkarPh OmkarPh linked a pull request Sep 9, 2023 that will close this issue
@OmkarPh
Copy link
Collaborator Author

OmkarPh commented Oct 2, 2023

@pombredanne
Copy link
Member

@OmkarPh if I am not mistaken pre-commit hooks need to be enabled locally, right?

@OmkarPh
Copy link
Collaborator Author

OmkarPh commented Oct 3, 2023

When we do npm install this prepare script is automatically run; It sets up required git config for the repository

"prepare": "husky install"

So, no special commands needed by contributors :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants