From bffc6176e439c59b23441fd43e06591226358e11 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 18 Jan 2023 22:41:32 +0100 Subject: [PATCH 1/2] fix: format stylelint output as json --- script.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script.sh b/script.sh index 60f0440..b702af9 100755 --- a/script.sh +++ b/script.sh @@ -31,7 +31,8 @@ if [ "${INPUT_REPORTER}" = 'github-pr-review' ]; then | jq -r '.[] | {source: .source, warnings:.warnings[]} | "\(.source):\(.warnings.line):\(.warnings.column):\(.warnings.severity): \(.warnings.text) [\(.warnings.rule)](https://stylelint.io/user-guide/rules/\(.warnings.rule))"' \ | reviewdog -efm="%f:%l:%c:%t%*[^:]: %m" -name="${INPUT_NAME}" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" -filter-mode="${INPUT_FILTER_MODE}" -fail-on-error="${INPUT_FAIL_ON_ERROR}" else - $(npm bin)/stylelint "${INPUT_STYLELINT_INPUT}" --config="${INPUT_STYLELINT_CONFIG}" --ignore-pattern="${INPUT_STYLELINT_IGNORE}" \ + $(npm bin)/stylelint "${INPUT_STYLELINT_INPUT}" --config="${INPUT_STYLELINT_CONFIG}" --ignore-pattern="${INPUT_STYLELINT_IGNORE}" -f json \ + | jq -r '.[] | {source: .source, warnings:.warnings[]} | "\(.source):\(.warnings.line):\(.warnings.column):\(.warnings.severity): \(.warnings.text)"' \ | reviewdog -f="stylelint" -name="${INPUT_NAME}" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" -filter-mode="${INPUT_FILTER_MODE}" -fail-on-error="${INPUT_FAIL_ON_ERROR}" fi From 5ec750b03a94da735352bdb02e9dfc3d5af33aba Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 18 Jan 2023 22:51:37 +0100 Subject: [PATCH 2/2] fix: use same reviewdog args as in github-pr-review --- script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.sh b/script.sh index b702af9..fcf6ebd 100755 --- a/script.sh +++ b/script.sh @@ -33,7 +33,7 @@ if [ "${INPUT_REPORTER}" = 'github-pr-review' ]; then else $(npm bin)/stylelint "${INPUT_STYLELINT_INPUT}" --config="${INPUT_STYLELINT_CONFIG}" --ignore-pattern="${INPUT_STYLELINT_IGNORE}" -f json \ | jq -r '.[] | {source: .source, warnings:.warnings[]} | "\(.source):\(.warnings.line):\(.warnings.column):\(.warnings.severity): \(.warnings.text)"' \ - | reviewdog -f="stylelint" -name="${INPUT_NAME}" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" -filter-mode="${INPUT_FILTER_MODE}" -fail-on-error="${INPUT_FAIL_ON_ERROR}" + | reviewdog -efm="%f:%l:%c:%t%*[^:]: %m" -name="${INPUT_NAME}" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}" -filter-mode="${INPUT_FILTER_MODE}" -fail-on-error="${INPUT_FAIL_ON_ERROR}" fi reviewdog_rc=$?