-
Notifications
You must be signed in to change notification settings - Fork 588
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
Fix shellcheck warnings #4574
Fix shellcheck warnings #4574
Conversation
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.
NAK, as written in here:
These changes produce a lot of noise, but the fixes are incomplete.
@kmk3, what do you mean with noise? I think their proposed changes are already an improvement over the current state, so the change makes sense in my opinion. And not fixing everything is in my opinion not a reason to not merge an improvement (especially as they gave a reason for leaving out some files like auto-generated files). |
I'm writing a better review; please ignore the previous one for now. |
Sorry for the delay. I made a few fixup commits and I'd like to propose them by pushing them to this @a1346054 Could you check the following option on the right?
|
That option has been checked since the start. I don't know why it is not working as it should. |
@a1346054 commented on Oct 13:
I was trying to push the wrong branch actually, my bad. Now it worked. So, the new commits contain my (and @rusty-snake's) suggestions. If you agree, you can squash them with something like: git checkout shellcheck-fix
git rebase -i --autosquash "$(git merge-base master HEAD)" Then, for the commit message of the main commit: Suggestion: Change it to the following:
It's taken from the first post, but adapted to be more in line with the This information helps understand the intent, as only some shell scripts are By the way, there are more shellcheck warnings on these files, but let's ignore |
Hello, any thoughts on the above suggestions? I can do the changes and rebasing if you want. |
I should be able to look at this some more in 2 days. |
I looked it over and all the suggested changes are fine. It's optional and possibly just a matter of taste whether the extra quotes are added or not, I don't have any hard feelings about it. Feel free to reword the commit message and merge, I am away from the computer that has the required gpg key to make the change myself. |
I'll say that I was surprised when I noticed that shellcheck doesn't warn about Misc: If anyone knows of a good explanation of why assignments behave
Very well, I'll do the changes then. |
Note: This does not modify the configure script, which is a source of a lot of the remaining shellcheck warnings, because it comes from autoconf and so it makes little sense to try to fix it here. Also, it does not modify the scripts in contrib, because they possibly are maintained at some other place. Similarly with the other scripts that don't appear to be called from any of the makefiles.
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.
LGTM.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01 says "Each variable assignment shall be expanded for tilde expansion, parameter expansion, command substitution, arithmetic expansion, and quote removal prior to assigning the value." So field splitting is not done. |
Thanks a lot! |
Split from #4497 for further discussion.
I did not modify the configure script, which is a source of a lot of the remaining shellcheck warnings, because it comes from autoconf and so it makes little sense to try to fix it here.
I also did not modify the scripts in contrib, because they possibly are maintained at some other place. Similarly with the other scripts that don't appear to be called from any of the makefiles.