-
Notifications
You must be signed in to change notification settings - Fork 877
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 Git Hooks to run lint #1788
Conversation
d67c5f9
to
b0ae4bb
Compare
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.
LGTM
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
All requested changes in #1788 (review) made |
@ChunkyProgrammer one more approval needed. Review if u have some spare time please |
No idea how I missed the notifications for this one. This looks good to me. I'll approve it now. (There are newer versions of lefthook available so maybe it should be upgraded soon?) |
Crap I forgot to update the lefthook version |
Pull Request Type
Please select what type of pull request this is:
Related issue
Smaller version of #1171
Description
For new comers not coming from #1171
Git Hooks is
Git has a way to fire off custom scripts when certain important actions occur.
(quote from official doc)There are client-side and server-side hooks but this PR is only about the client-side hooks.
For all available hook events and other stuff about Git Hooks see:
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Summary of changes
lefthook
lefthook
when installed viayarn
, no extra step requiredpre-commit
hook to runeslint
on every commit which lints staged (about to be committed) files only (faster) where the filenames end withjs/ts/vue
lefthook
is picked as git hook manager due toGo language makes Lefthook lightning-fast and provides support for concurrently executed scripts out of the box.
yarn
, just useyarn
)simple-git-hooks
can't run commands in parallel)lefthook
vianpm
/yarn
will generate git hook scripts in your git hook pathRead the introduction post for
lefthook
if you interested in finding out morePR Purpose
Lint task is sometimes NOT run by the PR submitter (including me!)
I know we have server side GH Action checks to ensure
So this is just an dev process improvement which should add just a little time to commit changes
Also #1171 is too big to review and merge
Screenshots (if appropriate)
Code Change Diff (for testing linting)
Git output
Testing (for code that is not small enough to be easily understandable)
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.