-
Notifications
You must be signed in to change notification settings - Fork 33
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
Proposal to use pre-commit for continuous integration #1240
Conversation
2602f92
to
8b1ab24
Compare
Most importantly, no lineage is changed. I will then test detailedly about the change of each field. |
cbe08cb
to
7729c13
Compare
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.
For me it looks fine, thanks @dachengx. Do you know why some of the test are currently failing is it because of the LNGS network thing? If yes lets maybe wait and rerun the tests when it is back up, just to be sure.
Yes, it is related to https://xenonnt.slack.com/archives/C016DM0JPK9/p1699638121051979, a network issue. I will rerun the test after the issue is gone. |
The test is passed. I will merge the PR. |
What does the code in this PR do / what does it improve?
Stop using the
wemake-python-styleguide
which gives too many errors. And switch topre-commit
's continuous integration.The advantage of
pre-commit
is that:git commit
.The codes are changed only in code style, the requirement of hooks.
Note:
black
will force you to use double quotes, it actually auto-format for you, so do not worry.You will see no reviewdog complaining, and pre-commit will do almost all formatting for you, and it is very fast.
Can you briefly describe how it works?
To setup pre-commit:
Besides basic whitespace and large files check,
black
will auto-format your code, mainly about indent and line-length, and make auto-commit if necessary.docformatter
will auto-format your docstring, following google convention, and make auto-commit if necessary.flake8
will check the code-style, but in a more lite way thanwemake-python-styleguide
.So there will be two pre-commit checks, one check of changed files when you
git commit
, and one check of all files by pre-commit CI.Can you give a minimal working example (or illustrate with a figure)?
When you
git commit
, it will automaticallypre-commit run
for the changed files, so actually you would not always run it manually.If you want to check all the files, run
pre-commit run --all-files
. If you want to check the difference between the current branch andmain
, runpre-commit run --from-ref main --to-ref .
. If you want to remove the color from the output, add--color never
.black
anddocformatter
will change your code, you still need to make a commit by yourself on the changed part.For more information, please go to https://pre-commit.com/ and https://pre-commit.ci/.
Please include the following if applicable:
Inspired by and closes #1192