Skip to content

ci(lint): clear the advisory linters' long-standing false positives (#2145) - #2147

Merged
JarryShaw merged 1 commit into
mainfrom
ci/2145-lint-noise
Oct 24, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/2145-lint-noise

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — workflows or build tooling

Description of your pull request and other information

Closes #2145. Comments, annotations and lint flags only; there is no behaviour change.

Linter Before After
vermin (make vermin) min 3.11, 3.8 target not met min 3.8, target met
bandit (make bandit) 7 Medium, 3 Low 0
mypy (make mypy) 334 errors 99 errors
  • vermin: --no-parse-comments is dropped. It came with the first vermin recipe in 2022, before the # novermin markers existed, and it made vermin ignore them. The TYPE_CHECKING-only builtin generics now use Tuple / List / Type.
  • bandit: # nosec: B104 # not a bind on the MH 0.0.0.0 packet defaults, and justified nosec on the two intentional continues and the escape-only xml.sax.saxutils import. A comment that bandit read as a marker is reworded.
  • mypy: the 25 unused ignores are gone, including from the pcapkit/vendor generator templates, so a regeneration keeps them out. The pyshark link-type tables are wrapped in cast, and util/pyshark_encap_map.py now emits that form, reproducing both committed tables exactly.
  • Not promoted: vermin and bandit stay advisory (continue-on-error). Making them blocking is the owner's call.
  • Tests: the project tests that read lint.yml, the Makefile or the generator, plus isort, issue-refs and the tier guard, give 357 passed. Narrow unit selections over every touched area give 2826 passed.

…2145)

- vermin: drop `--no-parse-comments`, so the `# novermin` markers on the
  version-gated backports in `compat.py` count; spell the builtin generics
  in `TYPE_CHECKING` aliases (`RawFrame`, `Packet`, `CallbackFn`,
  `_ContextManager.__exit__`) with `typing.Tuple`/`List`/`Type`. vermin now
  meets the 3.8 target.
- bandit: `# nosec: B104` on the MH IPv4 option builders' `0.0.0.0`
  defaults, justified `# nosec` on the intentional `continue`s (B112) and
  the escape-only `xml.sax.saxutils` import (B406); stop a comment in the
  TLS key label crawler from reading as a B105 marker. bandit is clean.
- mypy: delete the unused `type: ignore`s (and the unused codes of partly
  used ones, generator templates included); wrap pyshark's two link-type
  tables in `cast()`, as mypy reads aenum members as `int`, and make
  `util/pyshark_encap_map.py` render that shape.

Neither vermin nor bandit is promoted to blocking here.
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 24, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 24, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

GOOD TO GO at d5fb14b10 (Sonnet review).

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.55% (unit tier, Python 3.15, d5fb14b10, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 880 2618 866 92.12%
pcapkit/corekit 2589 75 816 37 96.48%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2971 23 1036 25 98.80%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17418 219 4574 185 98.14%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 498 7 144 5 98.13%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at d5fb14b10.

  • Review: the Sonnet review is GOOD TO GO.
  • CI: every blocking check passed (Required checks passed SUCCESS). The 3.8–3.10 KTLO legs carry no warnings.
  • Ordering: on a scratch merge into main d7aa41535, the legs whose code it touches at run time passed: toolkit (434/0), vendor (401/0) and utilities (379/0). The rest of the change is comments and TYPE_CHECKING-only annotations.

This closes #2145. Promoting vermin and bandit to blocking in lint.yml is the next step, if you want it.

@JarryShaw
JarryShaw merged commit 74286c7 into main Oct 24, 2026
65 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 24, 2026
@JarryShaw
JarryShaw deleted the ci/2145-lint-noise branch October 24, 2026 15:26
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 24, 2026
@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci(lint): clear the advisory linters' long-standing noise so vermin and bandit can be promoted

1 participant