Skip to content

Commit 6c63404

Browse files
committed
Switch formatter
1 parent cd38a81 commit 6c63404

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ You will find the built documentation in `docs/_build/html`.
124124
- If you add or change public APIs, tag the docstring using `.. versionadded:: 24.1.0 WHAT` or `.. versionchanged:: 24.1.0 WHAT`.
125125
We follow CalVer, so the next version will be the current with with the middle number incremented (for example, `24.1.0` -> `24.2.0`).
126126

127-
- We use [Ruff](https://ruff.rs/) to sort our imports, and we follow the [Black](https://github.com/psf/black) code style with a line length of 79 characters.
127+
- We use [Ruff](https://ruff.rs/) to sort our imports and format our code with a line length of 79 characters.
128128
As long as you run our full *tox* suite before committing, or install our [*pre-commit*](https://pre-commit.com/) hooks (ideally you'll do both -- see [*Local Development Environment*](#local-development-environment) above), you won't have to spend any time on formatting your code at all.
129129
If you don't, CI will catch it for you -- but that seems like a waste of your time!
130130

.pre-commit-config.yaml

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ ci:
33
autoupdate_schedule: monthly
44

55
repos:
6-
- repo: https://github.com/psf/black
7-
rev: 24.8.0
8-
hooks:
9-
- id: black
10-
116
- repo: https://github.com/astral-sh/ruff-pre-commit
127
rev: v0.6.3
138
hooks:
149
- id: ruff
1510
args: [--fix, --exit-non-zero-on-fix]
11+
- id: ruff-format
1612

1713
- repo: https://github.com/econchick/interrogate
1814
rev: 1.7.0

noxfile.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def docs(session: nox.Session) -> None:
134134

135135
for cmd in cmds:
136136
session.run(
137-
# fmt: off
138137
"python", "-Im", "sphinx",
139138
"-T", "-E",
140139
"-W", "--keep-going",
@@ -144,5 +143,4 @@ def docs(session: nox.Session) -> None:
144143
"-n",
145144
"docs",
146145
"docs/_build/html",
147-
# fmt: on
148-
)
146+
) # fmt: skip

pyproject.toml

+4-6
Original file line numberDiff line numberDiff line change
@@ -160,25 +160,23 @@ module = "noxfile"
160160
disallow_untyped_decorators = false
161161

162162

163-
[tool.black]
164-
line-length = 79
165-
166-
167163
[tool.ruff]
168164
src = ["src", "tests", "noxfile.py", "docs/conf.py"]
165+
line-length = 79
169166

170167
[tool.ruff.lint]
171168
select = ["ALL"]
172169
ignore = [
173170
"A001", # shadowing is fine
174171
"ANN", # Mypy is better at this
175172
"ARG001", # unused arguments are normal when implementing interfaces
176-
"COM", # Black takes care of our commas
173+
"COM", # Formatter takes care of our commas
177174
"D", # We prefer our own docstring style.
178-
"E501", # leave line-length enforcement to Black
175+
"E501", # leave line-length enforcement to formatter
179176
"FBT", # we have one function that takes one bool; c'mon!
180177
"FIX", # Yes, we want XXX as a marker.
181178
"INP001", # sometimes we want Python files outside of packages
179+
"ISC001", # conflicts with formatter
182180
"PLR0913", # yes, many arguments, but most have defaults
183181
"PLR2004", # numbers are sometimes fine
184182
"SLF001", # private members are accessed by friendly functions

src/stamina/instrumentation/_hooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
def init_hooks(
16-
maybe_delayed: tuple[RetryHook | RetryHookFactory, ...]
16+
maybe_delayed: tuple[RetryHook | RetryHookFactory, ...],
1717
) -> tuple[RetryHook, ...]:
1818
"""
1919
Execute delayed hook factories and return a tuple of finalized hooks.

0 commit comments

Comments
 (0)