For the complete documentation index, see llms.txt. This page is also available as Markdown.

Globbing

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.

Syntax

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

Precedence

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.

Last updated