From 7603fb77092bb128433abd1bf9a0713a90936b94 Mon Sep 17 00:00:00 2001 From: Jason Bowman Date: Thu, 2 Sep 2021 15:06:49 -0700 Subject: [PATCH] Update dotnet-format to address breaking changes introduced by upstream changes (#5528) Pre-commit is using a version of dotnet and dotnet-format and has picked up a newer version of the utility that is not compatible with .NET 3.1 or 5.x -- it installs it's packages using dotnet tool install. This version's default entrypoint is also incompatible with our project structure, as the style and analyzer subcommands are now run by default and do not support the --folder option. The entrypoint can be over-ridden to specify the whitespace module, which should match previous behavior. --- .github/workflows/pre-commit.yml | 3 ++- .pre-commit-config.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index aa9b69c513..ebd636acab 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -18,7 +18,8 @@ jobs: ruby-version: '2.6' - uses: actions/setup-dotnet@v1 with: - dotnet-version: '3.1.x' + dotnet-version: '6.0.x' + include-prerelease: true - uses: pre-commit/action@v2.0.0 markdown-link-check: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bce348ede..4baf0f7802 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -84,9 +84,10 @@ repos: exclude: ".*localized.*" - repo: https://github.com/dotnet/format - rev: "7e343070a0355c86f72bdee226b5e19ffcbac931" # TODO - update to a tagged version when one that includes the hook is ready. + rev: v5.1.225507 hooks: - id: dotnet-format + entry: dotnet-format whitespace args: [--folder, --include] # "Local" hooks, see https://pre-commit.com/#repository-local-hooks