Skip to content

Run shellcheck, add to tools/test. #4130

Open
@chrisbobbe

Description

@chrisbobbe

When @gnprice said:

@andersk Do you know of another good resource to point to for the key points of writing shell scripts? I linked to two below but I feel like there are a few other good things to mention that they don't cover.

@andersk replied:

Yes! Run ShellCheck on all of your shell scripts and get them down to zero diagnostics. Run it every time you commit. Run it in CI. Run it automatically in your editor. ShellCheck knows things that you didn’t know you needed to know. ShellCheck knows things that I didn’t know I needed to know. ShellCheck is excellent. ShellCheck is magical. ShellCheck is the one shining beacon of hope in the vast fiery hellscape that is the world of UNIX shell scripting. Run ShellCheck.

Run it.

Running shellcheck tools/test on master currently gives five or six warnings in that script. I haven't investigated any of them yet, but it sounds like a good goal to do so, and to maybe make tools/test shell (or similar) a thing, so we can run it frequently and in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions