Closed tadjohnston closed 4 years ago
We need to change -name
for each run. https://github.com/reviewdog/action-stylelint/blob/8727f560b63fa3fddee4da00472d84a9210c4884/entrypoint.sh#L17
Oh, I thought the name told reviewdog which linter to run. I will give it a try on a forked version to test, thanks!
OK, I added a name input and it seems to be directly related to the parser.
reviewdog: fail to create parser. use either -f or -efm: "stylelint-react-themed" is not supported. consider to add new errrorformat to https://github.com/reviewdog/errorformat
events.js:292
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (internal/stream_base_commons.js:154:25)
at writeGeneric (internal/stream_base_commons.js:145:3)
at Socket._writeGeneric (net.js:783:11)
at Socket._write (net.js:795:8)
if [ "${INPUT_REPORTER}" == 'github-pr-review' ]; then
# Use jq and github-pr-review reporter to format result to include link to rule page.
$(npm bin)/stylelint "${INPUT_STYLELINT_INPUT:-'**/*.css'}" --config="${INPUT_STYLELINT_CONFIG}" -f json \
| 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}:-stylelint}" -reporter=github-pr-review -level="${INPUT_LEVEL}"
else
$(npm bin)/stylelint "${INPUT_STYLELINT_INPUT:-'**/*.css'}" --config="${INPUT_STYLELINT_CONFIG}" \
| reviewdog -f="${INPUT_NAME:-stylelint}" -reporter="${INPUT_REPORTER:-github-pr-check}" -level="${INPUT_LEVEL}"
fi
stylelint-themed:
name: runner / stylelint / themed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 'stylelint react-themed'
uses: rentpath/action-stylelint@tj2
with:
name: 'stylelint-react-themed'
github_token: ${{ secrets.github_token }}
stylelint_input: 'src/**/*.{css,scss}'
stylelint_config: '.themed-stylelintrc'
stylelint_ignore: 'src/**/*.tw.{css,scss}'
-f
(format) should still use 'stylelint' and you need to add -name
flag.
Whoops! I edited the wrong one! 🤦
Works great! Is it worth it for me to put in a PR?
:+1:
Yes, can you create a PR?
I'd love to be able to do something like the following as we are transitioning to TailwindCss.
Unfortunately when I add a file in each input that I know will fail, I do not get all failures. Instead, whatever runner runs last trumps the first and only reports the errors from the one runner and not both. When I only run one of these at a time, it does what it's supposed to.
Example:
These are errors from
stylelint tailwind
I also get the errors I should for
stylelint react-themed
, but they never show up in the report. Here is the file that I've forced to have errors:Is this something that can be adjusted with action-stylelint here or is this a restriction of reviewdog itself?