Merge ~smoser/cloud-init:cleanup/ds-identify-shellcheck-fixes into cloud-init:master
Status: | Merged |
---|---|
Approved by: | Scott Moser |
Approved revision: | c172d647ab5e11b2afc55126705aac1ee17ea911 |
Merge reported by: | Scott Moser |
Merged at revision: | 4c1af5c7eb8db67f51f35130e13157a735256d2b |
Proposed branch: | ~smoser/cloud-init:cleanup/ds-identify-shellcheck-fixes |
Merge into: | cloud-init:master |
Diff against target: |
216 lines (+32/-18) 1 file modified
tools/ds-identify (+32/-18) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Scott Moser | Approve | ||
Server Team CI bot | continuous-integration | Approve | |
Review via email: mp+344768@code.launchpad.net |
Commit message
ds-identify: make shellcheck 0.4.6 happy with ds-identify.
This fixes warnings reported by shellcheck at 0.4.6.
The complaints that we are ignoring globally (top of the file) are:
2015: Note that A && B || C is not if-then-else. C may run if A is true.
2039: In POSIX sh, 'local' is undefined.
2162: read without -r will mangle backslashes.
2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Most of the complaints were just noise, but a few unused variables
were reported and fixed.
Related shellcheck issues opened:
- https:/
- https:/
- https:/
- https:/
Description of the change
see commit message
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.
In the process of doing this I filed 4 issues (2 bugs, 2 feature requests)
- https:/ /github. com/koalaman/ shellcheck/ issues/ 1191 /github. com/koalaman/ shellcheck/ issues/ 1192 /github. com/koalaman/ shellcheck/ issues/ 1193 /github. com/koalaman/ shellcheck/ issues/ 1194
- https:/
- https:/
- https:/
Things I am not terribly happy about:
* don't know how to run this from tox or c-i and get a 'shellcheck-tip' and 'shellchec' style targets.
* I don't love the '# shellcheck disable' noise. perhaps we could strip them out when installing.