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: add pre-push linter hook #378

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Conversation

andretchen0
Copy link
Contributor

@andretchen0 andretchen0 commented Apr 7, 2024

Adds a Git pre-push hook that lints the project.

  • If there are linter errors/warnings:
    • the push is stopped
    • the errors/warnings are printed
    • an explanatory message is printed – see .husky/pre-push in the commit
  • If there are no linter errors/warnings, the push continues.

Context

Discussed on TresJS: Tresjs/tres#590

Testing

You can run the hook without actually pushing if you ...

git push --dry-run <... extra args>

Skipping

You can skip the hook during a push if you ...

git push --no-verify <... extra args>

(NOTE: This is mentioned in the console if linting fails.)

Feedback?

@JaimeTorrealba @alvarosabu – What do you think?

Copy link

stackblitz bot commented Apr 7, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

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

Awesome addition, thanks a lot @andretchen0 I will try to work soon on a proper linter with autofix and flat config.

@JaimeTorrealba JaimeTorrealba merged commit aa86851 into main Apr 15, 2024
4 checks passed
@andretchen0 andretchen0 deleted the chore/git-pre-push-lint branch April 15, 2024 22:28
@andretchen0
Copy link
Contributor Author

Thanks for merging @JaimeTorrealba .

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

3 participants