Conversation
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Contributor
Author
|
This is in response to Qodo's review on an older PR, where I dismissed it, saying that hermetic builds will most likely need shell-quoting anyway. I'm happy to have found a solution that does not require executing |
e07bbf5 to
8ff93d8
Compare
MartinBasti
approved these changes
Mar 20, 2026
The commands we execute may include shell control characters
(most commonly whitespace). If we log the arguments separated by space,
the log messages will look confusing and will not be copy-paste-able
into a terminal.
Shell-quote the arguments that need quoting to make the log messages
copy-paste-able. Use a similar approach as alessio/shellescape [1]
or shlex [2] from the Python standard library.
Compared to those, use a slighly nicer escape style for single quotes.
Our approach:
it's => 'it'\''s'
Their approach:
it's => 'it'"'"'s'
[1]: https://github.com/alessio/shellescape/blob/59ee74454256aaf5478a6283be4c480c13fd3152/shellescape.go#L26-L42
[2]: https://github.com/python/cpython/blob/485699216f2186c63f85fc546301e5edbe6b2f22/Lib/shlex.py#L320-L338
Assisted-by: Claude
Signed-off-by: Adam Cmiel <acmiel@redhat.com>
8ff93d8 to
376ecda
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The commands we execute may include shell control characters (most commonly whitespace). If we log the arguments separated by space, the log messages will look confusing and will not be copy-paste-able into a terminal.
Shell-quote the arguments that need quoting to make the log messages copy-paste-able. Use a similar approach as alessio/shellescape 1 or shlex 2 from the Python standard library.
Compared to those, use a slighly nicer escape style for single quotes. Our approach:
Their approach:
Assisted-by: Claude