-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
New directive to ignore file #1996
Comments
Good idea! I agree that this would be useful, especially for dealing with lots of pre-existing/legacy files in a project. For my part, I like the following syntax, with just #!/usr/bin/env bash
# shellcheck disable=*
echo "This whole file will be ignored." Speaking of that, maybe the ability to similarly ignore all checks for a single line? #!/usr/bin/env bash
# shellcheck disable=* # Ignore the following line completely.
echo "Line with lots of errors." Wishful thinking...Related to this, perhaps the ability to ignore entire files by adding them to a Just some ideas. But anyway, I'm really glad I found shellcheck – it has helped me to improve my scripts dramatically! |
Having a In my case, I have a project that vendors external projects that have shell scripts that trigger |
In 0.7.2 you can specify a range, e.g. @docwhat Since ShellCheck currently only processes explicitly listed files without trying to discover them itself, this may already be supported by whichever tool you have that runs ShellCheck (there's currently no way to run |
For bugs
For new checks and feature suggestions
Here's what I wanted or expected to see:
I think it would be useful to have a new directive to ignore the whole file or part of it.
Or at least a flag when running shellcheck.
I'd see useful when you want to perform the check on *.sh but excluding some files
A workaround is:
shellcheck --external-sources --source-path=SCRIPTDIR --exclude=SC1072,SC1073 installation/scripts/*.sh
and setting a wrong disable directive:
The text was updated successfully, but these errors were encountered: