Glob Reference
Glob Reference
Section titled “Glob Reference”Globs define file patterns for filtering.
Syntax
Section titled “Syntax”glob(include, exclude)Pattern Characters
Section titled “Pattern Characters”| Pattern | Matches |
|---|---|
* | Any characters except / |
** | Any characters including / |
? | Single character |
[abc] | Character class |
[!abc] | Negated character class |
Examples
Section titled “Examples”Include Only
Section titled “Include Only”glob(["src/**", "docs/**"])Include and Exclude
Section titled “Include and Exclude”glob( include = ["**"], exclude = ["**/internal/**"],)By Extension
Section titled “By Extension”glob(["**/*.py", "**/*.pyi"])By Directory
Section titled “By Directory”glob(["src/**"])glob(["src/*"]) # One level onlyExclude Multiple
Section titled “Exclude Multiple”glob( include = ["**"], exclude = [ "**/test/**", "**/*_test.go", "**/testdata/**", ],)Usage Contexts
Section titled “Usage Contexts”origin_files
Section titled “origin_files”origin_files = glob(["src/**"])destination_files
Section titled “destination_files”destination_files = glob( include = ["**"], exclude = ["README.md"],)Transformation paths
Section titled “Transformation paths”core.replace( before = "old", after = "new", paths = glob(["**/*.md"]),)core.remove
Section titled “core.remove”core.remove(glob(["**/*.bak"]))