Skip to content

ci: add shellcheck linter for shell scripts

Administrator requested to merge shellcheck into master

Created by: ggilmore

Overview

This PR adds the popular https://github.com/koalaman/shellcheck to our CI pipeline. Shellcheck helps prevent a lot of shell footguns and pitfalls and will make our scripts more-robust overall.

I fixed all of these scripts by hand following shellcheck's suggestions. I'm reasonably confident that the critical paths work (CI pipelines + docker builds pass, dev/start.sh). There might be some lesser-used scripts that are slightly broken by these changes, but I'm confident that those be fixed up after they're discovered by follow up PRs.

Riskier edits

I tagged people here so that they can sign off on the more extensive / riskier script fixes that I had to make.

I'd like for these to signed off on before merging.

Scripts sorted by code owner

This PR touches a lot of scripts. This section conveniently lists all of the edited files group by their code owner so that each team can take a look at the scripts that they're supposed to maintain.

Note: I'm not asking each team to review every one of the files here before I merge this PR (the high-risk files I flagged are listed above). Most of the changes here are fairly straightforward. This section is just an easy way to navigate the PR. I'm confident that issues that slip through here can be easily fixed in a follow up PR.

@sourcegraph/web

@sourcegraph/nobody

@sourcegraph/distribution

@sourcegraph/core-services

@slimsag

@keegancsmith

@felixfbecker

@efritz

Merge request reports

Loading