Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Update scripts to pass Shellcheck lints #11166

Merged
merged 17 commits into from
Oct 27, 2021
Merged

Commits on Oct 22, 2021

  1. Fix Shellcheck SC2164: exit in case cd fails.

    Use `cd ... || exit` in case cd fails.
    
    https://github.com/koalaman/shellcheck/wiki/SC2164
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    12d79ff View commit details
    Browse the repository at this point in the history
  2. Fix Shellcheck SC2046: Quote to prevent word split

    Quote this to prevent word splitting
    
    https://www.shellcheck.net/wiki/SC2046
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    64adbb7 View commit details
    Browse the repository at this point in the history
  3. Fix Shellcheck SC2115: Ensure never expands to /*

    Use "${var:?}" to ensure this never expands to /* .
    
    https://github.com/koalaman/shellcheck/wiki/SC2115
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    5eb481c View commit details
    Browse the repository at this point in the history
  4. Fix Shellcheck SC2064: Use single quotes on traps

    Use single quotes, otherwise this expands now rather than when signalled.
    
    https://github.com/koalaman/shellcheck/wiki/SC2064
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    898e3be View commit details
    Browse the repository at this point in the history
  5. Fix Shellcheck SC2154: variable possibly undefined

    var is referenced but not assigned.
    
    https://github.com/koalaman/shellcheck/wiki/SC2154
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    6c736fa View commit details
    Browse the repository at this point in the history
  6. Fix Shellcheck SC2166: test -a is not well defined

    Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
    
    https://github.com/koalaman/shellcheck/wiki/SC2166
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    6a9d84a View commit details
    Browse the repository at this point in the history
  7. Fix Shellcheck SC2155: Declare + export separately

    Declare and assign separately to avoid masking return values.
    
    https://github.com/koalaman/shellcheck/wiki/SC2155
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    dfa6143 View commit details
    Browse the repository at this point in the history
  8. Fix Shellcheck SC2089 and SC2090: Quotes in vars

    SC2089: Quotes/backslashes will be treated literally. Use an array.
    
    https://github.com/koalaman/shellcheck/wiki/SC2089
    
    SC2090: Quotes/backslashes in this variable will not be respected.
    
    https://github.com/koalaman/shellcheck/wiki/SC2090
    
    Putting literal JSON in a variable mistakenly triggers these warnings.
    Instead of adding ignore directives, this can be avoided by inlining the
    JSON data into the curl invocation.
    
    Since the variable is only used in this one location, inlining is fine.
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    99e698d View commit details
    Browse the repository at this point in the history
  9. Fix Shellcheck SC1001: Meaningless char escapes

    This \o will be a regular 'o' in this context.
    
    https://github.com/koalaman/shellcheck/wiki/SC1001
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    7cf83c0 View commit details
    Browse the repository at this point in the history
  10. Fix Shellcheck SC1091: Can't follow file

    Not following: (error message here)
    
    https://github.com/koalaman/shellcheck/wiki/SC1091
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    bab2bc8 View commit details
    Browse the repository at this point in the history
  11. Fix Shellcheck SC2016: Single quotes don't expand

    Expressions don't expand in single quotes, use double quotes for that.
    
    https://github.com/koalaman/shellcheck/wiki/SC2016
    
    This specifically warned about the '$aregis...' part of the sed script.
    Which is a relatively obscure use of sed.
    
    Splitting this into two commands makes its intent more obvious and
    avoids contravening Shellcheck's lints.
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    9d0f9d5 View commit details
    Browse the repository at this point in the history
  12. Fix Shellcheck SC2012: Use find instead of ls

    Use find instead of ls to better handle non-alphanumeric filenames.
    
    https://github.com/koalaman/shellcheck/wiki/SC2012
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    3109613 View commit details
    Browse the repository at this point in the history
  13. Fix Shellcheck SC2086: Quote to prevent splitting

    Double quote to prevent globbing and word splitting.
    
    https://github.com/koalaman/shellcheck/wiki/SC2086
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    13f084e View commit details
    Browse the repository at this point in the history
  14. Fix Shellcheck SC2129: Consider using {..} >> file

    Consider using { cmd1; cmd2; } >> file instead of individual redirects.
    
    https://github.com/koalaman/shellcheck/wiki/SC2129
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    b5e9105 View commit details
    Browse the repository at this point in the history
  15. Fix Shellcheck SC2006: Use $(...) notation

    Use $(...) notation instead of legacy backticked `...`.
    
    https://github.com/koalaman/shellcheck/wiki/SC2006
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    d7141e0 View commit details
    Browse the repository at this point in the history
  16. Changelog

    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 22, 2021
    Configuration menu
    Copy the full SHA
    1afc6ec View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2021

  1. Merge remote-tracking branch 'origin/develop' into shellcheck

    Fixes a merge conflict with debian/changelog
    
    Signed-off-by: Dan Callahan <danc@element.io>
    callahad committed Oct 27, 2021
    Configuration menu
    Copy the full SHA
    0dffa9d View commit details
    Browse the repository at this point in the history