Closed rafvasq closed 2 years ago
Thanks @rafvasq. I have not used pre-commit hooks before. Is that idea to perform certain tests like linting, formatting, etc on the developer local machine when they commit the code? Also, I had to follow these steps to enable husky. Are these correct? and if so, we should add these steps in the docs as well.
cd ui
yarn install
to install huskyyarn run postinstall
to enable
huskyhello husky
when I commit.Since all three directories use the same root husky command, the developer just has to do this once. In any of the three folders.
@davidnixon I guess we should still add similar GitHub actions? Are they complementary to pre-commit hooks? The difference being they are run on servers after the commit happens. The advantage being the user does not have to "enable" anything, they just run on every commit.
Did I understand all this correctly? 😃
@upkarlidder exactly right. These are complementary to the actions. For example, It's faster to fix a lint issue if you find it when you commit rather than waiting for the action to run against your PR. The hooks however can be disabled by the committer so we still need the actions.
Also, do you need to tag this as hacktoberfest?
@davidnixon @rafvasq, do we need to update dev docs to mention this new recommended workflow? The devs still need to enable it by running:
cd ui
yarn install
to install huskyyarn run postinstall
to enable
huskyhello husky
when I commit.
Resolves #285
What did you do?
Added the husky package to enable git hooks for developers
Why did you do it?
Add pre-commit hook support
How have you tested it?
Saw "hello husky" after a test commit
Were docs updated if needed?
Type of change
Checklist: