[size]
[size] tunes the thresholds for the three size-category built-ins.
Schema
Section titled “Schema”[size]file_length_warn = 400file_length_error = 800fn_length_warn = 60fn_length_error = 120param_count_warn = 6param_count_error = 10| Field | Default | Used by |
|---|---|---|
file_length_warn | 400 | builtin.size.file-length |
file_length_error | 800 | builtin.size.file-length |
fn_length_warn | 60 | builtin.size.fn-length |
fn_length_error | 120 | builtin.size.fn-length |
param_count_warn | 6 | builtin.size.param-count |
param_count_error | 10 | builtin.size.param-count |
Each _warn value is the lower bound for a warn finding; _error
is the bound for error. A finding always fires at the highest
applicable severity — a 900-line file fires once at error, not
twice.
Calibration
Section titled “Calibration”Reasonable starting points:
| Codebase style | fn_length_warn | fn_length_error |
|---|---|---|
| Strict (Rust core libs, hot paths) | 30 | 60 |
| Default | 60 | 120 |
| Lenient (legacy, large procedural code) | 100 | 200 |
Files are similar — Rust modules tend to land at 200-400 lines, but TypeScript components can balloon to 600+ before being unwieldy. Calibrate to your codebase’s conventions; the defaults err on the conservative side.
Disabling individual rules
Section titled “Disabling individual rules”[size] doesn’t have an enable/disable flag — to turn off
builtin.size.fn-length entirely, ship a stub override:
---id: builtin.size.fn-lengthname: "(disabled)"description: "x"severity: infocategory: sizeenabled: falseevaluator: { type: regex, pattern: "(?!)" }---See Authoring rules → override a built-in.
See also
Section titled “See also”- Configuration overview — full schema.
- The three size rules: file-length, fn-length, param-count.