SublimeLinter / SublimeLinter-shellcheck

This linter plugin for SublimeLinter provides an interface to shellcheck.
MIT License
210 stars 20 forks source link

remove trailing dash from cmd #20

Closed Wasapl closed 6 years ago

Wasapl commented 6 years ago

Dash instructs shellcheck there are no options after the dash. But sometimes SublimeLinter provides args for shellcheck. For example, I need shellcheck to follow source commands. It can be achieved with -x or --external-sources option:

$ shellcheck
No files specified.

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

Next Setting will work only if there is no trailing dash in cmd:

// SublimeLinter Settings - User
{
    "linters": {
        "shellcheck": {
            "args": "-x"
        }
    }
}
braver commented 6 years ago

I think the right way to do this would be to put ${args} before the dash. @kaste ?

kaste commented 6 years ago

@braver is correct, if we put ${args} in the cmd we explicitly tell SL where to put those args.

braver commented 6 years ago

@Wasapl you want to make the change? Otherwise I’ll look into it some time next week.

Wasapl commented 6 years ago

@braver Here is the update!

braver commented 6 years ago

w00t