jbockle / format-files

VS Code extension to format all files in workspace
41 stars 13 forks source link

How to ignore a folder name on any folder level? #43

Closed Spenhouet closed 2 years ago

Spenhouet commented 2 years ago

With python I have a __pycache__ folder on most folder levels and I would like to ignore all of them.

I tried:

"formatFiles.excludedFolders": [
        ".vscode",
        ".git",
        ".mypy_cache",
        "__pycache__"
    ],

but this does not work. I tried adding wildcards, but no luck either. Also tried the same with the excludePattern option.

jbockle commented 2 years ago

if you use excludePattern, you can specify glob patterns to skip specific folders at any depth

e.g. to exclude all .vscode and .git try "excludePattern": "**/.vscode/**/*,**/.git/**/*"

Spenhouet commented 2 years ago

Thanks, this worked. I tried the wrong syntax for the wildcard (regex syntax).