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 #944

Merged
merged 2 commits into from
Feb 8, 2023
Merged

Husky #944

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test && npm run test:ct && npm run lint
Copy link
Contributor

Choose a reason for hiding this comment

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

Woah, do you really want to run component tests too? :-D folks will be crazy waiting for tests to complete. better just leave it on per-pull-request CI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think everyone runs component tests before pushing to CI. Usually what I do is run the tests to check if tests are passing, if not update tests&snapshots and then push to master.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With this, you will be sure that your PR does not fail tests&lint once and always after you create a PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also you can easly disable husky while creating a WIP commit with -n or --no-verify

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, I see, still sometimes you'd need to commit quickly, but the flag should help. lgtm 👍🏼

22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-react": "^7.22.0",
"glob": "^7.1.6",
"husky": "^8.0.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"node-sass": "^7.0.1",
Expand Down Expand Up @@ -149,7 +150,8 @@
"translations:compile": "npx formatjs compile ./build/messages/src/Messages.json --out-file ./locales/en.json",
"test:ct": "BABEL_ENV=componentTest cypress run --component",
"test:openct": "cypress open --component",
"coverage": "bash coverage.sh"
"coverage": "bash coverage.sh",
"prepare": "husky install"
},
"release": {
"analyzeCommits": {
Expand Down