Repository navigation
chore(lint): require a reason on every suppression and expect where unconditional - #6159
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 24 feature predicates suppressed match_like_matches_macro to keep a two-arm match. `matches!` over the old versions still lists them explicitly and falls forward for a new one, so the suppressions go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The suppression said is_multiple_of was unstable on Rust 1.85; it is stable since 1.87 and the workspace floor is 1.91. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Three state variants spelled out OpBox<(S, Option<Result<T, E>>)> under type_complexity allows. A StreamOp alias names it once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bench `--all-targets` clippy failed on both: the moq-auth examples read SystemTime::now under the crate's clock ban (Claims takes SystemTime, so the examples expect the lint), and the jitter bench dropped a must_use Poll. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ters typescript-eslint's no-deprecated flagged six reads of mediabunny's deprecated synchronous track properties (rotation, display size, codec, sample rate, channel count). They are read once while probing, before the clock is pinned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RUF100 fails a noqa that no longer suppresses anything. Five were stale: BLE001 is not a selected rule, F401 never fires on a star import, and ruff accepts an import after sys.path.insert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unconditional A [workspace.lints] table enables clippy::allow_attributes_without_reason, and every crate opts in. kio's and moq-net's loom check-cfg moves into it; moq-quic's quinn lints move to crate attributes, since a crate can't extend the workspace table. Each unconditional clippy suppression, and each always-firing rustc one (naming, missing_docs, deprecated), is now #[expect], so it fails once the lint stops firing. Suppressions that depend on features, targets, or pointer width use cfg_attr or stay an allow with their reason. Converting surfaced stale suppressions, which are removed: 27 repr(C) naming allows in moq-c (rustc skips repr(C) structs), off-by-default pedantic and restriction lints in moq-v4l and moq-nvenc, never-firing large_enum_variant, too_many_arguments, type_complexity, field_reassign_with_default, needless_lifetimes, and arc_with_non_send_sync (moq-net, moq-flate, moq-mux), an unused_mut in moq-relay, disallowed_types in test modules, the moq-uring clock module's ban opt-out, and a deprecated allow on a field that is no longer deprecated. moq-quic's crate-wide too_many_arguments and cognitive_complexity allows become four per-function expects. model-markers.py steps over attributes rustfmt wraps, so a marker above a long cfg_attr still counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Quest run complete: the m0 lint audit finished and the successor is queued in m1 (Written by Claude Opus 5.5) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Resolve conflicts and give main's new suppressions reasons: the async-only dead_code allows in moq-net, the server-only poll_playable allow in moq-hls, the group bench's disallowed_methods (now an expect), and has_drop_code's match_like_matches_macro (now matches!). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged Main's new bare suppressions now carry reasons:
Local checks on Codex reviewed this head with no findings. Enabling auto-merge. (Written by Claude Opus 5.5) |
Brings main's new suppressions under the reason rule: the moq-archive producer bench and moq-net scan timer become expect with a reason, and the five large_enum_variant allows that only fire under a workspace all-features build keep allow with a reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged Main's new bare suppressions now carry reasons:
Checks on (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c8a047b82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # quest/m0/README.md # quest/m0/audit-lints.md # quest/m1/README.md # rs/moq-cli/Cargo.toml # rs/moq-net/src/ietf/subscriber.rs # rs/moq-net/src/model/frame.rs # rs/moq-net/src/model/group.rs # rs/moq-net/src/model/track.rs # rs/moq-video/src/decode/consumer.rs # rs/moq-video/src/encode/producer.rs
…s on every target - Every bare suppression that main added since the branch point (mostly the moq-clock test allows) now says why, and is an `expect` where unconditional. Lints those `expect`s never hit are dropped, and stale ones are deleted. - qmux joins the workspace lint table. - moq-quic gets its own `[lints]` tables again, so quinn's lints reach its benches and examples, plus `allow_attributes_without_reason`. - model-markers.py steps over a wrapped attribute only when its bracket closes exactly on a `)]` line, so code ending in `)];` can't lend its marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t quest The x86_64 all-features `large_enum_variant` warnings no longer fire, and the clippy suppression baseline now counts main's moq-clock test allows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # quest/m0/README.md # quest/m1/README.md
# Conflicts: # rs/moq-net/src/model/track.rs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # rs/moq-net/src/model/origin.rs # rs/moq-video/src/encode/producer.rs
The wasm32 build lays FetchServe out without the gap, so an expectation fails there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # rs/moq-relay/Cargo.toml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e47b6b997
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [workspace.lints.clippy] | ||
| # Every suppression says why, so the next lint audit can judge it. | ||
| allow_attributes_without_reason = "warn" |
There was a problem hiding this comment.
Opt test-env into the workspace lint table
Checked cargo metadata for the workspace: rs/test-env is a workspace member, but its manifest is the sole member besides the deliberately custom moq-quic manifest without lints.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; opt rs/test-env/Cargo.toml into the workspace lint table as the other members are.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
Finishes the m0 run of the lint override and deprecation audit and hands it to m1.
Enforcement
[workspace.lints]enablesclippy::allow_attributes_without_reason, and every workspace crate exceptmoq-quicopts in withlints.workspace = true. Under CI's-D warnings, a suppression with no reason now fails clippy.check-cfgthatkioandmoq-netdeclared moved into the workspace table.moq-quickeeps its own[lints.rust]and[lints.clippy]tables with quinn's lints, so they reach its benches and examples too, and repeatsallow_attributes_without_reasonthere. Cargo can't extend the workspace table per crate.#[expect(..., reason = "...")], so a stale one fails asunfulfilled_lint_expectations.cfg_attr, or stays anallowwith its reason. One example islarge_enum_varianton 64-bit only, because the wasm lane lintsmoq-nettoo.sh/rs/model-markers.pynow walks over attributes that rustfmt wraps across several lines. It recognizes one by rustfmt's shape: a)]alone at the#[line's indent, with every line between indented deeper. The contents are never parsed, and code ending in)]or)];can't lend its marker to the next item. Each case has a regression test.Stale suppressions removed
match_like_matches_macroinlite/version.rsbecamematches!, including four that arrived from main during this run.non_camel_case_typesonmoq-crepr(C)structs. Rustc doesn't fire it there; the enums keep it.moq-quic's crate-widecognitive_complexityandtoo_many_argumentswere dropped. The four functions that still needtoo_many_argumentscarry anexpect.type_complexity(three, via aStreamOpalias inmoq-tokio).is_multiple_ofinTimestamp'sDebug.arc_with_non_send_sync,field_reassign_with_default,disallowed_methods/disallowed_types,unused_mut,needless_lifetimes,deprecated, and pedantic allows.Suppressions from main
moq-dev/moq#6135 landed first with more than 80 bare
allow(clippy::disallowed_methods, clippy::disallowed_types), and other PRs added a few more. Each now has a reason and is anexpect, except where noted:disallowed_typeshalf was dropped where nothing in the module names a disallowed type, and one attribute that covered nothing was deleted.moq-video's capture tests,moq-audio's playback tests) is acfg_attron those features.moq-relay's idle-listener tests stay anallow, since the benchmark that includes the module compiles the tests out.std::thread::sleepmoved their comment into the reason.qmux, a new crate, joins the workspace lint table. Itsvalidate_protocolexpectsdead_codeonly when no transport that calls it is enabled.Other languages
biome-ignore. Each@ts-expect-errorinjs/publishnow names the DOM types it covers.no-deprecatedsweep foundjs/publish's file import on mediabunny's deprecated sync track getters, which now read through the async ones. It ran on typescript 6 outside the repo, since typescript-eslint doesn't support TS 7 yet.RUF100at the root and indemo/carla/sim, and the stalenoqadirectives it found are gone.SA1019), Kotlin (uncached compile with now:lines), and Dart (--fatal-infos) needed no changes.moq-authexamples and themoq-muxjitter bench failed clippy under--all-targets, so they are fixed.Successor
quest/m0/audit-lints.mdmoved toquest/m1/audit-lints.mdat the end of m1'sRequired. It keeps the Goal and the recurrence paragraph.reportUnnecessaryTypeIgnoreCommentRelation to other PRs
allow(clippy::disallowed_methods)onrs/moq-net/benches/group.rs; it is now anexpectwith its reason.Decisions
Picked without a prompt, as the recommended option:
moq-quickeeps a crate-level[lints]table rather than per-target attributes, since Cargo applies a manifest table to every target and one place stays in sync.expectthat one feature lane fulfills and another doesn't becomes acfg_attron the feature that needs it, rather than anallow.API and wire impact
from_strmethods inhang,moq-auth, andmoq-msfkeep anexpect(clippy::should_implement_trait). Switching them toFromStris tracked by FromStr parsers.Checks
On the merged head:
just check, exceptnix flake check, whose VM image build needs user namespaces the local host deniescargo clippy --workspace --all-targets -- -D warningscargo clippy --workspace --exclude moq-net-fuzz --exclude moq-quic-fuzz --all-targets --all-features -- -D warnings, the nightlyfeatureslanejust rs wasm,capture,uring,quic-features,net-features, andtokio-features --allcargo clippy -p moq-net --all-targets --no-default-featurescargo clippy -p qmux --all-targets --all-featurescargo clippy -p moq-video --features capture,openh264 --all-targetsmodel-markers.pyand its testsNot run:
cargo checks them, so anexpecton Apple or Windows code is verified by reading only.cargo clippy -p qmux --no-default-featuresfails on an unusedMAX_FRAME_SIZE. That is pre-existing on main, and no lane runs it.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code