Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is one of my favorite tips for almost effortlessly improving devops productivity (along with using https://github.com/mvdan/sh for auto-formatting) — by now shellcheck has good editor support in e.g. VSCode and I have a standard pre-commit.com hook for all of my projects. I've seen so many long iterations where people flail at a complex shell script for something like a cron job which was immediately flagged by shellcheck. I generally recommend rewriting in Python but this is a good less invasive step.

One thing which might be worth considering is adding this to your personal ~/.shellcheckrc to make it more pedantic:

enable=all



I went looking through the issue tracker to see if there's an issue about supporting $XDG_CONFIG_HOME and was pleasantly surprised to find out that it seems to already work. So ~/.config/shellcheckrc works just as well as ~/.shellcheckrc




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: