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

Feature request: disable directives in fles #2951

Open
2 tasks done
TiZ-HugLife opened this issue Mar 21, 2024 · 1 comment
Open
2 tasks done

Feature request: disable directives in fles #2951

TiZ-HugLife opened this issue Mar 21, 2024 · 1 comment

Comments

@TiZ-HugLife
Copy link

For new checks and feature suggestions

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

shellcheck --help

Here's what shellcheck currently says:

No option to ignore directives in files.

Here's what I wanted or expected to see:

There should be an option to ignore directives in files, or at the very least, specify directives that should not be allowed in files.

The rationale here is that KDE recently had a huge problem with a global theme that nuked a user's home directory due to faulty code. KDE could possibly use Shellcheck for automated testing of such content, and that would be fine for faulty code, but then they'd still be vulnerable to people using directives irresponsibly, like if a scripter thinks that they know what they're doing when they really, really don't. This wouldn't protect against malicious actors, but I'm not sure there's really a good way to do that.

@ITler
Copy link

ITler commented Apr 19, 2024

I would like to share a use-case of why I see this feature being useful.

Imagine a script coder within an organization/company uses inline directives to ignore suggestions for convenience, which would lead to violating a style-guide or some compliance-motivated rules for writing scripts.
With the feature of ignoring directives in a file, a governed CI pipeline job could refer to a compliant shellcheck configuration and reliably fail on violations.

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

2 participants