Skip to content
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

Leading slashes in source .. directives are ignored by shellcheck #2955

Open
1 task done
svengit opened this issue Mar 28, 2024 · 0 comments
Open
1 task done

Leading slashes in source .. directives are ignored by shellcheck #2955

svengit opened this issue Mar 28, 2024 · 0 comments

Comments

@svengit
Copy link

svengit commented Mar 28, 2024

  • Rule Id (if any, e.g. SC1000): SC1091
  • My shellcheck version (shellcheck --version or "online"): 0.8.0 and 0.10.0 tried
  • The rule's wiki page does not already cover this (e.g. https://shellcheck.net/wiki/SC2086)

Here's a snippet or screenshot that shows the problem:

2 files, first one:

#!/bin/bash
source /foo

another one called foo in the same directory.

Here's what shellcheck currently says:

nothing. It seems shellcheck strips away the leading / and uses the file in the current directory. In real life examples it's usally something like /usr/share/... and I do not want shellcheck to take files from $(pwd)/usr/share

Here's what I wanted or expected to see:

In some-script line 2:
source /foo
       ^--^ SC1091 (info): Not following: /foo: openBinaryFile: does not exist (No such file or directory)

For more information:
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /foo: openBinaryFi...
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