Skip to content

Commit

Permalink
Use dotnet-format (#66)
Browse files Browse the repository at this point in the history
* Revert "Change .NET SDK version to a fixed version (#52)"

This reverts commit c05605a.

* Update to latest .NET 6 SDK

* Use `dotnet-format`

  - Due to dotnet/sdk#23972 and dotnet/format#1519, i'm going to start using the `dotnet-format` tool instead of the version integrated into the SDK.
  • Loading branch information
craigktreasure authored Mar 11, 2022
1 parent d50df25 commit 9c07a37
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"commands": [
"nbgv"
]
},
"dotnet-format": {
"version": "6.3.315103",
"commands": [
"dotnet-format"
]
}
}
}
8 changes: 5 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
SETUP_DOTNET_VERSION: 6.0.102

jobs:
build:
Expand All @@ -34,7 +33,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.SETUP_DOTNET_VERSION }}
dotnet-version: 6.x

- name: Set version
id: version
Expand All @@ -47,8 +46,11 @@ jobs:
- name: Install dependencies
run: dotnet restore

- name: Install .NET tools
run: dotnet tool restore

- name: DotNet Format
run: dotnet format --no-restore --verify-no-changes
run: dotnet dotnet-format --no-restore --verify-no-changes

- name: Build
run: dotnet build --configuration Release --no-restore
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: pull_request
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
SETUP_DOTNET_VERSION: 6.0.102

jobs:
build:
Expand All @@ -25,13 +24,16 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.SETUP_DOTNET_VERSION }}
dotnet-version: 6.x

- name: Install dependencies
run: dotnet restore

- name: Install .NET tools
run: dotnet tool restore

- name: DotNet Format
run: dotnet format --no-restore --verify-no-changes
run: dotnet dotnet-format --no-restore --verify-no-changes

- name: Build
run: dotnet build --configuration Release --no-restore
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"version": "6.0.201",
"allowPrerelease": false,
"rollForward": "latestFeature"
},
Expand Down
9 changes: 9 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
<packageSources>
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet6">
<package pattern="dotnet-format" />
</packageSource>
</packageSourceMapping>
</configuration>

0 comments on commit 9c07a37

Please sign in to comment.