Repository navigation
chore(rust-plugins): add a local quality gate script, pin the toolchain, dedupe the generated parser - #6417
Open
julienmathis wants to merge 1 commit into
Open
chore(rust-plugins): add a local quality gate script, pin the toolchain, dedupe the generated parser#6417julienmathis wants to merge 1 commit into
julienmathis wants to merge 1 commit into
Conversation
…in, dedupe the generated parser Adds rust-plugins/scripts/check.sh: a single local command (fmt check, clippy --all-targets -D warnings, test, and a reachable-panic scan) matching what the "lint"/"build" CI jobs enforce, plus a stricter local-only check the panic scan isn't in CI: no panic!()/.unwrap() may be reachable from production code (outside #[cfg(test)]), since a panic reachable from untrusted input (a malformed JSON definition, a malicious SNMP response) turns a reportable UNKNOWN into a crash. Wired into .githooks/pre-commit.d/ so it runs automatically for contributors using the repository's git hooks. Pins the toolchain via rust-toolchain.toml (1.97.1 + rustfmt/clippy): zero-warning is only meaningful with a fixed lint set. Removes a duplicate lalrpop_mod!(grammar) in main.rs — the ~4500-line generated parser was being compiled twice (once per declaration site); main.rs never referenced the grammar module directly, only compute::mod.rs does. Also drops the needless `return`s clippy flags in grammar.lalrpop's own action code. Test plan: - cargo build --release / cargo test: 67 passed, 0 failed - confirmed only one `lalrpop_mod!(grammar)` remains in the crate - ./scripts/check.sh's fmt/clippy steps currently flag the pre-existing findings #6415 fixes, and its panic scan currently reports the 103 pre-existing hits #6410 (70+15, false positives from two ungated test modules) and #6411 (12+5+1, genuinely reachable panics) fix — verified by hand that the counts match exactly. Once those merge, this script reads ALL CHECKS PASSED.
julienmathis
requested review from
Evan-Adam,
emgcentreon,
kabreu and
paloth
and removed request for
a team
September 4, 2026 12:34
This branch has not been deployed
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
Adds
rust-plugins/scripts/check.sh: a single local command (fmt check,clippy --all-targets -D warnings, test, and a reachable-panic scan) matching what thelint/buildCI jobs enforce, plus a stricter local-only check not in CI: nopanic!()/.unwrap()may be reachable from production code (outside#[cfg(test)]) — a panic reachable from untrusted input (a malformed JSON definition, a malicious SNMP response) turns a reportableUNKNOWNinto a crash. Wired into.githooks/pre-commit.d/so it runs automatically for contributors using the repository's git hooks (git config core.hooksPath .githooks).Pins the toolchain via
rust-toolchain.toml(1.97.1 + rustfmt/clippy): zero-warning is only meaningful with a fixed lint set.Removes a duplicate
lalrpop_mod!(grammar)inmain.rs— the ~4500-line generated parser was being compiled twice (once per declaration site);main.rsnever referenced thegrammarmodule directly, onlycompute::mod.rsdoes. Also drops the needlessreturns clippy flags ingrammar.lalrpop's own action code.Test plan
cargo build --release/cargo test: 67 passed, 0 failedlalrpop_mod!(grammar)remains in the crate./scripts/check.sh's fmt/clippy steps currently flag the pre-existing findings chore(rust-plugins): zero-warning codebase — fmt + clippy -D warnings, CI gate #6415 fixes, and its panic scan currently reports the 103 pre-existing hits chore(rust-plugins): gate test modules behind #[cfg(test)] #6410 (70+15, false positives from two ungated test modules) and fix(rust-plugins): remove reachable panics from expression evaluation and metric assembly #6411 (12+5+1, genuinely reachable panics) fix — verified by hand that the counts match exactly. Once those merge, this script readsALL CHECKS PASSED.