shellcheck
shellcheck copied to clipboard
SC2148, direnv and .envrc
Shellcheck fails with error SC2148 on .envrc files (missing shebang).
However, .envrc-files are https://github.com/direnv/direnv files, and according to the documentation these are always passed through bash (https://github.com/direnv/direnv?tab=readme-ov-file#how-it-works). It seems like shellcheck should always parse these files as bash, instead of having users add a shebang line only for the sake of shellcheck.
Example .envrc:
if has nix; then
use flake .
fi
I'm fine with trying to write a patch to fix this, but I would like some input on whether others also consider this a bug.