npm-groovy-lint 14.2.1 → 14.2.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.
package/lib/filter.js CHANGED
@@ -23,7 +23,7 @@ function collectDisabledBlocks(allLines) {
23
23
  if (matchingIndex > -1) {
24
24
  disabledBlocks[matchingIndex].endLine = lineNb;
25
25
  } else {
26
- console.warning(`npm-groovy-lint: Unable to find matching groovylint-disable for ${line}`);
26
+ console.warn(`npm-groovy-lint: Unable to find matching groovylint-disable for ${line}`);
27
27
  }
28
28
  }
29
29
  lineNb++;
@@ -3,6 +3,7 @@ const debug = require("debug")("npm-groovy-lint");
3
3
  const trace = require("debug")("npm-groovy-lint-trace");
4
4
  const fs = require("fs-extra");
5
5
  const os = require("os");
6
+ const path = require("path");
6
7
  const performance = require("perf_hooks").performance;
7
8
 
8
9
  const NpmGroovyLintFix = require("./groovy-lint-fix");
@@ -109,6 +110,11 @@ class NpmGroovyLint {
109
110
 
110
111
  await fs.remove(this.tmpGroovyFileName);
111
112
  debug(`Removed temp file ${this.tmpGroovyFileName} as it is not longer used :)`);
113
+ const tmpDir = path.dirname(this.tmpGroovyFileName);
114
+ if (tmpDir.includes("codeNarcTmpDir_") && fs.readdirSync(tmpDir).length === 0) {
115
+ await fs.remove(tmpDir);
116
+ debug(`Removed temp dir ${tmpDir} as it is not longer used :)`);
117
+ }
112
118
  this.tmpGroovyFileName = null;
113
119
  }
114
120
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-groovy-lint",
3
- "version": "14.2.1",
3
+ "version": "14.2.3",
4
4
  "description": "Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files",
5
5
  "main": "index.js",
6
6
  "scripts": {