Comments (11)
The line does appear to be unreachable, but ShellCheck should probably still not warn about uninvoked functions.
from shellcheck.
I have tried v0.10.0 on Windows and I didn't get any "info".
from shellcheck.
So there 2 possibilities:
- The bug doesn't happen on Windows, or
- Dataflow Analysis is never active on Windows even when specifically asked.
from shellcheck.
Sorry, I had an rc file in my repository and didn't remember it.
Now with --norc
I get:
Version 0.8.0 => OK
Version 0.9.0 => issue
Version 0.10.0 => issue
from shellcheck.
@ale5000-git maybe you can clean up the original report here and retitle the issue to make it to the point?
or close and open new if that's preferred.
from shellcheck.
Unreachable functions now have a separate SC2329, and unreachable commands within them will no longer emit SC2317. This also fixes x=$(y)
getting two separate SC2317, one for the assignment and one for the command in the substitution. Thanks!
from shellcheck.
This bug only happens on https://www.shellcheck.net/ but not on the release.
Bug present at d80fdfa9e8e as well as the current HEAD (04a8624).
not sure what version "but not on the release." refers to, probably something before 0.10.0 as that falls between the two hashes above and both those show the same output locally.
from shellcheck.
Interesting.
Did you get other info lines? (maybe the severity setting is passed somewhere?).
from shellcheck.
Just noticed now that all infos refer to the unused function.
In my opinion there should be a separate SC code (with a more clear message) for the unused functions (and just one per function).
from shellcheck.
I am actually seeing Command appears to be unreachable.
for every line in a function that actually is called from later in the script. The lines that call the function are reachable, and shellcheck does not claim otherwise. I am running v0.10.0.
from shellcheck.
@stevecj
Yours is a separate issue, also you need to post an example otherwise he cannot know why it happens.
from shellcheck.
Related Issues (20)
- SC1090 does not recognize `~` as a single expansion
- Option to specify shell iff shebang and in-file directives are missing
- SC2001 should not be recommended when shebang is /bin/ksh HOT 3
- RFC: Should SC2312 warn on testing pipelines? HOT 1
- FR: SC2086: Annotate a variable definition not meat to be quoted
- 1
- ShellCheck not available on DNF? HOT 1
- rule for double quote HOT 1
- "SC2004 (style): $/${} is unnecessary on arithmetic variables" is too strict HOT 3
- feature request: warn discarding exit code of `test`, `[`, and `[[` HOT 2
- False positive for SC1003 HOT 4
- SC2016 false positive with OpenShift client
- Don't warn about a function not invoked if the function is exported
- shell-test
- shellcheck-v0.10.0.linux.riscv64.tar.xz is actually gzipped, not xz'd HOT 1
- A large number of shells are collected. If you are interested, please contact my plane @VS889977
- /bin/dash detect error
- [QUESTION] is xargs also a solution to sc2089, sc2090? HOT 2
- [SC2312] triggers for return in a condition HOT 2
- SC2116 (Useless echo?) and SC2046 (prevent word splitting) should not apply if in case of SC2327 (command substitution will be empty). HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shellcheck.