-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement black and isort-based style checks (#549)
This PR adds `black` and `isort` style formatting and checking, and requires future code changes to comply with `black` and `isort` styles. - New workflow `check-style.yml` that runs `black`, `isort` and `flake8` checks - Removes `flake8` check from test workflow - `etstool.py` support for both checking and fixing style, via new `style` command (with subcommands `fix` and `check`) - removed old `flake8` command from `etstool.py` Note: I'm installing the style-related packages from PyPI in `etstool.py`, so that `etstool.py` and the new workflow are installing the same package versions. I'm also fixing black to version 23.x so that we don't suddenly get style failures for the first Black release in 2024 (or later years) - see Black's stability policy here: https://black.readthedocs.io/en/stable/the_black_code_style/index.html#stability-policy Closes #527
- Loading branch information
1 parent
5c55463
commit 57d5974
Showing
189 changed files
with
1,373 additions
and
1,398 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[flake8] | ||
max-line-length = 79 | ||
exclude = build | ||
ignore = E266, W503 | ||
ignore = E203, E266, W503 | ||
per-file-ignores = */api.py:F401 |
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,20 @@ | ||
name: Run style checks | ||
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
style: | ||
runs-on: 'ubuntu-latest' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
cache-dependency-path: '.github/workflows/style-requirements.txt' | ||
- run: python -m pip install -r .github/workflows/style-requirements.txt | ||
- run: | | ||
python -m black --check --diff . | ||
python -m isort --check --diff . | ||
python -m flake8 . |
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,4 @@ | ||
black ~= 23.0 | ||
flake8 | ||
flake8-ets | ||
isort |
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.