plumber-linter 1.4.0 → 1.4.1

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/README.md CHANGED
@@ -71,7 +71,7 @@ npx plumber-linter uninstall-hook
71
71
 
72
72
  ### SARIF output for GitHub code scanning
73
73
 
74
- `plumber scan . --format sarif` writes SARIF 2.1.0 JSON to stdout. The file contains one run for `plumber-linter` 1.4.0, every inspection rule (id, name, description, and the plain-English fix in `help.text`), and one result per finding. Each result's `message.text` repeats that finding's explanation and fix. Paths are relative to the scanned directory, and the line is included when the engine recorded one.
74
+ `plumber scan . --format sarif` writes SARIF 2.1.0 JSON to stdout. The file contains one run for `plumber-linter` 1.4.1, every inspection rule (id, name, description, and the plain-English fix in `help.text`), and one result per finding. Each result's `message.text` repeats that finding's explanation and fix. Paths are relative to the scanned directory, and the line is included when the engine recorded one.
75
75
 
76
76
  ```bash
77
77
  npx plumber-linter scan . --format sarif > results.sarif
@@ -222,6 +222,12 @@ Spots hallucinated library imports invented by LLMs or packages missing from pro
222
222
 
223
223
  ## Changelog
224
224
 
225
+ ## 1.4.1
226
+ `plumber scan` skips symlinks, including dangling links such as a `README.md` that points at a missing file, instead of crashing.
227
+
228
+ ## 1.4.0
229
+ Workflow YAML scanning (plumber scan on .github/workflows/*.yml) — 5 workflow rules (audit-gated, see Step 1).
230
+
225
231
  ## 1.3.0
226
232
  SARIF output (`--format sarif`) for GitHub code scanning.
227
233
 
@@ -231,6 +237,3 @@ SARIF output (`--format sarif`) for GitHub code scanning.
231
237
  - `sec/permissions-write-all`: Flag overly broad workflow write permissions (`permissions: write-all`, `contents: write`) (`HIGH`).
232
238
  - `leak/slack-webhook`: Flag hardcoded Slack and tokenized webhook URLs in workflows and code (`CRITICAL`).
233
239
  - `pipe/npm-unpinned`: Flag `npm install` in CI steps without `--save-exact` or `npm ci` lockfile enforcement (`MEDIUM`).
234
-
235
- ## 1.4.0
236
- Workflow YAML scanning (plumber scan on .github/workflows/*.yml) — 5 workflow rules (audit-gated, see Step 1).
package/bin/plumber.js CHANGED
@@ -183,6 +183,17 @@ async function runScan(target, fmt, failOn) {
183
183
  renderReport(report, fmt, failOn);
184
184
  }
185
185
 
186
+ function readEntryStat(target) {
187
+ try {
188
+ return fs.lstatSync(target);
189
+ } catch (err) {
190
+ if (err && (err.code === 'ENOENT' || err.code === 'EACCES' || err.code === 'EPERM' || err.code === 'ELOOP' || err.code === 'ENOTDIR')) {
191
+ return null;
192
+ }
193
+ throw err;
194
+ }
195
+ }
196
+
186
197
  function scanLocalDirectory(dirPath) {
187
198
  const scannableExts = new Set(['.py', '.js', '.jsx', '.ts', '.tsx', '.html', '.htm', '.css', '.scss', '.env', '.yml', '.yaml', '.sh']);
188
199
  const skipDirs = new Set(['.git', 'node_modules', 'dist', 'build', '.next', '.nuxt', 'vendor', '.venv', 'venv', '__pycache__']);
@@ -193,7 +204,8 @@ function scanLocalDirectory(dirPath) {
193
204
  const fileReports = [];
194
205
 
195
206
  function walk(current) {
196
- const stat = fs.statSync(current);
207
+ const stat = readEntryStat(current);
208
+ if (!stat || stat.isSymbolicLink()) return;
197
209
  if (stat.isFile()) {
198
210
  const ext = path.extname(current).toLowerCase();
199
211
  const base = path.basename(current);
@@ -1231,8 +1243,8 @@ function collectSourceFiles(target) {
1231
1243
  const skipDirs = new Set(['.git', 'node_modules', 'dist', 'build', '.next', '.nuxt', 'vendor', '.venv', 'venv', '__pycache__']);
1232
1244
 
1233
1245
  function walk(current) {
1234
- let stat;
1235
- try { stat = fs.statSync(current); } catch (_) { return; }
1246
+ const stat = readEntryStat(current);
1247
+ if (!stat || stat.isSymbolicLink()) return;
1236
1248
  if (stat.isFile()) { results.push(current); return; }
1237
1249
  if (!stat.isDirectory()) return;
1238
1250
  const base = path.basename(current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plumber-linter",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "CI/CD pipeline linter that flags hardcoded secrets, leaked credentials, and dead code — with fixes in plain English, plus SARIF output for GitHub code scanning and workflow YAML scanning for GitHub Actions.",
5
5
  "main": "bin/plumber.js",
6
6
  "bin": {