From d4a6d419f8e3e69e88a1cf5da9999fcf4f79ee7d Mon Sep 17 00:00:00 2001 From: m-allanson Date: Wed, 15 Jul 2020 14:10:30 +0100 Subject: [PATCH 1/7] Add failing tests for globbing issues --- lib/__tests__/standalone-globs.test.js | 181 +++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 lib/__tests__/standalone-globs.test.js diff --git a/lib/__tests__/standalone-globs.test.js b/lib/__tests__/standalone-globs.test.js new file mode 100644 index 0000000000..c0a1d0fdb4 --- /dev/null +++ b/lib/__tests__/standalone-globs.test.js @@ -0,0 +1,181 @@ +'use strict'; + +/* eslint-disable node/no-extraneous-require */ + +const describe = require('@jest/globals').describe; +const expect = require('@jest/globals').expect; +const it = require('@jest/globals').it; + +/* eslint-enable */ + +const path = require('path'); +const replaceBackslashes = require('../testUtils/replaceBackslashes'); +const standalone = require('../standalone'); + +const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures', 'globs')); + +/** + * + +Failing tests for https://github.com/stylelint/stylelint/issues/4521 + +How to fix? + +use fast-glob.escapePath() ? https://github.com/mrmlnc/fast-glob#escapepathpattern + +try this: + +if hasMagic +escapePath +is escapedPath an exact file match? if yes, use it +otherwise, +fall back to globbing + +// see static vs dynamic paths https://github.com/mrmlnc/fast-glob#what-is-a-static-or-dynamic-pattern + + */ + +describe('standalone globbing', () => { + // https://github.com/stylelint/stylelint/issues/4193 + it('static path contains "got(brackets)"', async () => { + const cssPath = `${fixturesPath}/with(brackets)/styles.css`; + + const { results } = await standalone({ + files: cssPath, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); + + // https://github.com/stylelint/stylelint/issues/4193 + it('static path contains "got [many] (special) + !chars"', async () => { + const cssPath = `${fixturesPath}/with [many] (special) + !characters/styles.css`; + + const { results } = await standalone({ + files: cssPath, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); + + // https://github.com/stylelint/stylelint/issues/4211 + it('glob has no + character, matched path does', async () => { + const cssGlob = `${fixturesPath}/**/glob-plus.css`; // file is in dir 'glob+chars' + + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }); + }); + + // https://github.com/stylelint/stylelint/issues/4211 + it('glob contains + character, matched path does not', async () => { + const cssGlob = `${fixturesPath}/glob-contains-plus+/*.css`; // file is in dir 'glob+chars' + + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); + + // https://github.com/stylelint/stylelint/issues/3272 + // should ignore 'negated-globs/ignore/styles.css' + it('negated glob patterns', async () => { + const cssGlob = [ + `${fixturesPath}/negated-globs/**/*.css`, + `!${fixturesPath}/negated-globs/ignore/**/*.css`, + ]; + + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + // ensure that the only result is from the unignored file + expect(results[0].source).toEqual(expect.stringContaining('lint-this-file.css')); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); + + // https://github.com/stylelint/stylelint/issues/4855 + it('glob with special chars matches path with special chars', async () => { + const cssGlob = `${fixturesPath}/[glob-and-path]/sub-dir/*.css`; + + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); +}); From 36908d11642adf79dcb0a857d7b9818b91afb591 Mon Sep 17 00:00:00 2001 From: m-allanson Date: Wed, 15 Jul 2020 14:11:05 +0100 Subject: [PATCH 2/7] Add fixtures --- lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css | 1 + lib/__tests__/fixtures/globs/glob+chars/glob-plus.css | 1 + lib/__tests__/fixtures/globs/glob-contains-plus/styles.css | 1 + .../fixtures/globs/got [many] (special) + !chars/styles.css | 1 + lib/__tests__/fixtures/globs/got(brackets)/styles.css | 1 + .../fixtures/globs/negated-globs/ignore/ignore-this-file.css | 1 + lib/__tests__/fixtures/globs/negated-globs/lint-this-file.css | 1 + 7 files changed, 7 insertions(+) create mode 100644 lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css create mode 100644 lib/__tests__/fixtures/globs/glob+chars/glob-plus.css create mode 100644 lib/__tests__/fixtures/globs/glob-contains-plus/styles.css create mode 100644 lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css create mode 100644 lib/__tests__/fixtures/globs/got(brackets)/styles.css create mode 100644 lib/__tests__/fixtures/globs/negated-globs/ignore/ignore-this-file.css create mode 100644 lib/__tests__/fixtures/globs/negated-globs/lint-this-file.css diff --git a/lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css b/lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/glob+chars/glob-plus.css b/lib/__tests__/fixtures/globs/glob+chars/glob-plus.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/glob+chars/glob-plus.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/glob-contains-plus/styles.css b/lib/__tests__/fixtures/globs/glob-contains-plus/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/glob-contains-plus/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css b/lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/got(brackets)/styles.css b/lib/__tests__/fixtures/globs/got(brackets)/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/got(brackets)/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/negated-globs/ignore/ignore-this-file.css b/lib/__tests__/fixtures/globs/negated-globs/ignore/ignore-this-file.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/negated-globs/ignore/ignore-this-file.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/negated-globs/lint-this-file.css b/lib/__tests__/fixtures/globs/negated-globs/lint-this-file.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/negated-globs/lint-this-file.css @@ -0,0 +1 @@ +a {} From df33e3db1e7051fbc77f2fd8463c648ef2fe10a8 Mon Sep 17 00:00:00 2001 From: m-allanson Date: Thu, 16 Jul 2020 13:28:23 +0100 Subject: [PATCH 3/7] Escape glob-like paths that point to a single file --- lib/standalone.js | 15 +++++++++++++++ package.json | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/lib/standalone.js b/lib/standalone.js index 16d84aa9bb..e92d9c1946 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -4,6 +4,7 @@ const _ = require('lodash'); const createStylelint = require('./createStylelint'); const createStylelintResult = require('./createStylelintResult'); const debug = require('debug')('stylelint:standalone'); +const fastGlob = require('fast-glob'); const FileCache = require('./utils/FileCache'); const filterFilePaths = require('./utils/filterFilePaths'); const formatters = require('./formatters'); @@ -170,6 +171,20 @@ module.exports = function (options) { fileList = [fileList]; } + fileList = fileList.map((entry) => { + if (globby.hasMagic(entry)) { + const cwd = _.get(globbyOptions, 'cwd', process.cwd()); + const absolutePath = !path.isAbsolute(entry) ? path.join(cwd, entry) : path.normalize(entry); + + if (fs.existsSync(absolutePath)) { + // This glob-like path points to a file. Return an escaped path to avoid globbing + return fastGlob.escapePath(entry); + } + } + + return entry; + }); + if (!options.disableDefaultIgnores) { fileList = fileList.concat(ALWAYS_IGNORED_GLOBS.map((glob) => `!${glob}`)); } diff --git a/package.json b/package.json index 8283cc81d2..81e66a5ac4 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,11 @@ "cosmiconfig": "^7.0.0", "debug": "^4.1.1", "execall": "^2.0.0", +<<<<<<< HEAD "fastest-levenshtein": "^1.0.9", +======= + "fast-glob": "^3.2.4", +>>>>>>> Escape glob-like paths that point to a single file "file-entry-cache": "^5.0.1", "get-stdin": "^8.0.0", "global-modules": "^2.0.0", From a1bb65be56936fd8dba644ed116648ae26b94b8a Mon Sep 17 00:00:00 2001 From: m-allanson Date: Thu, 16 Jul 2020 13:29:01 +0100 Subject: [PATCH 4/7] Update tests --- lib/__tests__/standalone-globs.test.js | 244 +++++++++++++++---------- 1 file changed, 144 insertions(+), 100 deletions(-) diff --git a/lib/__tests__/standalone-globs.test.js b/lib/__tests__/standalone-globs.test.js index c0a1d0fdb4..cf7836e00e 100644 --- a/lib/__tests__/standalone-globs.test.js +++ b/lib/__tests__/standalone-globs.test.js @@ -14,62 +14,46 @@ const standalone = require('../standalone'); const fixturesPath = replaceBackslashes(path.join(__dirname, 'fixtures', 'globs')); -/** - * - -Failing tests for https://github.com/stylelint/stylelint/issues/4521 - -How to fix? - -use fast-glob.escapePath() ? https://github.com/mrmlnc/fast-glob#escapepathpattern - -try this: - -if hasMagic -escapePath -is escapedPath an exact file match? if yes, use it -otherwise, -fall back to globbing - -// see static vs dynamic paths https://github.com/mrmlnc/fast-glob#what-is-a-static-or-dynamic-pattern - - */ +// Tests for https://github.com/stylelint/stylelint/issues/4521 describe('standalone globbing', () => { - // https://github.com/stylelint/stylelint/issues/4193 - it('static path contains "got(brackets)"', async () => { - const cssPath = `${fixturesPath}/with(brackets)/styles.css`; + describe('paths with special characters', () => { + // ref https://github.com/micromatch/micromatch#matching-features + const fixtureDirs = [ + `[digit]/not-digits`, + `with spaces`, + `extglob?(s)`, + `got!negate/negate`, + // `extglob+(s)`, // Note: +'s cause errors. Ignoring until it becomes a problem + ]; - const { results } = await standalone({ - files: cssPath, - config: { - rules: { - 'block-no-empty': true, - }, - }, + // https://github.com/stylelint/stylelint/issues/4193 + it.each(fixtureDirs)(`static path contains "%s"`, async (fixtureDir) => { + const cssPath = `${fixturesPath}/${fixtureDir}/styles.css`; + + const { results } = await standalone({ + files: cssPath, + config: { rules: { 'block-no-empty': true } }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); }); - - expect(results).toHaveLength(1); - expect(results[0].errored).toEqual(true); - expect(results[0].warnings[0]).toEqual( - expect.objectContaining({ - rule: 'block-no-empty', - severity: 'error', - }), - ); }); - // https://github.com/stylelint/stylelint/issues/4193 - it('static path contains "got [many] (special) + !chars"', async () => { - const cssPath = `${fixturesPath}/with [many] (special) + !characters/styles.css`; + // https://github.com/stylelint/stylelint/issues/4211 + it('glob has no + character, matched path does', async () => { + const files = `${fixturesPath}/**/glob-plus.css`; // file is in dir 'glob+chars' const { results } = await standalone({ - files: cssPath, - config: { - rules: { - 'block-no-empty': true, - }, - }, + files, + config: { rules: { 'block-no-empty': true } }, }); expect(results).toHaveLength(1); @@ -82,38 +66,13 @@ describe('standalone globbing', () => { ); }); - // https://github.com/stylelint/stylelint/issues/4211 - it('glob has no + character, matched path does', async () => { - const cssGlob = `${fixturesPath}/**/glob-plus.css`; // file is in dir 'glob+chars' - - const { results } = await standalone({ - files: cssGlob, - config: { - rules: { - 'block-no-empty': true, - }, - }, - }); - - expect(results).toHaveLength(1); - expect(results[0].errored).toEqual(true); - expect(results[0].warnings[0]).objectContaining({ - rule: 'block-no-empty', - severity: 'error', - }); - }); - // https://github.com/stylelint/stylelint/issues/4211 it('glob contains + character, matched path does not', async () => { - const cssGlob = `${fixturesPath}/glob-contains-plus+/*.css`; // file is in dir 'glob+chars' + const files = `${fixturesPath}/+(g)lob-contains-plus/*.css`; const { results } = await standalone({ - files: cssGlob, - config: { - rules: { - 'block-no-empty': true, - }, - }, + files, + config: { rules: { 'block-no-empty': true } }, }); expect(results).toHaveLength(1); @@ -129,18 +88,14 @@ describe('standalone globbing', () => { // https://github.com/stylelint/stylelint/issues/3272 // should ignore 'negated-globs/ignore/styles.css' it('negated glob patterns', async () => { - const cssGlob = [ + const files = [ `${fixturesPath}/negated-globs/**/*.css`, `!${fixturesPath}/negated-globs/ignore/**/*.css`, ]; const { results } = await standalone({ - files: cssGlob, - config: { - rules: { - 'block-no-empty': true, - }, - }, + files, + config: { rules: { 'block-no-empty': true } }, }); // ensure that the only result is from the unignored file @@ -156,26 +111,115 @@ describe('standalone globbing', () => { ); }); - // https://github.com/stylelint/stylelint/issues/4855 - it('glob with special chars matches path with special chars', async () => { - const cssGlob = `${fixturesPath}/[glob-and-path]/sub-dir/*.css`; + describe('mixed globs and paths with special chars', () => { + it('manual escaping', async () => { + const cssGlob = `${fixturesPath}/got\\[braces\\] and \\(spaces\\)/*.+(s|c)ss`; - const { results } = await standalone({ - files: cssGlob, - config: { - rules: { - 'block-no-empty': true, + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, }, - }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); }); - expect(results).toHaveLength(1); - expect(results[0].errored).toEqual(true); - expect(results[0].warnings[0]).toEqual( - expect.objectContaining({ - rule: 'block-no-empty', - severity: 'error', - }), - ); + it('setting "cwd" in globbyOptions', async () => { + const cssGlob = `*.+(s|c)ss`; + + const { results } = await standalone({ + files: cssGlob, + config: { + rules: { + 'block-no-empty': true, + }, + }, + globbyOptions: { + cwd: `${fixturesPath}/got[braces] and (spaces)/`, + }, + }); + + expect(results).toHaveLength(1); + expect(results[0].errored).toEqual(true); + expect(results[0].warnings[0]).toEqual( + expect.objectContaining({ + rule: 'block-no-empty', + severity: 'error', + }), + ); + }); + + /* eslint-disable jest/no-commented-out-tests -- Failing case for reference. Documents behaviour that doesn't work. */ + + // Note: This fails because there's no way to tell which parts of the glob are literal characters, and which are special globbing characters. + // + // 'got[braces] and (spaces)' is a literal directory path. `*.+(s|c)ss` is a glob. + + // https://github.com/stylelint/stylelint/issues/4855 + // it('glob and matched path contain different special chars, complex example', async () => { + // const cssGlob = `${fixturesPath}/got[braces] and (spaces)/*.+(s|c)ss`; + + // const { results } = await standalone({ + // files: cssGlob, + // config: { + // rules: { + // 'block-no-empty': true, + // }, + // }, + // }); + + // expect(results).toHaveLength(1); + // expect(results[0].errored).toEqual(true); + // expect(results[0].warnings[0]).toEqual( + // expect.objectContaining({ + // rule: 'block-no-empty', + // severity: 'error', + // }), + // ); + // }); + + /* eslint-enable */ }); }); + +// const cases = [ +// // [`glob and matched path contain different special chars`, `${fixturesPath}/[glob-and-path]/*.css`, undefined], +// // [`complex example`, `${fixturesPath}/got[braces] and (spaces)/*.+(s|c)ss`, undefined], + +// // description, glob, globbyOptions +// [`manual escaping`, `${fixturesPath}/got\\[braces\\] and \\(spaces\\)/*.+(s|c)ss`, undefined], +// [ +// `using cwd globbyOption`, +// `*.+(s|c)ss`, +// { +// cwd: `${fixturesPath}/got[braces] and (spaces)/`, +// }, +// ], +// ]; + +// it.each(cases)(`%s`, async (_, glob, globbyOptions) => { +// const { results } = await standalone({ +// files: glob, +// globbyOptions, +// config: { rules: { 'block-no-empty': true } }, +// }); + +// expect(results).toHaveLength(1); +// expect(results[0].errored).toEqual(true); +// expect(results[0].warnings[0]).toEqual( +// expect.objectContaining({ +// rule: 'block-no-empty', +// severity: 'error', +// }), +// ); +// }); From e22cae50c97378e3ceb9bb3e4293ccab62f2cd77 Mon Sep 17 00:00:00 2001 From: m-allanson Date: Thu, 16 Jul 2020 13:33:25 +0100 Subject: [PATCH 5/7] Update fixtures --- .../sub-dir => [digit]/not-digits}/styles.css | 0 .../styles.css | 0 .../negate}/styles.css | 0 .../globs/got[braces] and (spaces)/styles.css | 1 + .../fixtures/globs/with spaces/styles.css | 1 + lib/__tests__/standalone-globs.test.js | 32 ------------------- 6 files changed, 2 insertions(+), 32 deletions(-) rename lib/__tests__/fixtures/globs/{[glob-and-path]/sub-dir => [digit]/not-digits}/styles.css (100%) rename lib/__tests__/fixtures/globs/{got [many] (special) + !chars => extglob?(s)}/styles.css (100%) rename lib/__tests__/fixtures/globs/{got(brackets) => got!negate/negate}/styles.css (100%) create mode 100644 lib/__tests__/fixtures/globs/got[braces] and (spaces)/styles.css create mode 100644 lib/__tests__/fixtures/globs/with spaces/styles.css diff --git a/lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css b/lib/__tests__/fixtures/globs/[digit]/not-digits/styles.css similarity index 100% rename from lib/__tests__/fixtures/globs/[glob-and-path]/sub-dir/styles.css rename to lib/__tests__/fixtures/globs/[digit]/not-digits/styles.css diff --git a/lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css b/lib/__tests__/fixtures/globs/extglob?(s)/styles.css similarity index 100% rename from lib/__tests__/fixtures/globs/got [many] (special) + !chars/styles.css rename to lib/__tests__/fixtures/globs/extglob?(s)/styles.css diff --git a/lib/__tests__/fixtures/globs/got(brackets)/styles.css b/lib/__tests__/fixtures/globs/got!negate/negate/styles.css similarity index 100% rename from lib/__tests__/fixtures/globs/got(brackets)/styles.css rename to lib/__tests__/fixtures/globs/got!negate/negate/styles.css diff --git a/lib/__tests__/fixtures/globs/got[braces] and (spaces)/styles.css b/lib/__tests__/fixtures/globs/got[braces] and (spaces)/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/got[braces] and (spaces)/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/fixtures/globs/with spaces/styles.css b/lib/__tests__/fixtures/globs/with spaces/styles.css new file mode 100644 index 0000000000..077f6dd7c0 --- /dev/null +++ b/lib/__tests__/fixtures/globs/with spaces/styles.css @@ -0,0 +1 @@ +a {} diff --git a/lib/__tests__/standalone-globs.test.js b/lib/__tests__/standalone-globs.test.js index cf7836e00e..df3783d9be 100644 --- a/lib/__tests__/standalone-globs.test.js +++ b/lib/__tests__/standalone-globs.test.js @@ -191,35 +191,3 @@ describe('standalone globbing', () => { /* eslint-enable */ }); }); - -// const cases = [ -// // [`glob and matched path contain different special chars`, `${fixturesPath}/[glob-and-path]/*.css`, undefined], -// // [`complex example`, `${fixturesPath}/got[braces] and (spaces)/*.+(s|c)ss`, undefined], - -// // description, glob, globbyOptions -// [`manual escaping`, `${fixturesPath}/got\\[braces\\] and \\(spaces\\)/*.+(s|c)ss`, undefined], -// [ -// `using cwd globbyOption`, -// `*.+(s|c)ss`, -// { -// cwd: `${fixturesPath}/got[braces] and (spaces)/`, -// }, -// ], -// ]; - -// it.each(cases)(`%s`, async (_, glob, globbyOptions) => { -// const { results } = await standalone({ -// files: glob, -// globbyOptions, -// config: { rules: { 'block-no-empty': true } }, -// }); - -// expect(results).toHaveLength(1); -// expect(results[0].errored).toEqual(true); -// expect(results[0].warnings[0]).toEqual( -// expect.objectContaining({ -// rule: 'block-no-empty', -// severity: 'error', -// }), -// ); -// }); From 1ef46e0fe9a17cf7b810fa30eb1cae3ebd1941af Mon Sep 17 00:00:00 2001 From: m-allanson Date: Thu, 16 Jul 2020 15:47:06 +0100 Subject: [PATCH 6/7] Avoid invalid characters in fixture directories (for Windows). Reference: https://gist.github.com/doctaphred/d01d05291546186941e1b7ddc02034d3 --- .../fixtures/globs/{extglob?(s) => extglob!(s)}/styles.css | 0 lib/__tests__/standalone-globs.test.js | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/__tests__/fixtures/globs/{extglob?(s) => extglob!(s)}/styles.css (100%) diff --git a/lib/__tests__/fixtures/globs/extglob?(s)/styles.css b/lib/__tests__/fixtures/globs/extglob!(s)/styles.css similarity index 100% rename from lib/__tests__/fixtures/globs/extglob?(s)/styles.css rename to lib/__tests__/fixtures/globs/extglob!(s)/styles.css diff --git a/lib/__tests__/standalone-globs.test.js b/lib/__tests__/standalone-globs.test.js index df3783d9be..2f3f486287 100644 --- a/lib/__tests__/standalone-globs.test.js +++ b/lib/__tests__/standalone-globs.test.js @@ -22,7 +22,7 @@ describe('standalone globbing', () => { const fixtureDirs = [ `[digit]/not-digits`, `with spaces`, - `extglob?(s)`, + `extglob!(s)`, `got!negate/negate`, // `extglob+(s)`, // Note: +'s cause errors. Ignoring until it becomes a problem ]; From 62d73609a855fb15477e123a70d8dfd545b08335 Mon Sep 17 00:00:00 2001 From: jeddy3 Date: Mon, 31 Aug 2020 12:01:47 +0100 Subject: [PATCH 7/7] Resolve conflict --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 81e66a5ac4..b91ac5aec3 100644 --- a/package.json +++ b/package.json @@ -118,11 +118,8 @@ "cosmiconfig": "^7.0.0", "debug": "^4.1.1", "execall": "^2.0.0", -<<<<<<< HEAD - "fastest-levenshtein": "^1.0.9", -======= "fast-glob": "^3.2.4", ->>>>>>> Escape glob-like paths that point to a single file + "fastest-levenshtein": "^1.0.9", "file-entry-cache": "^5.0.1", "get-stdin": "^8.0.0", "global-modules": "^2.0.0",