Skip to content

CoverageTracker/example-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-rust

coverage badge complexity badge

A small, idiomatic Rust password strength and policy library used as the Rust reference example for Coverage Tracker. It exists to give the Rust row in the coverage report generation guide a live, working reference, and to populate the demo dashboard with real trend data.

This is a demo/marketing repo, not a test suite for Coverage Tracker itself. cargo-llvm-cov's stable-toolchain default emits line coverage only — branch data requires the nightly toolchain and an unstable --branch flag, which this repo deliberately doesn't take on — so unlike the other example repos, this one won't show a branch coverage metric on the dashboard (same situation as example-go).

What's here

  • src/strength.rs — heuristic password strength scoring from length and character-class variety.
  • src/policy.rs — configurable pass/fail policy checks (min length, required character classes) plus human-readable descriptions.
  • src/entropy.rs — a rough Shannon-entropy estimate and qualitative rating.
  • src/blocklist.rs — a small common-password denylist shared by the above.
  • Each module has unit tests, but each also has a real function or two left deliberately untested (Strength's "Excellent" tier, require_special policy checks, most Display/description text), landing at ~77% line coverage.
  • .github/workflows/coverage.yml — runs tests under cargo-llvm-cov, generates a Lizard complexity report, then reports both to the demo instance via the coverage-tracker reporting Action.

Running locally

cargo install cargo-llvm-cov
cargo llvm-cov --lcov --output-path lcov.info   # writes lcov.info
python -m lizard src --xml > lizard-report.xml

About

Rust demo project reporting coverage and complexity to CoverageTracker via the reporting Action.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages