-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial work for sorting usings closes #661 * handling more cases * maybe fixing last edge case * Sort by alias * Fixing some edge cases. Cleaning up sorting. * Working on validation, notes for some failing to compile files * Making progress on edge cases for sorting usings * Adding even more edge cases * Some finishing touches * Self code review * minor change
- Loading branch information
Showing
42 changed files
with
660 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function CSH-Release { | ||
function CSH-CreateRelease { | ||
param ( | ||
[Parameter(Mandatory=$true)] | ||
[string]$versionNumber | ||
|
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,12 @@ | ||
function CSH-DeleteReviewBranches { | ||
|
||
# TODO probably make this configurable | ||
$pathToTestingRepo = "C:/Projects/csharpier-repos" | ||
Set-Location $pathToTestingRepo | ||
|
||
git checkout main | ||
git branch | Where-Object { $_ -notmatch "main" } | ForEach-Object { git branch -D $_ } | ||
git branch -r | Where-Object { $_ -notmatch "origin/main" } | ForEach-Object { git push origin --delete $_.Replace("origin/", "").Trim() } | ||
} | ||
|
||
Export-ModuleMember -Function CSH-* |
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
19 changes: 0 additions & 19 deletions
19
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/Directives_CompilationUnit.test
This file was deleted.
Oops, something went wrong.
22 changes: 3 additions & 19 deletions
22
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives.test
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,29 +1,13 @@ | ||
// leading | ||
using First; // trailing | ||
|
||
using A; // trailing | ||
// leading with space | ||
using // another trailing | ||
Second; | ||
|
||
using | ||
// static leading | ||
static // static trailing | ||
Third; | ||
|
||
using M = System.Math; | ||
using Point = (int x, int y); | ||
|
||
using static System.Math; | ||
|
||
global using System; | ||
|
||
using First; | ||
using Second; | ||
B; | ||
|
||
namespace Namespace | ||
{ | ||
using Third; | ||
using One.Two.Three; | ||
using Third; | ||
|
||
public class ClassName { } | ||
} |
4 changes: 4 additions & 0 deletions
4
...harpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_BasicIfDirective.expected.test
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 @@ | ||
using System; | ||
#if DEBUG | ||
using Insite.Bad; | ||
#endif |
4 changes: 4 additions & 0 deletions
4
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_BasicIfDirective.test
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 @@ | ||
#if DEBUG | ||
using Insite.Bad; | ||
#endif | ||
using System; |
5 changes: 5 additions & 0 deletions
5
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_BasicSort.expected.test
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,5 @@ | ||
using AWord; | ||
using BWord; | ||
using MWord; | ||
using YWord; | ||
using ZWord; |
5 changes: 5 additions & 0 deletions
5
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_BasicSort.test
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,5 @@ | ||
using MWord; | ||
using ZWord; | ||
using AWord; | ||
using BWord; | ||
using YWord; |
7 changes: 7 additions & 0 deletions
7
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_Basics.test
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 @@ | ||
global using Global; | ||
using System; | ||
using global::Zebra; | ||
using Custom; | ||
using static Expression; | ||
using Point = (int x, int y); | ||
using Index = Microsoft.Framework.Index; |
9 changes: 9 additions & 0 deletions
9
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase1.test
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,9 @@ | ||
#if BUILD_MSI_TASKS | ||
using System; | ||
using Microsoft.Build.Framework; | ||
|
||
namespace RepoTasks; | ||
|
||
class ClassName { } | ||
|
||
#endif |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase2.expected.test
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,6 @@ | ||
using System.IO; | ||
#if DEBUG | ||
using System; | ||
#else | ||
using Microsoft; | ||
#endif |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase2.test
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,6 @@ | ||
#if DEBUG | ||
using System; | ||
#else | ||
using Microsoft; | ||
#endif | ||
using System.IO; |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase3.expected.test
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,6 @@ | ||
using System.IO; | ||
#if !DEBUG | ||
using System; | ||
#else | ||
using Microsoft; | ||
#endif |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase3.test
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,6 @@ | ||
#if !DEBUG | ||
using System; | ||
#else | ||
using Microsoft; | ||
#endif | ||
using System.IO; |
8 changes: 8 additions & 0 deletions
8
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase4.test
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,8 @@ | ||
#if DEBUG | ||
using A; | ||
#else | ||
using B; | ||
#endif | ||
#if !DEBUG | ||
using C; | ||
#endif |
10 changes: 10 additions & 0 deletions
10
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase5.expected.test
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,10 @@ | ||
using C; | ||
#if DEBUG | ||
using A; | ||
#else | ||
using B; | ||
#endif | ||
|
||
#if !DEBUG | ||
using C; | ||
#endif |
9 changes: 9 additions & 0 deletions
9
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase5.test
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,9 @@ | ||
#if DEBUG | ||
using A; | ||
#else | ||
using B; | ||
#endif | ||
using C; | ||
#if !DEBUG | ||
using C; | ||
#endif |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase6.expected.test
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,6 @@ | ||
#if DEBUG | ||
#define SYMBOL | ||
#endif | ||
|
||
using System; | ||
using System.Collections; |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase6.test
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,6 @@ | ||
#if DEBUG | ||
#define SYMBOL | ||
#endif | ||
|
||
using System.Collections; | ||
using System; |
7 changes: 7 additions & 0 deletions
7
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase7.expected.test
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 @@ | ||
#if DEBUG | ||
extern alias MonoSecurity; | ||
#else | ||
using Mono.Security.Cryptography; | ||
#endif | ||
|
||
using System; |
7 changes: 7 additions & 0 deletions
7
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase7.test
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 @@ | ||
#if DEBUG | ||
extern alias MonoSecurity; | ||
#else | ||
using Mono.Security.Cryptography; | ||
#endif | ||
|
||
using System; |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase9.expected.test
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,6 @@ | ||
#if XMLCHARTYPE_GEN_RESOURCE | ||
#undef XMLCHARTYPE_USE_RESOURCE | ||
#endif | ||
|
||
using System.Diagnostics; | ||
using System.Threading; |
6 changes: 6 additions & 0 deletions
6
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_EdgeCase9.test
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,6 @@ | ||
#if XMLCHARTYPE_GEN_RESOURCE | ||
#undef XMLCHARTYPE_USE_RESOURCE | ||
#endif | ||
|
||
using System.Threading; | ||
using System.Diagnostics; |
4 changes: 4 additions & 0 deletions
4
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_FileComments.expected.test
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 @@ | ||
// Licensed to something | ||
|
||
using Apple; | ||
using Microsoft; |
4 changes: 4 additions & 0 deletions
4
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_FileComments.test
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 @@ | ||
// Licensed to something | ||
|
||
using Microsoft; | ||
using Apple; |
7 changes: 7 additions & 0 deletions
7
...Sharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_KeepDefineAtTop.expected.test
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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
#define USE_STRUCT | ||
using System; | ||
using System.Runtime.CompilerServices; |
7 changes: 7 additions & 0 deletions
7
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_KeepDefineAtTop.test
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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
#define USE_STRUCT | ||
using System.Runtime.CompilerServices; | ||
using System; |
7 changes: 7 additions & 0 deletions
7
...CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_KeepUndefAtTop.expected.test
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 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
#undef USE_STRUCT | ||
using System; | ||
using System.Runtime.CompilerServices; |
8 changes: 8 additions & 0 deletions
8
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_KeepUndefAtTop.test
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,8 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
#undef USE_STRUCT | ||
using System.Runtime.CompilerServices; | ||
using System; | ||
|
3 changes: 3 additions & 0 deletions
3
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_SortsAlias.test
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,3 @@ | ||
using A = Z; | ||
using M = A; | ||
using Z = M; |
4 changes: 4 additions & 0 deletions
4
...harpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_SortsSystemToTop.expected.test
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 @@ | ||
using System; | ||
using System.Web; | ||
using AWord; | ||
using ZWord; |
4 changes: 4 additions & 0 deletions
4
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/UsingDirectives_SortsSystemToTop.test
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 @@ | ||
using ZWord; | ||
using AWord; | ||
using System.Web; | ||
using System; |
Oops, something went wrong.