Skip to content

Commit

Permalink
ci: Change dotnet formatter (#260)
Browse files Browse the repository at this point in the history
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- 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 <[email protected]>
Co-authored-by: Todd Baert <[email protected]>
  • Loading branch information
askpt and toddbaert authored Apr 11, 2024
1 parent bc8301d commit d2f08cd
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d2f08cd

Please sign in to comment.