-
Notifications
You must be signed in to change notification settings - Fork 92
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
Adding husky for yarn lint-fix #880
base: develop
Are you sure you want to change the base?
Adding husky for yarn lint-fix #880
Conversation
Hi! I just wanted to drop a small recommendation as I was passing by: As someone who has previously worked with (The reason for that is often when I'm working on large changes, I like to make tiny commits of my progress, if in case I ever want to revert to them. Since these commits are very minor and not the final products, I often don't want to spend time waiting for the CI/CD to pass, especially checks like linting and formatting. So being made aware of it when I install the project, and a small how to on how to skip them goes a long way IMO!). |
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 definitely like the idea overall (and across products) of having a tool for solely running linting on staged files.
However, I'm not sure about adding a .husky/pre-commit
config file. As @EshaanAgg mentioned, it's something that would best be documented and we'd want to be sure there is an easy way to skip the hooks as needed.
We don't have pre-commit
in Kolibri Design System, though, which is how we've typically handled such hooks.
This all said, looking now at Husky for the first time, it does seems reasonably promising. Interested in thoughts from @AlexVelezLl @MisRob @rtibbles
@EshaanAgg 's note about how Husky handles skipping hooks w/ an env var gets me wondering if they'll also be skipped during pre-commit when using the |
A warm hello to everyone!!! I had a couple of thoughts , could not type them down on time , apologies!!! The purpose I opened this PR was to overcome linting issues and enhance efficiency and code quality. My research about husky says , it helps in automation code linting before commits and thus does not let bad code enter the repository. What @EshaanAgg said is to update the documentation to:
2)List the specific scripts that Husky runs (example: yarn lint-fix) |
@nucleogenesis Actually there are certain environment variables present like:
2)Husky_skip_hooks=1(Only affects Husky managed hooks{if any}). |
Would you prefer: 1)Enforcing Husky via .husky/pre-commit, but documenting how to skip it? I’m happy to update the PR based on what works best for the team. Let me know your thoughts! |
Thanks for the replies @RONAK-AI647 I'm thinking that using husky here would be a nice improvements. I think that enforcing & documenting how to skip it would be the way to go as it is how our Python pre-commit hooks run in our other projects. I'll await additional discussion from the team before committing to a decision, so I'll mention this PR in Slack. |
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.
@marcellamaki helpfully pointed out that there has already been discussion about husky, so my hesitancy to add it is gone :)
I think that once the conflicts are resolved, this is ready to go
Description
A PR that runs yarn run lint-fix with appropriate arguments to ensure it lints only staged files.
Issue addressed
Closes #830
Addresses #*PR# 880
Before/after screenshots
Changelog
Steps to test
(optional) Implementation notes
At a high level, how did you implement this?
Does this introduce any tech-debt items?
Testing checklist
Reviewer guidance
Comments