fix(lint): reach every const/vendor __init__.py in isort and drop five stale pylint flags - #773
Conversation
96bfb44 to
f31e511
Compare
|
Second cross-review at The Makefile still needs bash ≥ 4.0. So on a macOS contributor's machine this PR takes line 126 from 264 files to 12, and those 34
The fix is already written in this PR: use Two smaller ones. The basis correction is 3 in R and 5 in the total, not 2 — the old R figures already included their three Confirmed good: |
f31e511 to
f29df2c
Compare
|
Third cross-review at 1. A measured number in a permanent comment is wrong, and it is my number used wrongly. The new test prose says the degradation sorts "none of the 34 depth-two 34 is the all-depth total; I supplied it and it was written up as the loss. The figure is 32, and the "depth-two" label is then correct. Both halves need fixing together. 2. The A correction the reviewer made against itself, which matters beyond this PR. Last pass it cleared the space-in-path case as failing loudly — "word-splits into two nonexistent paths → isort errors". Measured, that is false: isort prints Related, and worth knowing even though neither case is reachable today: the Makefile merges both Three minor points, non-blocking: the same paragraph says the empty case "fails the build under The no-rebase choice is right and should stand. Rebasing onto |
f29df2c to
4976665
Compare
|
Fourth pass at Every The functions are The report claims "all four physical line numbers stable, verified with Do not renumber to 133-136. That re-arms the same trap — the next comment added above the target breaks them again, and the encoded number is load-bearing in six docstring cross-references. Key the names on their target instead: Everything else this round is correct. The count is fixed to 32 with the "depth-two" label kept, which I verified: 32 at depth two, plus the two depth-three apptype files the degraded glob still reached, is the 34 all-depth total. The split of line 126 into per-directory calls closes the partial-failure gap outright rather than caveating it, matches Four isort lines, four subtests, |
4976665 to
67035d9
Compare
|
Round-six review at Confirmed. On reordering, the answer is better than I feared: a reorder is not caught, but it structurally cannot mismatch flags to targets, because each The two hostile inputs I named both make the parser disagree with
One silent-wrong-set path, and it is the only one constructible: a Blast radius, stated because it bounds all of the above: flags and target expressions come from One pre-existing gap worth a clause rather than a fix: the resolver reads line numbers only, while flags and target expressions stay hardcoded, so changing Merge with |
…e stale pylint flags
Makefile:126's isort glob (`pcapkit/{const,vendor}/*/*.py`) stopped at a fixed
two levels, so #754's `pcapkit/const/reg/apptype/` package landed its
`__init__.py` a level deeper than either that line or line 125's
`--skip-glob '**/__init__.py'` reached -- sorted by no `make isort` line at
all. A first pass here widened it to `*/**/*.py` under `shopt -s globstar`,
which needs bash >= 4.0 and is not what the Makefile's own
`SHELL := $(shell command -v bash ...)` guarantees on a machine without a
brew bash ahead of macOS's system 3.2 -- silently: `shopt` on such a machine
just prints one stderr line and the next command still runs, under the old,
non-recursive glob, sorting none of the 32 depth-two `__init__.py` files it
used to cover (the two three levels down under `.../reg/apptype/` stay
reachable either way) -- the hole reopened one level up. A second pass
replaced that with a single `isort` invocation fed by
`$(find pcapkit/const -mindepth 2 -name '*.py')` and the `vendor` equivalent,
needing no particular bash and no shell option at all, but merging both
`find`s into one invocation meant only a fully-empty expansion would fail
loudly; a partially-empty one would exit 0 having quietly skipped half the
tree. Unreachable today -- neither directory can be absent where
`make isort` runs, and no path under either contains whitespace -- but the
same shape of latent gap as the original bug, so the const/vendor line is now
split into two calls, one per directory, matching
`.github/workflows/cron-vendor.yml`'s own two calls exactly (the one other
place this glob lived, on the path that actually regenerates the deep files,
fixed the same way for the same reason). The Makefile's own bash pin is
re-justified: brace expansion, its original reason, is gone from the file
entirely.
`tests/project/test_isort_clean.py` is restructured for the resulting four
recipe lines, and its own naming is fixed along with it: it used to key its
target-resolution functions on line numbers (`_line_125_targets` and so on),
which is exactly the failure this file exists to catch, and expanding the
Makefile's bash-pin comment above the `isort:` target this same round moved
the real lines to 133-136 while the names still said 125-128 -- caught by a
reviewer's measurement, not by the test. Functions are now named for what
they target (`_pcapkit_tree_targets`, `_const_targets`, `_vendor_targets`,
`_util_examples_targets`), `MAKEFILE_LINES` is a plain list paired with line
numbers positionally rather than keyed by one, and a new
`_isort_recipe_line_numbers()` reads `Makefile` and returns those numbers
fresh every run -- verified by shifting the target down a line in a scratch
copy and confirming the resolver's output shifts with it (132->133,
133-136->134-137). Every prose reference to a specific line number in the
module docstring is swept to a descriptive name for the same reason.
`_isort_recipe_line_numbers()` itself needed one more fix: it broke on the
first line that was not tab-indented, which is not what ends a recipe as far
as `make` is concerned -- a blank line or a column-0 `#` comment inside the
recipe is transparent to `make` (measured with `make -n isort` as the
oracle: still four commands with either dropped between two recipe lines),
and the resolver undercounted both, silently, in exactly the way this PR
exists to stop. It now treats those two as transparent too. Documented, not
defended against: a `define`/`endef` block containing a bare `isort:` would
still fool it -- nothing in this Makefile uses `define`. The `MAKEFILE_LINES`
comment is reworded to separate why the list has to match the Makefile
(the "clean locally, red in CI" risk) from what actually checks that it does
(a length comparison, nothing about the flags or targets themselves), and to
note the asymmetry that bounds all of this: flags and targets are literals
in `MAKEFILE_LINES`, never read back out of the Makefile, so a line-number
bug can only mislabel where a failure points, never change which isort
invocation the test actually runs.
`PYLINT_FLAGS` loaded `pylint.extensions.emptystring`, which pylint removed at
3.0 (`E0013 bad-plugin-value` every run), and named four `--disable=` checks
pylint has since removed (`old-division`, `no-absolute-import`,
`input-builtin`) or left unloaded (`eq-without-hash`, live in
`pylint.extensions.eq_without_hash` but never in `--load-plugins=`) -- five
stale entries, dropped. This is flag hygiene, not enablement: `E0013` did not
gate `compare-to-empty-string`, which reaches the core `refactoring` checker's
`use-implicit-booleaness-not-comparison-to-string` (C1804) via an `old_names`
alias regardless of the plugin's own load failure, confirmed with
`--list-msgs-enabled` (identical, 399 lines, before and after). `lint.yml`'s
header is corrected to match and re-pinned to 1a85269, since `pcapkit/` had
in fact moved from the previous pin (932cb48) in four files even though
E/W/C read the same on both; its R/total range is restated on a consistent
basis and labelled with the tree it was measured on.
Fixes #765.
Fixes #767.
Build: `make isort` clean on all four lines; pylint re-measured once several
rounds back, output redirected to a file and parsed (E 90, W 4765, C 542,
R 648, exit 30) -- unchanged since, no pcapkit/ file touched.
67035d9 to
ce21ace
Compare
|
Round-seven cross-review at The risk I briefed it on did not materialise.
One residual, pre-existing and disclosed: a recipe line commented out with a tab is still counted, so the length guard passes while Merged into |
`main` moved from 73f09ae to 3cbdf89 while this PR sat open. This commit (relative to its parent, 4233555) now names all 20 bullets it carries, not just the 8 this session added on top of the 10 already there -- a first draft of this message named only its own 8 and left the other 10 silent, which a cross-review caught. Four are breaking: - #754 -- AppType split into per-transport registries; the 1,004 portless and 704 transportless rows stop being members. - #764 -- an out-of-range port in `AppType.get` is refused, not minted. - #778 -- `@final` enforced at runtime on `Info`/`Schema`. - #575 -- four `.get()`-backed enum fields fall through to `_unregistered_member` instead of minting; 14 of 23 sample captures change output. - #772 (with #790's docstring reword), #766, #759, #787, #794 (with #791's citation repoint), #792/#798, #802, #782 (a further #745-hazard instance), #704, #723, #739, #743/#746 (cross-dependent, one bullet each), #805 (closes #802's own filed-as-out-of-scope), #796, #800 -- the other 16, non-breaking. Also restores a measurement an earlier round in this same diff dropped while updating an adjacent one: the #692 entry's "mypy is unmoved at 112 errors" silently lost its "and pylint ... 364 messages" half when `EXPECTED_FAILURES` was corrected 44 to 43 elsewhere in the same sentence. Restored to the last value earlier rounds signed off on rather than re-measured, since this branch's own `pcapkit/` tree predates several since-merged PRs and a fresh run would not be measuring the same thing the original round measured. Unmoved, and not silently dropped this time: `93 of the 95 sites` corrected to `94 of the 95` and `EXPECTED_FAILURES` 44 to 43 in the several other places that already carried the fix. On which PRs get a bullet: there is no clean "user-facing only" rule -- #766 and #791 are pure CI/test/lint-comment entries that are in, while #773 and #763 are the same kind of thing and are out. The real pattern across this file's 46 commits is closer to "each round's author judged it worth a reader's time," which is inconsistent by construction. This round leaves that inconsistency as found rather than trying to retrofit a rule, but did add #782 on reconsideration -- its own PR body names it as sharing #766's hazard, and pre-existing precedent already treats that hazard's instances as bullet-worthy. `changelog_md.py` regenerated `CHANGELOG.md`; `--check` exit 0. `test_changelog_md.py` 47 passed.
`main` moved from 73f09ae to 3cbdf89 while this PR sat open. This commit (relative to its parent, 4233555) now names all 20 bullets it carries, not just the 8 this session added on top of the 10 already there -- a first draft of this message named only its own 8 and left the other 10 silent, which a cross-review caught. Six are breaking, matching the crediting PRs' own `breaking` label in each case: - #754 -- AppType split into per-transport registries; the 1,004 portless and 704 transportless rows stop being members. - #764 -- an out-of-range port in `AppType.get` is refused, not minted. - #778 -- `@final` enforced at runtime on `Info`/`Schema`. - #575 -- four `.get()`-backed enum fields fall through to `_unregistered_member` instead of minting; 14 of 23 sample captures change output. - #759 -- `AppType._dispatch` on a multi-transport `proto` now raises `ProtocolError` instead of silently resolving to whichever transport owns the lowest set bit. - #805 -- `FieldBase.length` on a negative resolved length now raises `ProtocolError` instead of letting a bare `struct.error` escape. A second cross-review caught both: their crediting PRs (#783, #811) both carry GitHub's own `breaking` label, and neither bullet said so. - #772 (with #790's docstring reword), #766, #787, #794 (with #791's citation repoint), #792/#798, #802, #779 (via #782, a further #745-hazard instance), #704, #723, #739, #743/#746 (cross-dependent, one bullet each), #796, #800 -- the other 14, non-breaking. Also restores a measurement an earlier round in this same diff dropped while updating an adjacent one: the #692 entry's "mypy is unmoved at 112 errors" silently lost its "and pylint ... 364 messages" half when `EXPECTED_FAILURES` was corrected 44 to 43 elsewhere in the same sentence. Restored to the last value earlier rounds signed off on rather than re-measured, since this branch's own `pcapkit/` tree predates several since-merged PRs and a fresh run would not be measuring the same thing the original round measured. Unmoved, and not silently dropped this time: `93 of the 95 sites` corrected to `94 of the 95` and `EXPECTED_FAILURES` 44 to 43 in the several other places that already carried the fix. On which PRs get a bullet: there is no clean "user-facing only" rule -- #766 and #791 are pure CI/test/lint-comment entries that are in, while #773 and #763 are the same kind of thing and are out. The real pattern across this file's 46 commits is closer to "each round's author judged it worth a reader's time," which is inconsistent by construction. This round leaves that inconsistency as found rather than trying to retrofit a rule, but did add #779 (via #782) on reconsideration -- its own PR body names it as sharing #766's hazard, and pre-existing precedent already treats that hazard's instances as bullet-worthy. `changelog_md.py` regenerated `CHANGELOG.md`; `--check` exit 0. `test_changelog_md.py` 47 passed.
`main` moved from 73f09ae to 3cbdf89 while this PR sat open. This commit (relative to its parent, 4233555) now names all 20 bullets it carries, not just the 8 this session added on top of the 10 already there -- a first draft of this message named only its own 8 and left the other 10 silent, which a cross-review caught. Six are breaking, matching the crediting PRs' own `breaking` label in each case: - #754 -- AppType split into per-transport registries; the 1,004 portless and 704 transportless rows stop being members. - #764 -- an out-of-range port in `AppType.get` is refused, not minted. - #778 -- `@final` enforced at runtime on `Info`/`Schema`. - #575 -- four `.get()`-backed enum fields fall through to `_unregistered_member` instead of minting; 14 of 23 sample captures change output. - #759 -- `AppType._dispatch` on a multi-transport `proto` now raises `ProtocolError` instead of silently resolving to whichever transport owns the lowest set bit. - #805 -- `FieldBase.length` on a negative resolved length now raises `ProtocolError` instead of letting a bare `struct.error` escape. A second cross-review caught both: their crediting PRs (#783, #811) both carry GitHub's own `breaking` label, and neither bullet said so. - #772 (with #790's docstring reword), #766, #787, #794 (with #791's citation repoint), #792/#798, #802, #779 (via #782, a further #745-hazard instance), #704, #723, #739, #743/#746 (cross-dependent, one bullet each), #796, #800 -- the other 14, non-breaking. Also restores a measurement an earlier round in this same diff dropped while updating an adjacent one: the #692 entry's "mypy is unmoved at 112 errors" silently lost its "and pylint ... 364 messages" half when `EXPECTED_FAILURES` was corrected 44 to 43 elsewhere in the same sentence. Restored to the last value earlier rounds signed off on rather than re-measured, since this branch's own `pcapkit/` tree predates several since-merged PRs and a fresh run would not be measuring the same thing the original round measured. Unmoved, and not silently dropped this time: `93 of the 95 sites` corrected to `94 of the 95` and `EXPECTED_FAILURES` 44 to 43 in the several other places that already carried the fix. On which PRs get a bullet: there is no clean "user-facing only" rule -- #766 and #791 are pure CI/test/lint-comment entries that are in, while #773 and #763 are the same kind of thing and are out. The real pattern across this file's 46 commits is closer to "each round's author judged it worth a reader's time," which is inconsistent by construction. This round leaves that inconsistency as found rather than trying to retrofit a rule, but did add #779 (via #782) on reconsideration -- its own PR body names it as sharing #766's hazard, and pre-existing precedent already treats that hazard's instances as bullet-worthy. `changelog_md.py` regenerated `CHANGELOG.md`; `--check` exit 0. `test_changelog_md.py` 47 passed.
`main` moved from 73f09ae to 3cbdf89 while this PR sat open. This commit (relative to its parent, 4233555) now names all 20 bullets it carries, not just the 8 this session added on top of the 10 already there -- a first draft of this message named only its own 8 and left the other 10 silent, which a cross-review caught. Six are breaking, matching the crediting PRs' own `breaking` label in each case: - #754 -- AppType split into per-transport registries; the 1,004 portless and 704 transportless rows stop being members. - #764 -- an out-of-range port in `AppType.get` is refused, not minted. - #778 -- `@final` enforced at runtime on `Info`/`Schema`. - #575 -- four `.get()`-backed enum fields fall through to `_unregistered_member` instead of minting; 14 of 23 sample captures change output. - #759 -- `AppType._dispatch` on a multi-transport `proto` now raises `ProtocolError` instead of silently resolving to whichever transport owns the lowest set bit. - #805 -- `FieldBase.length` on a negative resolved length now raises `ProtocolError` instead of letting a bare `struct.error` escape. A second cross-review caught both: their crediting PRs (#783, #811) both carry GitHub's own `breaking` label, and neither bullet said so. - #772 (with #790's docstring reword), #766, #787, #794 (with #791's citation repoint), #792/#798, #802, #779 (via #782, a further #745-hazard instance), #704, #723, #739, #743/#746 (cross-dependent, one bullet each), #796, #800 -- the other 14, non-breaking. Also restores a measurement an earlier round in this same diff dropped while updating an adjacent one: the #692 entry's "mypy is unmoved at 112 errors" silently lost its "and pylint ... 364 messages" half when `EXPECTED_FAILURES` was corrected 44 to 43 elsewhere in the same sentence. Restored to the last value earlier rounds signed off on rather than re-measured, since this branch's own `pcapkit/` tree predates several since-merged PRs and a fresh run would not be measuring the same thing the original round measured. Unmoved, and not silently dropped this time: `93 of the 95 sites` corrected to `94 of the 95` and `EXPECTED_FAILURES` 44 to 43 in the several other places that already carried the fix. On which PRs get a bullet: there is no clean "user-facing only" rule -- #766 and #791 are pure CI/test/lint-comment entries that are in, while #773 and #763 are the same kind of thing and are out. The real pattern across this file's 46 commits is closer to "each round's author judged it worth a reader's time," which is inconsistent by construction. This round leaves that inconsistency as found rather than trying to retrofit a rule, but did add #779 (via #782) on reconsideration -- its own PR body names it as sharing #766's hazard, and pre-existing precedent already treats that hazard's instances as bullet-worthy. `changelog_md.py` regenerated `CHANGELOG.md`; `--check` exit 0. `test_changelog_md.py` 47 passed.
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible -- N/A — changelog centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Fixes #765.
Fixes #767.
Makefile:126's isort glob stopped at a fixed two levels, so #754's split left
pcapkit/const/reg/apptype/__init__.py(and its vendor counterpart) reachedby no
make isortline at all. Two intermediate fixes each traded one gapfor a narrower one (a bash-version dependency, then a partial-failure gap in
a merged
isortcall); the const/vendor line is now split into two calls,one per directory, matching
cron-vendor.yml's own two calls exactly.tests/project/test_isort_clean.pyis restructured for the resulting fourlines, and its own naming is fixed along with it: it used to key its
target-resolution functions on line numbers, which drifted the moment this
same PR's Makefile comment expanded above the target -- caught by a
reviewer's measurement, not by the test. Functions are now named for what
they target,
MAKEFILE_LINESpairs flags with targets positionally ratherthan by a line-number key, and
_isort_recipe_line_numbers()readsMakefileand resolves those numbers fresh every run (verified by shiftingthe target in a scratch copy and confirming the resolver's output moves with
it). That resolver also treats a blank or column-0 comment line inside the
recipe as transparent, matching
make's own behaviour there (make -n isortstill reports four commands with either dropped between two recipelines; the resolver used to undercount both). Every prose reference to a
specific line number in the module docstring is swept to a descriptive name
for the same reason.
PYLINT_FLAGSnamedpylint.extensions.emptystring, which pylint removed at3.0 (
E0013every run), plus four--disable=entries for checks pylint hassince removed or left unloaded -- five stale entries, dropped. This is flag
hygiene, not enablement:
compare-to-empty-stringreaches the corerefactoringchecker'suse-implicit-booleaness-not-comparison-to-string(C1804) via a backward-compatible alias regardless of the plugin's own load
failure -- confirmed with
--list-msgs-enabled, identical before and after.lint.yml's header is corrected to match, re-pinned to 1a85269, and itsR/total range is restated on a consistent basis with the tree it was
measured on.