ludeeus / action-shellcheck

GitHub action for ShellCheck.
MIT License
292 stars 69 forks source link

Exact path matching ignore path #59

Closed bi1yeu closed 2 years ago

bi1yeu commented 2 years ago

Fixes https://github.com/ludeeus/action-shellcheck/issues/58

Currently, to ignore files from being checked, you can use ignore_paths and ignore_names, but these inputs can't be used in combination to exclude specific files.

As an example, say you want to exclude the file ./folder_a/maybe_ignore.sh. Using ignore_paths: folder_a would ignore other files in that directory that shouldn't be ignored. Using ignore_names: maybe_ignore.sh would ignore files that share the same name as the target file, but which exist in other directories.

├── folder_a
│   ├── maybe_ignore.sh
│   └── dont_ignore.sh
└── folder_b
    └── maybe_ignore.sh

This change makes the ignore_paths input a little more expressive:

I also added more tests for ignore_paths. And I removed testfiles/ignore/ignore.sh, which looked unused. I can add this back if it was being used as an implicit exclusion test.