Skip to content

How the Glob Pattern Filter Works

The tool uses glob patterns to include or exclude files and directories, working similarly to tools like tree or grep. Here’s a detailed explanation:

  • Include List (A): A set containing the glob patterns for files and directories you want to include.
  • Exclude List (B): A set containing the glob patterns for files and directories you want to exclude.
  • Universe (Ω): The set of all files and directories.

When you specify an --exclude list and/or an --include list, the following logic applies:

  1. No include list, no exclude list
    Include everything:

  2. No include list, with exclude list
    Include everything except what matches the exclude list:

  3. With include list, no exclude list
    Include only what matches the include list:

  4. With include list and exclude list
    Include what matches the include list and exclude what matches the exclude list. Handle the intersection based on the include_priority parameter:

    • Include priority == true:

    • Include priority != true*:

Let (A) and (B) overlap. Depending on the priority, the intersection is either included or excluded based on the include_priority parameter.

Visual Representation of Case 4