Skip to content

fix(live): Run shellcheck in CI to find errors in the scripts#2069

Merged
lslezak merged 4 commits intomasterfrom
live_shellcheck
Feb 25, 2025
Merged

fix(live): Run shellcheck in CI to find errors in the scripts#2069
lslezak merged 4 commits intomasterfrom
live_shellcheck

Conversation

@lslezak
Copy link
Contributor

@lslezak lslezak commented Feb 25, 2025

Problem

Solution

  • Run shellcheck in the CI and fail if any error is reported
  • Because shellcheck reports lots of warning and some of them are false positives let's run it in two stages:
    • The first run checks only for errors, if an error is found then the CI fails
    • If no error is found it runs it in full mode with warnings enabled. But in this case the CI always passes.
  • Later we should fix the warnings and silence the false positives and make the check to fail also with warnings.

Testing

# FIXME: remove when the module is included in the default driver list in
# in /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh, see
# https://github.com/openSUSE/dracut/blob/7559201e7480a65b0da050263d96a1cd8f15f50d/modules.d/90kernel-modules/module-setup.sh#L42-L46
if [ -f /lib/modules/*/kernel/drivers/usb/host/xhci-pci-renesas.ko* ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See https://www.shellcheck.net/wiki/SC2144 for more details about the problem.

@lslezak lslezak merged commit 086bb9a into master Feb 25, 2025
6 checks passed
Copy link
Contributor

@teclator teclator left a comment

Choose a reason for hiding this comment

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

LGTM

@lslezak lslezak deleted the live_shellcheck branch February 25, 2025 09:05
@imobachgs imobachgs mentioned this pull request Feb 26, 2025
imobachgs added a commit that referenced this pull request Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants