comply-overrideschanged
Asserts — Repo-scoped overrides re-scope severities: one rule downgraded to warn, one switched off and gone from the table.
Ran hermex comply --config configs/overrides.config.ts in fixtures/ → exit 1, as asserted
Config fixtures/configs/overrides.config.ts · Fixture fixtures (overview) · Case comply-overrides (dossier)
Reproduce locally: pnpm run test:output -- --filter comply-overrides
fixtures/configs/overrides.config.ts
import type { HermexConfigInput } from '../../src/config/types.ts';
import base from '../hermex.config.ts';
/**
* Repo-scoped rule adjustments. `match` is checked against the current
* repo's package.json "name", which for the primary fixture repo is
* `hermex-fixtures`, so both entries below apply and the rules table has to
* show the *resolved* severities rather than the ones authored in the base
* config:
*
* - `no-packages` on `moment` drops from error to warn.
* - `require-files` on `.editorconfig` is switched off entirely and must
* disappear from the output, not appear greyed out.
*
* The remaining error-severity rules are left alone on purpose — an
* override that made the repo compliant would prove the rules vanished, not
* that they were re-scoped.
*/
export default {
...base,
overrides: [
{
match: ['hermex-fixtures'],
rules: {
'no-packages': {
severity: 'warn',
patterns: ['moment'],
message: 'Use date-fns or dayjs (scheduled for removal)',
},
'require-files': { severity: 'off', patterns: ['.editorconfig'] },
},
},
],
} satisfies HermexConfigInput;
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/exit-code.txt
+++ current/exit-code.txt
@@ -1,2 +1,2 @@
-0
+1
--- target/stdout.txt
+++ current/stdout.txt
@@ -17,6 +17,20 @@
Syntax Error
+🔍 Rules
+
+┌──────────────────┬────────────────────────────────────────────────────────────────────────┐
+│ Rule │ Description │
+├──────────────────┼────────────────────────────────────────────────────────────────────────┤
+│ no-packages │ 🟡 moment is forbidden — Use date-fns or dayjs (scheduled for removal) │
+├──────────────────┼────────────────────────────────────────────────────────────────────────┤
+│ require-packages │ 🔴 typescript not installed — TypeScript is required │
+├──────────────────┼────────────────────────────────────────────────────────────────────────┤
+│ require-files │ 🔴 .nvmrc not found │
+└──────────────────┴────────────────────────────────────────────────────────────────────────┘
+
+2 errors, 1 warning
+
⚖️ Versus
Design System Migration
@@ -25,6 +39,7 @@
@new-system/arc ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.0% (0 usages)
-🟢 COMPLIANT
+🔴 NOT COMPLIANT
+ 2 mandatory violations found
stdout.txthermex 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
🔍 Rules
┌──────────────────┬────────────────────────────────────────────────────────────────────────┐
│ Rule │ Description │
├──────────────────┼────────────────────────────────────────────────────────────────────────┤
│ no-packages │ 🟡 moment is forbidden — Use date-fns or dayjs (scheduled for removal) │
├──────────────────┼────────────────────────────────────────────────────────────────────────┤
│ require-packages │ 🔴 typescript not installed — TypeScript is required │
├──────────────────┼────────────────────────────────────────────────────────────────────────┤
│ require-files │ 🔴 .nvmrc not found │
└──────────────────┴────────────────────────────────────────────────────────────────────────┘
2 errors, 1 warning
⚖️ Versus
Design System Migration
──────────────────────────────────────────────────
@design-system/foundation ██████████████████████████████ 100.0% (33 usages)
@new-system/arc ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.0% (0 usages)
🔴 NOT COMPLIANT
2 mandatory violations found
stderr.txt