Skip to content

glob crosses directory boundaries #383

@jamesadevine

Description

@jamesadevine

scripts/gate-eval.py:

regex = _re.escape(pattern).replace(r"*", ".").replace(r"?", ".")
Because Python .
matches /, src/.rs matches src/compile/filter_ir.rs as well as src/lib.rs. The PR documents this explicitly (" any chars"), but the fixture src/**/*.rs strongly implies users expect standard glob semantics where * doesn't cross /. The ** is redundant here since * already matches everything.

Consider warning at compile time when a pattern contains * followed by / or ** (since both behave identically), or adopt Python's fnmatch.fnmatch which matches the full path string but documents * the same way. Either way, updating the front-matter docs to include a concrete cross-directory example would prevent confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions