You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recommended "fix" in the suggested warning message is bad from a correctness perspective.
If the other file is installed as part of the same package (or a prerequisite package) as the main file, such a suggestion would be misleading and worse than useless. In those cases, if the file is missing, it's a fatal error, not something that should be ignored.
If this were to be implemented, the default recommendation should be to abort with a fatal error if the other file is missing. The script writer can then decide whether it's appropriate for their case.
For new checks and feature suggestions
Here's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Nothing
Here's what I wanted or expected to see:
Warning: sourcing without check if file exists, please use: [ -e foo/bar.script ] && source foo/bar.script
The text was updated successfully, but these errors were encountered: