From 315a142558819bf244e20399286a21e11264d7dd Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 15 Apr 2024 17:27:17 +0900 Subject: [PATCH 1/3] Update code inspection tooling --- .config/dotnet-tools.json | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index c3d034d..0ab8265 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,25 +3,19 @@ "isRoot": true, "tools": { "CodeFileSanity": { - "version": "0.0.36", + "version": "0.0.37", "commands": [ "CodeFileSanity" ] }, - "dotnet-format": { - "version": "3.1.37601", - "commands": [ - "dotnet-format" - ] - }, "jetbrains.resharper.globaltools": { - "version": "2020.3.2", + "version": "2023.3.3", "commands": [ "jb" ] }, "nvika": { - "version": "2.0.0", + "version": "3.0.0", "commands": [ "nvika" ] From 5ddc5dce9ff480b128e39cf9f76754c735f142f3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 15 Apr 2024 17:31:58 +0900 Subject: [PATCH 2/3] Replace appveyor with GHA workflow --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ appveyor.yml | 14 ------------- 2 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d9dcdd9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +on: [push, pull_request] +name: Continuous Integration +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + inspect-code: + name: Code Quality + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install .NET 8.0.x + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + + - name: Restore Tools + run: dotnet tool restore + + - name: Restore Packages + run: dotnet restore + + - name: CodeFileSanity + run: | + # TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround. + # FIXME: Suppress warnings from templates project + exit_code=0 + while read -r line; do + if [[ ! -z "$line" ]]; then + echo "::error::$line" + exit_code=1 + fi + done <<< $(dotnet codefilesanity) + exit $exit_code + + - name: InspectCode + run: dotnet jb inspectcode $(pwd)/osu.Server.DifficultyCalculator.sln --build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN + + - name: NVika + run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c6856cb..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -clone_depth: 1 -version: '{branch}-{build}' -image: Visual Studio 2022 -test: off - -environment: - APPVEYOR: true - -build_script: - - cmd: dotnet tool restore - - cmd: dotnet build osu.Server.DifficultyCalculator.sln -c:Release - - cmd: dotnet CodeFileSanity - - cmd: dotnet jb inspectcode "osu.Server.DifficultyCalculator.sln" --output="temp/inspectcodereport.xml" --caches-home="temp/inspectcode" --verbosity=WARN - - cmd: dotnet nvika parsereport "temp/inspectcodereport.xml" --treatwarningsaserrors From 253e77df36b46ab532606510cad2d229c94ead55 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 15 Apr 2024 17:50:10 +0900 Subject: [PATCH 3/3] Fix inspection It looks like the default value of this particular inspection changed from Warning to Suggestion in 2024.1, or something like that. The tool window shows two different values for this inspection (Warning on 2023, Suggestion on 2024), so I'll just hard code this for now. --- osu.Server.DifficultyCalculator.sln.DotSettings | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Server.DifficultyCalculator.sln.DotSettings b/osu.Server.DifficultyCalculator.sln.DotSettings index ad0cc9d..3ca27d8 100644 --- a/osu.Server.DifficultyCalculator.sln.DotSettings +++ b/osu.Server.DifficultyCalculator.sln.DotSettings @@ -143,6 +143,7 @@ WARNING WARNING WARNING + SUGGESTION WARNING WARNING WARNING