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

shellcheck: disable "unreachable command" check [SC2317] #15089

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

robn
Copy link
Member

@robn robn commented Jul 21, 2023

Motivation and Context

make shellcheck fails with shellcheck 0.9.0 (standard in Debian 12).

cmd/zed/zed.d/history_event-zfs-list-cacher.sh:25:3: note: Command appears to be unreachable. Check usage (or ignore if invoked indirectly). [SC2317]
cmd/zed/zed.d/history_event-zfs-list-cacher.sh:26:3: note: Command appears to be unreachable. Check usage (or ignore if invoked indirectly). [SC2317]

Description

This new check in 0.9.0 appears to have some issues with various forms of "early return", like trap, exit and return. This is tripping up (at least):

  • cmd/zed/zed.d/history_event-zfs-list-cacher.sh
  • etc/zfs/zfs-functions

Its not obvious what its complaining about or what the remedy is, so it seems sensible to disable this check for now.

See also:

How Has This Been Tested?

Just make shellcheck before and after.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

This new check in 0.9.0 appears to have some issues with various forms
of "early return", like trap, exit and return. This is tripping up (at
least):

  cmd/zed/zed.d/history_event-zfs-list-cacher.sh
  /etc/zfs/zfs-functions

Its not obvious what its complaining about or what the remedy is, so it
seems sensible to disable this check for now.

See also:

  https://www.shellcheck.net/wiki/SC2317
  koalaman/shellcheck#2542
  koalaman/shellcheck#2613

Signed-off-by: Rob Norris <[email protected]>
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jul 21, 2023
@behlendorf behlendorf merged commit 13ec73a into openzfs:master Jul 21, 2023
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jul 21, 2023
This new check in 0.9.0 appears to have some issues with various forms
of "early return", like trap, exit and return. This is tripping up (at
least):

  cmd/zed/zed.d/history_event-zfs-list-cacher.sh
  /etc/zfs/zfs-functions

Its not obvious what its complaining about or what the remedy is, so it
seems sensible to disable this check for now.

See also:

  https://www.shellcheck.net/wiki/SC2317
  koalaman/shellcheck#2542
  koalaman/shellcheck#2613

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#15089
behlendorf pushed a commit that referenced this pull request Jul 21, 2023
This new check in 0.9.0 appears to have some issues with various forms
of "early return", like trap, exit and return. This is tripping up (at
least):

  cmd/zed/zed.d/history_event-zfs-list-cacher.sh
  /etc/zfs/zfs-functions

Its not obvious what its complaining about or what the remedy is, so it
seems sensible to disable this check for now.

See also:

  https://www.shellcheck.net/wiki/SC2317
  koalaman/shellcheck#2542
  koalaman/shellcheck#2613

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #15089
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
This new check in 0.9.0 appears to have some issues with various forms
of "early return", like trap, exit and return. This is tripping up (at
least):

  cmd/zed/zed.d/history_event-zfs-list-cacher.sh
  /etc/zfs/zfs-functions

Its not obvious what its complaining about or what the remedy is, so it
seems sensible to disable this check for now.

See also:

  https://www.shellcheck.net/wiki/SC2317
  koalaman/shellcheck#2542
  koalaman/shellcheck#2613

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#15089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants