Enable Black - Python Auto Formmatter#9550
Conversation
|
Do you guys have any opinion if we should delay "Black" or do it now? We can also enable this on |
|
Have you considered enabling the "--skip-string-normalization" option? This should reduce the number of changes without compromising the readability of the code. Thanks to this, we will only have whitespace changes. |
Applied |
|
The Build Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*. |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
b7ceb32 to
8c5e313
Compare
| - id: black | ||
| files: api_connexion/.*\.py|.*providers.*\.py|^chart/tests/.*\.py | ||
| exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$ | ||
| exclude: .*kubernetes_pod\.py|.*google/common/hooks/base_google\.py$|^airflow/configuration.py$ |
There was a problem hiding this comment.
Yes, black had issues with it i.e. it couldn't reproduce the same file pre and post black so it would be good to ignore them for now
❯ pre-commit run black -a
black....................................................................Failed
- hook id: black
- exit code: 123
error: cannot format /Users/kaxilnaik/Documents/Github/astronomer/airflow/airflow/configuration.py: INTERNAL ERROR: Black produced different code on the second pass of the formatter. Please report a bug on https://github.com/psf/black/issues. This diff might be helpful: /var/folders/jk/z68c_8nd1w5ggdc51r5zhnxm0000gn/T/blk_madaodvm.log
Oh no! 💥 💔 💥
2548 files left unchanged, 1 file failed to reformat.
|
The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it! |
(cherry-picked from commit 4e8f9cc)
(cherry-picked from commit 4e8f9cc)
(cherry-picked from commit 4e8f9cc)
Enable Black (https://github.com/psf/black) using pre-commit
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.