Skip to content

SC2148, direnv and .envrc #3204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
adamtulinius opened this issue May 7, 2025 · 0 comments
Open

SC2148, direnv and .envrc #3204

adamtulinius opened this issue May 7, 2025 · 0 comments

Comments

@adamtulinius
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant