You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stop using the wemake-python-styleguide which gives too many errors. And switch to pre-commit's continuous integration.
The advantage of pre-commit is that:
It runs automatically when you git commit.
You will not upload codes that are not aligned with some styles.
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.
What will this PR improve?
You will see no reviewdog complaining, and pre-commit will do almost all formatting for you, and it is very fast.
How to setup pre-commit?
cd alea
pip install pre-commit
pre-commit install
What will the configuration tell pre-commit to do?
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.
mypy will check the typing in your code, it is a bug finder, you still need to fix and commit them.
doc8 will check the docs/*.rst and docs/*.md, it gives the warning of wrong format. Currently, there is no popular auto-formatter for .rst.
flake8 will check the code-style, but in a more lite way than wemake-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.
How to execute pre-commit locally
When you git commit, it will automatically pre-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 and main, run pre-commit run --from-ref main --to-ref .. If you want to remove the color from the output, add --color never.
black and docformatter will change your code, you still need to make a commit by yourself on the changed part.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does?
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.What will this PR improve?
You will see no reviewdog complaining, and pre-commit will do almost all formatting for you, and it is very fast.
How to setup pre-commit?
What will the configuration tell pre-commit to do?
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.mypy
will check the typing in your code, it is a bug finder, you still need to fix and commit them.doc8
will check thedocs/*.rst
anddocs/*.md
, it gives the warning of wrong format. Currently, there is no popular auto-formatter for.rst
.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.How to execute pre-commit locally
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/.
Inspired by XENONnT/straxen#1192