Merge pull request #13639 from deivid-rodriguez/verify-latest-reviewdog

Upgrade to latest reviewdog
This commit is contained in:
Maikel
2025-11-03 12:28:01 +11:00
committed by GitHub
3 changed files with 44 additions and 20 deletions

View File

@@ -5,7 +5,7 @@ permissions:
checks: write # to post check annotations
jobs:
lint:
name: prettier and rubocop
name: reviewdog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@@ -22,21 +22,10 @@ jobs:
- run: git show --no-patch # the commit being tested (which is often a merge due to actions/checkout@v3)
- name: prettier
uses: EPMatt/reviewdog-action-prettier@v1
- uses: reviewdog/action-setup@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: error
fail_on_error: true
reviewdog_version: v0.21.0
- name: rubocop
uses: reviewdog/action-rubocop@v2
with:
rubocop_version: gemfile
rubocop_extensions: rubocop-rails:gemfile rubocop-rspec:gemfile
reporter: github-pr-check
level: error
filter_mode: nofilter
use_bundler: true
fail_level: any
- run: ./script/reviewdog.sh
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }}

View File

@@ -184,9 +184,8 @@
}
// Hide columns
$columns:
"image", "name", "sku", "unit_scale", "unit", "price", "on_hand", "producer", "category",
"tax_category", "tags", "inherits_properties";
$columns: "image", "name", "sku", "unit_scale", "unit", "price", "on_hand", "producer",
"category", "tax_category", "tags", "inherits_properties";
@each $col in $columns {
&.hide-#{$col} {
.col-#{$col} {

36
script/reviewdog.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
#
# Runs linters and pipes their output to reviewdog so it annotates a pull request with the issues found
#
set -eo pipefail
echo "::group:: Running prettier with reviewdog 🐶 ..."
"$(npm root)/.bin/prettier" --check . 2>&1 | sed --regexp-extended 's/(\[warn\].*)$/\1 File is not properly formatted./' \
| reviewdog \
-efm="%-G[warn] Code style issues found in %s. Run Prettier to fix. File is not properly formatted." \
-efm="[%tarn] %f %m" \
-efm="%E[%trror] %f: %m (%l:%c)" \
-efm="%C[error]%r" \
-efm="%Z[error]%r" \
-efm="%-G%r" \
-name="prettier" \
-reporter="github-pr-check" \
-filter-mode="nofilter" \
-fail-level="any" \
-level="error" \
-tee
echo "::group:: Running rubocop with reviewdog 🐶 ..."
bundle exec rubocop \
--fail-level info \
| reviewdog -f="rubocop" \
-name="rubocop" \
-reporter="github-pr-check" \
-filter-mode="nofilter" \
-level="error" \
-fail-level="any" \
-tee