diff --git a/.github/workflows/diff_shades.yml b/.github/workflows/diff_shades.yml index 159e163..5fc4983 100644 --- a/.github/workflows/diff_shades.yml +++ b/.github/workflows/diff_shades.yml @@ -34,7 +34,8 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} 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: name: analysis / ${{ matrix.mode }} @@ -48,7 +49,7 @@ jobs: strategy: fail-fast: false matrix: - include: ${{ fromJson(needs.configure.outputs.matrix )}} + include: ${{ fromJson(needs.configure.outputs.matrix) }} steps: - name: Checkout this repository (full clone) @@ -130,10 +131,9 @@ jobs: - name: Generate summary file (PR only) if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes' run: > - python helper.py comment-body - ${{ matrix.baseline-analysis }} ${{ matrix.target-analysis }} - ${{ matrix.baseline-sha }} ${{ matrix.target-sha }} - ${{ github.event.pull_request.number }} + python helper.py comment-body ${{ matrix.baseline-analysis }} + ${{ matrix.target-analysis }} ${{ matrix.baseline-sha }} + ${{ matrix.target-sha }} ${{ github.event.pull_request.number }} - name: Upload summary file (PR only) if: github.event_name == 'pull_request' && matrix.mode == 'preview-changes' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2cd8c44..dda279d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,11 +64,11 @@ repos: args: ["--python-version=3.10"] additional_dependencies: *mypy_deps - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.5.3 hooks: - id: prettier - types_or: [css, javascript, html, json, yaml] + types_or: [markdown, yaml, json] exclude: \.github/workflows/diff_shades\.yml - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/CHANGES.md b/CHANGES.md index 65bd285..cf415f1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,20 +9,20 @@ ### Stable style + - Fix crash while formatting a long `del` statement containing tuples (#4628) -- Fix crash while formatting expressions using the walrus operator in complex - `with` statements (#4630) +- Fix crash while formatting expressions using the walrus operator in complex `with` + statements (#4630) - 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 - (#4634) +- Fix crash when a tuple appears in the `as` clause of a `with` statement (#4634) - Fix crash when tuple is used as a context manager inside a `with` statement (#4646) ### Preview style -- Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` - would still be formatted (#4552) +- Fix a bug where one-liner functions/conditionals marked with `# fmt: skip` would still + be formatted (#4552) ### Configuration @@ -37,8 +37,8 @@ - Rewrite tokenizer to improve performance and compliance (#4536) -- Fix bug where certain unusual expressions (e.g., lambdas) were not accepted - in type parameter bounds and defaults. (#4602) +- Fix bug where certain unusual expressions (e.g., lambdas) were not accepted in type + parameter bounds and defaults. (#4602) ### Performance @@ -57,8 +57,8 @@ - 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 - section in pyproject.toml: `[project.dependency-groups]` (#4606) +- Enhance GitHub Action `psf/black` to read Black version from an additional section in + pyproject.toml: `[project.dependency-groups]` (#4606) ### Documentation @@ -69,8 +69,8 @@ ### Highlights -This release introduces the new 2025 stable style (#4558), stabilizing -the following changes: +This release introduces the new 2025 stable style (#4558), stabilizing the following +changes: - Normalize casing of Unicode escape characters in strings to lowercase (#2916) - 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) - 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) -- 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) - Fix type annotation spacing between `*` and more complex type variable tuple (#4440) The following changes were not in any previous release: - Remove parentheses around sole list items (#4312) -- Generic function definitions are now formatted more elegantly: parameters are - split over multiple lines first instead of type parameter definitions (#4553) +- Generic function definitions are now formatted more elegantly: parameters are split + over multiple lines first instead of type parameter definitions (#4553) ### Stable style diff --git a/README.md b/README.md index cb3cf71..2450b8b 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,8 @@ SQLAlchemy, Poetry, PyPA applications (Warehouse, Bandersnatch, Pipenv, virtuale pandas, Pillow, Twisted, LocalStack, every Datadog Agent Integration, Home Assistant, Zulip, Kedro, OpenOA, FLORIS, ORBIT, WOMBAT, and many more. -The following organizations use _Black_: Dropbox, KeepTruckin, Lyft, Mozilla, -Quora, Duolingo, QuantumBlack, Tesla, Archer Aviation. +The following organizations use _Black_: Dropbox, KeepTruckin, Lyft, Mozilla, Quora, +Duolingo, QuantumBlack, Tesla, Archer Aviation. Are we missing anyone? Let us know. diff --git a/docs/contributing/release_process.md b/docs/contributing/release_process.md index 2c904fb..c66ffae 100644 --- a/docs/contributing/release_process.md +++ b/docs/contributing/release_process.md @@ -29,8 +29,8 @@ frequently than monthly nets rapidly diminishing returns. **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 -publish a [GitHub Release]. This triggers [release automation](#release-workflows) that builds -all release artifacts and publishes them to the various platforms we publish to. +publish a [GitHub Release]. This triggers [release automation](#release-workflows) that +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. @@ -96,8 +96,9 @@ In the end, use your best judgement and ask other maintainers for their thoughts ## Release workflows -All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore configured -using YAML files in the `.github/workflows` directory of the _Black_ repository. +All of _Black_'s release automation uses [GitHub Actions]. All workflows are therefore +configured using YAML files in the `.github/workflows` directory of the _Black_ +repository. They are triggered by the publication of a [GitHub Release]. diff --git a/docs/integrations/github_actions.md b/docs/integrations/github_actions.md index 3270e0f..af7dee8 100644 --- a/docs/integrations/github_actions.md +++ b/docs/integrations/github_actions.md @@ -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 `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 -`project.dependencies` array and finally the `project.optional-dependencies` table. -The action defaults to the latest release available on PyPI. Only versions available -from PyPI are supported, so no commit SHAs or branch names. +`project.dependencies` array and finally the `project.optional-dependencies` table. The +action defaults to the latest release available on PyPI. Only versions available from +PyPI are supported, so no commit SHAs or branch names. 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