Skip to content
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

ci: fix shellcheck warning SC2319 #2501

Closed
wants to merge 1 commit into from
Closed

Conversation

Henrik66
Copy link
Contributor

@Henrik66 Henrik66 commented Aug 24, 2023

fix shellcheck warning SC2319

@github-actions github-actions bot added github Issues related to .github modules Issue tracker for all modules livenet Issues related to the livenet module iscsi Issues related to the iscsi module labels Aug 24, 2023
Copy link
Collaborator

@LaszloGombos LaszloGombos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

.shellcheckrc Outdated

# SC2317: Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
# https://github.com/koalaman/shellcheck/wiki/SC2317
disable=SC2317
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be helpful... what is the reason to disable this?

Copy link
Collaborator

@LaszloGombos LaszloGombos Aug 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To resolve this we need to change 200+ lines of code as mentioned in #2272 (comment) .

I think this should be done as a follow-up PR (and likely will take a long time to resolve).

.shellcheckrc Outdated

# SC2086: Double quote to prevent globbing and word splitting.
# https://github.com/koalaman/shellcheck/wiki/SC2086
disable=SC2086
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see why would you want not to quote "$@". I'd rather solve this on case-by-case basis, as globally disabling this might lead to possibly faulty code.

Copy link
Collaborator

@LaszloGombos LaszloGombos Aug 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather solve this on case-by-case basis,

I do not see why this PR would stop you to help with this work and upload follow-up PRs that resolve this.

I do see that not having this PR land would enable us to introduce even more of this kind of problems as the current action-sh-schecker v0.6 does not report these.

@@ -229,7 +229,8 @@ handle_netroot() {
echo "$target"
done
})
[ -z "$targets" ] && warn "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && return 1
ret=$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be also declared as local.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that trigger https://github.com/koalaman/shellcheck/wiki/SC3043 (it it would not be in shellcheckrc) ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, you're right. I didn't know this file is supposed to be POSIX (and that posix doesn't know local). Prefixing it makes sense as well.

.shellcheckrc Outdated

# SC2004: $/${} is unnecessary on arithmetic variables.
# https://github.com/koalaman/shellcheck/wiki/SC2004
disable=SC2004
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one (SC2004 ) seems completely reasonable to me; why would you disable this?

@LaszloGombos
Copy link
Collaborator

LaszloGombos commented Aug 26, 2023

@pvalena Thanks for the the reviews.

You seem to indicate that this PR can only be landed by making massive changes all in one PR. Massive PRs like that do not get reviews for months. We can all point to a few PRs that are good but too big to review.

what is the reason to disable this?

So that we can incrementally improve the code in reviewable increments. Making progress on this is blocked for about half year - see #2272 . At least this PR allows us to make progress and understand our current issues.

@jamacku jamacku mentioned this pull request Oct 3, 2023
3 tasks
@stale
Copy link

stale bot commented Oct 15, 2023

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Oct 15, 2023
@stale stale bot removed the stale communication is stuck label Nov 1, 2023
@Henrik66 Henrik66 changed the title ci: switch to action-sh-checker v0.7.0 ci: fix shellcheck warning SC2319 Nov 1, 2023
@Henrik66
Copy link
Contributor Author

Henrik66 commented Nov 1, 2023

Given the help from #2530 I removed the changes related to shellcheck version changes and just kept the code changes regarding SC2319 . Thanks @pvalena for your help with the reviews.

@github-actions github-actions bot removed the github Issues related to .github label Nov 1, 2023
@LaszloGombos LaszloGombos added this to the dracut-061 milestone Nov 1, 2023
@aafeijoo-suse aafeijoo-suse removed this from the dracut-061 milestone Nov 18, 2023
@Henrik66 Henrik66 closed this Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iscsi Issues related to the iscsi module livenet Issues related to the livenet module modules Issue tracker for all modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants