-
Notifications
You must be signed in to change notification settings - Fork 47
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
Code formatting using black (infra) #1163
Merged
Merged
Conversation
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
pieqq
force-pushed
the
CHECKBOX-784-black-formatting
branch
3 times, most recently
from
April 11, 2024 00:47
7906c65
to
ac46f1d
Compare
black uses pyproject.toml to store its configuration. Update the different projects in the monorepo to match line length of 79 when calling black. See black documentation[1] for more information. [1] https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
Command used: black . --line-length 79 --extend-exclude "/vendor/"
Command used: black . --line-length 79 --extend-exclude "/vendor/"
Command used: black . --line-length 79 --extend-exclude "/vendor/"
Command used: black . --line-length 79 --extend-exclude "/vendor/"
Command used: black . --line-length 79 --extend-exclude "/vendor/"
Command used: black . --line-length 79 --extend-exclude "/vendor/"
As explained in this issue[1], E203[2] is not PEP 8 compliant so it should be ignored when running flake8. Black is now being used in the codebase, and it takes care of the formatting. [1] psf/black#315 [2] https://www.flake8rules.com/rules/E203.html
Although Black is configured at 79 chars line length, it keeps a few lines to 80, 81 or 82 chars. Flake8 will complain about this, but we can ignore these.
pieqq
force-pushed
the
CHECKBOX-784-black-formatting
branch
from
April 11, 2024 07:35
ac46f1d
to
e77ab97
Compare
Hook25
previously approved these changes
Apr 11, 2024
Waiting until the squashed commit gets merged, and will create one afterwards.
Hook25
approved these changes
Apr 11, 2024
LiaoU3
pushed a commit
to LiaoU3/checkbox
that referenced
this pull request
Apr 17, 2024
* Set line length to 79 when calling black black uses pyproject.toml to store its configuration. Update the different projects in the monorepo to match line length of 79 when calling black. See black documentation[1] for more information. [1] https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file * Update contributing guide to mention black * Add black GitHub Action * Ignore vendorized code when running black * Format all the codebase using black Command used: black . --line-length 79 --extend-exclude "/vendor/" * Ignore E203 (Whitespace before ':') As explained in this issue[1], E203[2] is not PEP 8 compliant so it should be ignored when running flake8. Black is now being used in the codebase, and it takes care of the formatting. [1] psf/black#315 [2] https://www.flake8rules.com/rules/E203.html * Ignore flake8 complaints for a few specific lines in the base provider Although Black is configured at 79 chars line length, it keeps a few lines to 80, 81 or 82 chars. Flake8 will complain about this, but we can ignore these.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
line-length
set to79
line-length
option to the different sub-projects so that runningblack .
orblack . --diff
locally from within one of these projects (checkbox-ng
, thebase
provider, etc.) runs what's expected from the CI.git-blame-ignore-revs
so that they are ignored when browsing GitHub, or when usinggit config blame.ignoreRevsFile .git-blame-ignore-revs
(as explained in the contrib guide)Resolved issues
CHECKBOX-784
Documentation
Contributing guide is updated to include some information about black as code formatter.
Tests