-
Notifications
You must be signed in to change notification settings - Fork 90
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 pre-commit configuration #862
Conversation
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.
🚀
Thanks for doing this @lucacome! Can you add the pre-commit installation instructions or link to the quickstart installation list: https://github.com/nginxinc/nginx-kubernetes-gateway/blob/main/docs/developer/quickstart.md#setup-your-development-environment? |
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.
are we going to enable this in the CI too?
@kate-osborn I added the docs 👍 @pleshakov once this PR is merged I will enable the pre-commit CI for the repo. It's an app that we have installed for the org that runs the checks, commits fixable changes and keeps the dependencies up to date. |
8dd7984
to
cef1c9d
Compare
cef1c9d
to
5fab59f
Compare
Proposed changes
Adds configuration for pre-commit.com that runs checks automatically before committing and (in most cases) fix the problems.
Here the quick start for installing it, basically:
brew install pre-commit followed by pre-commit install. After that, it will run before every commit.
I've added some hooks in the config (there are many more):
golang-ci lint
andprettier
, which we're already using, will just run it automaticallypre-commit-hooks
, has a few hooks, mostly about formatting (and end of line whitespaces and similar), and not committing large files or with merge conflicts.gitleaks
, for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repos.Checklist
Before creating a PR, run through this checklist and mark each as complete.