Commit a1a1e7d
authored
fix: the generated ruff config runs the rules it selects (#8)
`DTZ` and `ANN` sat in `select` and in `ignore` at once, so a generated
project shipped a lint file that promised three timezone rules and the
whole annotation family and ran neither. A naive `datetime.now()`, a
`utcnow()` and an unannotated def passed `make check` without a word.
`DTZ` is the family nothing else covers, and this org computes deadlines,
retention windows and TTLs from timestamps, so it comes on rather than out
of `select`. Annotations mypy already enforces for the package; keeping
`ANN` on adds the coverage mypy has no view of, since it reads the package
and never `tests/`.
The entries that only ever meant "except in tests" now say so: `S101`,
`S105` and `S106` move into a `per-file-ignores` block for `tests/**/*.py`,
which leaves library code held to them. `S104` stays global -- library code
does bind all interfaces. `ANN401` and `ANN204` stay and finally mean
something.
Measured against the org's libraries before changing anything: `DTZ` reports
nothing in `deadline-budget`, `clientwright`, `servicewright` or
`sqlalchemy-foundation-kit`, in library code or tests. The whole cost of the
new set is five narrowing asserts in `clientwright` and fifteen missing test
annotations across three repositories.
CI gets the check that was missing: a rule selected and then ignored looks
exactly like a rule that works, so the rendered project is now fed the
mistakes those rules exist to catch and has to report them.
Closes #71 parent ffb60a1 commit a1a1e7d
3 files changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
41 | 70 | | |
42 | 71 | | |
43 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| |||
0 commit comments