-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fixed whitespace after else with ifPolicy, fixes #543 * fixed emptyline afterReturn when return is body of function
- Loading branch information
Showing
5 changed files
with
71 additions
and
1 deletion.
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
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
26 changes: 26 additions & 0 deletions
26
test/testcases/emptylines/end_type_empty_line_with_return_body.hxtest
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,26 @@ | ||
{ | ||
"emptyLines": { | ||
"classEmptyLines": { | ||
"beginType": 1, | ||
"endType": 1 | ||
}, | ||
"afterLeftCurly": "keep", | ||
"beforeRightCurly": "keep" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
function main2() | ||
return ""; | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
|
||
function main2() | ||
return ""; | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
test/testcases/whitespace/issue_543_ifPolicy_after_else.hxtest
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,21 @@ | ||
{ | ||
"whitespace": { | ||
"ifPolicy": "onlyBefore" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
return if(self == id) self else id; | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
return if(self == id) self else id; | ||
} | ||
} |