frankgrimes97 opened a new issue, #662:
URL: https://github.com/apache/pulsar-helm-chart/issues/662

   **Is your feature request related to a problem? Please describe.**
   
   In reviewing the documentation and setup/install scripts I noticed numerous 
issues in the Bash scripts that could lead to problems/bugs.
   
   [ShellCheck](https://github.com/koalaman/shellcheck) is a useful linting 
tool which can help catch and report them.
   
   e.g. for `$ shellcheck scripts/pulsar/prepare_helm_release.sh` it reports 
the following issues:
   
   ```
   
   In scripts/pulsar/prepare_helm_release.sh line 21:
   CHART_HOME=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/../.. && pwd)
                                   ^----------------------------^ SC2046 
(warning): Quote this to prevent word splitting.
   
   
   In scripts/pulsar/prepare_helm_release.sh line 22:
   cd ${CHART_HOME}
   ^--------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || 
return' in case cd fails.
      ^-----------^ SC2086 (info): Double quote to prevent globbing and word 
splitting.
   
   Did you mean:
   cd "${CHART_HOME}" || exit
   
   
   In scripts/pulsar/prepare_helm_release.sh line 100:
           kubectl create namespace ${namespace} ${local:+ -o yaml 
--dry-run=client}
                                    ^----------^ SC2086 (info): Double quote to 
prevent globbing and word splitting.
   
   Did you mean:
           kubectl create namespace "${namespace}" ${local:+ -o yaml 
--dry-run=client}
   
   
   In scripts/pulsar/prepare_helm_release.sh line 107:
   if [ $? -ne 0 ]; then
        ^-- SC2181 (style): Check exit code directly with e.g. 'if ! mycmd;', 
not indirectly with $?.
   
   
   In scripts/pulsar/prepare_helm_release.sh line 124:
   ${CHART_HOME}/scripts/pulsar/generate_token_secret_key.sh -n ${namespace} -k 
${release} ${extra_opts}
   ^-----------^ SC2086 (info): Double quote to prevent globbing and word 
splitting.
                                                                ^----------^ 
SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                
^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                
           ^-----------^ SC2086 (info): Double quote to prevent globbing and 
word splitting.
   
   Did you mean:
   "${CHART_HOME}"/scripts/pulsar/generate_token_secret_key.sh -n 
"${namespace}" -k "${release}" "${extra_opts}"
   
   
   In scripts/pulsar/prepare_helm_release.sh line 133:
       ${CHART_HOME}/scripts/pulsar/generate_token.sh -n ${namespace} -k 
${release} -r ${user} ${extra_opts} 
       ^-----------^ SC2086 (info): Double quote to prevent globbing and word 
splitting.
                                                         ^----------^ SC2086 
(info): Double quote to prevent globbing and word splitting.
                                                                         
^--------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                
       ^-----^ SC2086 (info): Double quote to prevent globbing and word 
splitting.
                                                                                
               ^-----------^ SC2086 (info): Double quote to prevent globbing 
and word splitting.
   
   Did you mean:
       "${CHART_HOME}"/scripts/pulsar/generate_token.sh -n "${namespace}" -k 
"${release}" -r "${user}" "${extra_opts}" 
   
   For more information:
     https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word 
splitt...
     https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... 
|...
     https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing 
...
   ```
   
   
   **Describe the solution you'd like**
   
   There are GitHub Actions available which run ShellCheck on every Pull 
Request to help keep the Bash scripts clean and bug-free moving forward.
   e.g. 
     - https://github.com/reviewdog/action-shellcheck
     - https://github.com/ludeeus/action-shellcheck
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to