Repository navigation
chore(lint): require a reason on every suppression and expect where unconditional #6159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
f7cc585
quest: claim quest/m0/audit-lints.md
kixelated e40db75
refactor(net): express lite version predicates with matches!
kixelated 4c799c5
refactor(net): use is_multiple_of in Timestamp's Debug
kixelated 7ad3633
refactor(tokio): name the interruptible stream op type
kixelated 1f98fa3
fix(lint): clear clippy failures in moq-auth examples and the jitter …
kixelated 0f50eda
fix(publish): read file track metadata through mediabunny's async get…
kixelated 15c152a
chore(publish): say which DOM types each ts-expect-error covers
kixelated 576f55b
chore(py): enable ruff's RUF100 and drop stale noqa directives
kixelated 6b7ae69
ci(rs): require a reason on every lint suppression, and expect where …
kixelated 1d07785
quest: hand the lint audit to m1 with this run's baselines
kixelated 23ea3e2
Merge remote-tracking branch 'origin/main' into quest/m0/audit-lints
kixelated 22c9288
fix(net): give suppressions merged from main a reason
kixelated 82b47fb
style(sock): format the quinn-derived udp module after the reason sweep
kixelated 6fca024
Merge origin/main into quest/m0/audit-lints
kixelated bb4c190
style: wrap the group bench's expect
kixelated b635923
Merge origin/main into quest/m0/audit-lints
kixelated 1c8a047
Merge origin/main into quest/m0/audit-lints
kixelated c547ade
Merge remote-tracking branch 'origin/main' into audit-lints-iter
kixelated 13e33c9
chore(lint): give main's new suppressions reasons, keep moq-quic lint…
kixelated 2da7b8a
chore(lint): rustfmt a quinn-style test attribute, refresh the m1 lin…
kixelated 80209ed
Merge remote-tracking branch 'origin/main' into audit-lints-iter
kixelated 7b0960e
fix(model-markers): ignore delimiters in comments inside a wrapped at…
kixelated ba9e7fc
quest: point the m1 lint audit at moq-quic's manifest lint tables
kixelated 0425ec5
fix(model-markers): find a wrapped attribute by rustfmt's shape, not …
kixelated b1f00cc
Merge remote-tracking branch 'origin/main' into fix-6159
kixelated 68ed7f2
Merge remote-tracking branch 'origin/main' into fix-6159
kixelated bef45d2
style: wrap the run_present lint expectation
kixelated d4c9287
Merge remote-tracking branch 'origin/main' into fix-6159
kixelated aa49c9b
fix(net): allow FetchServe's variant gap, which varies by target
kixelated 63a4b54
Merge remote-tracking branch 'origin/main' into fix-6159
kixelated 5e47b6b
fix(relay): give main's new bench and test double lint reasons
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # [M] Lint override and deprecation audit | ||
|
|
||
| ## Goal | ||
|
|
||
| Every lint suppression in first-party code, in every language, is still | ||
| needed and says why, or is removed. Nothing calls a deprecated upstream API, | ||
| and our own deprecated items are removed or planned for removal once their | ||
| migration window has passed. | ||
|
|
||
| ## Plan | ||
|
|
||
| Recurs once per major release (decided 2026-10-20). The PR that finishes | ||
| this run also adds the next one with the same file name at the end of the next | ||
| milestone's `Required` (m0 to m1, m1 to m2). The successor keeps the Goal | ||
| and this paragraph; the rest of its Plan is rewritten with what this run | ||
| learned: baselines, results, and what to check first. A successor placed in m2 | ||
| also lists the [release cut](/quest/m2/release/cut.md) under `Required`, so it | ||
| waits for the release in flight to ship. Only `/quest-delete` ends the | ||
| recurrence. Fixes land in the run's PR, one commit each, rather than as follow-ups. | ||
| Only a change that needs a maintainer decision (public API, scope) or is | ||
| independently landable and too large to review alongside the rest becomes a | ||
| follow-up through `/quest-plan`. | ||
|
|
||
| Scope is every language (decided 2026-10-20): clippy and rustc overrides, | ||
| `clippy.toml`, `biome-ignore`, `@ts-expect-error`, `noqa` and | ||
| `type: ignore`, Kotlin `@Suppress`, and the equivalents in Go, Swift, Dart, | ||
| and C/C++. `dead_code` and `unused` suppressions belong to the [dead code | ||
| audit](/quest/m2/audit-dead-code.md); skip them here. Generated or vendored | ||
| bindings (`moq-nvenc`, `moq-v4l/src/sys`, `moq-rtmp/src/rml`, and the | ||
| untracked UniFFI output) keep their blanket allows unless the generator can | ||
| emit clean code. Shell `shellcheck disable` comments stay out of scope. | ||
|
|
||
| A suppression stays only when fixing the lint would make the code worse; a | ||
| signature reshaped to satisfy `too_many_arguments` or `large_enum_variant` | ||
| on a public type is an API change, so it is a follow-up. Removing one of our | ||
| own deprecated exports or hidden CLI spellings is a breaking change with a | ||
| `MIGRATE.md` entry, so it is also a follow-up. | ||
|
|
||
| ### What the m0 run left in place | ||
|
|
||
| Every workspace crate but `moq-quic` sets `lints.workspace = true`, and the | ||
| root `[workspace.lints]` enables `clippy::allow_attributes_without_reason`, so a | ||
| suppression without a reason fails clippy. Unconditional suppressions are | ||
| `#[expect(..., reason = "...")]`, so a stale one fails as | ||
| `unfulfilled_lint_expectations`. A crate needing extra lints gets its own | ||
| manifest `[lints]` tables that repeat that rule (`moq-quic/Cargo.toml`), since | ||
| Cargo can't extend the workspace table per crate and crate attributes skip | ||
| benches and examples. Biome reports an unused `biome-ignore` as | ||
| `suppressions/unused`, and ruff selects `RUF100` (root and | ||
| `demo/carla/sim`). This run only reviews what those gates can't see. | ||
|
|
||
| ### Check first | ||
|
|
||
| - Conditional suppressions: every `cfg_attr(..., allow(...))` and every | ||
| plain `allow` with a reason. Ask whether the condition still holds or the | ||
| lint now fires everywhere (then `expect`) or nowhere (then delete). The | ||
| wasm lane also lints `moq-net` and `moq-flate` as dependencies, so a | ||
| suppression there must hold on wasm32 too. | ||
| - Lanes clippy never runs: the macOS and Windows platform lane is | ||
| `cargo check` only, so an `expect` on Apple or Windows code | ||
| (`moq-video` AVFoundation, `moq-sock`) is unverified. Run clippy there or | ||
| confirm by reading. | ||
| - Python type ignores: run pyright with | ||
| `reportUnnecessaryTypeIgnoreComment`, which m0 didn't. | ||
| - Swift: grep and build for deprecation warnings, which m0 didn't. | ||
| - TypeScript deprecations: typescript-eslint doesn't support the repo's TS 7 | ||
| yet, so m0 swept `no-deprecated` from a throwaway package pinning | ||
| typescript 6 and eslint 9. Files outside any `tsconfig` project can't be | ||
| typed-linted. Check whether typescript-eslint supports TS 7 before | ||
| repeating that setup; if it does, consider joining CI. | ||
| - `sh/rs/model-markers.py` walks attributes above a model marker, including | ||
| ones rustfmt wraps over several lines. Run its tests if a long reason moves | ||
| near a marker. | ||
|
|
||
| ### Results (m0, 2026-10-20) | ||
|
|
||
| - Rust: workspace lints adopted, every suppression given a reason, and | ||
| stale ones removed: 27 `match_like_matches_macro` (now `matches!`), 27 | ||
| `non_camel_case_types` on `repr(C)` structs, `moq-quic`'s crate-wide | ||
| `cognitive_complexity` and `too_many_arguments`, and stale | ||
| `type_complexity`, `arc_with_non_send_sync`, `field_reassign_with_default`, | ||
| `disallowed_methods`, and pedantic allows. | ||
| - Deprecations: `js/publish` file import moved to mediabunny's async track | ||
| getters. The `moq-relay` cluster test's `#[allow(deprecated)]` was stale. | ||
| Go (staticcheck `SA1019`), Kotlin, and Dart (`--fatal-infos`) were clean. | ||
|
|
||
| ### Baselines (2026-10-20, after the m0 run) | ||
|
|
||
| - Rust `clippy::` suppression attributes: 189 (168 `expect`, 12 `cfg_attr` | ||
| `expect`, 9 `allow`), counted 2026-10-22 after main's moq-clock move. | ||
| Most common: `disallowed_methods` 123, `disallowed_types` 48, | ||
| `large_enum_variant` 24, mostly test modules reading the host clock. | ||
| - Rust rustc and rustdoc suppressions: 64 (49 `expect`, 15 `allow`), led by | ||
| `non_camel_case_types` 19 on C ABI enums. `dead_code` and `unused`: 421, | ||
| owned by the dead code audit. | ||
| - Rust `deprecated`: 1, the macOS AVFoundation `devicesWithMediaType`. | ||
| - TypeScript: 40 `biome-ignore` and 47 `@ts-expect-error`. | ||
| - Python: 26 `noqa` or `type: ignore`. | ||
|
|
||
| Count with `git grep` over the whole tree, not per language directory, so | ||
| only tracked files count and none outside `rs/`, `js/`, or `py/` are missed. | ||
| Count multi-line Rust attributes too, since rustfmt wraps long ones. | ||
| Generated UniFFI bindings are untracked (`kt/.gitignore`) and carry their own | ||
| suppressions, such as Kotlin's 139 `@Suppress`; leave them out, and fix a | ||
| noisy one in the generator config instead of the output. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked
cargo metadatafor the workspace:rs/test-envis a workspace member, but its manifest is the sole member besides the deliberately custommoq-quicmanifest withoutlints.workspace = true. Consequently this new lint is not enabled for that crate, so a future reasonless suppression there will still pass the workspace Clippy gate; optrs/test-env/Cargo.tomlinto the workspace lint table as the other members are.AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.