From d2f08cde4ca3cbaa53f4236bccbc7b82657d499a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= <2493377+askpt@users.noreply.github.com> Date: Thu, 11 Apr 2024 17:19:04 +0100 Subject: [PATCH] ci: Change dotnet formatter (#260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## This PR - This PR changes the code formatter we currently use to the new built-in in the SDK. See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format ### Notes - We should now use this tool since it is now shipped as part of the dotnet SDK, removing the need to install an external one. - As pointed out in the chat, this build runs in parallel and is relatively fast. I will enable all PRs instead of those focusing on changes to .cs files. --------- Signed-off-by: André Silva <2493377+askpt@users.noreply.github.com> Co-authored-by: Todd Baert --- .github/workflows/dotnet-format.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml index 3455a1e0..9af0ae8b 100644 --- a/.github/workflows/dotnet-format.yml +++ b/.github/workflows/dotnet-format.yml @@ -2,29 +2,22 @@ name: dotnet format on: push: - branches: [ main ] - paths: - - '**.cs' - - '.editorconfig' + branches: [main] pull_request: - branches: [ main ] - paths: - - '**.cs' - - '.editorconfig' + branches: [main] jobs: check-format: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 + - name: Check out code + uses: actions/checkout@v4 - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x - - name: Install format tool - run: dotnet tool install -g dotnet-format - - - name: dotnet format - run: dotnet-format --folder --check + - name: dotnet format + run: dotnet format --verify-no-changes OpenFeature.sln