Skip to content

[size]

[size] tunes the thresholds for the three size-category built-ins.

[size]
file_length_warn = 400
file_length_error = 800
fn_length_warn = 60
fn_length_error = 120
param_count_warn = 6
param_count_error = 10
FieldDefaultUsed by
file_length_warn400builtin.size.file-length
file_length_error800builtin.size.file-length
fn_length_warn60builtin.size.fn-length
fn_length_error120builtin.size.fn-length
param_count_warn6builtin.size.param-count
param_count_error10builtin.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.

Reasonable starting points:

Codebase stylefn_length_warnfn_length_error
Strict (Rust core libs, hot paths)3060
Default60120
Lenient (legacy, large procedural code)100200

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.

[size] doesn’t have an enable/disable flag — to turn off builtin.size.fn-length entirely, ship a stub override:

.sextant/rules/disable-fn-length.md
---
id: builtin.size.fn-length
name: "(disabled)"
description: "x"
severity: info
category: size
enabled: false
evaluator: { type: regex, pattern: "(?!)" }
---

See Authoring rules → override a built-in.