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

Update pre-commit hook #117

Closed
wants to merge 1 commit into from
Closed

Conversation

xl4624
Copy link
Contributor

@xl4624 xl4624 commented Nov 4, 2023

Addresses #38 by using git diff --staged --name-only to only add staged files to the commit.

Caveat here is that npm run lint:fix and npm run format will still run for all files in the working directory. Tried fixing it by passing the staged files in git diff --staged --name-only to the linters/formatters, but unfortunately passing specific files with xargs will throw an error to file types that aren't recognized like No parser could be inferred for file: .husky/pre-commit. Also tried stashing untracked/unstaged files with git stash push -k -u before linting and git stash pop after but that seemed very error prone.

@calvinatian calvinatian self-requested a review November 12, 2023 03:46
@xl4624 xl4624 closed this Jan 14, 2025
@xl4624 xl4624 deleted the update-precommit branch January 14, 2025 22:09
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.

1 participant