shellcheck icon indicating copy to clipboard operation
shellcheck copied to clipboard

Stuck in a loop

Open grahamc opened this issue 9 months ago • 3 comments

I have a file called build-dry.sh, and it looks like this:

source common.sh

export NIX_TESTS_CA_BY_DEFAULT=1

cd .. && source build-dry.sh

When I run shellcheck on it, it blocks forever. I believe it is recursively checking itself? Is there a way to ask it to not follow that source?

grahamc avatar Apr 06 '25 20:04 grahamc

...I worked around it like this:

# shellcheck disable=SC1091 source=/..
cd .. && source build-dry.sh

grahamc avatar Apr 06 '25 20:04 grahamc

I'm unable to reproduce this as described with shellcheck -x build-dry.sh. Which version are you using?

koalaman avatar Apr 06 '25 22:04 koalaman

hmmm.... v0.10.0. It is on https://github.com/DeterminateSystems/nix-src/blob/852075ec9d44f41083b8a6c107cc69335864e223/tests/functional/ca/build-dry.sh this file specifically:

Grahams-MacBook-Pro:nix-src grahamc$ shellcheck tests/functional/ca/build-dry.sh
<stalls forever at 100% cpu>

grahamc avatar Apr 07 '25 00:04 grahamc