Closed Bug 1799489 Opened 2 years ago Closed 1 year ago

Fix shellcheck lint checks and start running in CI

Categories

(Thunderbird :: Build Config, task)

Tracking

(thunderbird_esr102 unaffected)

VERIFIED FIXED
109 Branch
Tracking Status
thunderbird_esr102 --- unaffected

People

(Reporter: rjl, Assigned: rjl)

Details

Attachments

(5 files)

The shellcheck linter fails on a handful of scripts found in comm-central, mostly related to build tasks.

I wrote these for the most part, and can fix easily enough:

  • taskcluster/scripts/build-libotr.sh
  • taskcluster/scripts/source-test-clang-format.sh
  • third_party/update_rnp.sh

These need investigation. Are they still relevant? Fix or remove.

  • mailnews/test/data/smime/generate.sh
  • mailnews/test/data/smime/local-gen.sh
Assignee: nobody → rob
Status: NEW → ASSIGNED

The smime test scripts are still needed. They're meant to be run by a developer to update S/MIME certificates used in CI tests. I'm not sure if updating for shellcheck is worth the effort. Kai, do you have any thoughts?

./mach commlint -l shellcheck comm/mailnews/test/data/smime/ will show the errors:

/home/rob/moz/m-c/comm/mailnews/test/data/smime/generate.sh
  14:1   error  Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.  2164 (shellcheck)
  20:1   error  Use 'cd ... || exit' or 'cd ... || return' in case cd fails.           2164 (shellcheck)
  25:1   error  Use 'cd ... || exit' or 'cd ... || return' in case cd fails.           2164 (shellcheck)
  28:1   error  Use 'popd ... || exit' or 'popd ... || return' in case popd fails.     2164 (shellcheck)
  33:23  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  34:12  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  36:8   error  Declare and assign separately to avoid masking return values.          2155 (shellcheck)
  36:14  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  38:1   error  Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.  2164 (shellcheck)
  39:8   error  Declare and assign separately to avoid masking return values.          2155 (shellcheck)
  39:15  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  40:1   error  Use 'popd ... || exit' or 'popd ... || return' in case popd fails.     2164 (shellcheck)
  43:29  error  Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.               2166 (shellcheck)
  43:59  error  Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.               2166 (shellcheck)
  45:10  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  53:10  error  Use $(...) notation instead of legacy backticks `...`.                 2006 (shellcheck)
  62:13  error  Double quote to prevent globbing and word splitting.                   2086 (shellcheck)
  63:21  error  Double quote to prevent globbing and word splitting.                   2086 (shellcheck)

/home/rob/moz/m-c/comm/mailnews/test/data/smime/local-gen.sh
  29:10  error  Use $(...) notation instead of legacy backticks `...`.                   2006 (shellcheck)
  34:27  error  Double quote to prevent globbing and word splitting.                     2086 (shellcheck)
  73:1   error  Consider using { cmd1; cmd2; } >> file instead of individual redirects.  2129 (shellcheck)
  81:9   error  Double quote to prevent globbing and word splitting.                     2086 (shellcheck)
Flags: needinfo?(kaie)

Most problems were related to SC2086, and the suggested remedies are documented
at https://github.com/koalaman/shellcheck/wiki/SC2086.

Can revisit later, in the meantime these scripts are not critical build scripts
or anything.

Target Milestone: --- → 109 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/ac0fd63cd0bd
Fix source-test-clang-format.sh shellcheck errors. r=dandarnell
https://hg.mozilla.org/comm-central/rev/b6c5ac1561a8
Fix shellcheck errors in build-libotr.sh. r=dandarnell
https://hg.mozilla.org/comm-central/rev/38fa9ceacde1
Fix shellcheck errors in update_rnp.sh. r=dandarnell
https://hg.mozilla.org/comm-central/rev/c1b5a7c88c08
Exclude S/MIME test data-gen scripts from shellcheck. r=dandarnell

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED

Reopened since the tests are not enabled yet.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED

RE Comment #2, moving to bug 1809653.

Flags: needinfo?(kaie)
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: