micromatch / micromatch/picomatch

Implementation of basename and matchBase options to not match documentation

Open
#89 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.3k
Forks
135
Avg merge
23h 38m
Merged PRs (30d)
7

Description

The basename option description reads, with my emphasis:

If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123.

This description appears to be copied from minimatch, however the behavior does not match this description. Enabling the option causes patterns with slashes to also be handled in the same manner as those without slashes.

I've captured the issue with working example here: https://github.com/pskfyi/picomatch-basename-issue

I discovered this when trying to migrate from minimatch to picomatch, and it is inhibiting my ability to migrate cleanly. It seems to me that the docs are wrong, or this is a bug from your perspective, or I am missing something. If this is indeed a bug I'm willing to take a whack at submitting a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the behavior in the linked picomatch-basename-issue example. Compare basename matching for patterns with and without slashes against the quoted description and the minimatch reference. Done means resolving whether the implementation or documentation is incorrect and making picomatch behavior and its description agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.