-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Consider enabling --external-sources
by default
#883
Comments
Add |
@felipecrs |
I see, so your point is to have My opinion is: this should be discussed in ShellCheck. The VS Code extension should follow the CLI behavior as closely as possible, so that they return similar results. Therefore, if you someday run shellcheck from CLI for whatever reason (like automated linting in your CI), you will receive the same error and you need to act on it (create the |
Thank you very much for your reply!
Exactly, that was my intention.
You've made a very valid point! However, I'm not so sure whether ShellCheck is interested in enabling this option by default... But I'm going to give that a shot 😃 I'd still like to emphasize that I think the context of this extension is usually a bit different than with the native command. |
Please do open the discussion there. I agree with you that this should be enabled by default, but on ShellCheck itself. About enabling here by default, @timonwong do you have any opinion about it? |
Will do 👍 |
PS: Bash IDE enables |
Okay, that's interesting 😃 |
--external-sources
by default
PS: If we enable it by default, we can probably add it to the default // .vscode/settings.json
{
"shellcheck.runArgs": []
} I believe the majority of the users would prefer this feature, and for the minority who doesn't, they can opt-out like above. This should give a better out of the box experience after all. Anyone interested to send a PR? Worst case: we revert. :) |
According to ShellCheck Wiki for SC1091 we should be able to use |
I would argue that in VScode, in a project with more than one dev, we should not use |
I was talking about having the shellcheckrc file in your git repository. Are you talking about the same thing? I suspect you are talking about having a shellcheckrc file in your home folder, which is certainly not what I recommend. |
It should work the same as the CLI. Just be aware of how cwd works in the vscode extension, which you can change through the extension settings. |
Fun fact, since husky v9 this is no longer applicable:
|
The popular husky package for Node.js generates scripts that start like this:
The vscode-shellcheck extension complains about the second line:
(The warning is emitted whether or not I enable the "Shellcheck: Use Workspace Root As Cwd" setting.)
I raised this issue with the husky folks (typicode/husky#1226) to see if there might be a better way to write the script, and they suggested that it might be better for vscode-shellcheck to change its behavior instead, by flipping on Shellcheck's
--external-sources
flag.Thoughts?
The text was updated successfully, but these errors were encountered: