-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format null-aware elements - Add support for passing experiment flags with tests. The old way of doing this was to just hardcode experiments inside the formatter when a new feature was supported. That made sense when the formatter didn't know about language version, but now that it does, it should probably require experiment flags explicitly and tests for new features should enable them.
- Loading branch information
1 parent
852e54f
commit 348a146
Showing
9 changed files
with
110 additions
and
5 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
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
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,28 @@ | ||
40 columns | | ||
>>> (experiment null-aware-elements) List element. | ||
var list = [ ? x ]; | ||
<<< | ||
var list = [?x]; | ||
>>> (experiment null-aware-elements) Set element. | ||
var set = { ? x }; | ||
<<< | ||
var set = {?x}; | ||
>>> (experiment null-aware-elements) Map key. | ||
var map = { ? key : value}; | ||
<<< | ||
var map = {?key: value}; | ||
>>> (experiment null-aware-elements) Map value. | ||
var map = { key: ? value }; | ||
<<< | ||
var map = {key: ?value}; | ||
>>> (experiment null-aware-elements) Both key and value. | ||
var map = { ? key : ? value }; | ||
<<< | ||
var map = {?key: ?value}; | ||
>>> (experiment null-aware-elements) Split inside element. | ||
var list = [?(veryLongExpression +thatIsForcedToSplit)]; | ||
<<< | ||
var list = [ | ||
?(veryLongExpression + | ||
thatIsForcedToSplit), | ||
]; |
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,34 @@ | ||
40 columns | | ||
>>> (experiment null-aware-elements) Inline comment after `?`. | ||
var list = [ ? /* c */ x ]; | ||
<<< | ||
var list = [? /* c */ x]; | ||
>>> (experiment null-aware-elements) | ||
var map = { ? /* c */ key : ? /* c */ value }; | ||
<<< | ||
var map = { | ||
? /* c */ key: ? /* c */ value, | ||
}; | ||
>>> (experiment null-aware-elements) Line comment after `?`. | ||
var list = [ ? // c | ||
x ]; | ||
<<< | ||
### This is an odd place for a comment so the formatting is odd, but we want to | ||
### at least pin it down with a test. | ||
var list = [ | ||
? // c | ||
x, | ||
]; | ||
>>> (experiment null-aware-elements) | ||
var map = { ? // c | ||
key : ? // c | ||
value }; | ||
<<< | ||
### This is an odd place for a comment so the formatting is odd, but we want to | ||
### at least pin it down with a test. | ||
var map = { | ||
? // c | ||
key: | ||
? // c | ||
value, | ||
}; |
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