Globbing
Syntax
# Match all files except those with a `.md` or `.py` extension.
$ vale --glob='!**/*.{md,py}' path/to/filesPrecedence
Last updated
Learn how to use glob patterns in Vale.
Glob patterns are used for matching file paths in a filesystem. They are commonly employed in command-line tools, scripting languages, and libraries to specify sets of filenames or directories.
This guide will cover the basics of using glob patterns in Vale.
Vale supports the following glob syntax:
/ to separate path segments.
* to match zero or more characters, including /.
? to match one character other than /.
** to match zero or more directories.
[] to declare a range of characters to match.
{} to declare a set of patterns to match.
[!...] to negate a range of characters to match.
* isn't limited to a single path segment: docs/*.md matches docs/sub/nested.md as well as docs/page.md. Use ? where you need to stay within one segment.
Additionally, when using the --glob flag, you can use the ! prefix to negate the entire pattern:
# Match all files except those with a `.md` or `.py` extension.
$ vale --glob='!**/*.{md,py}' path/to/filesWhen evaluating glob patterns, the result of using the --glob flag is computed first, followed by any sections in the .vale.ini file.
For example, given the following .vale.ini:
And this directory structure:
We can then run Vale with the following command:
You’ll notice that the b.md file is not included in the output because the --glob flag takes precedence over the .vale.ini file.
Last updated
StylesPath = styles
[*.md]
BasedOnStyles = Testcases/test/
├── a.md
├── b
│ └── b.md
└── c.md$ vale --glob='!**/b/*' .
cases/test/c.md
8:37 warning Found 'Here'. Test.Test
cases/test/a.md
8:37 warning Found 'Here'. Test.Test