anordal / shellharden

The corrective bash syntax highlighter
Mozilla Public License 2.0
4.62k stars 129 forks source link

feature request: make shellharden drop-in compatible with shellcheck #21

Closed xyproto closed 6 years ago

xyproto commented 6 years ago

Hi!

If shellharden would support the same command line arguments as shellcheck, then it could act as a drop-in replacement for shellcheck, and be used in the projects/IDEs/scripts that currently use shellcheck.

Here is a quick overview of the current shellcheck arguments:

Usage: shellcheck [OPTIONS...] FILES...
  -a                --check-sourced          Include warnings from sourced files
  -C[WHEN]          --color[=WHEN]           Use color (auto, always, never)
  -e CODE1,CODE2..  --exclude=CODE1,CODE2..  Exclude types of warnings
  -f FORMAT         --format=FORMAT          Output format (checkstyle, gcc, json, tty)
  -s SHELLNAME      --shell=SHELLNAME        Specify dialect (sh, bash, dash, ksh)
  -V                --version                Print version information
  -x                --external-sources       Allow 'source' outside of FILES

Supporting all different output formats and shell dialects would be a huge task, but just having support for -s bash, would go a long way.

Cheers!

xyproto commented 6 years ago

Feel free to close this issue if this is not the direction you want shellaharden to go, of course. :)

anordal commented 6 years ago

I don't see a need to support the same output formats, since the outputs are different: ShellCheck outputs errors, while Shellharden outputs the script in colors. I might do HTML if needed.

-s bash would go a long way

Sounds compelling. I don't have a functional reason for supporting this option, and I don't see it coming, but you may convince me anyway. Until then, consider using a wrapper script.