Use Black 23 specifically (#303)

This commit is contained in:
Dragorn421
2024-01-26 15:37:11 +01:00
committed by GitHub
parent dcb1891a26
commit 42eddfd4b0
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -10,4 +10,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
- uses: psf/black@23.12.1
+14 -2
View File
@@ -91,14 +91,26 @@ https://b3d.interplanety.org/en/using-microsoft-visual-studio-code-as-external-i
#### Formatting
We use [Black](https://black.readthedocs.io/en/stable/index.html).
We use [Black](https://black.readthedocs.io/en/stable/index.html), version 23.
To make VS Code use it, change the `python.formatting.provider` setting to "black". VS Code will ask you to install Black if not already installed.
To install it, run `pip install 'black>=23,<24'`.
To make VS Code use it, change the `python.formatting.provider` setting to "black".
To format the whole repo, run `black .` (or `python3 -m black .` depending on how it is installed) from the root of the repo.
The (minimal) configuration for Black is in `/pyproject.toml`.
There is a GitHub action set up to check that PRs and the main branch are formatted: `/.github/workflows/black-lint.yml`
If you see a message such as
```
Oh no! 💥 💔 💥 The required version `23` does not match the running version `24.1.0`!
```
Make sure the `black --version` is 23. Install a 23 version with `pip install 'black>=23,<24'`.
#### Updater notes
Be careful if testing the updater when using git, it may mess up the .git folder in some cases.
+5
View File
@@ -3,6 +3,11 @@
# See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html
# or `black --help` for what can go here
# Require black version to be 23.x.y
required-version = '23'
# Install such a version with:
# pip install 'black>=23,<24'
line-length = 120
target-version = [