shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

[Feature request] shellcheck for git diff

Open AtsushiSakai opened this issue 5 years ago • 1 comments

First of all, thank you so much for great OSS!!

For new checks and feature suggestions

  • [x] shellcheck.net (i.e. the latest commit) currently gives no useful warnings about this
  • [x] I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related

I have a feature request. I think it would be great to add "--diff" option for shellcheck command for style checking for git diff. Currently, this tool check a whole file, but sometimes it difficult to perform an effective style check on the codes under development before cleaning up all the existing style problems. So, when we would like to improve the codes incrementally, style check for git diff is needed. Python code style checker "pycodestyle" has the "--diff" option for git diff: https://pycodestyle.pycqa.org/en/latest/intro.html I need a similar function for shell script.

Best

AtsushiSakai avatar May 02 '20 12:05 AtsushiSakai

This would be great. I wrote a python script for reading shellcheck json and it generates markdown for a GH check. It would be nice and simple if the analyzing could be limited to the lines changed in the diff. I thought about parsing the diff and then ignoring shellcheck feedback which fell outside of the lines; I searched for this issue first in case it existed.

samrocketman avatar Mar 14 '25 00:03 samrocketman