-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
format: Fix panic with else blocks and comments
When an else block had a comment in between it and the rule body we were not starting a new line, which triggers a panic in the formatter. This corrects the issue, and also removes the panics. If the functions are not called correctly the formatting will be off and tests will fail. There is little benefit in them causing a panic. Fixes: #2420 Signed-off-by: Patrick East <[email protected]>
- Loading branch information
1 parent
e6ac0a0
commit 1aec554
Showing
3 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package example | ||
|
||
allow { | ||
some_condition | ||
} | ||
|
||
# some comments | ||
|
||
else { | ||
another_condition | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package example | ||
|
||
allow { | ||
some_condition | ||
} | ||
|
||
# some comments | ||
|
||
else { | ||
another_condition | ||
} |