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

Add pre-commit configuration #2154

Merged
merged 7 commits into from
Nov 3, 2022
Merged

Add pre-commit configuration #2154

merged 7 commits into from
Nov 3, 2022

Conversation

lucacome
Copy link
Member

@lucacome lucacome commented Nov 3, 2021

Adding configuration for https://pre-commit.com/ with this we can have checks that run 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, which we're already using, will just run it automatically
  • pyupgrade, will update python syntax to use the latest from the language
  • isort, will sort python imports
  • balck, will format python
  • pre-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 or scripts that are not executables.

There's an option to run it as a check in GitHub so external contributors don't need to install it, but the checks will still be enforced. (https://pre-commit.ci/)

Let me know what you think.

@lucacome lucacome self-assigned this Nov 3, 2021
@github-actions github-actions bot added the chore Pull requests for routine tasks label Nov 3, 2021
@lucacome lucacome added the proposal An issue that proposes a feature request label Nov 3, 2021
@nginx-bot nginx-bot force-pushed the chore/add-pre-commit branch 8 times, most recently from e0a3cb2 to 1a29f5f Compare November 10, 2021 18:51
@nginx-bot nginx-bot force-pushed the chore/add-pre-commit branch 10 times, most recently from dc011a5 to d2cf8a0 Compare November 16, 2021 09:13
@lucacome lucacome requested review from a team, pleshakov and ciarams87 and removed request for a team November 16, 2021 18:23
@nginx-bot nginx-bot force-pushed the chore/add-pre-commit branch from d2cf8a0 to d32432b Compare November 16, 2021 23:42
@lucacome lucacome requested a review from soneillf5 November 18, 2021 02:02
@nginx-bot nginx-bot force-pushed the chore/add-pre-commit branch 3 times, most recently from 844c632 to 27ca1c7 Compare November 18, 2021 20:32
@nginx-bot nginx-bot force-pushed the chore/add-pre-commit branch 4 times, most recently from 424fe0b to a2af6c1 Compare November 29, 2021 23:35
@lucacome lucacome removed the request for review from soneillf5 January 11, 2022 18:51
@lucacome lucacome force-pushed the chore/add-pre-commit branch from 10d638f to a95be88 Compare January 11, 2022 19:01
@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2022

Codecov Report

Merging #2154 (aca6f3e) into main (d9fe6a2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2154   +/-   ##
=======================================
  Coverage   52.52%   52.52%           
=======================================
  Files          58       58           
  Lines       16070    16070           
=======================================
  Hits         8441     8441           
  Misses       7351     7351           
  Partials      278      278           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lucacome lucacome requested review from haywoodsh and jjngx February 23, 2022 16:35
@lucacome lucacome requested review from eufinco and shaun-nx March 11, 2022 20:22
@lucacome lucacome force-pushed the chore/add-pre-commit branch from 4f221da to ea00cba Compare April 6, 2022 02:05
@lucacome lucacome mentioned this pull request Aug 16, 2022
@lucacome lucacome force-pushed the chore/add-pre-commit branch from 1e6d5bd to 9e81403 Compare November 3, 2022 02:55
@lucacome lucacome requested a review from a team as a code owner November 3, 2022 02:55
@lucacome lucacome merged commit fb6bbeb into main Nov 3, 2022
@lucacome lucacome deleted the chore/add-pre-commit branch November 3, 2022 18:50
coolbry95 pushed a commit to coolbry95/kubernetes-ingress that referenced this pull request Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks proposal An issue that proposes a feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants