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

SC2329 should be transitive #3054

Closed
2 tasks done
ensc opened this issue Sep 6, 2024 · 3 comments
Closed
2 tasks done

SC2329 should be transitive #3054

ensc opened this issue Sep 6, 2024 · 3 comments

Comments

@ensc
Copy link

ensc commented Sep 6, 2024

For bugs

  • Rule id SC2329
  • My shellcheck version (shellcheck --version or "online"): online; 0.9.0 shows similar results but for SC2317
  • The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)
  • I tried on https://www.shellcheck.net/ and verified that this is still a problem on the latest commit

Here's a snippet or screenshot that shows the problem:

#! /bin/bash

note() {
    echo "$*"
}

# shellcheck disable=SC2317,SC2329
tool_a() {
    note a
}

# shellcheck disable=SC2317,SC2329
tool_b() {
    echo b
}

RC=0

for i in a b; do
    tool_"$i" || RC=1
done

exit $RC

Here's what shellcheck currently says:

[Line 3:](javascript:setPosition(3, 1))
note() {
^-- [SC2329](https://www.shellcheck.net/wiki/SC2329) (info): This function is never invoked. Check usage (or ignored if invoked indirectly).

Here's what I wanted or expected to see:

no warnings;

SC2329 should not be triggered for functions which are called by functions with disabled SC2329 check

@wileyhy
Copy link

wileyhy commented Sep 6, 2024 via email

@ensc
Copy link
Author

ensc commented Sep 6, 2024

Hm. I get a different result on a Fedora 40 local vm instance: SC2317 on line 4

SC2329 seems to have been splitted off from SC2317 in recent versions (used on http://spellcheck.net, but not (yet) by Fedora 40)

@koalaman
Copy link
Owner

This should be working as described on the latest git commit, and also on shellcheck.net (which may not have been published when this issue was filed).

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

No branches or pull requests

3 participants