duggan / shlint

A shell linting utility.
http://rubygems.org/gems/shlint
MIT License
50 stars 1 forks source link

Exclude non-shell scripts from linting #22

Open mcandre opened 7 years ago

mcandre commented 7 years ago

For large projects with many shell and non-shell files, it can be difficult to find the right syntax to get shlint to lint all shell scripts, that is, just the shell scripts and nothing else. One can construct a UNIX find command, such as find lib -name "*.sh" -exec shlint {} \;, though this is not a one-size-fits-all, if your shell scripts sometimes lack extensions or are housed in different directory structures. Accordingly, it would be helpful if shlint automatically ignored file paths that are not actually shell scripts.

As a workaround, I'm releasing stank, so users can stank . | xargs shlint. It's not a Ruby application, but there are binary ports for macOS, Windows, Linux, and other platforms so at least it's relatively easy to obtain, even if you're not a hardcore Go developer.