tools: Added shellcheck for bash, sh, dash or ksh files.

This commit is contained in:
Andrew Hamilton 2017-12-13 19:15:26 +10:00
parent 45a3f1ede8
commit 4a02b26fb0
3 changed files with 9 additions and 2 deletions

View file

@ -41,3 +41,4 @@ Extensions | Tools
.tar.bz2 | [tar_bz2](http://www.gnu.org/software/tar/manual/tar.html) .tar.bz2 | [tar_bz2](http://www.gnu.org/software/tar/manual/tar.html)
.a .so | [nm](https://linux.die.net/man/1/nm) .a .so | [nm](https://linux.die.net/man/1/nm)
.png .jpg .gif .bmp .ppm .tiff .tga | [pil](http://python-pillow.github.io/) • [pil_half](http://python-pillow.github.io/) .png .jpg .gif .bmp .ppm .tiff .tga | [pil](http://python-pillow.github.io/) • [pil_half](http://python-pillow.github.io/)
.bash .sh .dash .ksh | [shellcheck](http://hackage.haskell.org/package/ShellCheck)

2
TODO
View file

@ -6,7 +6,6 @@ Todo (tool related)
- Report on python doctests. (also coverage of) - Report on python doctests. (also coverage of)
- Cache tools._python_version. - Cache tools._python_version.
- Colourise git_diff. - Colourise git_diff.
- Add shellcheck tool for shell scripts.
Done Done
@ -166,6 +165,7 @@ Done
- Add bandit tool for python. - Add bandit tool for python.
- Created a setup.py file. - Created a setup.py file.
- Add cppcheck tool for C and C++. - Add cppcheck tool for C and C++.
- Add shellcheck tool for shell scripts.
A-syntax, B-tests, C-auto docs, D-lint, E-coverage, F-profile, G-tidy, H-import deps A-syntax, B-tests, C-auto docs, D-lint, E-coverage, F-profile, G-tidy, H-import deps
A B C D E F G H A B C D E F G H

View file

@ -675,6 +675,11 @@ def pil_half(path):
return Status.normal, result return Status.normal, result
@deps(deps={"shellcheck"}, url="shellcheck", executables={"shellcheck"})
def shellcheck(path):
return _run_command(["shellcheck", path])
@deps(deps={"git"}, url="git", executables={"git"}) @deps(deps={"git"}, url="git", executables={"git"})
def git_blame(path): # FIX: Add to tools_test.py def git_blame(path): # FIX: Add to tools_test.py
stdout, stderr, returncode = _do_command( stdout, stderr, returncode = _do_command(
@ -830,7 +835,8 @@ TOOLS_FOR_EXTENSIONS = \
(["tar.gz", "tgz"], [tar_gz]), (["tar.gz", "tgz"], [tar_gz]),
(["tar.bz2"], [tar_bz2]), (["tar.bz2"], [tar_bz2]),
(["a", "so"], [nm]), (["a", "so"], [nm]),
(IMAGE_EXTENSIONS, [pil, pil_half]) (IMAGE_EXTENSIONS, [pil, pil_half]),
(["bash", "sh", "dash", "ksh"], [shellcheck])
] ]