Skip to content

Old pony 4889#96

Merged
IgorDeepakM merged 2 commits intomasterfrom
old_pony_4889
Feb 28, 2026
Merged

Old pony 4889#96
IgorDeepakM merged 2 commits intomasterfrom
old_pony_4889

Conversation

@IgorDeepakM
Copy link
Owner

No description provided.

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: #4844
…ules (#4890)

Two new AST rules for pony-lint that enforce the Pony style guide's
formatting requirements for multiline type aliases and array literals.

TypeAliasFormat checks multiline union/intersection type aliases for:
- Opening `(` as first non-whitespace on its line (no hanging indent)
- Space after `(`
- Space after `|`/`&` at line starts
- Space before `)`

ArrayLiteralFormat checks multiline array literals for:
- Opening `[` as first non-whitespace on its line
- Space after `[`

Existing pony-lint source updated to comply with the new array-literal-format
rule (space after `[` in multiline array literals throughout).

Design: #4844
@IgorDeepakM IgorDeepakM merged commit 6cc6157 into master Feb 28, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants