1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# code-moniker default rule pack — embedded into the binary at build time.
# Users override per-project via `.code-moniker.toml` at the repo root.
#
# Each `[[<lang>.<kind>.where]]` entry is a single assertion in the form
# `<lhs> <op> <rhs>`. A def violates the rule when the assertion is false.
# Suppress with `// code-moniker: ignore[<lang>.<kind>.<id>]`.
#
# Embedded defaults stick to structural / naming hygiene that is broadly
# uncontroversial. Project-specific policies (comment-content allow-lists,
# doc-comment requirements, max-lines/max-methods budgets) belong in the
# user overlay — see docs/check-dsl.md for a worked example.
# Aliases factor the case regexes shared across languages. A user overlay
# may redefine any of these to tighten or loosen the convention without
# touching the per-kind rules.
[]
= "name =~ ^[A-Z][A-Za-z0-9]*$"
= "name =~ ^[a-z_][A-Za-z0-9]*$"
= "name =~ ^[a-z_][a-z0-9_]*$"
= "name =~ ^[A-Z][A-Z0-9_]*$"
= "name =~ ^([A-Z][a-zA-Z0-9_]*|[a-z][a-zA-Z0-9_]*)$"
# ─── TypeScript / JavaScript ──────────────────────────────────────────────
[[]]
= "name-pascalcase"
= "$pascal"
= "Class names must be PascalCase. Rename `{name}`."
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-camelcase"
= "$camel"
= "Function names use camelCase. Rename `{name}`."
[[]]
= "no-placeholder-names"
= "name !~ ^(helper|helpers|utils|util|manager|temp|tmp|handleData|processData|newFunction[0-9]*)$"
= "`{name}` is a placeholder name. Pick a verb that describes the actual behaviour."
# ─── Rust ─────────────────────────────────────────────────────────────────
[[]]
= "name-snakecase"
= "$snake"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-screaming"
= "$screaming"
# ─── Java ─────────────────────────────────────────────────────────────────
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-camelcase"
= "$camel"
[[]]
= "name-camelcase"
= "$camel"
[[]]
= "name-screaming"
= "$screaming"
# ─── Python ───────────────────────────────────────────────────────────────
[[]]
= "name-snakecase"
= "$snake"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-snakecase"
= "$snake"
# ─── Go ───────────────────────────────────────────────────────────────────
[[]]
= "name-go"
= "$go_id"
[[]]
= "name-go"
= "$go_id"
# ─── C# ───────────────────────────────────────────────────────────────────
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-i-prefix"
= "name =~ ^I[A-Z][A-Za-z0-9]*$"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
[[]]
= "name-pascalcase"
= "$pascal"
# ─── SQL / PL/pgSQL ───────────────────────────────────────────────────────
[[]]
= "name-snakecase"
= "$snake"
[[]]
= "name-snakecase"
= "$snake"
[[]]
= "name-snakecase"
= "$snake"
# ─── Cross-language structural invariants ────────────────────────────────
# These use the `shape` projection (see docs/check-dsl.md "Shape — the
# canonical kind grouping") to express rules that hold regardless of
# which language's kinds are involved.
# Annotations have no business calling code or referencing types — they
# are leaf nodes in the graph by construction.
[[]]
= "annotations-do-not-emit-non-annotates-refs"
= "source.shape = 'annotation' => kind = 'annotates'"
= "An annotation def (`{source.name}`) emitted a `{kind}` ref. The annotation shape is leaf — only `annotates` refs originate from it."