Skip to content

loadMintIgnore mis-parses directory patterns without a leading slash #1819

Description

@dumanoglu1

loadMintIgnore() handles directory patterns ending in /*, but it always removes the first character with slice(1, -2).

File evidence:

  • scripts/lib/docs-utils.js checks if (trimmed.endsWith('/*')).
  • That branch stores ignored.dirs.add(trimmed.slice(1, -2)), assuming the pattern starts with /.
  • The file-pattern branch immediately below supports both leading-slash and bare filenames, so a contributor can reasonably expect foo/* to work the same way as /foo/*.

For a slashless directory pattern such as draft-notes/*, the parser stores raft-notes, so the intended directory is not ignored and there is no warning.

Expected behavior: directory patterns should preserve the directory name whether they are written as /foo/* or foo/*.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions