Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving away from SpaceBrace #441

Merged
merged 3 commits into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class ClassName
Func<bool, bool> f5 = delegate(
string longName,
string longerName,
string longeeeeeeestName
) {
string longestName________________________________________
)
{
return !a;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ class ClassName
[VeryLongAttributeName(SomeFlag.SomeValue, SomeOtherFlag.SomeOtherLongValue)]
string tabbedBreakParameter,
bool anotherParameter
) {
)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class BasicClass
public BasicClass(
int two,
string justOver100___________________________________________________
) {
)
{
return;
}
}
Expand All @@ -28,15 +29,18 @@ public class Initializers : BasicClass

public Initializers(
string longParameter_______________________________________________________________________________
) : base(
longParameter_______________________________________________________________________________
) { }
)
: base(
longParameter_______________________________________________________________________________
) { }

public Initializers(
string longParameter_______________________________________________________________________________
) : base(
longParameter_______________________________________________________________________________
) {
)
: base(
longParameter_______________________________________________________________________________
)
{
WithBody();
}

Expand All @@ -63,7 +67,8 @@ public class Initializers : BasicClass
public WithParameters(string parameter)
: base(
longParameter____________________________________________________________________________
) {
)
{
WithBody();
}

Expand All @@ -72,10 +77,8 @@ public class Initializers : BasicClass
longParameter____________________________________________________________________________
) { }

public Initializers(
string value
) /*Comment*/
: base(value) { }
public Initializers(string value) /*Comment*/
: base(value) { }

public LongMethodName___________________________________________________________()
/*Comment*/: base(false) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class Test

public static implicit operator Test(
OtherPerson someReallyLongNameThatWillMakeThisBreak_________________
) {
)
{
return new Test();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class ClassName
else if (
jklasdfklalsdkfjlkasdflkaslkjfjsdkf
|| kljadsfklaskldflkjasdfklaskjdfjklasdfjlkasdfjlkasdf
) {
)
{
DoElse();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class ClassName
fixed (
int* someLongNameThatWillMakeThisBreakYeahKeepGoing_____________________ =
stackalloc int[100]
) {
)
{
*intref = 1;
}

Expand All @@ -27,7 +28,8 @@ class ClassName

fixed (
int* justOver100_______________________________________________ = stackalloc int[100]
) {
)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ public class ClassName
var x in this.SomeMethodCall()
.SomeChainedCall()
.AnotherChainedCall__________________________()
) {
)
{
break;
}

foreach (
var x // trailing
in y
) {
)
{
return;
}

Expand All @@ -41,7 +43,8 @@ public class ClassName

foreach (
var justOver100 in Something_______________________________________________________
) {
)
{
return;
}

Expand Down Expand Up @@ -87,7 +90,8 @@ public class ClassName
).AsParallel()
.Select(l => (l, res: GenerateTable(l.l2, l.l3, cutOff)))
.OrderBy(v => v.res.Total)
) {
)
{
return;
}
}
Expand Down
12 changes: 8 additions & 4 deletions Src/CSharpier.Tests/FormattingTests/TestFiles/ForStatements.cst
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ class ClassName
someLongName____________
< someOtherLongName__________________________________________________;
someLongishName_________________________++
) {
)
{
break;
}

for (
var someShortName = 0, anotherShortName = 1;
someRandomCondition;
someShortName++, anotherShortName++
) {
)
{
break;
}

Expand All @@ -59,7 +61,8 @@ class ClassName
someRandomCondition;
someLongerName_________________________++,
anotherLongerName________________________________++
) {
)
{
break;
}

Expand All @@ -78,7 +81,8 @@ class ClassName
y = 0;
y < justOver100____________________________________________________________;
y++
) {
)
{
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class ClassName
NativeMethods.REQUEST_NOTIFICATION_STATUS> asyncCallback,
delegate* unmanaged<IntPtr, void> requestsDrainedHandler,
IntPtr pvRequestContext
) {
)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class ClassName
&& longerStatementName
&& evenLongerStatementName
&& superLongStatementName
) {
)
{
return;
}

Expand Down Expand Up @@ -68,7 +69,8 @@ public class ClassName

if (
justOver100 || moreTextToMakeItWork_____________________________________________________
) {
)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class ClassName
SomeProperty: "someValue________________",
SomeOtherProperty: "someOtherValue______________"
}
) {
)
{
return;
}

Expand All @@ -50,7 +51,8 @@ class ClassName
if (
someRandomValue___________________ is SomeRandomType someRandomType
&& someRandomType.IsEnum
) {
)
{
return;
}

Expand Down Expand Up @@ -120,14 +122,16 @@ class ClassName
if (
someOtherValue_____________
is (SomeLongType_____________ or SomeOtherLongType_____________)
) {
)
{
return;
}

if (
someOtherValue_____________
is not (SomeLongType_____________ or SomeOtherLongType_____________)
) {
)
{
return;
}

Expand All @@ -137,7 +141,8 @@ class ClassName
SomeLongType_____________________________________
or SomeLongType_____________________________________
)
) {
)
{
return;
}

Expand All @@ -146,7 +151,8 @@ class ClassName
{
SomeProperty: SomeOtherType_____________________________
}
) {
)
{
return;
}

Expand All @@ -158,7 +164,8 @@ class ClassName
Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax
},
}
) {
)
{
return;
}

Expand All @@ -170,7 +177,8 @@ class ClassName
Expression: IsPatternExpressionSyntax or IsPatternExpressionSyntax______________
},
}
) {
)
{
return;
}

Expand All @@ -181,28 +189,32 @@ class ClassName
Operand: ParenthesizedExpressionSyntax or IsPatternExpressionSyntax
}
)
) {
)
{
return;
}

if (
someLongName____________________________________________________ is
{ } anotherLongName______________________
) {
)
{
return;
}

if (
someLongVariableName____________
is SomeLongTypeName______________________________ someOtherLongVariableName_____________
) {
)
{
return;
}

if (
someArray[index]
is SomeLongTypeName______________________________ someOtherLongVariableName_____________
) {
)
{
return;
}

Expand All @@ -211,7 +223,8 @@ class ClassName
is SomeObjectType
or SomeOtherObjectType
or YetAnotherObjectType
) {
)
{
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public class ClassName
string two,
string three,
string four_______________
) {
)
{
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class ClassName
string firstParameter___________,
string secondParameter___________,
string thirdParameter___________
) {
)
{
return;
}

Expand All @@ -33,7 +34,8 @@ public class ClassName
string one, // trailing
string two,
string three
) {
)
{
var x = 0;
}

Expand Down Expand Up @@ -114,7 +116,8 @@ namespace SomeNamespace
public void JustOver100(
IApplicationBuilder app,
IWebHostEnvironment env____________________
) {
)
{
return;
}
}
Expand Down
Loading