CircleCI-Public / shellcheck-orb

An orb for ShellCheck, a static analysis tool for shell scripts (https://shellcheck.net) — check all scripts in your repository on every commit
https://circleci.com/developer/orbs/orb/circleci/shellcheck
MIT License
19 stars 26 forks source link

[CIRCLE-14970] Add "exclude" parameter for skipping certain directories #2

Closed zzak closed 5 years ago

zzak commented 5 years ago

I've tested this command against the CLI:

# skip anything in vendor:
$ find . -type f -not -path './vendor/*' -name '*.sh'
./.circleci/brew-deploy.sh
./.circleci/deploy-gh-pages.sh
./.circleci/generate-docs.sh
./install.sh
# show results for default value of blank string:
$ find . -type f -not -path '' -name '*.sh'
./vendor/golang.org/x/sys/unix/mkerrors.sh
./vendor/golang.org/x/sys/unix/mkall.sh
./vendor/google.golang.org/appengine/internal/regen.sh
./vendor/github.com/onsi/ginkgo/before_pr.sh
./.circleci/brew-deploy.sh
./.circleci/deploy-gh-pages.sh
./.circleci/generate-docs.sh
./install.sh
zzak commented 5 years ago

@marcomorain It's in the description of this PR but here's another test.

Using an empty -not -path '':

$ find . -type f -not -path '' -name '*.sh'
./vendor/golang.org/x/sys/unix/mkerrors.sh
./vendor/golang.org/x/sys/unix/mkall.sh
./vendor/google.golang.org/appengine/internal/regen.sh
./vendor/github.com/onsi/ginkgo/before_pr.sh
./.circleci/brew-deploy.sh
./.circleci/deploy-gh-pages.sh
./.circleci/generate-docs.sh
./install.sh

Using original command without -not -path:

$ find . -type f -name '*.sh'
./vendor/golang.org/x/sys/unix/mkerrors.sh
./vendor/golang.org/x/sys/unix/mkall.sh
./vendor/google.golang.org/appengine/internal/regen.sh
./vendor/github.com/onsi/ginkgo/before_pr.sh
./.circleci/brew-deploy.sh
./.circleci/deploy-gh-pages.sh
./.circleci/generate-docs.sh
./install.sh
wyardley commented 5 years ago

I can submit a docs fix to make it more clear that it’s a find pattern and include an example, but I don’t think this can support >1 exclude pattern, can it?

zzak commented 5 years ago

@wyardley Correct, just one exclude pattern is supported with this patch.