-
Notifications
You must be signed in to change notification settings - Fork 0
test: OpenCodeReview smoke test (throwaway) #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,7 @@ | ||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||
| # throwaway file to smoke-test OpenCodeReview (safe to delete) | ||||||||||||||||||||||||
| greet() { | ||||||||||||||||||||||||
| name=$1 | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable Suggestion:
Suggested change
|
||||||||||||||||||||||||
| echo Hello $name | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable expansion Suggestion:
Suggested change
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| greet $USER | ||||||||||||||||||||||||
|
Comment on lines
+4
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quote expansions in function body and call site to avoid word-splitting/globbing. Line 5 and Line 7 should quote variable expansions; otherwise names containing spaces or glob characters can be mangled. Suggested fix greet() {
- name=$1
- echo Hello $name
+ name="$1"
+ echo "Hello $name"
}
-greet $USER
+greet "$USER"📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.11.0)[info] 5-5: Double quote to prevent globbing and word splitting. (SC2086) [info] 7-7: Double quote to prevent globbing and word splitting. (SC2086) 🤖 Prompt for AI AgentsSource: Linters/SAST tools There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable expansion Suggestion:
Suggested change
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
set -euo pipefailfor strict error handling. Without it, the script will continue executing even if a command fails, and unset variables won't be caught.Suggestion: