cloudbeat icon indicating copy to clipboard operation
cloudbeat copied to clipboard

Lint `deploy/` shell scripts with shellcheck

Open orestisfl opened this issue 1 year ago • 4 comments

Motivation Shellcheck is a very popular shell script linter, its usage is recommended as a best practice when developing shell scripts.

Expand the shellcheck linter usage to other scripts in our repo, especially the ones that are used by users, like deploy.sh.

For example, one potential problem I see in that script is that the set -e option is not set which means that the script will continue even when commands start failing. But, enabling that option is not enough because we are affected by rule SC2155 in our variable exports.

Definition of done What needs to be completed at the end of this task

  • [ ] Expand pre-commit file regex to include more files
  • [ ] Evaluate and fix or ignore failures

Related tasks/epics Shellcheck introduced in https://github.com/elastic/cloudbeat/pull/1357

orestisfl avatar Sep 21 '23 16:09 orestisfl

Closed by: https://github.com/elastic/cloudbeat/pull/1534

oren-zohar avatar Nov 12 '23 14:11 oren-zohar

Not all scripts are linted yet, re-opening

orestisfl avatar Nov 13 '23 09:11 orestisfl

  • [ ] Include deploy/deployment-manager/ scripts as well

romulets avatar Nov 22 '23 14:11 romulets

It will be covered by https://github.com/elastic/cloudbeat/pull/1568

romulets avatar Nov 22 '23 15:11 romulets