Skip to content

Commit 14db834

Browse files
committed
Add dotnet-format to build.ps1
1 parent c4547a6 commit 14db834

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"commands": [
88
"reportgenerator"
99
]
10+
},
11+
"dotnet-format": {
12+
"version": "4.1.131201",
13+
"commands": [
14+
"dotnet-format"
15+
]
1016
}
1117
}
1218
}

build.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ $artifacts = "$PSScriptRoot/artifacts/"
4242
Remove-Item -Recurse $artifacts -ErrorAction Ignore
4343

4444
exec dotnet tool restore
45+
46+
[string[]] $formatArgs=@()
47+
if ($ci) {
48+
$formatArgs += '--check'
49+
}
50+
51+
exec dotnet tool run dotnet-format -- -v detailed @formatArgs "$PSScriptRoot/CommandLineUtils.sln"
52+
exec dotnet tool run dotnet-format -- -v detailed @formatArgs "$PSScriptRoot/docs/samples/samples.sln"
4553
exec dotnet build --configuration $Configuration '-warnaserror:CS1591' @MSBuildArgs
4654
exec dotnet pack --no-restore --no-build --configuration $Configuration -o $artifacts @MSBuildArgs
4755
exec dotnet build --configuration $Configuration "$PSScriptRoot/docs/samples/samples.sln"

0 commit comments

Comments
 (0)