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

Allow file level and shellcheckrc shell and severity directives #1554

Open
1 of 2 tasks
scop opened this issue Apr 22, 2019 · 2 comments
Open
1 of 2 tasks

Allow file level and shellcheckrc shell and severity directives #1554

scop opened this issue Apr 22, 2019 · 2 comments

Comments

@scop
Copy link
Contributor

scop commented Apr 22, 2019

For new checks and feature suggestions

Here's what I wanted or expected to see:

Would be good to be able to use file wide and shell and severity directives, like:

# shellcheck shell=bash severity=error"

...as well as in shellcheckrc:

shell=bash
severity=error
@viccuad
Copy link

viccuad commented Oct 25, 2019

I would be glad to have this too.

@mineo
Copy link

mineo commented Dec 5, 2019

shell works:

↪ ll -a                       
Permissions Size User    Date Modified Name
.rw-r--r--     8 wieland  5 Dez 22:10  foo.sh
↪ cat foo.sh       
echo $1
↪ shellcheck foo.sh 

In foo.sh line 1:
echo $1
^-- SC2148: Tips depend on target shell and yours is unknown. Add a shebang.
     ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
echo "$1"

For more information:
  https://www.shellcheck.net/wiki/SC2148 -- Tips depend on target shell and y...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
↪ echo 'shell=bash' > .shellcheckrc 
↪ shellcheck foo.sh

In foo.sh line 1:
echo $1
     ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
echo "$1"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...

severity does not, though:

↪ echo 'severity=error' >> .shellcheckrc
↪ shellcheck foo.sh

In foo.sh line 1:
echo $1
     ^-- SC2086: Double quote to prevent globbing and word splitting.

Did you mean: 
echo "$1"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
↪ shellcheck -S error foo.sh
↪

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

3 participants