From e1cb448e70704b94119baf6ccaf522c76439e4f0 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:15:35 +0000 Subject: [PATCH 01/12] Adds reviewdog process --- .github/reviewdog.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/reviewdog.yml diff --git a/.github/reviewdog.yml b/.github/reviewdog.yml new file mode 100644 index 0000000..ffe16fc --- /dev/null +++ b/.github/reviewdog.yml @@ -0,0 +1,27 @@ +name: reviewdog +on: [pull_request] +jobs: + misspell: + name: runner / misspell + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v1 + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + github_token: ${{ secrets.github_token }} + locale: "UK" + level: 'warning' + dotnet: + name: runner / dotnet + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v1 + - name: reviewdog + uses: udellgames/reviewdog-csharp + with: + github_token: ${{ secrets.github_token }} + locale: "UK" + level: 'warning' \ No newline at end of file From 0d6f8cd5d7e403325b5c9642d32ae5965ae3e2eb Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:16:05 +0000 Subject: [PATCH 02/12] Test commit with a warnable offence for ReviewDog --- .github/workflows/dotnetcore.yml | 2 +- .../Matchers/FuncControlStringMatcher.cs | 3 ++- ...holas.udell_SAGRES 2020-02-19 14_21_30.coverage | Bin 0 -> 10 bytes ...holas.udell_SAGRES 2020-02-18 16_15_13.coverage | Bin 0 -> 10 bytes 4 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage create mode 100644 TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 223c1b8..9d731ac 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -14,6 +14,6 @@ jobs: with: dotnet-version: 3.1.100 - name: Build with dotnet - run: dotnet build --configuration Release + run: dotnet build --configuration Release /warnaserror - name: Run tests run: dotnet test diff --git a/ControlStrings/Matchers/FuncControlStringMatcher.cs b/ControlStrings/Matchers/FuncControlStringMatcher.cs index 77b3a63..6c6972a 100644 --- a/ControlStrings/Matchers/FuncControlStringMatcher.cs +++ b/ControlStrings/Matchers/FuncControlStringMatcher.cs @@ -21,9 +21,10 @@ public string Match(ControlString controlString) throw new ArgumentException("Argument cannot be matched by this matcher.", nameof(controlString)); } + var a = true; + return Matcher(controlString); } - public bool Matches(ControlString controlString) => CanMatch(controlString); } } \ No newline at end of file diff --git a/TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage b/TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage new file mode 100644 index 0000000000000000000000000000000000000000..2dacd7816eac7a78bd36cb80c604f3ec68715e89 GIT binary patch literal 10 OcmWG=_V~}p00ICG!~xs@ literal 0 HcmV?d00001 diff --git a/TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage b/TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage new file mode 100644 index 0000000000000000000000000000000000000000..2dacd7816eac7a78bd36cb80c604f3ec68715e89 GIT binary patch literal 10 OcmWG=_V~}p00ICG!~xs@ literal 0 HcmV?d00001 From cef3153ef3283239cdfc687ca6005cc848218910 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:17:43 +0000 Subject: [PATCH 03/12] Revert "Test commit with a warnable offence for ReviewDog" This reverts commit 0d6f8cd5d7e403325b5c9642d32ae5965ae3e2eb. --- .github/workflows/dotnetcore.yml | 2 +- .../Matchers/FuncControlStringMatcher.cs | 3 +-- ...holas.udell_SAGRES 2020-02-19 14_21_30.coverage | Bin 10 -> 0 bytes ...holas.udell_SAGRES 2020-02-18 16_15_13.coverage | Bin 10 -> 0 bytes 4 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage delete mode 100644 TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 9d731ac..223c1b8 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -14,6 +14,6 @@ jobs: with: dotnet-version: 3.1.100 - name: Build with dotnet - run: dotnet build --configuration Release /warnaserror + run: dotnet build --configuration Release - name: Run tests run: dotnet test diff --git a/ControlStrings/Matchers/FuncControlStringMatcher.cs b/ControlStrings/Matchers/FuncControlStringMatcher.cs index 6c6972a..77b3a63 100644 --- a/ControlStrings/Matchers/FuncControlStringMatcher.cs +++ b/ControlStrings/Matchers/FuncControlStringMatcher.cs @@ -21,10 +21,9 @@ public string Match(ControlString controlString) throw new ArgumentException("Argument cannot be matched by this matcher.", nameof(controlString)); } - var a = true; - return Matcher(controlString); } + public bool Matches(ControlString controlString) => CanMatch(controlString); } } \ No newline at end of file diff --git a/TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage b/TestResults/acc3b091-bb19-4c99-879e-3eb2624885c4/nicholas.udell_SAGRES 2020-02-19 14_21_30.coverage deleted file mode 100644 index 2dacd7816eac7a78bd36cb80c604f3ec68715e89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10 OcmWG=_V~}p00ICG!~xs@ diff --git a/TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage b/TestResults/cb316d1f-aa0a-4360-b3db-7680a2d11e9f/nicholas.udell_SAGRES 2020-02-18 16_15_13.coverage deleted file mode 100644 index 2dacd7816eac7a78bd36cb80c604f3ec68715e89..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10 OcmWG=_V~}p00ICG!~xs@ From fbe073f3e7975e8c8f5d9870108d624aec7ca715 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:18:19 +0000 Subject: [PATCH 04/12] Adds Microsoft analysers --- ControlStrings/ControlStrings.csproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ControlStrings/ControlStrings.csproj b/ControlStrings/ControlStrings.csproj index 4f9b55f..0b97746 100644 --- a/ControlStrings/ControlStrings.csproj +++ b/ControlStrings/ControlStrings.csproj @@ -13,4 +13,7 @@ 0.2.0.0 0.2.0.0 + + + \ No newline at end of file From 77a89d7795ee90182ffdfb57715074333e1520b6 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:19:36 +0000 Subject: [PATCH 05/12] Moves reviewdog action to the right folder --- .github/{ => workflows}/reviewdog.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/reviewdog.yml (100%) diff --git a/.github/reviewdog.yml b/.github/workflows/reviewdog.yml similarity index 100% rename from .github/reviewdog.yml rename to .github/workflows/reviewdog.yml From 91e63fe019623e61f27def309efc82013f791797 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:21:23 +0000 Subject: [PATCH 06/12] Fixes reviewdog action indentation --- .github/workflows/reviewdog.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index ffe16fc..455d2a8 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -17,11 +17,11 @@ jobs: name: runner / dotnet runs-on: ubuntu-latest steps: - - name: Check out code. + - name: Check out code. uses: actions/checkout@v1 - - name: reviewdog + - name: reviewdog uses: udellgames/reviewdog-csharp with: - github_token: ${{ secrets.github_token }} - locale: "UK" - level: 'warning' \ No newline at end of file + github_token: ${{ secrets.github_token }} + locale: "UK" + level: 'warning' \ No newline at end of file From c07520571195f618ca24ca1a64bbfb04f5319b10 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 13:29:19 +0000 Subject: [PATCH 07/12] Points the reviewdog action at master --- .github/workflows/reviewdog.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 455d2a8..56a30e0 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -20,7 +20,7 @@ jobs: - name: Check out code. uses: actions/checkout@v1 - name: reviewdog - uses: udellgames/reviewdog-csharp + uses: udellgames/reviewdog-csharp@master with: github_token: ${{ secrets.github_token }} locale: "UK" From 9baadb098ea0438ad3b6ba99688691427419781b Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 14:14:05 +0000 Subject: [PATCH 08/12] Fixes a warning caused by an out-dated moq version --- Unit Tests/UnitTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Unit Tests/UnitTests.csproj b/Unit Tests/UnitTests.csproj index f83bd0d..fb09c9a 100644 --- a/Unit Tests/UnitTests.csproj +++ b/Unit Tests/UnitTests.csproj @@ -11,6 +11,7 @@ + all From 479317ce537f6842a1da90844d374f981e10e0ac Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 14:14:37 +0000 Subject: [PATCH 09/12] Adds an issue ReviewDog should catch --- ControlStrings/ControlStringFinder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ControlStrings/ControlStringFinder.cs b/ControlStrings/ControlStringFinder.cs index 983abb9..ac03afb 100644 --- a/ControlStrings/ControlStringFinder.cs +++ b/ControlStrings/ControlStringFinder.cs @@ -34,6 +34,8 @@ public IEnumerable FindAllControlStrings(string input) throw new ArgumentNullException(nameof(input)); } + var a = true; + // Yield return methods doesn't throw any exceptions until you try to access the results // This could happen at any time, including far away from when the error was caused // So we pass error handle normally here and contain the yield return in its own bubble From f7314d8a09126696add5cf7317c002c14e2af728 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 14:21:30 +0000 Subject: [PATCH 10/12] Misspell should catch this --- ControlStrings/ControlStringFinder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ControlStrings/ControlStringFinder.cs b/ControlStrings/ControlStringFinder.cs index ac03afb..b690bcb 100644 --- a/ControlStrings/ControlStringFinder.cs +++ b/ControlStrings/ControlStringFinder.cs @@ -36,7 +36,7 @@ public IEnumerable FindAllControlStrings(string input) var a = true; - // Yield return methods doesn't throw any exceptions until you try to access the results + // Yield retrn methods doesn't throw any exceptions until you try to access the results // This could happen at any time, including far away from when the error was caused // So we pass error handle normally here and contain the yield return in its own bubble return FindAllControlStringsEnumeratorInternal(input); From a8e88a60ace6f23d3ebebb6cc08e54aaab0a4dff Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 14:32:47 +0000 Subject: [PATCH 11/12] Adds more analyzers --- ControlStrings/ControlStrings.csproj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ControlStrings/ControlStrings.csproj b/ControlStrings/ControlStrings.csproj index 0b97746..89fa1b3 100644 --- a/ControlStrings/ControlStrings.csproj +++ b/ControlStrings/ControlStrings.csproj @@ -15,5 +15,10 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + \ No newline at end of file From 17b3c7c199ab694b9f884e7e0b817f2783165412 Mon Sep 17 00:00:00 2001 From: Nick Udell Date: Thu, 20 Feb 2020 15:03:05 +0000 Subject: [PATCH 12/12] Removes reviewdog, updates dotnetcore to do better build logs --- .github/workflows/dotnetcore.yml | 2 +- .github/workflows/reviewdog.yml | 27 --------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 .github/workflows/reviewdog.yml diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 223c1b8..148b023 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -14,6 +14,6 @@ jobs: with: dotnet-version: 3.1.100 - name: Build with dotnet - run: dotnet build --configuration Release + run: dotnet build --configuration Release -v detailed -clp:NoSummary --nologo - name: Run tests run: dotnet test diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml deleted file mode 100644 index 56a30e0..0000000 --- a/.github/workflows/reviewdog.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: reviewdog -on: [pull_request] -jobs: - misspell: - name: runner / misspell - runs-on: ubuntu-latest - steps: - - name: Check out code. - uses: actions/checkout@v1 - - name: misspell - uses: reviewdog/action-misspell@v1 - with: - github_token: ${{ secrets.github_token }} - locale: "UK" - level: 'warning' - dotnet: - name: runner / dotnet - runs-on: ubuntu-latest - steps: - - name: Check out code. - uses: actions/checkout@v1 - - name: reviewdog - uses: udellgames/reviewdog-csharp@master - with: - github_token: ${{ secrets.github_token }} - locale: "UK" - level: 'warning' \ No newline at end of file