Repository navigation
chore(rust-plugins): zero-warning codebase — fmt + clippy -D warnings, CI gate - #6415
Closed
julienmathis wants to merge 1 commit into
Closed
julienmathis wants to merge 1 commit into
julienmathis wants to merge 1 commit into
Conversation
julienmathis
requested review from
Nivoky,
pkriko and
sdepassio
and removed request for
a team
September 4, 2026 12:23
3 tasks done
Nivoky
previously approved these changes
Oct 1, 2026
pkriko
previously approved these changes
Oct 26, 2026
…, CI gate Fixes every cargo clippy --all-targets warning in rust-plugins (unneeded returns, manual Option::map, needless borrows, &Vec/&Vec<T> instead of slices, legacy std::f64::INFINITY, collapsible ifs, unused lifetimes, useless .into() conversions, dead/unused imports, from_over_into on Status) and applies cargo fmt, without changing any runtime behavior. Notable non-mechanical fixes: - output::OutputFormatter's inherent to_string() (shadowing the ToString trait) becomes a proper impl Display; call sites are unaffected since ToString is blanket-implemented for Display. - Three test modules (compute/mod.rs, compute/lexer.rs, compute/threshold.rs) lack #[cfg(test)] (see the dedicated PR for that): their imports/helpers are only used by #[test] fn bodies, which a plain (non-test) build strips, so clippy's default pass always flags them as unused regardless of gating elsewhere. Silenced locally with #[allow(unused_imports, dead_code)] rather than duplicating the #[cfg(test)] fix here, to avoid the two PRs conflicting on the same line. - snmp::mod.rs: a few imports (FailedToConnectToHost, InvalidSnmpPduDecode/Encode, log::info/trace, UdpSocket) are used only by the #[cfg(not(test))] variant of get_data_from_udp; moved local to that function instead of importing them crate-wide. Adds a "lint" CI job (cargo fmt --check + cargo clippy --all-targets --release -- -D warnings) alongside the existing build/test job, so regressions are caught going forward. Test plan: - cargo fmt --check: clean - cargo clippy --all-targets --release -- -D warnings: clean - cargo build --release: succeeds - cargo test: 67 passed, 0 failed
omercier
force-pushed
the
chore/rust-lints
branch
from
November 13, 2026 15:55
fa7a7c7 to
6784db0
Compare
|
❌ Jira reference required No Jira issue key (for example Every pull request targeting
Prefix the branch name with the key for the next pull requests (for example |
4 tasks done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes every
cargo clippy --all-targetswarning inrust-plugins(unneeded returns, manualOption::map, needless borrows,&Vec/&Vec<T>instead of slices, legacystd::f64::INFINITY, collapsible ifs, unused lifetimes, useless.into()conversions, dead/unused imports,from_over_intoonStatus) and appliescargo fmt, without changing any runtime behavior.Notable non-mechanical fixes:
output::OutputFormatter's inherentto_string()(shadowing theToStringtrait) becomes a properimpl Display; call sites are unaffected sinceToStringis blanket-implemented forDisplay.compute/mod.rs,compute/lexer.rs,compute/threshold.rs) lack#[cfg(test)](see chore(rust-plugins): gate test modules behind #[cfg(test)] #6410): their imports/helpers are only used by#[test]fn bodies, which a plain (non-test) build strips, so clippy's default pass always flags them as unused regardless of gating elsewhere. Silenced locally with#[allow(unused_imports, dead_code)]rather than duplicating the#[cfg(test)]fix here, to avoid the two PRs conflicting on the same line — once chore(rust-plugins): gate test modules behind #[cfg(test)] #6410 merges these allows become redundant but harmless (also safe to drop them then).snmp::mod.rs: a few imports (FailedToConnectToHost,InvalidSnmpPduDecode/Encode,log::info/trace,UdpSocket) are used only by the#[cfg(not(test))]variant ofget_data_from_udp; moved local to that function instead of importing them crate-wide.Adds a
lintCI job (cargo fmt --check+cargo clippy --all-targets --release -- -D warnings) alongside the existing build/test job, so regressions are caught going forward.Test plan
cargo fmt --check: cleancargo clippy --all-targets --release -- -D warnings: cleancargo build --release: succeedscargo test: 67 passed, 0 failed