Repository navigation
Expand file tree
/
Copy pathruff.toml
More file actions
48 lines (44 loc) · 2.31 KB
/
Copy pathruff.toml
File metadata and controls
48 lines (44 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
extend = "nix/shared/ruff-anyio.toml"
# The gate. `checks.lint` and `checks.format` in default.nix read this file,
# and ruff finds it by proximity, so do not add a `[tool.ruff]` to
# `pyproject.toml` beside it: a `ruff.toml` in a directory wins over the
# `pyproject.toml` in the same directory, and one used to sit there looking
# like the configuration of this project while governing nothing.
#
# `nix-daemon-protocol/` carries its own `pyproject.toml`, so ruff reads that
# for those files. Passing `--config ruff.toml` overrides the proximity rule
# and reports import-sort findings there that the gate does not; run ruff
# without `--config` to see what CI sees.
#
# `ruff-strict.toml` beside this file is the target, not a gate: 66 findings
# on 2026-09-16. It extends this file, so a change here reaches it.
# `I` is selected, and without this section isort sorts this tree's own
# absolute imports as third-party packages. Each name needs saying:
#
# - `nix_daemon_protocol` lives at `nix-daemon-protocol/src/nix_daemon_protocol`,
# so no directory of that name sits beside this file for ruff to find.
# `pynixd_store` lives at `pynixd-store/src/pynixd_store` for the same reason.
# - `tests` is this project's suite. It has no `src/` layout either, and its
# modules import each other as `tests.something`.
# - `pynixd` is beside this file, and ruff still sorted `pynixd.serde.ids`
# into the third-party block while it put `pynixd.serde` in the first-party
# one. One project cannot be in two groups.
[lint.isort]
known-first-party = [
"nix_daemon_protocol",
"pynixd",
"pynixd_store",
"tests",
]
# The repository writes concurrency in one vocabulary, and that vocabulary is
# anyio: the banned-api table of `nix/shared/ruff-anyio.toml`. This project
# starts with `anyio.run(backend="asyncio", ...)` in `__main__.py`, so an anyio
# primitive works anywhere in it. nixidae/nixidae#1143.
# WireModel.from_reader / _wire_fields / _find_reader all resolve type
# annotations at runtime (get_type_hints + issubclass checks). Without this,
# TC rules flag imports used only as WireModel field annotations, forcing
# pervasive # noqa: TC001 noise.
#
# `ruff-strict.toml` inherits this through `extend`, so it is written once.
[lint.flake8-type-checking]
runtime-evaluated-base-classes = ["nix_daemon_protocol.wire_message.WireModel"]