Skip to main content

sort

Function sort 

Source
pub fn sort(violations: &mut [Violation])
Expand description

Sort violations into lanekeep’s canonical order: (ruleId, file, line, column).

This is part of the output contract, not a presentation choice. An agent reads lanekeep’s output, changes code, and reads it again — if unrelated violations moved between the two reads, the diff implies a change that did not happen. Architecture §11 states it plainly: repeated runs over identical input produce identical output.

The sort is total. Every field of the key is compared, so two violations can only tie if they are genuinely at the same position from the same rule, and ties keep their relative order via a stable sort. Nothing here depends on the order rules ran in, which matters because they run in parallel and that order is not reproducible.