Skip to content

Commit

Permalink
Remove references to black
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Dec 14, 2023
1 parent c39fbda commit 9178684
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
3 changes: 0 additions & 3 deletions scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ addopts = [
]
filterwarnings = ["error"]

[tool.black]
line-length = 120

[tool.ruff]
line-length = 120
allowed-confusables = ["", "×"]
Expand Down
11 changes: 4 additions & 7 deletions {{cookiecutter.project_name}}/docs/template_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ All dependencies listed in such optional dependency groups can then be installed
#### Tool configurations

The `pyproject.toml` file also serves as single configuration file for many tools such as many {ref}`pre-commit`.
For example, the line length of [black](https://github.com/psf/black) can be configured as follows:
For example, the line length for auto-formatting can be configured as follows:

```toml
[tool.black]
[tool.ruff]
line-length = 120
```

Expand Down Expand Up @@ -230,12 +230,9 @@ Once authorized, pre-commit.ci should automatically be activated.

The following pre-commit hooks are for code style and format:

- [black](https://black.readthedocs.io/en/stable/):
standard code formatter in Python.
- [blacken-docs](https://github.com/asottile/blacken-docs):
black on Python code in docs.
- [prettier](https://prettier.io/docs/en/index.html):
standard code formatter for non-Python files (e.g. YAML).
- [ruff][] formatting (`ruff-format`)
- [ruff][] based checks:
- [isort](https://beta.ruff.rs/docs/rules/#isort-i) (rule category: `I`):
sort module imports into sections and types.
Expand Down Expand Up @@ -281,7 +278,7 @@ This section shows you where these checks are defined, and how to enable/ disabl
##### pre-commit
You can add or remove pre-commit checks by simply deleting relevant lines in the `.pre-commit-config.yaml` file under the repository root.
Some pre-commit checks have additional options that can be specified either in the `pyproject.toml` (for `ruff` and `black`) or tool-specific
Some pre-commit checks have additional options that can be specified either in the `pyproject.toml` (for `ruff`) or tool-specific
config files, such as `.prettierrc.yml` for **prettier**.
##### Ruff
Expand Down
5 changes: 1 addition & 4 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ addopts = [
"--import-mode=importlib", # allow using test files with same name
]

[tool.black]
line-length = 120

[tool.ruff]
src = ["src"]
line-length = 120
Expand All @@ -87,7 +84,7 @@ select = [
"RUF100", # Report unused noqa directives
]
ignore = [
# line too long -> we accept long comment lines; black gets rid of long code lines
# line too long -> we accept long comment lines; formatter gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
Expand Down

0 comments on commit 9178684

Please sign in to comment.