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

disable shellcheck for files with no extension? #187

Open
apolopena opened this issue Apr 5, 2021 · 7 comments
Open

disable shellcheck for files with no extension? #187

apolopena opened this issue Apr 5, 2021 · 7 comments

Comments

@apolopena
Copy link

Is this even possible?

@felipecrs
Copy link
Collaborator

It's probably doable through

image

@felipecrs
Copy link
Collaborator

felipecrs commented Apr 5, 2021

According to this answer, something like the following should work:

"shellcheck.ignorePatterns": {
  "[!.]": true,
  "[!.][!.]": true,
  "[!.][!.][!.]": true,
  "[!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true
}

@apolopena
Copy link
Author

Make sense. I had this type of glob hack in my vscode settings for another purpose.
I have all my scripts I need to run shellcheck on in a hidden folder so I wont be able to use this.

I decided to use shellcheck from the command line with an inclusive approach, offloading to find the responsibility of what files to run. So like this:

alias lint-starter-scripts='find "$(pwd)/.gp" -type d \( -name node_modules -o -name vendor \) -prune -false -o -name "*.sh" -exec shellcheck -x -P "$(pwd)/.gp" {} \;'

@felipecrs
Copy link
Collaborator

Got it. I'll think about it and if this could be solved in another way. The best thing would be VS Code's globbing to support such scenarios.

@felipecrs
Copy link
Collaborator

PS: I could not think of anything yet.

@s3rgeym
Copy link

s3rgeym commented Aug 4, 2023

According to this answer, something like the following should work:

"shellcheck.ignorePatterns": {
  "[!.]": true,
  "[!.][!.]": true,
  "[!.][!.][!.]": true,
  "[!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true,
  "[!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.][!.]": true
}

просто охуеть! no comments

@felipecrs
Copy link
Collaborator

I believe this is a limitation of vscode's glob parser, not the extension's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants