rscheck-semantic 0.1.0

Semantic backend surface for rscheck.
Documentation
  • Coverage
  • 0%
    0 out of 13 items documented0 out of 7 items with examples
  • Size
  • Source code size: 10.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.93 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 2s Average build duration of successful builds.
  • all releases: 1m 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • xsyetopz/rscheck
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • xsyetopz

rscheck

rscheck checks Rust workspaces against layered project rules.

It covers rules that sit above compiler errors and default Clippy linting: architecture boundaries, API contracts, duplication thresholds, scoped overrides, and repo-specific constraints.

Site: https://xsyetopz.github.io/rscheck/

Install

cargo install rscheck-cli

That installs:

  • rscheck
  • cargo-rscheck

Git install still works if you want the repo head instead of the published crate:

cargo install --git https://github.com/xsyetopz/rscheck --locked rscheck-cli

Check A Workspace

Initialize a policy file:

rscheck init

Run checks:

rscheck check

Choose a report format:

rscheck check --format text
rscheck check --format json
rscheck check --format sarif --output rscheck.sarif.json
rscheck check --format html --output rscheck.html

Preview edits:

rscheck check --dry-run

Apply safe fixes:

rscheck check --write

Apply safe and unsafe fixes:

rscheck check --write --unsafe

Pass extra cargo/clippy arguments after --:

rscheck check -- --all-targets --all-features

Inspect rule metadata:

rscheck list-rules
rscheck explain shape.file_complexity

Configuration

rscheck reads .rscheck.toml from the workspace root. The v3 config uses stable/nightly channel selection, adapters, dot-form rule IDs, and path-scoped overrides.

version = 3

[engine]
semantic = "auto"
toolchain = "stable"
nightly_toolchain = "nightly"

[workspace]
include = ["**/*.rs"]
exclude = ["target/**", ".git/**"]

[output]
format = "text"
# output = "path/to/report.txt"

[adapters.clippy]
enabled = true
toolchain = "inherit"
args = []

[rules."architecture.qualified_module_paths"]
level = "deny"
roots = ["std", "core", "alloc", "crate"]
allow_crate_root_macros = true
allow_crate_root_consts = true
allow_crate_root_fn_calls = true

[rules."shape.file_complexity"]
level = "warn"
mode = "cyclomatic"
max_file = 200
max_fn = 25

[rules."architecture.banned_dependencies"]
level = "deny"
banned_prefixes = ["std::process::Command"]

[rules."testing.external_test_modules"]
level = "deny"

[rules."design.naming_policy"]
level = "warn"

[rules."perf.hot_path_allocations"]
level = "warn"

[[scope]]
include = ["crates/rscheck-cli/**"]

[scope.rules."shape.file_complexity"]
max_file = 260
max_fn = 35

toolchain = "stable" runs stable syntax rules and the Clippy adapter. toolchain = "nightly" requires a nightly cargo/rustc selector. toolchain = "auto" uses nightly for semantic checks when available and falls back to stable when semantic checks are not required. semantic = "require" fails the run if the semantic backend is unavailable; off disables semantic rules.

Rule Families

Current built-in families include:

  • architecture.*
  • design.*
  • shape.*
  • portability.*
  • testing.*
  • perf.*
  • pattern.*

Current rules include:

  • architecture.qualified_module_paths
  • architecture.banned_dependencies
  • architecture.layer_direction
  • design.public_api_errors
  • design.repeated_type_aliases
  • design.naming_policy
  • design.god_object
  • shape.file_complexity
  • shape.duplicate_logic
  • shape.responsibility_split
  • portability.absolute_literal_paths
  • testing.external_test_modules
  • perf.hot_path_allocations
  • pattern.custom

Use As A Library

The library crates are not published on crates.io yet.

[dependencies]
rscheck = { git = "https://github.com/xsyetopz/rscheck" }
use rscheck::analysis::Workspace;
use rscheck::config::Policy;
use rscheck::runner::Runner;
use std::env;

let root = env::current_dir().unwrap();
let policy = Policy::default();
let ws = Workspace::new(root).load_files(&policy).unwrap();
let report = Runner::run(&ws, &policy).unwrap();
println!("{:#?}", report.worst_severity());

Release

Manual release flow for the published crate family:

cargo test --workspace
cargo package --list -p rscheck-semantic
cargo package --list -p rscheck
cargo package --list -p rscheck-cli

cargo publish --dry-run -p rscheck-semantic
cargo publish -p rscheck-semantic

# Wait until crates.io can resolve rscheck-semantic.
cargo publish --dry-run -p rscheck
cargo publish -p rscheck

# Wait until crates.io can resolve rscheck.
cargo publish --dry-run -p rscheck-cli
cargo publish -p rscheck-cli

Verify the published package in a fresh environment:

cargo install rscheck-cli --version <version>
rscheck --help
cargo-rscheck --help

Trusted publishing can be added later once the manual crates.io flow is settled.

Local Site

bun install
bun run site:dev

Build the Pages artifact locally:

bun run site:build