Commit a30addb
Generic/IncrementDecrementSpacing: fix post-decrement error message
This commit fixes the post-decrement error message when there is one or
more newlines between the variable and the post-decrement operator.
The wrong variable was being used to check whether the post-decrement
and the variable were not on the same line, resulting in an incorrect
error message. The error message should explicitly say that a newline
was found.
Before this commit the error message was:
```
Expected no spaces between $i and the decrement operator; 0 found
```
Now it is:
```
Expected no spaces between the decrement operator and $i; newline found
```
(`newline` instead of `0`)
This commit also includes a test that exercises the modified line.1 parent b03d10f commit a30addb
File tree
4 files changed
+7
-1
lines changed- src/Standards/Generic
- Sniffs/WhiteSpace
- Tests/WhiteSpace
4 files changed
+7
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
0 commit comments