Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Unable to specify complex path patterns for matching file/directory #985

Open
ssbarnea opened this issue Jan 4, 2018 · 3 comments
Open

Comments

@ssbarnea
Copy link

ssbarnea commented Jan 4, 2018

Prerequisites

Description

As a power user I expect to be able to specify complex patterns for matching file/directories in Atom.

Steps to Reproduce

I tried foo/**/bar/** and foo/.*/bar/.* and I realised that none of them work.

Expected behavior:

Be able to respect the java style globing pattern which allows the first example. Have it documented in the sample text so user will learn how to use without having to read the documentation.

Actual behavior:
Anything after ** is ignored so more files are found than expected.

Reproduces how often:
Always

Versions

Atom    : 1.23.1
Electron: 1.6.15
Chrome  : 56.0.2924.87
Node    : 7.4.0
apm  1.18.11
npm  3.10.10
node 6.9.5 x64
atom 1.23.1
python 2.7.14
git 2.15.0

Additional Information

I do not have a strong preference upon the syntax being supported, which ever is easier to implement but the default example text should contain an example that explains it.

@winstliu
Copy link
Contributor

winstliu commented Jan 4, 2018

We use minimatch for glob matching. I am unaware if minimatch offers what you are looking for.

@y-a-v-a
Copy link

y-a-v-a commented Jan 18, 2018

Had the same question. This might be of some help:

minimatch('basedir/projectcore/test/script.js', 'basedir/project+(core|)/**/*.js'); // true
minimatch('basedir/projectcore/test/script.js', '**/project+(core|)/**/*.js'); // true
minimatch('basedir/projectcore/test/script.js', '**/project*/**/*.js'); // true
minimatch('basedir/project/test/script.js', 'basedir/project+(core|)/**/*.js'); // true

// globstar not allowed in combination with string
minimatch('basedir/projectcore/test/script.js', '**/project*/**.js'); // false
minimatch('basedir/projectcore/test/script.js', '**/projectcore/**.js'); // false

@jrial
Copy link

jrial commented Aug 7, 2018

This probably explains: isaacs/minimatch#67

Seems it won't be fixed, unless someone comes up with a good PR. It looks like yarn has moved to micromatch for this specific reason: yarnpkg/yarn#3339 - although what other issues that might introduce I have no clue about.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants