cspell 5.12.2 → 5.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin.js +0 -1
  2. package/dist/lint.js +12 -4
  3. package/package.json +8 -8
package/bin.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
-
3
2
  'use strict';
4
3
 
5
4
  const app = require('./dist/app');
package/dist/lint.js CHANGED
@@ -174,7 +174,7 @@ async function runLint(cfg) {
174
174
  cspell.setLogger(getLoggerFromReporter(reporter));
175
175
  const useGitignore = (_b = (_a = cfg.options.gitignore) !== null && _a !== void 0 ? _a : configInfo.config.useGitignore) !== null && _b !== void 0 ? _b : false;
176
176
  const gitignoreRoots = (_c = cfg.options.gitignoreRoot) !== null && _c !== void 0 ? _c : configInfo.config.gitignoreRoot;
177
- const gitIgnore = useGitignore ? generateGitIgnore(gitignoreRoots) : undefined;
177
+ const gitIgnore = useGitignore ? await generateGitIgnore(gitignoreRoots) : undefined;
178
178
  const cliGlobs = cfg.files;
179
179
  const allGlobs = cliGlobs.length ? cliGlobs : configInfo.config.files || [];
180
180
  const combinedGlobs = (0, glob_1.normalizeGlobsToRoot)(allGlobs, cfg.root, false);
@@ -240,7 +240,10 @@ Options:
240
240
  }
241
241
  function filterFiles(files, globMatcher) {
242
242
  const patterns = globMatcher.patterns;
243
- const excludeInfo = patterns.map(extractGlobSource).map(({ glob, source }) => `Glob: ${glob} from ${source}`);
243
+ const excludeInfo = patterns
244
+ .map(extractGlobSource)
245
+ .map(({ glob, source }) => `Glob: ${glob} from ${source}`)
246
+ .filter(util.uniqueFn());
244
247
  reporter.info(`Exclusion Globs: \n ${excludeInfo.join('\n ')}\n`, cspell_types_1.MessageTypes.Info);
245
248
  const result = files.filter(util.uniqueFn()).filter((filename) => !isExcluded(filename, globMatcher));
246
249
  return result;
@@ -302,8 +305,13 @@ function getLoggerFromReporter(reporter) {
302
305
  error,
303
306
  };
304
307
  }
305
- function generateGitIgnore(roots) {
306
- const root = typeof roots === 'string' ? [roots] : roots;
308
+ async function generateGitIgnore(roots) {
309
+ const root = (typeof roots === 'string' ? [roots].filter((r) => !!r) : roots) || [];
310
+ if (!(root === null || root === void 0 ? void 0 : root.length)) {
311
+ const cwd = process.cwd();
312
+ const repo = (await (0, cspell_gitignore_1.findRepoRoot)(cwd)) || cwd;
313
+ root.push(repo);
314
+ }
307
315
  return new cspell_gitignore_1.GitIgnore(root === null || root === void 0 ? void 0 : root.map((p) => path.resolve(p)));
308
316
  }
309
317
  //# sourceMappingURL=lint.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "5.12.2",
3
+ "version": "5.12.3",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "main": "dist/index.js",
@@ -72,9 +72,9 @@
72
72
  "chalk": "^4.1.2",
73
73
  "commander": "^8.2.0",
74
74
  "comment-json": "^4.1.1",
75
- "cspell-gitignore": "^5.12.2",
76
- "cspell-glob": "^5.12.2",
77
- "cspell-lib": "^5.12.2",
75
+ "cspell-gitignore": "^5.12.3",
76
+ "cspell-glob": "^5.12.3",
77
+ "cspell-lib": "^5.12.3",
78
78
  "fast-json-stable-stringify": "^2.1.0",
79
79
  "file-entry-cache": "^6.0.1",
80
80
  "fs-extra": "^10.0.0",
@@ -88,18 +88,18 @@
88
88
  "node": ">=12.13.0"
89
89
  },
90
90
  "devDependencies": {
91
- "@cspell/cspell-json-reporter": "^5.12.2",
92
- "@cspell/cspell-types": "^5.12.2",
91
+ "@cspell/cspell-json-reporter": "^5.12.3",
92
+ "@cspell/cspell-types": "^5.12.3",
93
93
  "@types/file-entry-cache": "^5.0.2",
94
94
  "@types/fs-extra": "^9.0.13",
95
95
  "@types/glob": "^7.1.4",
96
96
  "@types/imurmurhash": "^0.1.1",
97
97
  "@types/micromatch": "^4.0.2",
98
98
  "@types/minimatch": "^3.0.5",
99
- "jest": "^27.2.4",
99
+ "jest": "^27.2.5",
100
100
  "micromatch": "^4.0.4",
101
101
  "minimatch": "^3.0.4",
102
102
  "rimraf": "^3.0.2"
103
103
  },
104
- "gitHead": "1418785bb9c3a29b794a6e9d447b5638f8eb9fbf"
104
+ "gitHead": "6c424aed933adb8d983ab09dd45042d63d7a5cd8"
105
105
  }