koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
36.37k stars 1.78k forks source link

endColumn with SC2034 (and in general with non-json -f) #966

Open blueyed opened 7 years ago

blueyed commented 7 years ago

It would be nice to have endColumn being set with rule SC2034 ("X appears unused"), where it is currently the same as column.

Example output:

[{"file":"tests/run.sh","line":20,"endLine":20,"column":12,"endColumn":12,"level":"warning","code":2034,"message":"fail_on_warning appears unused. Verify it or export it."}]

How is the support for endColumn in general? I am using -f gcc in Neomake currently, but having the endColumn might be worth switching to -f json. OTOH -f gcc could also include the endColumn I suppose?

tests/run.sh:20:12-26: warning: fail_on_warning appears unused. Verify it or export it. [SC2034]

shellcheck 0.4.6.

koalaman commented 7 years ago

Support is very poor. I don't think there's more than one or two warnings that emit endColumn. It's the kind of thing that's tricky to retrofit.

This feature is more likely to go away than to be fixed.

blueyed commented 7 years ago

I see. Thanks for the info. I've imagined that given the identifier name is known, it should be trivial (in this case). Unfortunately I don't know Haskell, otherwise I would have looked into it already.

Feel free to close this issue then, or keep it open as a reminder to remove the feature.