reviewdog / action-shellcheck

Run shellcheck with reviewdog
https://github.com/marketplace?type=actions&query=reviewdog
MIT License
102 stars 20 forks source link

Exclude multiple folders #14

Closed RealHarshThakur closed 3 years ago

RealHarshThakur commented 4 years ago

How do I exclude multiple folders? I have tried : exclude: './.git/* , ./vendor/*' exclude: './.git/* ./vendor/*'

alan-barzilay commented 3 years ago

I'm having the same problem to input multiple patterns, but it looks like this may not be something currently supported. @haya14busa would you mind clarifying if this is possible?

evulhotdog commented 3 years ago

https://github.com/marketplace/actions/run-misspell-with-reviewdog#exclude

It appears for other reviewdog actions, you can provide multiple.

evulhotdog commented 3 years ago

The way that this is built doesn't support multiple paths from what I can tell, unless you can somehow glob multiple paths.

https://github.com/reviewdog/action-shellcheck/blob/master/script.sh#L16

FILES=$(find "${INPUT_PATH:-'.'}" -not -path "${INPUT_EXCLUDE}" -type f -name "${INPUT_PATTERN:-'*.sh'}")

A fix could be to change it to use regex instead of globbing, using the the egrep regextype:

find . -regextype egrep -not -regex '(./roles/foo/files/installer.*|./roles/bar/templates/callhome.j2.sh)' -type f -name '*.sh'