Open
Description
For bugs
- Rule Id (if any, e.g. SC1000):
- My shellcheck version (
shellcheck --version
or "online"): - 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
For new checks and feature suggestions
- https://www.shellcheck.net/ (i.e. the latest commit) currently gives no useful warnings about this
- I searched through https://github.com/koalaman/shellcheck/issues and didn't find anything related
Here's a snippet or screenshot that shows the problem:
main.sh
#!/bin/bash
# shellcheck source=./sourced.sh
source sourced.sh
echo "this comes after 'source sourced.sh'"
echo "the next line"
sourced.sh
return
Here's what shellcheck currently says:
> shellcheck -x main.sh
In main.sh line 4:
echo "this comes after 'source sourced.sh'"
^-- SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
In main.sh line 5:
echo "the next line"
^------------------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly).
For more information:
https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable...
All lines following source ...
are reported as unreachable.
Here's what I wanted or expected to see:
The highlighted commands are reachable and should not be flagged.
Metadata
Metadata
Assignees
Labels
No labels