From 867a7f6d989931c0991066ffe50040bf059e02c6 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 May 2024 06:07:42 +0100 Subject: [PATCH 1/9] lint using resharper --- .github/workflows/lint.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..ea8d0be579 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,29 @@ +name: Lint + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + lint: + runs-on: linux + + steps: + - uses: actions/checkout@v2 + - name: Setup submodule + run: | + git submodule update --init --recursive + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.100 + - name: Setup Resharper + run: dotnet tool install -g JetBrains.ReSharper.GlobalTools + - name: Run Linter + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*" + - name: Annotate Lints + uses: equisoft-actions/sarif-annotator@v1.5.0 + with: + sarif-path: ./output.json From 5966cde97e47973b382945ee6569194651d3e56b Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 May 2024 06:11:04 +0100 Subject: [PATCH 2/9] more specific --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ea8d0be579..a6a353320d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,7 +8,7 @@ on: jobs: lint: - runs-on: linux + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 0c71266c43f5dc22e9f7ed90f2484c84a6e74064 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 May 2024 07:25:16 +0100 Subject: [PATCH 3/9] test that htis annotates --- OpenDreamClient/Rendering/DreamViewOverlay.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenDreamClient/Rendering/DreamViewOverlay.cs b/OpenDreamClient/Rendering/DreamViewOverlay.cs index ae51b1b402..37ab52774e 100644 --- a/OpenDreamClient/Rendering/DreamViewOverlay.cs +++ b/OpenDreamClient/Rendering/DreamViewOverlay.cs @@ -154,11 +154,11 @@ private void DrawAll(OverlayDrawArgs args, EntityUid eye, Vector2i viewportSize) } var eyeTile = _mapSystem.GetTileRef(gridUid, grid, eyeCoords); - var tiles = CalculateTileVisibility(gridUid, grid, eyeTile, seeVis); + var Tiles = CalculateTileVisibility(gridUid, grid, eyeTile, seeVis); RefreshRenderTargets(args.WorldHandle, viewportSize); - CollectVisibleSprites(tiles, gridUid, grid, eyeTile, seeVis, sight, args.WorldAABB); + CollectVisibleSprites(Tiles, gridUid, grid, eyeTile, seeVis, sight, args.WorldAABB); ClearPlanes(); ProcessSprites(worldHandle, viewportSize, args.WorldAABB); From 1f48c679ddf88945a4a4c75792a0f838b031d340 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 May 2024 08:03:41 +0100 Subject: [PATCH 4/9] revert test, increase limit and disable swea --- .github/workflows/lint.yml | 3 ++- OpenDreamClient/Rendering/DreamViewOverlay.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a6a353320d..92f7bb4674 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,8 +22,9 @@ jobs: - name: Setup Resharper run: dotnet tool install -g JetBrains.ReSharper.GlobalTools - name: Run Linter - run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*" + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea - name: Annotate Lints uses: equisoft-actions/sarif-annotator@v1.5.0 with: sarif-path: ./output.json + limit: 200 diff --git a/OpenDreamClient/Rendering/DreamViewOverlay.cs b/OpenDreamClient/Rendering/DreamViewOverlay.cs index 37ab52774e..ae51b1b402 100644 --- a/OpenDreamClient/Rendering/DreamViewOverlay.cs +++ b/OpenDreamClient/Rendering/DreamViewOverlay.cs @@ -154,11 +154,11 @@ private void DrawAll(OverlayDrawArgs args, EntityUid eye, Vector2i viewportSize) } var eyeTile = _mapSystem.GetTileRef(gridUid, grid, eyeCoords); - var Tiles = CalculateTileVisibility(gridUid, grid, eyeTile, seeVis); + var tiles = CalculateTileVisibility(gridUid, grid, eyeTile, seeVis); RefreshRenderTargets(args.WorldHandle, viewportSize); - CollectVisibleSprites(Tiles, gridUid, grid, eyeTile, seeVis, sight, args.WorldAABB); + CollectVisibleSprites(tiles, gridUid, grid, eyeTile, seeVis, sight, args.WorldAABB); ClearPlanes(); ProcessSprites(worldHandle, viewportSize, args.WorldAABB); From a2e5db48986ba82a06e501afbff3baa02aa13a35 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sun, 19 May 2024 08:28:29 +0100 Subject: [PATCH 5/9] use github codeql, skip build --- .github/workflows/lint.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 92f7bb4674..cb8bf372c4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,9 +22,7 @@ jobs: - name: Setup Resharper run: dotnet tool install -g JetBrains.ReSharper.GlobalTools - name: Run Linter - run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea - - name: Annotate Lints - uses: equisoft-actions/sarif-annotator@v1.5.0 + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea --no-build + - uses: github/codeql-action/upload-sarif@v3 with: - sarif-path: ./output.json - limit: 200 + sarif_file: output.json From b012bc5e677182c66eb8fa5a0858eb3c5b221844 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Wed, 22 May 2024 23:10:34 +0100 Subject: [PATCH 6/9] ignore xaml files --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cb8bf372c4..f14e38b53d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Resharper run: dotnet tool install -g JetBrains.ReSharper.GlobalTools - name: Run Linter - run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea --no-build + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --exclude="*.xaml" --no-swea --no-build - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: output.json From 855f517a593885622fb3781d519be2e4e81a1f5b Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Wed, 22 May 2024 23:56:32 +0100 Subject: [PATCH 7/9] restore beforehand, un-exclude xamls --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f14e38b53d..eedd604a4c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,10 +19,12 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 8.0.100 + - name: Install dependencies + run: dotnet restore - name: Setup Resharper run: dotnet tool install -g JetBrains.ReSharper.GlobalTools - name: Run Linter - run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --exclude="*.xaml" --no-swea --no-build + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea --no-build - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: output.json From 18a066feeb6fd48bec2be0228d001346c67aa2ba Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Wed, 22 May 2024 23:59:26 +0100 Subject: [PATCH 8/9] always run the build, suck up the cpu time --- .github/workflows/lint.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eedd604a4c..260423980e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,12 +19,10 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: 8.0.100 - - name: Install dependencies - run: dotnet restore - name: Setup Resharper run: dotnet tool install -g JetBrains.ReSharper.GlobalTools - name: Run Linter - run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea --no-build + run: jb inspectcode OpenDream.sln -o="output.json" --project="OpenDream*;DM*" --no-swea - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: output.json From d8606b1b663713ad16a305848d2503dbf55a1379 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Thu, 23 May 2024 00:35:22 +0100 Subject: [PATCH 9/9] =?UTF-8?q?we=20don=E2=80=99t=20have=20perms=20to=20ru?= =?UTF-8?q?n=20on=20push=20here?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 260423980e..cdc9c261c4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,8 +1,6 @@ name: Lint on: - push: - branches: [master] pull_request: branches: [master]