Commit 0945953
authored
Add control structure alignment lint rule (#4889)
Implement style/control-structure-alignment for pony-lint (Phase 3,
PR 3 from Discussion #4844). The rule checks that control structure
keywords are vertically aligned: if/elseif/else/end, for/else/end,
while/else/end, try/else/then/end, repeat/until/else/end, with/end,
and ifdef/elseif/else/end. Single-line structures are exempt.
Uses a hybrid approach: opening keywords and elseif positions come
from the AST, while else/end/until/then positions are found via source
text scanning (the parser discards their positions). Forward scanning
for end uses full-line depth tracking to handle inline single-line
blocks correctly.
Design: #48441 parent 7dd0055 commit 0945953
File tree
4 files changed
+1533
-0
lines changed- tools/pony-lint
- test
4 files changed
+1533
-0
lines changed
0 commit comments