shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

SC2164

Open zefir-git opened this issue 8 months ago • 2 comments

For bugs

  • Rule Id (if any, e.g. SC1000): SC2164
  • My shellcheck version (shellcheck --version or "online"): online
  • [X] 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/zsh
function foo() {
    cd generated_files
    return $?
}

Here's what shellcheck currently says:

SC2164: suggested cd generated_files || exit

Here's what I wanted or expected to see:

No suggestion. The function returns on the next line anyways.

zefir-git avatar Jun 17 '24 13:06 zefir-git