chore: Checking ShellCheck errors and applying relevant fixes - #1305
Conversation
Signed-off-by: Leanne Ahern <lahern@redhat.com>
Reviewer's GuideThis PR addresses a ShellCheck warning by quoting the to_host variable value in the db_copy.sh script to ensure proper parsing and prevent word splitting. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @OpinionatedHeron - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `hack/db_copy.sh:3` </location>
<code_context>
#!/bin/bash
-to_host=<db-service-host>
+to_host="<db-service-host>"
to_port=5432
to_user=postgres
</code_context>
<issue_to_address>
Quoting the variable assignment improves safety for special characters.
Quoting prevents issues with spaces or special characters in the value, which is recommended in shell scripts.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…C2068 Signed-off-by: Leanne Ahern <lahern@redhat.com>
Signed-off-by: Leanne Ahern <lahern@redhat.com>
…repare-restricted-environment script Signed-off-by: Leanne Ahern <lahern@redhat.com>
…ning - SC2178 and SC2128. Signed-off-by: Leanne Ahern <lahern@redhat.com>
Signed-off-by: Leanne Ahern <lahern@redhat.com>
Signed-off-by: Leanne Ahern <lahern@redhat.com>
| local dest_image | ||
| dest_image=$(replaceInternalRegIfNeeded "$1") |
There was a problem hiding this comment.
| local dest_image | |
| dest_image=$(replaceInternalRegIfNeeded "$1") | |
| src_image=$(replaceInternalRegIfNeeded "$1") |
I meant not using dest_image at all, since it is not needed.
Signed-off-by: Leanne Ahern <lahern@redhat.com>
rm3l
left a comment
There was a problem hiding this comment.
Thanks @OpinionatedHeron !!
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gazarenkov, rm3l The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
666d602
into
redhat-developer:main
…-developer#1305) * Checking shellCheck fix - for db_copyfile Signed-off-by: Leanne Ahern <lahern@redhat.com> * Adding double quotes to all arrays in db_copy script. Reason: Error SC2068 Signed-off-by: Leanne Ahern <lahern@redhat.com> * Fixing SC2145 errors in prepare-restricted-environment script Signed-off-by: Leanne Ahern <lahern@redhat.com> * Fixing SC2206 errors -Quote to prevent word splitting/globbing - in prepare-restricted-environment script Signed-off-by: Leanne Ahern <lahern@redhat.com> * Fixing comments to ignore certain warnings. Adjusting code to fix warning - SC2178 and SC2128. Signed-off-by: Leanne Ahern <lahern@redhat.com> * Updating db_copy.sh file with necessary changes. Quoting all variables. Signed-off-by: Leanne Ahern <lahern@redhat.com> * Running script and making changes to ensure it runs to completion Signed-off-by: Leanne Ahern <lahern@redhat.com> * Changing lines to ensure script runs correctly without errors Signed-off-by: Leanne Ahern <lahern@redhat.com> * Updating db_copy based on PR feedback Signed-off-by: Leanne Ahern <lahern@redhat.com> * Slight changes based on PR feedback Signed-off-by: Leanne Ahern <lahern@redhat.com> * Making changes based on suggestions Signed-off-by: Leanne Ahern <lahern@redhat.com> * Fixing missed errors and small mistake Signed-off-by: Leanne Ahern <lahern@redhat.com> * Update .rhdh/scripts/prepare-restricted-environment.sh --------- Signed-off-by: Leanne Ahern <lahern@redhat.com> Co-authored-by: Armel Soro <armel@rm3l.org>
Description
Reviewing ShellCheck errors that appear in Code Scanning. Searching and reviewing that error and making changes to the code, if relevant and necessary to do so. Testing the changes by re-running the shellcheck and ensuring that no other errors appear when checking.
Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer
Summary by Sourcery
Enhancements: