-
Notifications
You must be signed in to change notification settings - Fork 30
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
Added precommit hook #67
Conversation
@Manvityagi Please review my PR. |
hey @Samridhi-98, did you test these changes locally before making a Pull Request? from what I can see, you have installed following are the changes I want you to make:
Let me know if you need any help. And please test your code locally before making PRs. |
Okay, will update as you suggested. |
@abdus Please review I have updated as you suggested and also tested my code locally. Screenshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes you have made aren't working as expected. Files that were changed since the last commit, should be formatted automatically using prettier before commit.
Also, by "test your code locally", I meant to say that whatever code you have changed, is working as expected. For example, here you are working on formatting code with the pre-commit hook. check that whether the changed files were formatted or not.
I wrote a how-to on writing a pre-commit hook using husky@6. please check it out and see if this could be of any help.
README.md
Outdated
# To test run pre commit hook | ||
$ npm test | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-commit
hook should run automatically before committing the changes.
package.json
Outdated
"devDependencies": { | ||
"chai": "^4.3.4", | ||
"faker": "^5.5.2", | ||
"husky": "^6.0.0", | ||
"mocha": "^8.3.2", | ||
"sinon": "^10.0.0" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to install prettier
and pretty-quick
as well.
@abdus Please review. Also while running this |
@abdus @Manvityagi please add the appropriate label and GSSOC tag. |
* Added precommit hook * Updated and tested husky * added pre-commit and updated package.json
Description
Added pre-commit hook
.pre-commit-config.yaml
Fixes #62
Type of change
Please delete options that are not relevant.
Checklist: