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

v0.10.0 miscategorizes uncalled function as unreachable code #3137

Open
1 of 4 tasks
matthewpersico opened this issue Feb 4, 2025 · 2 comments
Open
1 of 4 tasks

v0.10.0 miscategorizes uncalled function as unreachable code #3137

matthewpersico opened this issue Feb 4, 2025 · 2 comments

Comments

@matthewpersico
Copy link

matthewpersico commented Feb 4, 2025

For bugs

  • Rule Id (if any, e.g. SC1000): SC2329
  • My shellcheck version (shellcheck --version or 'online'): online
  • I tried on shellcheck.net and verified that this is still a problem on the latest commit
  • It's not reproducible on shellcheck.net, but I think that's because it's an OS, configuration or encoding issue

For new checks and feature suggestions

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

#!/bin/bash

main()
{
        echo I am in main
}

subber ()
{
        echo I am in subber
}

main
exit

Here's what shellcheck (https://github.com/koalaman/shellcheck/releases/tag/v0.10.0) currently says:

In /home/mpersico5/sctest line 10:
        echo I am in subber
        ^-----------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).

Here's what I wanted or expected to see:

Line 8	SC2329: This function is never invoked. Check usage (or ignored if invoked indirectly).

Can we get a new release v0.11.0?

@brother
Copy link
Collaborator

brother commented Feb 6, 2025

I am not sure what the issue really is apart from no recent release. Or that might be the only issue here?

The expected output is seen at shellcheck.net and that system uses the most recent git HEAD - and a new release would then match the expected behavior.

A workaround until a release is available would be to build from source.

I think this issue should be closed.

@matthewpersico
Copy link
Author

I am not sure what the issue really is apart from no recent release. Or that might be the only issue here?

Yes - can you cut 0.11.0? I'm about to approve a PR to our repo that applies all of your updates as a bazillion [sic] patches. Prefer to grab 0.11.0.

And my apologies for the duplicated issues; not sure how I managed that.

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

2 participants