From 7cd12dff9633107596a3be2336ff53dd94675e66 Mon Sep 17 00:00:00 2001 From: William Theaker Date: Wed, 8 Nov 2023 15:53:56 -0500 Subject: [PATCH] Add problem matcher for rubocop. --- .github/rubocop_matcher.json | 32 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 14 ++------------ 2 files changed, 34 insertions(+), 12 deletions(-) create mode 100644 .github/rubocop_matcher.json diff --git a/.github/rubocop_matcher.json b/.github/rubocop_matcher.json new file mode 100644 index 0000000..4de8b86 --- /dev/null +++ b/.github/rubocop_matcher.json @@ -0,0 +1,32 @@ +{ + "problemMatcher": [ + { + "owner": "rubocop-error", + "severity": "error", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+): C: ((.+): .+)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + }, + { + "owner": "rubocop-warning", + "severity": "warning", + "pattern": [ + { + "regexp": "^(.+):(\\d+):(\\d+): W: ((.+): .+)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8b7f95..89bf606 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,20 +21,10 @@ jobs: run: bundle install - name: Run rspec run: bundle exec rspec + - name: Enable rubocop matcher + run: echo "::add-matcher::.github/rubocop_matcher.json" - name: Run rubocop run: bundle exec rubocop --display-cop-names -# This doesn't work on PRs from forks due to GITHUB_TOKEN, which makes -# it kinda useless for now -# https://github.com/andrewmcodes/rubocop-linter-action/issues/68 -# rubocop: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout repository -# uses: actions/checkout@v3 -# - name: Run Rubocop Linter -# uses: andrewmcodes/rubocop-linter-action@v3.2.0 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} markdown: runs-on: ubuntu-latest steps: