Hermex Output Review

← all cases

scan-json-toggles

changed

Asserts — What output.* toggles do to –format json: today, nothing (#91). The payload below is emitted with every section switched off, yet still carries packages, components, versus and ruleViolations in full. Pair it with scan-human-minimal to see the two formats diverge; when #91 lands, this baseline shrinking is the proof.

Ran hermex scan --format json --config configs/minimal.config.ts in fixtures/ → exit 0, as asserted

Config fixtures/configs/minimal.config.ts · Fixture fixtures (overview) · Case scan-json-toggles (dossier)

Reproduce locally: pnpm run test:output -- --filter scan-json-toggles

Config

fixtures/configs/minimal.config.ts — resolved, as the loader sees it

{
  "excludes": [
    "**/node_modules/**",
    "**/dist/**",
    "**/build/**",
    "cases.ts",
    "configs/**",
    "registry/**",
    "repos/**"
  ],
  "versus": [
    {
      "name": "Design System Migration",
      "packages": [
        "@design-system/foundation",
        "@new-system/arc"
      ]
    }
  ],
  "rules": {
    "no-files": [
      {
        "severity": "error",
        "patterns": [
          "jest.config.*",
          ".babelrc"
        ],
        "message": "Use vitest + Vite"
      }
    ],
    "no-packages": [
      {
        "severity": "error",
        "patterns": [
          "moment"
        ],
        "message": "Use date-fns or dayjs"
      }
    ],
    "require-files": [
      {
        "severity": "error",
        "patterns": [
          ".nvmrc"
        ]
      },
      {
        "severity": "warn",
        "patterns": [
          ".editorconfig"
        ]
      }
    ],
    "require-packages": [
      {
        "severity": "error",
        "patterns": [
          "typescript"
        ],
        "message": "TypeScript is required"
      }
    ],
    "require-scripts": [
      {
        "severity": "error",
        "patterns": [
          "build",
          "test"
        ],
        "message": "Required npm scripts"
      }
    ],
    "require-package-fields": [
      {
        "severity": "warn",
        "patterns": [
          "engines",
          "license"
        ]
      }
    ],
    "require-engine-version": {
      "severity": "warn",
      "range": ">=20",
      "message": "Minimum Node 20 required"
    }
  },
  "output": {
    "summary": "log",
    "packages": false,
    "components": false,
    "patterns": false,
    "details": false,
    "versus": false,
    "rules": false
  }
}

Diff against the target branch

Diffs are unified format: - is the target branch, + is this run. @@ -12,7 +12,9 @@ is a hunk header — unchanged lines were skipped, and the hunk below covers 7 lines from line 12 of the target branch and 9 lines from line 12 of this run.

--- target/stdout.json
+++ current/stdout.json
@@ -14,7 +14,6 @@
         "moment"
       ],
       "message": "Use date-fns or dayjs",
-      "matchedFiles": [],
       "packageName": "moment"
     },
     {
@@ -23,24 +22,21 @@
       "patterns": [
         "typescript"
       ],
-      "message": "TypeScript is required",
-      "matchedFiles": []
+      "message": "TypeScript is required"
     },
     {
       "ruleId": "require-files",
       "severity": "error",
       "patterns": [
         ".nvmrc"
-      ],
-      "matchedFiles": []
+      ]
     },
     {
       "ruleId": "require-files",
       "severity": "warn",
       "patterns": [
         ".editorconfig"
-      ],
-      "matchedFiles": []
+      ]
     }
   ],
   "compliance": {
@@ -48,7 +44,6 @@
     "compliant": false,
     "counts": {
       "errorRuleViolations": 3,
-      "releaseAgeViolations": 0,
       "warningRuleViolations": 1
     }
   }

Full output

stdout.json
{
  "version": "<version>",
  "summary": {
    "filesAnalyzed": 17,
    "totalImports": 80,
    "totalComponents": 35,
    "totalUsagePatterns": 284
  },
  "ruleViolations": [
    {
      "ruleId": "no-packages",
      "severity": "error",
      "patterns": [
        "moment"
      ],
      "message": "Use date-fns or dayjs",
      "packageName": "moment"
    },
    {
      "ruleId": "require-packages",
      "severity": "error",
      "patterns": [
        "typescript"
      ],
      "message": "TypeScript is required"
    },
    {
      "ruleId": "require-files",
      "severity": "error",
      "patterns": [
        ".nvmrc"
      ]
    },
    {
      "ruleId": "require-files",
      "severity": "warn",
      "patterns": [
        ".editorconfig"
      ]
    }
  ],
  "compliance": {
    "status": "non-compliant",
    "compliant": false,
    "counts": {
      "errorRuleViolations": 3,
      "warningRuleViolations": 1
    }
  }
}
stderr.txt
hermex v<version>
- Parsing lockfile...
✔ Found pnpm lockfile (supports: v5, v6, v9) - 5 packages
✔ Found 18 files
✔ Analysis complete! Analyzed 17/18 files

⚠ 1 file(s) failed to parse:
  broken/unparseable.tsx
      x Expression expected
   ,----
 1 | export const Broken = ( : : :;
   :                         ^
   `----


Caused by:
    Syntax Error