Fix shellcheck lint checks and start running in CI
Categories
(Thunderbird :: Build Config, task)
Tracking
(thunderbird_esr102 unaffected)
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 | ||
Comment 1•2 years ago
|
||
Depends on D161504
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
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)
Assignee | ||
Comment 3•2 years ago
|
||
Most problems were related to SC2086, and the suggested remedies are documented
at https://github.com/koalaman/shellcheck/wiki/SC2086.
Assignee | ||
Comment 4•2 years ago
|
||
Assignee | ||
Comment 5•1 year ago
|
||
Can revisit later, in the meantime these scripts are not critical build scripts
or anything.
Assignee | ||
Updated•1 year ago
|
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
Updated•1 year ago
|
Assignee | ||
Comment 7•1 year ago
|
||
Reopened since the tests are not enabled yet.
Assignee | ||
Comment 8•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 9•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Description
•