.hexcheck.yaml RawHistoryFolder
1version: 1
2components:
3 domain:
4 role: core
5 paths:
6 - internal/domain/**
7 usecase:
8 role: usecase
9 paths:
10 - internal/usecase/**
11 ports:
12 role: ports
13 paths:
14 - internal/ports/**
15 adapters:
16 role: adapter
17 paths:
18 - internal/adapters/**
19 clientlimit:
20 # Per-client HTTP rate limiting: infrastructure shared by the HTTP adapters.
21 role: adapter
22 paths:
23 - internal/clientlimit/**
24 entrypoints:
25 # cmd/ermite only calls app.Run.
26 role: entrypoint
27 paths:
28 - cmd/**
29 app:
30 # Composition root and CLI: builds the adapters and wires them to the use
31 # cases. hexcheck has no dedicated bootstrap role; entrypoint is the
32 # closest.
33 role: entrypoint
34 paths:
35 - internal/app/**
36 config:
37 role: entrypoint
38 paths:
39 - internal/config/**
40 generated:
41 role: ignore
42 paths:
43 - gen/**
44 - '**/mocks/**'
45 - '**/*_templ.go'
46 readertest:
47 # Test-only fixtures and conformance suite for ports.RepoReader.
48 role: ignore
49 paths:
50 - internal/readertest/**
51# Cross-layer contracts live in ports: adapters and use cases import ports and
52# domain, never each other. hexcheck has no rule for an adapter importing a use
53# case or internal/app; internal/boundary/boundary_test.go enforces the full
54# import matrix.
55rules:
56 no-adapter-imports-in-core: error
57 no-infra-imports-in-usecase: error
58 no-framework-types-in-core: error
59 no-infra-types-in-ports: error
60 no-adapter-to-adapter-imports: warn
61 suspicious-business-logic-in-adapter: warn
62 no-local-fakes-for-ports: warn
63 missing-generated-mock-for-port: warn
64 prefer-generated-mocks: warn
65mocking:
66 generatedMockPaths:
67 - internal/ports/mocks/**
68 generatedMockNamePatterns:
69 - '{{Interface}}'
70allow:
71 # clientlimit is a shared infrastructure library, not a sibling adapter: the
72 # HTTP adapters that rate-limit clients import it by design.
73 - rule: no-adapter-to-adapter-imports
74 path: internal/adapters/githttp/**
75 reason: rate-limits Git clients with internal/clientlimit
76 - rule: no-adapter-to-adapter-imports
77 path: internal/adapters/githubapi/**
78 reason: rate-limits the clients of the REST subset with internal/clientlimit
79 - rule: no-adapter-to-adapter-imports
80 path: internal/adapters/oidchttp/**
81 reason: rate-limits the clients of the OIDC token endpoint with internal/clientlimit
82 - rule: no-adapter-to-adapter-imports
83 path: internal/adapters/rpc/**
84 reason: rate-limits API clients with internal/clientlimit
85 - rule: no-adapter-to-adapter-imports
86 path: internal/adapters/web/**
87 reason: rate-limits login attempts with internal/clientlimit