-
Notifications
You must be signed in to change notification settings - Fork 160
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
shellcheck.yml: add new tests using shellcheck #492
base: master
Are you sure you want to change the base?
Conversation
Woah. Thanks! Can you also add the actual commits that fix the shellcheck errors? :) |
Yes, but that is a bit more work and will take some time. |
No pressure! Many thanks. |
6d0ab82
to
42f8805
Compare
Thanks for your effort. Please clear the draft flag once it is ready for review. |
e06f247
to
2ed8552
Compare
Done! CI is green again. 90% of this was just missing quotes. Other common issues were:
There were some more complex issues which I marked as todo for later in a comment. Specifically a couple of cases where There were also two obvious typos which got flagged as a variable unused warning. |
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.
Now that this is working, can we split up the huge dkms.in commit into a few smaller ones? While reading, the following categories came into my mind:
bugfix: misspelled variable names
bugfix: cd $dest || exit $some-unused-error-code
see the list at the beginning, add it there, in order to clean up error code usage some day I don't want to add even more uses of the heavily overloaded ones
reindent - there is at least one big hunk being reindented, please do this separately (git diff -w should be empty on such a change) without any other changes hidden in it
the complex change w.r.t. parameter passing for safe_source() including the changes f
for list splitting, including all the (transitive) calls
(If I got it right, this is the only change where multiple lines at different places need to change together, while all other changes only affect that single line
missing quoting for scalars
array vs scalar misuse
shellcheck ignore without todo
shellcheck ignore with todo
removal of unused variables
lets see what is left over ;-)
what does shellcheck think about [[ $var ]]
vs. [[ -n "$var" ]]
? I'd prefer the first, but currently both are used inconsistently.
While cleaning that up, would it be helpful if |
Technically this would be better indeed, but since we know that none of these variables contain whitespaces we can safely split the string into an array in the sourcing function. I am not sure if changing this now could have unintended side effects, so I'd rather not do it now and focus instead purely on introducing the new check and making it (mostly) happy with the current code without changing it too much. |
2ed8552
to
12988c8
Compare
I think we can wait until this pull request is finished and make a new release, we have already a few fixes worth releasing. |
Also, personal experience so far, unfortunately nobody tests or gives any feedback until code is tagged in a release. When people see a new release and start updating it's where you start getting feedback. So no candiates/betas etc. |
I propose to add this new github action using shellcheck, it should hopefully avoid issues such as [1] occurring in a release. [1]: dell#488 Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
479f682
to
3a2a43b
Compare
Signed-off-by: Nowa Ammerlaan <[email protected]>
3a2a43b
to
a46f977
Compare
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
Signed-off-by: Nowa Ammerlaan <[email protected]>
a46f977
to
b34537e
Compare
Done!
AFAIK it doesn't complain about either. |
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.
Thanks for splitting it up. Improves readability of the changes a lot.
Nothing obvious that I've spotted, will give it some testing in my module test setup soon.
Let's get this in, as it will change the base for other pending changes.
I propose to add this new github action using shellcheck, it should hopefully avoid issues such as #488 occurring in a release.
Note this will cause the CI to fail until all existing issues are either fixed or ignored.