-
-
Notifications
You must be signed in to change notification settings - Fork 170
fix(shell): all remaining shellcheck issues #459
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
base: master
Are you sure you want to change the base?
Conversation
|
@bradymiller I don't think this is exceptional and I've spot-checked it (and tested things on the commandline until I got what it was trying to get across) but it touches every script we own. Is there anything you want to peek at it before we let it through? |
docker/openemr/7.0.3/openemr.sh
Outdated
|
|
||
| #run auto_configure | ||
| php auto_configure.php -c auto_configure.ini -f ${CONFIGURATION} || return 1 | ||
| php auto_configure.php -c auto_configure.ini -f "${CONFIGURATION}" || return 1 |
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.
Will this require this change (both for 7.0.3 and 7.0.4) if not already there:
openemr-devops/docker/openemr/flex-edge/auto_configure.php
Lines 27 to 48 in 8f3eca7
| // Collect parameters(if exist) for installation configuration settings | |
| for ($i=1; $i < count($argv); $i++) { | |
| if ($argv[$i] == '-f' && isset($argv[$i+1])) { | |
| // Handle case where a single string contains all parameters | |
| $configString = $argv[$i+1]; | |
| $configPairs = preg_split('/\s+/', trim($configString)); | |
| foreach ($configPairs as $pair) { | |
| if (strpos($pair, '=') !== false) { | |
| list($index, $value) = explode('=', $pair, 2); | |
| $installSettings[$index] = $value; | |
| } | |
| } | |
| // Skip the next argument since we already processed it | |
| $i++; | |
| } else { | |
| // Handle standard key=value parameters | |
| $indexandvalue = explode("=", $argv[$i]); | |
| $index = $indexandvalue[0]; | |
| $value = $indexandvalue[1] ?? ''; | |
| $installSettings[$index] = $value; | |
| } | |
| } |
|
bah, there was a bug in my git ls-files and this didn't actually catch all the shellcheck issues. There are still a ton in the xbackup scripts. |
|
Those might not be worth fighting. I need to migrate away from the current MySQL image with Percona's XtraBackup stuff to something with MariaDB. |
|
@kojiromike I've migrated off the xbackup stuff, which was blocking you, but this pull is aging -- should we close or can we move on it? |
|
I'll move on it soon. |
8d87f0f to
d2d3ae4
Compare
Changes across docker/openemr (7.0.4, 7.0.5, 8.0.0, binary, flex),
packages/standard, and utilities:
Shell style improvements:
- Quote variables to prevent word splitting (SC2086)
- Use `find -exec {} +` instead of `find -print0 | xargs -0`
- Use arithmetic syntax `(( ))` instead of `[ ]` for numeric comparisons
- Use single `=` in `[[ ]]` tests instead of `==`
- Use single quotes for literal strings
- Use `mkdir -p` instead of `[[ ! -d ]] && mkdir`
- Use POSIX parameter expansion for optional args: `${VAR:+-flag} ${VAR:+"$VAR"}`
- Use `:` instead of `true` for no-op commands
- Use `echo` for simple strings, `printf` only when format specifiers needed
- Replace manual ANSI escapes with tput
Bug fixes:
- Fix misplaced quote in chown command (7.0.4, 8.0.0 devtoolsLibrary.source)
Legitimate shellcheck disables with comments:
- SC2086: CONFIGURATION variable intentionally word-splits
- SC2154: Variables passed as environment variables to container
- SC2310: Functions in retry loops with set -e are intentional
- SC2016: Literal $ in warning messages
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Short description of what this resolves:
Fixes all shellcheck warnings when running with
-oall(maximum strictness) across docker/openemr (7.0.4+), packages/standard, and utilities.Changes proposed in this pull request:
Shell style improvements:
find -exec {} +instead offind -print0 | xargs -0(( ))instead of[ ]for numeric comparisons=in[[ ]]tests instead of==mkdir -pinstead of[[ ! -d ]] && mkdir${VAR:+-flag} ${VAR:+"$VAR"}:instead oftruefor no-op commandsechofor simple strings,printfonly when format specifiers neededBug fixes:
Legitimate shellcheck disables with comments:
AI disclosure: