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

Add pre-commit hook for linting and formatting #686

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Add pre-commit hook for linting and formatting #686

merged 1 commit into from
Oct 20, 2023

Conversation

Uxio0
Copy link
Member

@Uxio0 Uxio0 commented Oct 20, 2023

  • 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

@coveralls
Copy link

coveralls commented Oct 20, 2023

Pull Request Test Coverage Report for Build 6588754092

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.185%

Totals Coverage Status
Change from base Build 6494000556: 0.0%
Covered Lines: 368
Relevant Lines: 377

💛 - Coveralls

Comment on lines 7 to 19
# 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
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Member Author

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
Comment on lines +1 to +2
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Attention to detail 😛.

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha of course 😁

@mmv08 mmv08 merged commit b344bd8 into main Oct 20, 2023
18 checks passed
@mmv08 mmv08 deleted the add-precommit branch October 20, 2023 15:16
@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants