-
Notifications
You must be signed in to change notification settings - Fork 958
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
Add pre-commit hook for linting and formatting #686
Conversation
Pull Request Test Coverage Report for Build 6588754092
💛 - Coveralls |
.husky/pre-commit
Outdated
# prevent it.only or describe.only commited | ||
if [ "$allowonlytests" != "true" ] && | ||
test $(git diff --cached | grep -E "\b(it|describe).only\(" | wc -l) != 0 | ||
then | ||
cat <<\EOF | ||
Error: Attempt to add it.only or describe.only - which may disable all other tests | ||
|
||
If you know what you are doing you can disable this check using: | ||
|
||
git config hooks.allowonlytests true | ||
EOF | ||
exit 1 | ||
fi |
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.
why remove the check for it.only
in tests?
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.
I thought this was a placeholder and not used. I made husky
regenerate the file from scratch. Do you think this is relevant?
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.
Well, it prevented me from accidentally pushing only
to a PR. I use it quite often to debug a specific test and avoid running other ones.
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.
I understand, I added the check back
- Check linting and formatting of Typescript and Solidity files - Split linting and formatting checking on Github Actions - Refactor `NODE_VERSION` on Github Actions into an environment variable
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" |
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.
Attention to detail 😛.
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.
Haha of course 😁
NODE_VERSION
on Github Actions into an environment variable