Globbing

Learn how to use glob patterns in Vale.

Globarrow-up-right 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 in a path segment.

  • ? to match on one character in a path segment.

  • ** 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.

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/files

When 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.

Regex Hunspell