Skip to content

builtin.size.file-length

FieldValue
idbuiltin.size.file-length
severitywarn
categorysize
scopefile
languagesall
evaluatorbuiltin / file_length

Long files almost always do too many things. They’re harder to read, harder to test in isolation, and harder to navigate. When a single module starts exceeding a few hundred lines it’s usually time to split it: one responsibility per file, one entry point per concept.

Configure under [size] in .sextant/config.toml:

[size]
file_length_warn = 400
file_length_error = 800
SettingDefaultEffect
file_length_warn400Files at or above this trigger a warn finding.
file_length_error800Files at or above this escalate to error.

Counts every line in the file, including blanks and comments — no clever counting heuristics. The intent is “the file is too big”, which is what the raw line count measures.

  • Identify cohesive groups of items (one type and its impls, one feature, one pipeline stage) and move each into its own module.
  • Re-export from mod.rs / lib.rs to avoid breaking call sites.
  • Move tests next to the code they cover so the split stays balanced.