comply-human-failexpected red
Asserts — The rules table on a failing repo: row ordering, severity badges, the error/warning tally, and exit 1.
Ran hermex comply in fixtures/ → exit 1, as asserted
Config fixtures/hermex.config.ts · Fixture fixtures (overview) · Case comply-human-fail (dossier)
Expected red — this baseline is v3’s intended output, written before the code that produces it. Rule ids go kebab-case — #101. The baseline is the intended table; the run still prints the v2 snake_case ids.
Reproduce locally: pnpm run test:output -- --filter comply-human-fail
import type { HermexConfigInput } from '../src/config/types.ts';
/**
* The primary fixture repo's config: a deliberately non-compliant policy
* over a deliberately messy repo, so `scan` and `comply` both have
* something to say. Variants that change one thing at a time live in
* `./configs/` and spread this object — see `fixtures/README.md`.
*/
export default {
// Spelled out rather than left to the schema defaults because this repo
// now contains fixture *machinery* alongside the code under analysis:
// the case manifest, the alternate configs, the recorded registry
// timelines, and the secondary repos that cases scan with their own cwd.
// None of it is code this repo "uses", and without these entries the
// primary output would grow rows every time a case is added.
excludes: [
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'cases.ts',
'configs/**',
'registry/**',
'repos/**',
],
packages: {
internal: ['@design-system/*'],
},
versus: [
{
name: 'Design System Migration',
packages: ['@design-system/foundation', '@new-system/arc'],
},
],
rules: {
detect_files: [
{
severity: 'error',
patterns: ['jest.config.*', '.babelrc'],
message: 'Use vitest + Vite',
},
],
forbid_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'] }],
engine_version: { severity: 'warn', range: '>=20', message: 'Minimum Node 20 required' },
},
output: {
details: false,
patterns: false,
},
} satisfies HermexConfigInput;
Diffs are unified format: - is the committed baseline, + 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 baseline and 9 lines from line 12 of this run — which is where to look in tests/__output_baselines__/.
--- baseline/stdout.txt
+++ current/stdout.txt
@@ -22,13 +22,13 @@
┌──────────────────┬──────────────────────────────────────────────────────┐
│ Rule │ Description │
├──────────────────┼──────────────────────────────────────────────────────┤
-│ forbid-packages │ 🔴 moment is forbidden — Use date-fns or dayjs │
+│ forbid_packages │ 🔴 moment is forbidden — Use date-fns or dayjs │
├──────────────────┼──────────────────────────────────────────────────────┤
-│ require-packages │ 🔴 typescript not installed — TypeScript is required │
+│ require_packages │ 🔴 typescript not installed — TypeScript is required │
├──────────────────┼──────────────────────────────────────────────────────┤
-│ require-files │ 🔴 .nvmrc not found │
+│ require_files │ 🔴 .nvmrc not found │
├──────────────────┼──────────────────────────────────────────────────────┤
-│ require-files │ 🟡 .editorconfig not found │
+│ require_files │ 🟡 .editorconfig not found │
└──────────────────┴──────────────────────────────────────────────────────┘
3 errors, 1 warning
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 │
├──────────────────┼──────────────────────────────────────────────────────┤
│ forbid_packages │ 🔴 moment is forbidden — Use date-fns or dayjs │
├──────────────────┼──────────────────────────────────────────────────────┤
│ require_packages │ 🔴 typescript not installed — TypeScript is required │
├──────────────────┼──────────────────────────────────────────────────────┤
│ require_files │ 🔴 .nvmrc not found │
├──────────────────┼──────────────────────────────────────────────────────┤
│ require_files │ 🟡 .editorconfig not found │
└──────────────────┴──────────────────────────────────────────────────────┘
3 errors, 1 warning
⚖️ Versus
Design System Migration
──────────────────────────────────────────────────
@design-system/foundation ██████████████████████████████ 100.0% (33 usages)
@new-system/arc ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0.0% (0 usages)
🔴 NOT COMPLIANT
3 mandatory violations found
stderr.txt