base / base/docs

loadMintIgnore mis-parses directory patterns without a leading slash

Open Beginner friendly
#1,819 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
337
Forks
792
Avg merge
17h 23m
Merged PRs (30d)
49

Description

`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/*`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in scripts/lib/docs-utils.js at loadMintIgnore(), especially the directory-pattern branch that handles paths ending in /*. Check that both /foo/* and foo/* preserve the same directory name, then verify that a slashless pattern such as draft-notes/* is ignored without a warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.