diff --git a/formatters/README.md b/formatters/README.md index 109f3b85d..7bb3e06ee 100644 --- a/formatters/README.md +++ b/formatters/README.md @@ -5,5 +5,6 @@ You will need the following in your `PATH`: - JDK 10+ - clang-format 12 (i.e. `brew install clang-format`) +- dotnet format (i.e. `dotnet tool install -g dotnet-format`, comes with dotnet 6 out of the box) To run the formatter, invoke the `format.sh` script. This will shuffle around the Gradle config files, invoke spotless, then undo the config file shuffling. Invoking `./gradlew spotlessApply` from the `formatters/` directory will not work. \ No newline at end of file diff --git a/formatters/format.sh b/formatters/format.sh index 75892a425..9f13c9b8b 100755 --- a/formatters/format.sh +++ b/formatters/format.sh @@ -8,21 +8,33 @@ setup() { cp $dir/.clang-format $dir/.. cp $dir/build.gradle $dir/.. cp $dir/settings.gradle $dir/.. + cp $dir/.editorconfig $dir/../spine-csharp + cp $dir/.editorconfig $dir/../spine-xna + cp $dir/.editorconfig $dir/../spine-monogame + cp $dir/.editorconfig $dir/../spine-unity } cleanup() { rm $dir/../.clang-format rm $dir/../build.gradle rm $dir/../settings.gradle + rm $dir/../spine-csharp/.editorconfig + rm $dir/../spine-xna/.editorconfig + rm $dir/../spine-monogame/.editorconfig + rm $dir/../spine-unity/.editorconfig } -# copy Gradle and clang-format config to root +# copy Gradle, dotnet-format, and clang-format config to root setup -# Execute spotless +# Execute spotless and dotnet-format pushd $dir/.. ./formatters/gradlew spotlessApply +dotnet-format spine-csharp/spine-csharp.sln +dotnet-format -f spine-xna +dotnet-format -f spine-monogame +dotnet-format -f spine-unity popd -# Delete Gradle and clang-format config files in root +# Delete Gradle, dotnet-format, and clang-format config files in root cleanup \ No newline at end of file