Skip to content

Sd rust tooling#7

Open
federico-martinez-invgate wants to merge 2 commits into
mainfrom
sd-rust-tooling
Open

Sd rust tooling#7
federico-martinez-invgate wants to merge 2 commits into
mainfrom
sd-rust-tooling

Conversation

@federico-martinez-invgate

Copy link
Copy Markdown
Contributor

No description provided.

Formatting previously followed rustfmt's floating default style, which changed
between toolchain releases (notably import ordering under the 2024 style) and
would silently break `cargo fmt --check` in CI as the pinned `stable` channel
advanced. Pin it explicitly in rustfmt.toml so formatting is deterministic
regardless of the installed rustfmt version, and reformat every file to that
style in one pass.

This pass also carries the mechanical clippy cleanups that `cargo clippy --fix`
applies at the new lint level enabled in the following commit (let-else,
map_or, usize::midpoint, clone_from, iterator idioms, inlined format args) plus
a WriteLock `_file` -> `file` rename now that the field is read in Drop. No
behavioral change; 212 tests pass, byte-identity preserved.
Two additions to raise the quality bar, both wired into the existing CI gates.

Lints ([workspace.lints], inherited by both crates): enable clippy::pedantic as
a baseline plus rustc unsafe_op_in_unsafe_fn=deny (matters for the FFI/mmap/
GlobalAlloc unsafe) and unreachable_pub. The pedantic lints that are pure noise
on a hand-rolled binary-format parser (intentional narrowing casts, exact-float
test asserts, lowercase-only file-extension compares, doc-prose nags) are
allow-listed with a documented rationale rather than churned away. CI already
runs `cargo clippy --all-targets -- -D warnings`, so this is a hard gate.

jscpd: copy-paste detector as a regression ratchet. Threshold 7% in .jscpd.json
sits above the current ~4.9% (which is mostly intentional: the #[cfg(test)]
differential-oracle encoder and repetitive FFI wrappers), so it does not force
refactoring today but fails CI on a large new duplicate. Runs in the lint job
(node is preinstalled on the runner).
@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (6f5ff72) #7 (028efe6) +/-
Coverage 97.0% 97.0% +0.0%
Test Execution Time 6s 7s +1s
Details
  |                     | main (6f5ff72) | #7 (028efe6) |  +/-  |
  |---------------------|----------------|--------------|-------|
+ | Coverage            |          97.0% |        97.0% | +0.0% |
  |   Files             |             36 |           36 |     0 |
  |   Lines             |           6200 |         6203 |    +3 |
+ |   Covered           |           6017 |         6020 |    +3 |
- | Test Execution Time |             6s |           7s |   +1s |

Code coverage of files in pull request scope (97.2% → 97.2%)

Files Coverage +/- Status
sdsearch-core/src/analysis.rs 100.0% 0.0% modified
sdsearch-core/src/distance.rs 100.0% 0.0% modified
sdsearch-core/src/index.rs 97.1% 0.0% modified
sdsearch-core/src/query.rs 97.2% 0.0% modified
sdsearch-core/src/search.rs 96.6% -0.1% modified
sdsearch-core/src/serialize.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/bytes.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/cfs.rs 88.8% 0.0% modified
sdsearch-core/src/zsl/norms.rs 93.0% 0.0% modified
sdsearch-core/src/zsl/postings.rs 78.6% 0.0% modified
sdsearch-core/src/zsl/runner.rs 98.5% 0.0% modified
sdsearch-core/src/zsl/segment.rs 93.8% -0.1% modified
sdsearch-core/src/zsl/stored.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/terms.rs 98.4% -0.1% modified
sdsearch-core/src/zsl/writer/cfs.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/writer/fnm.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/writer/index_writer.rs 97.5% +0.0% modified
sdsearch-core/src/zsl/writer/lock.rs 97.0% 0.0% modified
sdsearch-core/src/zsl/writer/merge.rs 97.6% +0.0% modified
sdsearch-core/src/zsl/writer/norms.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/writer/postings.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/writer/segments.rs 95.5% -0.1% modified
sdsearch-core/src/zsl/writer/stored.rs 100.0% 0.0% modified
sdsearch-core/src/zsl/writer/terms.rs 100.0% 0.0% modified

Reported by octocov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant