question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Respect directives in `.shellcheckrc`

See original GitHub issue

In my project I have a .shellcheckrc next to my .sh files, as defined in https://github.com/koalaman/shellcheck/wiki/Ignore

This .shellcheckrc looks like this:

disable=2086
disable=3006
disable=3010
disable=3018
disable=3043

This means that shellcheck (the cli command) will ignore those codes in any of the files in that directory or below.

However, the VSCode extension only respects the directives in the files themselves. I would hope that the VS Code extension can read the .shellcheckrc file and follow the directives therein, otherwise there is a disconnect between what successfully builds in my project and what files VS Code shows as “green”.

Also funny enough, this extension also “shellchecks” the .shellcheckrc file even though the .shellcheckrc file format is not shell syntax or shell related. I think it would make sense (since this type of file is specific to shellcheck) to have it excluded from checking by default?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
AaronHarriscommented, Oct 7, 2021

Makes sense, thank you for the quick reply. I’ll give it a bash (no pun intended).

On Thu, Oct 7, 2021, 7:25 AM Felipe Santos @.***> wrote:

And the reason why you .shellcheckrc is treated as a Shell Script is due to VS Code trying to infer its language based on its contents.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vscode-shellcheck/vscode-shellcheck/issues/350#issuecomment-937790302, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMASRESK7ETZTXPROG2RFLUFWNTDANCNFSM5FQ3LZ3A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

0reactions
github-actions[bot]commented, Oct 20, 2021

🎉 This issue has been resolved in version 0.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying external-sources directive in .shellcheckrc file #1818
It would be nice to able to add a directive analogous to the --external-sources / -x flag in a .shellcheckrc file.
Read more >
ShellCheck directives
Shellcheck directives allow you to control how shellcheck works, ... or entries in a .shellcheckrc in the project root or user's home directory:...
Read more >
Homebrew 3.6.15 Download for Mac / Change Log / FileHorse ...
install: respect pins when auto-upgrading - Fix typo in docs/Manpage.md ... .shellcheckrc: disable unneeded check SC2310-SC2312 globally
Read more >
Homebrew 3.4.0 Mac軟體下載Download
install: respect pins when auto-upgrading - Fix typo in docs/Manpage.md ... .shellcheckrc: disable unneeded check SC2310-SC2312 globally
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found