This repository has been archived by the owner on May 16, 2020. It is now read-only.
forked from Unity-Technologies/uncrustify
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Unity-Technologies#77 from Unity-Technologies/fixe…
…s/indente-4-to-1-line-func Fixes/indente 4 to 1 line func
- Loading branch information
Showing
17 changed files
with
94 additions
and
76 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
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,7 @@ | ||
include Uncrustify.Common-Cpp.cfg | ||
|
||
# We need to make FAKE_FUNCTION a PROTO_WRAP macro function to help properly tokenize it's parameters. | ||
# Previously parameters with CT_AMP and CT_STAR were tokenized as CT_ARITH. Support for optional parenthesis added in github PR #629. | ||
set PROTO_WRAP FAKE_FUNCTION | ||
nl_create_func_def_one_liner=true | ||
sp_inside_braces=Add |
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,4 @@ | ||
### This file holds rules specific to C# | ||
|
||
include Uncrustify.Common-CStyle.cfg | ||
nl_create_func_def_one_liner=true |
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 |
---|---|---|
@@ -1,41 +1,29 @@ | ||
// Non-indented two-line func+body | ||
// Test code: | ||
// updating the testcase for 1247 | ||
// concluded that we need to convert all the 4,3,2 liners to one liner based on the option | ||
int fun () | ||
{ | ||
return 0; | ||
} | ||
|
||
int Func() | ||
{ return 0; } | ||
int fun() {return 0; } | ||
|
||
// The contents of the method will get aligned with 'int'. Sometimes we want this, sometimes we don't. | ||
int fun() { | ||
return 0; | ||
} | ||
|
||
// There is no workaround; would require a new Uncrustify feature. | ||
// Re-indentation of wrapped args leaves hanging previous-line args | ||
// This: | ||
int fun() { | ||
return 0; } | ||
|
||
// ```cs | ||
int fun() | ||
{return 0; } | ||
|
||
UtilityFunctions.DisplayAwesomeness (position, fullFlagNames.ToArray (), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray (), | ||
Boo.m_Instance.Foo, null); | ||
// ``` | ||
// becomes this: | ||
int fun() { return 0; | ||
} | ||
|
||
// ```cs | ||
int fun() | ||
{ | ||
return 0; } | ||
|
||
UtilityFunctions.DisplayAwesomeness(position, fullFlagNames.ToArray(), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray(), | ||
Boo.m_Instance.Foo, null); | ||
|
||
// ``` | ||
|
||
// but we'd rather have this: | ||
|
||
// ```cs | ||
|
||
UtilityFunctions.DisplayAwesomeness( | ||
position, fullFlagNames.ToArray(), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray(), | ||
Boo.m_Instance.Foo, null); | ||
|
||
// ``` | ||
int fun() | ||
{ return 0; | ||
} |
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 |
---|---|---|
@@ -1,43 +1,17 @@ | ||
// Non-indented two-line func+body | ||
// Test code: | ||
// updating the testcase for 1247 | ||
// concluded that we need to convert all the 4,3,2 liners to one liner based on the option | ||
int fun() {return 0; } | ||
|
||
int Func() | ||
{ return 0; } | ||
int fun() {return 0; } | ||
|
||
// The contents of the method will get aligned with 'int'. Sometimes we want this, sometimes we don't. | ||
int fun() {return 0; } | ||
|
||
// There is no workaround; would require a new Uncrustify feature. | ||
// Re-indentation of wrapped args leaves hanging previous-line args | ||
// This: | ||
int fun() {return 0; } | ||
|
||
// ```cs | ||
int fun() {return 0; } | ||
|
||
UtilityFunctions.DisplayAwesomeness( | ||
position, fullFlagNames.ToArray(), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray(), | ||
Boo.m_Instance.Foo, null); | ||
// ``` | ||
// becomes this: | ||
int fun() { return 0; } | ||
|
||
// ```cs | ||
int fun() {return 0; } | ||
|
||
UtilityFunctions.DisplayAwesomeness( | ||
position, fullFlagNames.ToArray(), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray(), | ||
Boo.m_Instance.Foo, null); | ||
|
||
// ``` | ||
|
||
// but we'd rather have this: | ||
|
||
// ```cs | ||
|
||
UtilityFunctions.DisplayAwesomeness( | ||
position, fullFlagNames.ToArray(), | ||
// Only show selections if we are not multi-editing | ||
GUI.showMixedValue ? new int[] {} : selectedFlags.ToArray(), | ||
Boo.m_Instance.Foo, null); | ||
|
||
// ``` | ||
int fun() {return 0; } |
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