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

chore(fix post commit): fixes post commit hooks borking the developer machine #1250

Merged
merged 2 commits into from
Dec 11, 2022

Conversation

doublethefish
Copy link
Contributor

No description provided.

.husky/post-commit Show resolved Hide resolved
Comment on lines 16 to 22
npm run lint:src 2>&1 | sed 1,4d || notify "Lint Error" &
npm run lint:src 2>&1 | sed 1,4d || notify "Lint Error"
Copy link
Owner

Choose a reason for hiding this comment

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

The & is actually intentional. I often perform several commits very quickly (such as several small amends), and I prefer not to be slowed down by running the linter synchronously.

When the linter completes in the background, I get a notification and can then easily fix the linter error and amend the last commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm, ok I've pushed an alternative solution where the lint output skips the terminal entirely and as many errors as possible get shown in the notification.

…erminal

To achieve this we pipe the output to a bg task *and* display the output
in the notification, with some useful identifying output to tell us
which commit we broke.
Copy link
Owner

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

This is great, thanks!

@raineorshine raineorshine merged commit c42b5b5 into raineorshine:main Dec 11, 2022
raineorshine added a commit to cybersemics/em that referenced this pull request Dec 11, 2022
@doublethefish doublethefish deleted the chore/fix_post_commit branch December 12, 2022 09:07
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.

None yet

2 participants