Make long parenthesized expressions not always break. #1020
Annotations
3 errors and 1 warning
Run dotnet test CSharpier.sln --configuration Release --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true:
Src/CSharpier.Tests/CSharpier.Tests.Generators/CSharpier.Tests.Generators.FormattingTestsGenerator/FormattingTests.cs#L567
Expected normalizedCode to be "var x =
query
&& (
currentChar == '='
|| currentChar == '<'
|| currentChar == '!'
|| currentChar == '>'
|| currentChar == '|'
|| currentChar == '&'
);
// some comment won't break the next line
(someObject as SomeType).CallMethod();
(someObject as Exactly100____________________________________________________________).CallMethod();
(someObject as SomeLongType___________________________________________________________)
.CallMethod();
(someObject as SomeLongType________________________________________________________________________)
.CallMethod();
(
someObject
as UnlikelyButThisIsWhatItWouldLookLike_________________________________________________
)
.CallMethod();
(
someObject
as UnlikelyButThisIsWhatItWouldLookLike_________________________________________________
)
.CallMethod______________()
.CallMethod______________()
.CallMethod______________();
" with a length of 965, but "var x =
query
&& (
currentChar == '='
|| currentChar == '<'
|| currentChar == '!'
|| currentChar == '>'
|| currentChar == '|'
|| currentChar == '&'
);
// some comment won't break the next line
(someObject as SomeType).CallMethod();
(someObject as Exactly100____________________________________________________________).CallMethod();
(someObject as SomeLongType___________________________________________________________)
.CallMethod();
(someObject as SomeLongType________________________________________________________________________)
.CallMethod();
(
someObject
as UnlikelyButThisIsWhatItWouldLookLike_________________________________________________
)
.CallMethod();
(
someObject
as UnlikelyButThisIsWhatItWouldLookLike_________________________________________________
)
.CallMethod______________()
.CallMethod______________()
.CallMethod______________();
" has a length of 964, differs near "
" (index 963).
|
Run dotnet test CSharpier.sln --configuration Release --logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true" -- RunConfiguration.CollectSourceInformation=true:
Src/CSharpier.Tests/CSharpier.Tests.Generators/CSharpier.Tests.Generators.FormattingTestsGenerator/FormattingTests.cs#L877
Expected normalizedCode to be "class ClassName
{
void MethodName()
{
int x = 0,
y = 1,
z = 12;
string one = "one",
two = "two";
// leading comment
var leading = 0;
var trailing = 0; // trailing comment
// leading comment
bool leading2;
bool trailing2; // trailing comment
var trailingMulti = 1; /* ensure no extra line after this */
var trailingMultiAfter = 2;
var captureUnmatchedValuesParameters______________________________ =
new List<IPropertySymbol>();
Func<SyntaxTrivia, bool> s_isVisualBasicCommentTrivia = (syntaxTrivia) =>
syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia);
Func<SyntaxTrivia, bool> s_isVisualBasicCommentTrivia = (
syntaxTrivia_________________________________
) => syntaxTrivia.IsKind(VisualBasic.SyntaxKind.CommentTrivia);
Action find = () =>
EntryPointDiscoverer.FindStaticEntryMethod(typeof(IEnumerable<>).Assembly);
Action find = () =>
EntryPointDiscoverer.FindStaticEntryMethod(
typeof(IEnumerable<>).Assembly_________________________________________
);
var arrayCreationExpression1 = new byte[100];
var arrayCreationExpression2 = new byte[
SqlParameterCollectionExtensions.DefaultValueColumnWidth
];
var arrayCreationExpression3 = new byte[
SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100
];
var shortOne______ = new byte[
SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100
];
var muchLongerOne_________________ = new byte[
SqlParameterCollectionExtensions.DefaultValueColumnWidth + DefaultValueColumnWidth
];
var muchLongerOne_________________ = new byte[
SqlParameterCollectionExtensions.DefaultValueColumnWidth
+ SqlParameterCollectionExtensions.DefaultValueColumnWidth
];
var elementAccessExpression1 = anArray[100];
var elementAccessExpression2 = anArray[
SqlParameterCollectionExtensions.DefaultValueColumnWidth
];
var elementAccessExpression3 = anArray[
SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100
];
var shortOne______ = anArray_[
SqlParameterCollectionExtensions.DefaultValueColumnWidth + 100
];
var shortOne______ = anArray[
DefaultValueColumnWidth_________ + DefaultValueColumnWidth_______
];
var shortOne______ = anArray[
SqlParameterCollectionExtensions.DefaultValueColumnWidth
+ SqlParameterCollectionExtensions.DefaultValueColumnWidth
];
var someLongValue_________________ = memberAccessExpression[
elementAccessExpression
].theMember______________________________;
var someLongValue_________________ = memberAccessExpression[elementAccessExpression]
.theMember______________________________();
var someLongValue_________________ = memberAccessExpression(
elementAccessExpression
).theMember______________________________;
var someLongValue_________________ = memberAccessExpression(elementAccessExpression)
.theMember______________________________();
var someLongVariable_doesNotBreakArrayRank____________________________ =
(ArrayType[])CallMethod();
var conditionalIndentation = someBoolean
? someLongValue____________________________________
+ someLongValue____________________________________
: someLongValue____________________________________
+ someLongValue____________________________________;
var longEnoughToMakeThisBreak =
something == somethingElse ? shortValue__________ : otherShortValue;
var value =
someLongValue__________________________________
|
|
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
The logs for this run have expired and are no longer available.
Loading