Commit de56890
committed
Fix blank line indentation for unless statements
Previously, the cop was only tracking indentation deltas for 'if'
statements but not 'unless' statements, even though both are parsed
as :if nodes. This caused blank lines inside unless blocks to be
incorrectly flagged or 'corrected' to the wrong indentation level.
The fix includes 'unless' statements in the condition that creates
indentation deltas, ensuring blank lines inside unless blocks are
properly indented to match their context.
Fixes issue where blank lines inside nested unless blocks were
incorrectly rewritten from two tabs to one tab.1 parent f998562 commit de56890
File tree
2 files changed
+28
-1
lines changed- lib/rubocop/socketry/layout
- test/rubocop/socketry/layout
2 files changed
+28
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
686 | 713 | | |
0 commit comments