-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code formatting using black (infra) (#1163)
* 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.
- Loading branch information
Showing
483 changed files
with
31,331 additions
and
20,025 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Black formatting (79 chars lines) | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
black: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable | ||
with: | ||
options: "--check --diff --line-length 79 --extend-exclude '/vendor/'" |
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
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
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
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
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
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
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
Oops, something went wrong.