Skip to content

Commit

Permalink
Update dotnet-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ProbablyManuel committed May 20, 2023
1 parent 82df985 commit 2eaab06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
6 changes: 2 additions & 4 deletions buildSrc/src/main/kotlin/skyrim/requiem/build/CSharpTasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ private fun runProcess(args: List<String>, workDir: File): Boolean {

}

private val formatterArgs = listOf("-w", "-a", "warn")

//TODO: refine input parameters to avoid unnecessary re-executions after temp build subfolders are created
open class CompileCSharpTask : DefaultTask() {

Expand Down Expand Up @@ -81,7 +79,7 @@ open class CheckFormatCSharpTask : DefaultTask() {

@TaskAction
fun taskAction() {
val args = listOf("dotnet", "dotnet-format", "--verbosity", loglevel, "--check") + formatterArgs
val args = listOf("dotnet", "format", "--verbosity", loglevel, "--verify-no-changes")
if (!runProcess(args, solutionFolder)) throw GradleException("C# project does not obey format and analyzer rules!")
}
}
Expand All @@ -95,7 +93,7 @@ open class FormatCSharpTask : DefaultTask() {

@TaskAction
fun taskAction() {
val args = listOf("dotnet", "dotnet-format", "--verbosity", loglevel) + formatterArgs
val args = listOf("dotnet", "format", "--verbosity", loglevel)
if (!runProcess(args, solutionFolder)) throw GradleException("C# project does not obey format and analyzer rules!")
}
}
Expand Down
10 changes: 1 addition & 9 deletions components/mutagen-reqtificator/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-format": {
"version": "5.1.225507",
"commands": [
"dotnet-format"
]
}
}
"isRoot": true
}
1 change: 1 addition & 0 deletions components/mutagen-reqtificator/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dotnet_diagnostic.CA1003.severity = none # seems to trigger false positives when
dotnet_diagnostic.CA1826.severity = none # our collections shouldn't be large enough to suffer any noteworthy performance impacts
dotnet_diagnostic.CA1032.severity = none # our exceptions aren't used externally, so we don't need to add constructors we don't use
dotnet_diagnostic.CA1305.severity = none # no idea how to fix this
dotnet_diagnostic.IDE0130.severity = none # https://github.com/dotnet/format/issues/1623

[UserSettings.cs]
# only used to write booleans to json
Expand Down

0 comments on commit 2eaab06

Please sign in to comment.