0

I am using the shellcheck vscode extension and I would like shellcheck to ignore files everywhere that do not have a file extension. I have tried many different glob patterns and nothing works.

The closest I got was:

  "shellcheck.ignorePatterns": {
      "*[!(.)]/**": true
  }

But it really wasn't close.

Does anyone know the magic sauce?

apena
  • 2,091
  • 12
  • 19
  • 1
    I'm searching the web on terms like *glob file no extension*, and the results don't look promising. What if instead you had a first entry like `"*": true`, followed by `"*.*": false`? – Noah Apr 05 '21 at 22:49
  • 1
    @noah Thanks for the input. Alas `"*": true`, followed by `"*.*": false` does not work. I found a decent solution that takes the opposite approach (inclusive) and does not use globs. – apena Apr 05 '21 at 23:23

1 Answers1

0

It seems that an extensionless file cannot be globbed.

I ended up not using the vscode shellcheck extension and used an inclusive approach with shellcheck on the command line, offloading the task of what to include to find.

All my scripts that needed to be linted were .sh files so this worked:

find . -type d \( -name node_modules -o -name vendor -o -path /tmp \) -prune -false -o -name '*.sh' -exec shellcheck {} \;

I would have liked to keep the bash linting in vscode but I had to settle for the above solution due to the limitation of globs/vscode.

apena
  • 2,091
  • 12
  • 19