Closed
Description
For bugs
- Rule Id (if any, e.g. SC1000): SC2015
- My shellcheck version (
shellcheck --version
or "online"): 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
Here's a snippet or screenshot that shows the problem:
#!/bin/sh
set -e
foo && bar || true
Here's what shellcheck currently says:
foo && bar || true
^-- [SC2015](https://www.shellcheck.net/wiki/SC2015) (info): Note that A && B || C is not if-then-else. C may run when A is true.
Here's what I wanted or expected to see:
Nothing, the || true
is used to ignore return codes so even if it get executed when A is true it doesn't matter.
Metadata
Metadata
Assignees
Labels
No labels