Skip to content

Configuration

Configuration is optional. Without a slopometer.toml, built-in defaults apply and the report says so.

toml
exclude = ["generated/**"]

[thresholds]
max_function_lines = 60
max_file_lines = 600
max_nesting_depth = 5
narration_comment_ratio = 0.5
min_relevant_lines = 200

[rules."rust/unwrap-in-library"]
enabled = false
severity = "medium"

[categories.doc]
weight = 2.0
half_density = 2.2

Addressing rules

Rules are namespaced by category, so the same syntax reaches both a family and a single rule:

sh
slopometer . --disable doc              # the whole family
slopometer . --disable doc/work-marker  # one rule
slopometer . --enable rust/single-caller-indirection

Unknown keys are rejected

An unparseable file, an unknown rule identifier, or an out-of-range value fails the run before analysis starts, naming the offending key.

This is deliberate. A typo that silently disabled nothing would corrupt a score with no sign of it, which is the worst possible outcome for a tool whose output is a number.

Precedence

Command line beats the file, and the file beats the built-in defaults.

Suppressing one finding

Name the rule:

rust
// slopometer:allow(rust/unwrap-in-library)
let value = certain.unwrap();

A marker that names no rule is refused and reported as a diagnostic. A blanket suppression nobody can read is indistinguishable from a rule that quietly stopped working.

Thresholds worth knowing

min_relevant_lines is the floor below which a category is marked low confidence rather than scored. Beneath it a density is noise, and a number derived from noise is worse than no number.

half_density is the weighted density at which a category scores exactly 50. Lowering it makes a category stricter. The shipped values come from measurement rather than taste; see calibration.

Dual licensed under MIT or Apache-2.0.