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 pre post commit hooks #342

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

dmnisson
Copy link
Contributor

@dmnisson dmnisson commented Mar 4, 2020

Links

Description

  • Scripts are added to pre-commit and post-commit hooks to ensure that automatic changes made by the linter are staged for the commit.
  • A stash is used to ensure that unstaged changes are kept in the working tree, and only staged files are linted before they are committed.
  • It's possible someone could stage some changes, run git commit meaning to commit the originally staged changes, then make further changes while the linter is still running. If the commit fails, then this setup will overwrite the original changes with the new changes. We should address this edge case at some point, but for now most people will probably not want to bring back lint errors that have been auto fixed.

Developer self-review checklist

  • Potentially confusing code has been explained with comments
  • No warnings or errors have been introduced; all known error cases have been handled
  • Any appropriate documentation (within the code, README.md, docs, etc) has been updated
  • All edge cases have been addressed

@dmnisson dmnisson marked this pull request as ready for review March 6, 2020 03:17
@dmnisson dmnisson requested a review from treystevens March 6, 2020 03:17
@treystevens
Copy link
Member

Hmm, would it be possible to edit a file and not have it come back to the working tree as "Modified"? I'm still coming across that problem that we talked about earlier where the file before it was committed and linted pops back on as "Modified"

Screen Shot 2020-04-14 at 1 29 28 AM

Screen Shot 2020-04-14 at 1 29 45 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants