Update Prettier pre-commit configuration (#4662)
* Update Prettier configuration Signed-off-by: cobalt <61329810+cobaltt7@users.noreply.github.com> * Update .github/workflows/diff_shades.yml Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> --------- Signed-off-by: cobalt <61329810+cobaltt7@users.noreply.github.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
d0ff3bd6cb
commit
314f8cf92b
10
.github/workflows/diff_shades.yml
vendored
10
.github/workflows/diff_shades.yml
vendored
@ -34,7 +34,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
run: >
|
run: >
|
||||||
python scripts/diff_shades_gha_helper.py config ${{ github.event_name }} ${{ matrix.mode }}
|
python scripts/diff_shades_gha_helper.py config ${{ github.event_name }}
|
||||||
|
${{ matrix.mode }}
|
||||||
|
|
||||||
analysis:
|
analysis:
|
||||||
name: analysis / ${{ matrix.mode }}
|
name: analysis / ${{ matrix.mode }}
|
||||||
@ -130,10 +131,9 @@ jobs:
|
|||||||
- name: Generate summary file (PR only)
|
- name: Generate summary file (PR only)
|
||||||
if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
|
if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
|
||||||
run: >
|
run: >
|
||||||
python helper.py comment-body
|
python helper.py comment-body ${{ matrix.baseline-analysis }}
|
||||||
${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }}
|
${{ matrix.target-analysis }} ${{ matrix.baseline-sha }}
|
||||||
${{ matrix.baseline-sha }} ${{ matrix.target-sha }}
|
${{ matrix.target-sha }} ${{ github.event.pull_request.number }}
|
||||||
${{ github.event.pull_request.number }}
|
|
||||||
|
|
||||||
- name: Upload summary file (PR only)
|
- name: Upload summary file (PR only)
|
||||||
if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
|
if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes'
|
||||||
|
@ -64,11 +64,11 @@ repos:
|
|||||||
args: ["--python-version=3.10"]
|
args: ["--python-version=3.10"]
|
||||||
additional_dependencies: *mypy_deps
|
additional_dependencies: *mypy_deps
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- repo: https://github.com/rbubley/mirrors-prettier
|
||||||
rev: v4.0.0-alpha.8
|
rev: v3.5.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: prettier
|
- id: prettier
|
||||||
types_or: [css, javascript, html, json, yaml]
|
types_or: [markdown, yaml, json]
|
||||||
exclude: \.github/workflows/diff_shades\.yml
|
exclude: \.github/workflows/diff_shades\.yml
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
31
CHANGES.md
31
CHANGES.md
@ -9,20 +9,20 @@
|
|||||||
### Stable style
|
### Stable style
|
||||||
|
|
||||||
<!-- Changes that affect Black's stable style -->
|
<!-- Changes that affect Black's stable style -->
|
||||||
|
|
||||||
- Fix crash while formatting a long `del` statement containing tuples (#4628)
|
- Fix crash while formatting a long `del` statement containing tuples (#4628)
|
||||||
- Fix crash while formatting expressions using the walrus operator in complex
|
- Fix crash while formatting expressions using the walrus operator in complex `with`
|
||||||
`with` statements (#4630)
|
statements (#4630)
|
||||||
- Handle `# fmt: skip` followed by a comment at the end of file (#4635)
|
- Handle `# fmt: skip` followed by a comment at the end of file (#4635)
|
||||||
- Fix crash when a tuple appears in the `as` clause of a `with` statement
|
- Fix crash when a tuple appears in the `as` clause of a `with` statement (#4634)
|
||||||
(#4634)
|
|
||||||
- Fix crash when tuple is used as a context manager inside a `with` statement (#4646)
|
- Fix crash when tuple is used as a context manager inside a `with` statement (#4646)
|
||||||
|
|
||||||
### Preview style
|
### Preview style
|
||||||
|
|
||||||
<!-- Changes that affect Black's preview style -->
|
<!-- Changes that affect Black's preview style -->
|
||||||
|
|
||||||
- Fix a bug where one-liner functions/conditionals marked with `# fmt: skip`
|
- Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` would still
|
||||||
would still be formatted (#4552)
|
be formatted (#4552)
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
@ -37,8 +37,8 @@
|
|||||||
<!-- Changes to the parser or to version autodetection -->
|
<!-- Changes to the parser or to version autodetection -->
|
||||||
|
|
||||||
- Rewrite tokenizer to improve performance and compliance (#4536)
|
- Rewrite tokenizer to improve performance and compliance (#4536)
|
||||||
- Fix bug where certain unusual expressions (e.g., lambdas) were not accepted
|
- Fix bug where certain unusual expressions (e.g., lambdas) were not accepted in type
|
||||||
in type parameter bounds and defaults. (#4602)
|
parameter bounds and defaults. (#4602)
|
||||||
|
|
||||||
### Performance
|
### Performance
|
||||||
|
|
||||||
@ -57,8 +57,8 @@
|
|||||||
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
||||||
|
|
||||||
- Fix the version check in the vim file to reject Python 3.8 (#4567)
|
- Fix the version check in the vim file to reject Python 3.8 (#4567)
|
||||||
- Enhance GitHub Action `psf/black` to read Black version from an additional
|
- Enhance GitHub Action `psf/black` to read Black version from an additional section in
|
||||||
section in pyproject.toml: `[project.dependency-groups]` (#4606)
|
pyproject.toml: `[project.dependency-groups]` (#4606)
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
@ -69,8 +69,8 @@
|
|||||||
|
|
||||||
### Highlights
|
### Highlights
|
||||||
|
|
||||||
This release introduces the new 2025 stable style (#4558), stabilizing
|
This release introduces the new 2025 stable style (#4558), stabilizing the following
|
||||||
the following changes:
|
changes:
|
||||||
|
|
||||||
- Normalize casing of Unicode escape characters in strings to lowercase (#2916)
|
- Normalize casing of Unicode escape characters in strings to lowercase (#2916)
|
||||||
- Fix inconsistencies in whether certain strings are detected as docstrings (#4095)
|
- Fix inconsistencies in whether certain strings are detected as docstrings (#4095)
|
||||||
@ -78,15 +78,16 @@ the following changes:
|
|||||||
- Remove redundant parentheses in if guards for case blocks (#4214)
|
- Remove redundant parentheses in if guards for case blocks (#4214)
|
||||||
- Add parentheses to if clauses in case blocks when the line is too long (#4269)
|
- Add parentheses to if clauses in case blocks when the line is too long (#4269)
|
||||||
- Whitespace before `# fmt: skip` comments is no longer normalized (#4146)
|
- Whitespace before `# fmt: skip` comments is no longer normalized (#4146)
|
||||||
- Fix line length computation for certain expressions that involve the power operator (#4154)
|
- Fix line length computation for certain expressions that involve the power operator
|
||||||
|
(#4154)
|
||||||
- Check if there is a newline before the terminating quotes of a docstring (#4185)
|
- Check if there is a newline before the terminating quotes of a docstring (#4185)
|
||||||
- Fix type annotation spacing between `*` and more complex type variable tuple (#4440)
|
- Fix type annotation spacing between `*` and more complex type variable tuple (#4440)
|
||||||
|
|
||||||
The following changes were not in any previous release:
|
The following changes were not in any previous release:
|
||||||
|
|
||||||
- Remove parentheses around sole list items (#4312)
|
- Remove parentheses around sole list items (#4312)
|
||||||
- Generic function definitions are now formatted more elegantly: parameters are
|
- Generic function definitions are now formatted more elegantly: parameters are split
|
||||||
split over multiple lines first instead of type parameter definitions (#4553)
|
over multiple lines first instead of type parameter definitions (#4553)
|
||||||
|
|
||||||
### Stable style
|
### Stable style
|
||||||
|
|
||||||
|
@ -137,8 +137,8 @@ SQLAlchemy, Poetry, PyPA applications (Warehouse, Bandersnatch, Pipenv, virtuale
|
|||||||
pandas, Pillow, Twisted, LocalStack, every Datadog Agent Integration, Home Assistant,
|
pandas, Pillow, Twisted, LocalStack, every Datadog Agent Integration, Home Assistant,
|
||||||
Zulip, Kedro, OpenOA, FLORIS, ORBIT, WOMBAT, and many more.
|
Zulip, Kedro, OpenOA, FLORIS, ORBIT, WOMBAT, and many more.
|
||||||
|
|
||||||
The following organizations use _Black_: Dropbox, KeepTruckin, Lyft, Mozilla,
|
The following organizations use _Black_: Dropbox, KeepTruckin, Lyft, Mozilla, Quora,
|
||||||
Quora, Duolingo, QuantumBlack, Tesla, Archer Aviation.
|
Duolingo, QuantumBlack, Tesla, Archer Aviation.
|
||||||
|
|
||||||
Are we missing anyone? Let us know.
|
Are we missing anyone? Let us know.
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ frequently than monthly nets rapidly diminishing returns.
|
|||||||
**You must have `write` permissions for the _Black_ repository to cut a release.**
|
**You must have `write` permissions for the _Black_ repository to cut a release.**
|
||||||
|
|
||||||
The 10,000 foot view of the release process is that you prepare a release PR and then
|
The 10,000 foot view of the release process is that you prepare a release PR and then
|
||||||
publish a [GitHub Release]. This triggers [release automation](#release-workflows) that builds
|
publish a [GitHub Release]. This triggers [release automation](#release-workflows) that
|
||||||
all release artifacts and publishes them to the various platforms we publish to.
|
builds all release artifacts and publishes them to the various platforms we publish to.
|
||||||
|
|
||||||
We now have a `scripts/release.py` script to help with cutting the release PRs.
|
We now have a `scripts/release.py` script to help with cutting the release PRs.
|
||||||
|
|
||||||
@ -96,8 +96,9 @@ In the end, use your best judgement and ask other maintainers for their thoughts
|
|||||||
|
|
||||||
## Release workflows
|
## Release workflows
|
||||||
|
|
||||||
All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore configured
|
All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore
|
||||||
using YAML files in the `.github/workflows` directory of the _Black_ repository.
|
configured using YAML files in the `.github/workflows` directory of the _Black_
|
||||||
|
repository.
|
||||||
|
|
||||||
They are triggered by the publication of a [GitHub Release].
|
They are triggered by the publication of a [GitHub Release].
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ the `pyproject.toml` file. `version` can be any
|
|||||||
or just the version number if you want an exact version. To read the version from the
|
or just the version number if you want an exact version. To read the version from the
|
||||||
`pyproject.toml` file instead, set `use_pyproject` to `true`. This will first look into
|
`pyproject.toml` file instead, set `use_pyproject` to `true`. This will first look into
|
||||||
the `tool.black.required-version` field, then the `dependency-groups` table, then the
|
the `tool.black.required-version` field, then the `dependency-groups` table, then the
|
||||||
`project.dependencies` array and finally the `project.optional-dependencies` table.
|
`project.dependencies` array and finally the `project.optional-dependencies` table. The
|
||||||
The action defaults to the latest release available on PyPI. Only versions available
|
action defaults to the latest release available on PyPI. Only versions available from
|
||||||
from PyPI are supported, so no commit SHAs or branch names.
|
PyPI are supported, so no commit SHAs or branch names.
|
||||||
|
|
||||||
If you want to include Jupyter Notebooks, _Black_ must be installed with the `jupyter`
|
If you want to include Jupyter Notebooks, _Black_ must be installed with the `jupyter`
|
||||||
extra. Installing the extra and including Jupyter Notebook files can be configured via
|
extra. Installing the extra and including Jupyter Notebook files can be configured via
|
||||||
|
Loading…
Reference in New Issue
Block a user