Repository navigation
ci: enforce pedantic through workspace lints - #295
Conversation
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. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Workspace lint settings and CI profiles Cargo.toml, .github/workflows/ci.yml, scripts/*, docs/ci-hardening.md, package Cargo.toml files |
Workspace Rust and Clippy lints are inherited by packages. CI adds stable and feature-specific lint profiles, handles the large_stack_arrays MSRV exception, and removes the former XML-kernel, XSLT, and security check scripts. |
Configuration parsing and policy snapshots crates/xml-sec-config/src/*, crates/xml-sec-config/tests/* |
Configuration APIs document error conditions and mark selected results must_use. Timestamp parsing uses checked epoch arithmetic. Snapshot generation uses operation-specific helpers; the output structure remains unchanged. |
CLI argument and policy handling tools/xmlsec1/src/args*, tools/xmlsec1/src/main.rs, tools/xmlsec1/src/policy_commands.rs, tools/xmlsec1/tests/policy_commands.rs |
Argument parsing moves positional values instead of cloning them. Error reporting and policy-option handling use shared helpers. Tests cover parsing, authorization timestamps, duplicate options, and process failure on output flush errors. |
Key import and normalization tools/xmlsec1/src/key_material* |
Key import adds bounded PEM payload decoding, traditional EC normalization, and DSA public-value validation. Tests cover key formats, protected containers, memory limits, and signature metadata references. |
Feature, capability, and UTC-facts checks src/document.rs, tools/xmlsec1/src/capabilities*, tools/xmlsec1/src/utc_facts* |
Parse-work budget handling is unified across feature configurations. Tests cover capability output and feature gates, UTC-facts validation, and memory and work limits. |
CLI command and process-contract tests tools/xmlsec1/src/commands/tests.rs, tools/xmlsec1/tests/process_contract.rs, tests/c14n_golden.rs |
Tests cover command resource accounting, candidate selection, template processing, input limits, and process contracts. Reusable test helpers replace repeated setup and assertions. |
ML-KEM and XML Encryption interoperability tests tools/xmlsec1/tests/ml_kem_keys.rs, tools/xmlsec1/tests/xmlenc_encrypt_xmlsec1.rs |
Tests extract shared helpers for ML-KEM CLI and reference cases, and for XML Encryption interoperability across templates, CipherReference, KDFs, and ECDH. |
Benchmarks, examples, and capability ledger benches/*, examples/*, tools/capability-ledger/*, tests/capability_ledger.rs |
Benchmark and example setup and reporting move into helpers. Capability-ledger parsing uses shared patterns and extraction helpers, with expanded parser, classification, and provenance tests. |
Priority:
Estimated code review effort: 4 (Complex) | ~60 minutes
Merge Risk: 
Minimal · up to bc2d6
-
This PR moves pedantic lint enforcement into the workspace lint table and refactors tooling, tests and examples without intended behavior changes. No concrete defect was found, so the merge risk is minimal. The PR does not report the full test matrix or the coverage figure requested in the linked issue.
Pre-merge checks: 
3 · 
1 · 
1
-
Failed checks: 1 warning · 1 inconclusive Passed checks: 3 passed-
Full details: Out of Scope Changes check
-
Explanation
The changes remain connected to
#277. They configure workspace pedantic linting, qualify the scoped packages, CLI, examples, benchmarks, ledger tooling, and test support, add focused contract and oracle tests, update lint profiles, and document or remove the superseded scoped gates. The XML parse-budget change supports the required pedantic-clean feature graphs. No unrelated change is established.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 20.30% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 404 functions across 37 files. (11 skipped: 11 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Full details: Linked Issues check
-
Explanation
The PR implements the main
#277coding work. Workspace lint inheritance,-D warningsCI profiles, separate minimal-feature lint graphs, alloc-only XML-input linting, CLI/configuration refactors, ledger checks, benchmark support, and oracle tests are present in the reported changes. The evidence does not establish the full acceptance matrix for embedded/WASM and documentation runs, or a measured coverage result of at least 85%. The PR description also does not report example execution.Resolution
Provide reviewable CI or test evidence for the complete
#277matrix, including embedded/WASM and documentation runs, example execution, and coverage of at least 85%.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
1edde92 to
e936b97
Compare
- Inherit one workspace lint table in every member: pedantic clippy plus the shared unexpected_cfgs feature names - Qualify xml-sec-config: explicit policy imports, checked timestamp conversions, Option<&T> snapshot inputs, per-operation snapshot functions that keep exhaustive field destructuring, documented errors - Qualify the capability ledger: compile header patterns once, count URI declaration lines incrementally, split header extraction stages - Qualify benchmark harnesses and examples: write! instead of format pushes, exact limb conversions for report ratios, split fixture setup - Move inline unit tests into sibling tests.rs files Part of #277
- Take positional arguments out of the owned argv buffer instead of cloning them, and document the parser's errors and invariants - Split policy command option parsing, authorization and diff output; track the two flags directly and insert options through the entry API - Pass private key imports by reference, split traditional EC normalization and PEM payload decoding into their own stages - Move key material unit tests into sibling files Part of #277
- Pass invocations by reference and split command key selection, recipient, template and decryption stages into named steps - Move the remaining inline CLI unit tests into sibling files and load the shared argument module so its tests resolve the same way - Split oversized CLI integration tests into fixture and check helpers, sharing RSA store, recipient template and success-run builders - Build signature templates in one pass in the benchmark support and separate benchmark argument parsing from measurement - Replace FromIterator calls the MSRV toolchain reports Part of #277
- Remove the scoped XML-kernel, XSLT and security pedantic gate scripts; the workspace lint table now carries clippy::pedantic for every member - Lint the default-feature workspace and the MSRV XSLT graph, and add library-only xmldsig, xmlenc and xslt minimal graphs that keep the former gates' separately resolved feature sets - Lint the alloc-only XML-input crate instead of only checking it - Allow clippy::large_stack_arrays on MSRV lint only: clippy 1.92 reports the libtest descriptor array without a span (rust-lang/rust-clippy#13774); stable lint keeps the check Closes #277
DOM and C14N graphs have no XML Security operation, so their parse work budget cannot exist. An uninhabited field states that in the type, and the charge path stays one unconditional call instead of a cfg-split helper that pedantic flags as an always-Ok wrapper.
The feature-contract job runs check-features.sh on 1.92, whose clippy reports the libtest descriptor array of a large test crate as a spanless large_stack_arrays finding (rust-lang/rust-clippy#13774, fixed by rust-lang/rust-clippy#16347). The runner now relaxes that one lint only for clippy before 1.94, as the CI test blocks already do, and keeps it for current clippy. The runner test pins both sides with a stub rustc.
e936b97 to
bc2d6d7
Compare
Summary
Qualifies the remaining tooling under
clippy::pedanticand moves pedantic enforcement from the scoped gate scripts into the workspace lint table.[workspace.lints.clippy] pedantic = "warn"in the rootCargo.toml; every member inherits it with[lints] workspace = true. Locally pedantic warns; every CI lint invocation runs with-D warnings.xmlsec1CLI (arguments, policy commands, key material, commands, tests) are clean on stable and on the 1.92 MSRV, withoutallow/expectsuppressions.tests.rsfiles.check-xml-kernels,check-xsltandcheck-securityscripts and their tests are removed. Their separately resolved graphs remain linted: the default-feature workspace and the MSRV XSLT graph gain lint,xmldsig/xmlenc/xsltminimal library graphs are new lint-only profiles, and the alloc-only XML-input crate is linted instead of only checked.-A clippy::large_stack_arrays, both in the CI test blocks and incheck-features.sh: clippy 1.92 reports the libtest descriptor array of a large test crate without a span (No span for clippy::large_stack_arrays rust-lang/rust-clippy#13774, fixed upstream by Do not warn about large stack arrays without having a valid span rust-lang/rust-clippy#16347). Newer clippy keeps the check; the runner test pins both sides with a stubrustc.Testing
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features -- -D warningson stable and 1.92.0, plus the experimental-PQ profile on 1.92.0scripts/check-features.shlint profile (default, DOM, C14N, dsig, xmlenc, XSLT, legacy, experimental, fips-dsig, pkcs11) on stable and 1.92.0node --test scripts/: 74 passed, 1 skippedscripts/test-pkcs11.shwith SoftHSM and the pinned xmlsec1 oracle: 5604 tests passedCloses #277
Summary by CodeRabbit
Bug Fixes
Developer Improvements