-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sort-usings
- Loading branch information
Showing
22 changed files
with
406 additions
and
176 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 was deleted.
Oops, something went wrong.
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,93 @@ | ||
function CSH-UpdateCSharpierRepos() | ||
{ | ||
|
||
$repositories = @() | ||
$repositories += "https://github.com/dotnet/aspnetcore.git" | ||
$repositories += "https://github.com/aspnet/AspNetWebStack.git" | ||
$repositories += "https://github.com/AutoMapper/AutoMapper.git" | ||
$repositories += "https://github.com/castleproject/Core.git" | ||
$repositories += "https://github.com/dotnet/command-line-api.git" | ||
$repositories += "https://github.com/dotnet/format.git" | ||
$repositories += "https://github.com/dotnet/efcore.git" | ||
$repositories += "https://github.com/moq/moq4.git" | ||
$repositories += "https://github.com/JamesNK/Newtonsoft.Json.git" | ||
$repositories += "https://github.com/dotnet/roslyn.git" | ||
$repositories += "https://github.com/dotnet/runtime.git" | ||
$repositories += "https://github.com/mono/mono.git" | ||
$repositories += "https://github.com/increase-POS/Res-Server.git" | ||
|
||
$tempLocation = "c:\temp\UpdateRepos" | ||
|
||
if (-not(Test-Path $tempLocation)) | ||
{ | ||
New-Item $tempLocation -Force -ItemType Directory | ||
} | ||
|
||
Set-Location $tempLocation | ||
|
||
$ErrorActionPreference = "Continue" | ||
|
||
foreach ($repository in $repositories) | ||
{ | ||
$repoFolder = $tempLocation + "/" + (Split-Path $repositories -Leaf).Replace(".git", "") | ||
if (Test-Path $repoFolder) | ||
{ | ||
Set-Location $repoFolder | ||
& git pull origin | ||
Set-Location $tempLocation | ||
} | ||
else | ||
{ | ||
& git clone $repository | ||
} | ||
} | ||
|
||
$destination = "C:\projects\csharpier-repos\" | ||
Set-Location $destination | ||
& git checkout main | ||
|
||
Get-ChildItem $tempLocation | Copy-Item -Destination $destination -Filter *.cs -Recurse -Force | ||
|
||
$items = Get-ChildItem -Recurse C:\projects\csharpier-repos -File | ||
$count = 0 | ||
foreach ($item in $items) | ||
{ | ||
if ($item.Name -eq ".git") | ||
{ | ||
Remove-Item -Force -Recurse $item.FullName | ||
} | ||
elseif ($item.Extension -ne ".cs") | ||
{ | ||
if ($item.Name -ne ".csharpierignore") | ||
{ | ||
Remove-Item $item.FullName | ||
} | ||
} | ||
else | ||
{ | ||
# we don't really need all of these files, let's just cut out every other one | ||
if ($count % 2 -eq 0) | ||
{ | ||
Remove-Item $item.FullName | ||
} | ||
$count++ | ||
} | ||
} | ||
|
||
$items = Get-ChildItem C:\projects\csharpier-repos -Directory -Recurse | ||
foreach ($item in $items) | ||
{ | ||
if ($item.Name -eq ".git") | ||
{ | ||
Remove-Item -Force -Recurse $item.FullName | ||
} | ||
} | ||
|
||
Set-Location $destination | ||
|
||
& git add . | ||
& git commit -m "Updating repos" | ||
& git push origin | ||
} | ||
|
||
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
18 changes: 18 additions & 0 deletions
18
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/CollectionExpressions.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,18 @@ | ||
int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8 ]; | ||
|
||
Span<int> b = [ 'a', 'b', 'c', 'd', 'e', 'f', 'h', 'i' ]; | ||
|
||
string[] c = | ||
[ | ||
"________________________", | ||
"________________________", | ||
"________________________", | ||
"________________________" | ||
]; | ||
|
||
int[][] d = | ||
[ | ||
[1, 2, 3], | ||
[4, 5, 6], | ||
[7, 8, 9] | ||
]; |
15 changes: 15 additions & 0 deletions
15
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChain_ArraysConsistent.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,15 @@ | ||
var x = someLongNameField | ||
.CallMethod____________________________________() | ||
.AccessArray[1] | ||
.Property_______________; | ||
|
||
var x = someLongNameField | ||
.CallMethod____________________________________() | ||
.CallMethod(1) | ||
.Property_______________; | ||
|
||
new Action(AssertConfigurationIsValid) | ||
.ShouldThrow<AutoMapperConfigurationException>() | ||
.Errors[0] | ||
.UnmappedPropertyNames[0] | ||
.ShouldBe(nameof(Destination.Count)); |
33 changes: 33 additions & 0 deletions
33
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChain_PropertiesConsistent.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,33 @@ | ||
var someVariable = someObject | ||
.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = someObject | ||
.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = someObject | ||
.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
var someVariable = someObject | ||
.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
// TODO too hard to change this for now, will do it in https://github.com/belav/csharpier/issues/451 | ||
var someVariable = this.Property.CallMethod( | ||
someValue => someValue.SomeProperty == someOtherValue___________________________ | ||
); | ||
|
||
var someVariable = this.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = this.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
var someVariable = this.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); |
Oops, something went wrong.