type-rename-move 0.0.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/bin/trmv-compliance.js +4 -0
  4. package/dist/bin/trmv-config.js +4 -0
  5. package/dist/bin/trmv-doctor.js +4 -0
  6. package/dist/bin/trmv-mock-lint.js +4 -0
  7. package/dist/bin/trmv-refactor.js +4 -0
  8. package/dist/bin/trmv-typecheck.js +4 -0
  9. package/dist/changes/index.d.ts +24 -0
  10. package/dist/changes/index.js +112 -0
  11. package/dist/cli/index.d.ts +4 -0
  12. package/dist/cli/index.js +36 -0
  13. package/dist/config/command.d.ts +20 -0
  14. package/dist/config/command.js +68 -0
  15. package/dist/config/error.d.ts +3 -0
  16. package/dist/config/error.js +4 -0
  17. package/dist/config/files.d.ts +6 -0
  18. package/dist/config/files.js +29 -0
  19. package/dist/config/format.d.ts +25 -0
  20. package/dist/config/format.js +172 -0
  21. package/dist/config/index.d.ts +73 -0
  22. package/dist/config/index.js +239 -0
  23. package/dist/config/read.d.ts +4 -0
  24. package/dist/config/read.js +37 -0
  25. package/dist/contract/data/CONTRACT_HASH +1 -0
  26. package/dist/contract/data/README.md +69 -0
  27. package/dist/contract/data/cli.yaml +239 -0
  28. package/dist/contract/data/config.yaml +8 -0
  29. package/dist/contract/data/findings.yaml +212 -0
  30. package/dist/contract/data/languages.yaml +146 -0
  31. package/dist/contract/data/regex-subset.md +28 -0
  32. package/dist/contract/data/schema/rename-map.schema.json +51 -0
  33. package/dist/contract/data/schema/trmv.schema.json +92 -0
  34. package/dist/contract/data/schema/word-table.schema.json +55 -0
  35. package/dist/contract/data/vectors/cli.yaml +216 -0
  36. package/dist/contract/data/vectors/command-split.yaml +69 -0
  37. package/dist/contract/data/vectors/diff.yaml +287 -0
  38. package/dist/contract/data/vectors/format.yaml +160 -0
  39. package/dist/contract/data/vectors/glob.yaml +148 -0
  40. package/dist/contract/data/vectors/materialize.yaml +51 -0
  41. package/dist/contract/data/vectors/os-errors.yaml +123 -0
  42. package/dist/contract/data/vectors/refactor-symbols.yaml +220 -0
  43. package/dist/contract/data/vectors/refactor-text.yaml +186 -0
  44. package/dist/contract/data/vectors/refactor-words.yaml +83 -0
  45. package/dist/contract/data/vectors/regex-subset.yaml +40 -0
  46. package/dist/contract/data/vectors/repr.yaml +118 -0
  47. package/dist/contract/data/vectors/skill-leaks.yaml +6 -0
  48. package/dist/contract/data/vectors/test-files.yaml +135 -0
  49. package/dist/contract/data/vectors/yaml.yaml +858 -0
  50. package/dist/contract/glob.d.ts +3 -0
  51. package/dist/contract/glob.js +49 -0
  52. package/dist/contract/index.d.ts +13 -0
  53. package/dist/contract/index.js +14 -0
  54. package/dist/contract/json.d.ts +1 -0
  55. package/dist/contract/json.js +43 -0
  56. package/dist/contract/os-error.d.ts +13 -0
  57. package/dist/contract/os-error.js +66 -0
  58. package/dist/contract/parser.d.ts +18 -0
  59. package/dist/contract/parser.js +207 -0
  60. package/dist/contract/plugin.d.ts +5 -0
  61. package/dist/contract/plugin.js +90 -0
  62. package/dist/contract/regex.d.ts +5 -0
  63. package/dist/contract/regex.js +116 -0
  64. package/dist/contract/render.d.ts +3 -0
  65. package/dist/contract/render.js +19 -0
  66. package/dist/contract/schema.d.ts +10 -0
  67. package/dist/contract/schema.js +139 -0
  68. package/dist/contract/snapshot.d.ts +47 -0
  69. package/dist/contract/snapshot.js +129 -0
  70. package/dist/contract/text.d.ts +14 -0
  71. package/dist/contract/text.js +56 -0
  72. package/dist/contract/values.d.ts +24 -0
  73. package/dist/contract/values.js +127 -0
  74. package/dist/contract/which.d.ts +4 -0
  75. package/dist/contract/which.js +27 -0
  76. package/dist/contract/yaml.d.ts +11 -0
  77. package/dist/contract/yaml.js +595 -0
  78. package/dist/doctor/index.d.ts +3 -0
  79. package/dist/doctor/index.js +69 -0
  80. package/dist/index.d.ts +2 -0
  81. package/dist/index.js +5 -0
  82. package/dist/lang/conventions.d.ts +33 -0
  83. package/dist/lang/conventions.js +216 -0
  84. package/dist/lang/edges.d.ts +2 -0
  85. package/dist/lang/edges.js +142 -0
  86. package/dist/lang/files.d.ts +28 -0
  87. package/dist/lang/files.js +122 -0
  88. package/dist/lang/imports.d.ts +3 -0
  89. package/dist/lang/imports.js +64 -0
  90. package/dist/lang/index.d.ts +13 -0
  91. package/dist/lang/index.js +18 -0
  92. package/dist/lang/lines.d.ts +21 -0
  93. package/dist/lang/lines.js +96 -0
  94. package/dist/lang/projects.d.ts +30 -0
  95. package/dist/lang/projects.js +115 -0
  96. package/dist/lang/specifiers.d.ts +7 -0
  97. package/dist/lang/specifiers.js +88 -0
  98. package/dist/lang/ts.d.ts +2 -0
  99. package/dist/lang/ts.js +7 -0
  100. package/dist/lang/tsc.d.ts +32 -0
  101. package/dist/lang/tsc.js +130 -0
  102. package/dist/lang/types.d.ts +27 -0
  103. package/dist/lang/types.js +4 -0
  104. package/dist/refactor/baseline.d.ts +13 -0
  105. package/dist/refactor/baseline.js +148 -0
  106. package/dist/refactor/bindings.d.ts +76 -0
  107. package/dist/refactor/bindings.js +594 -0
  108. package/dist/refactor/carve.d.ts +31 -0
  109. package/dist/refactor/carve.js +145 -0
  110. package/dist/refactor/compliance.d.ts +15 -0
  111. package/dist/refactor/compliance.js +161 -0
  112. package/dist/refactor/compound.d.ts +5 -0
  113. package/dist/refactor/compound.js +40 -0
  114. package/dist/refactor/diff.d.ts +2 -0
  115. package/dist/refactor/diff.js +170 -0
  116. package/dist/refactor/edits.d.ts +16 -0
  117. package/dist/refactor/edits.js +34 -0
  118. package/dist/refactor/generate.d.ts +4 -0
  119. package/dist/refactor/generate.js +209 -0
  120. package/dist/refactor/index.d.ts +11 -0
  121. package/dist/refactor/index.js +144 -0
  122. package/dist/refactor/lines.d.ts +13 -0
  123. package/dist/refactor/lines.js +34 -0
  124. package/dist/refactor/literal-sources.d.ts +20 -0
  125. package/dist/refactor/literal-sources.js +243 -0
  126. package/dist/refactor/map.d.ts +21 -0
  127. package/dist/refactor/map.js +45 -0
  128. package/dist/refactor/members.d.ts +68 -0
  129. package/dist/refactor/members.js +187 -0
  130. package/dist/refactor/mention-scope.d.ts +19 -0
  131. package/dist/refactor/mention-scope.js +113 -0
  132. package/dist/refactor/mentions.d.ts +28 -0
  133. package/dist/refactor/mentions.js +92 -0
  134. package/dist/refactor/mocks.d.ts +16 -0
  135. package/dist/refactor/mocks.js +139 -0
  136. package/dist/refactor/module-rename.d.ts +17 -0
  137. package/dist/refactor/module-rename.js +160 -0
  138. package/dist/refactor/outcomes.d.ts +42 -0
  139. package/dist/refactor/outcomes.js +61 -0
  140. package/dist/refactor/own-scope.d.ts +16 -0
  141. package/dist/refactor/own-scope.js +142 -0
  142. package/dist/refactor/position.d.ts +34 -0
  143. package/dist/refactor/position.js +58 -0
  144. package/dist/refactor/program-check.d.ts +11 -0
  145. package/dist/refactor/program-check.js +49 -0
  146. package/dist/refactor/progress.d.ts +27 -0
  147. package/dist/refactor/progress.js +66 -0
  148. package/dist/refactor/rename.d.ts +18 -0
  149. package/dist/refactor/rename.js +1299 -0
  150. package/dist/refactor/retarget.d.ts +79 -0
  151. package/dist/refactor/retarget.js +647 -0
  152. package/dist/refactor/routing.d.ts +19 -0
  153. package/dist/refactor/routing.js +237 -0
  154. package/dist/refactor/session.d.ts +81 -0
  155. package/dist/refactor/session.js +180 -0
  156. package/dist/refactor/sites.d.ts +62 -0
  157. package/dist/refactor/sites.js +207 -0
  158. package/dist/refactor/symbols.d.ts +41 -0
  159. package/dist/refactor/symbols.js +385 -0
  160. package/dist/refactor/timings.d.ts +24 -0
  161. package/dist/refactor/timings.js +79 -0
  162. package/dist/refactor/typescript.d.ts +5 -0
  163. package/dist/refactor/typescript.js +279 -0
  164. package/dist/refactor/words.d.ts +42 -0
  165. package/dist/refactor/words.js +114 -0
  166. package/dist/refactor/workspace.d.ts +59 -0
  167. package/dist/refactor/workspace.js +314 -0
  168. package/dist/refactor/writer.d.ts +10 -0
  169. package/dist/refactor/writer.js +110 -0
  170. package/dist/twin/index.d.ts +50 -0
  171. package/dist/twin/index.js +180 -0
  172. package/dist/typecheck/index.d.ts +11 -0
  173. package/dist/typecheck/index.js +210 -0
  174. package/package.json +84 -3
@@ -0,0 +1,239 @@
1
+ # Every command's surface. Each twin builds its parser from this file: no abbreviated long options, `--`
2
+ # ends options, a usage error exits 2, and a `passthrough` command hands its raw argv to its handler.
3
+ #
4
+ # option: name, type (string | int | float | path | flag), help; optional: dest, metavar, choices,
5
+ # default, required, repeatable, store (a flag's stored value; default true), internal
6
+ # (accepted but omitted from help: the twins' own protocol)
7
+ # positional: name, help; optional: nargs ('?' | '*' | '+'; default exactly one)
8
+ # command: help, exit (code -> meaning), options, positionals, subcommands, passthrough, usage,
9
+ # require_one_of (dests; none given is a usage error), exclusive (lists of dests, at most one of
10
+ # each list given; more is a usage error), script (the bundled review script it
11
+ # runs), native (the languages whose twin implements the command; absent: neutral, every twin runs it),
12
+ # format (exempt: the command skips the repo format check; absent: it checks the format declared in
13
+ # living-architecture.yaml after parsing its arguments, and a format refusal exits 2)
14
+ # trmv-refactor's prose_extensions are the non-source files `rename --docs` scans for mentions.
15
+ # language_keys: the public `lang.<language>.<key>` keys; source_globs (one `**/*<ext>` glob per source extension) and
16
+ # waiver (the language's waiver comment) are derived, the rest come from languages.yaml.
17
+ # base_fetch_timeout_seconds: the best-effort `git fetch origin <base>` before a command compares with
18
+ # origin/<base> is killed after this many seconds; the command then uses the ref as it stands.
19
+ # literal_value_forbidden: the substrings a Literal member's new value may not hold (`refactor.literal-value`).
20
+ # timing_phases: the phases `trmv-refactor --timings` reports (`refactor.timing`), in print order; `total` follows them.
21
+ # package, plugin, doctor: the package these commands ship in, its plugin's name (how messages name the tools), and
22
+ # the command that reports a twin's identity (`--twin`).
23
+
24
+ package: type-rename-move
25
+ plugin: trmv
26
+ doctor: trmv-doctor
27
+ base_fetch_timeout_seconds: 30
28
+ literal_value_forbidden: ["'", '"', '`', "\\", '${', "\0", "\r", "\n", "\u2028", "\u2029"]
29
+ timing_phases: [load, resolve, references, rules, conflicts, blindspot-scan, literal-scan, literal-probe, baseline, write]
30
+ language_keys: [source_extensions, source_globs, test_globs, declaration_globs, comment_prefix, suppression, waiver, baseline_file, markers]
31
+
32
+ commands:
33
+ trmv-config:
34
+ help: Print trmv's resolved config values for skills and scripts.
35
+ exit: {0: ok, 1: invalid config, 2: 'usage error, unknown key, both config files or format refusal'}
36
+ options:
37
+ - {name: --root, type: path, help: 'repo root (default: nearest git root of cwd)'}
38
+ subcommands:
39
+ get:
40
+ help: >-
41
+ print one value by dotted key, e.g. commands.typecheck.python; `languages` prints the repo languages and
42
+ lang.<language>.<key> a language fact
43
+ positionals:
44
+ - {name: key, help: dotted config key}
45
+ show:
46
+ help: print trmv's whole resolved config as JSON
47
+
48
+ trmv-doctor:
49
+ help: Check the installed trmv tools match the plugin and the config trmv reads is valid.
50
+ exit: {0: healthy, 1: problems found, 2: usage error}
51
+ format: exempt
52
+ options:
53
+ - {name: --plugin, type: path, metavar: DIR,
54
+ help: "directory inside the calling plugin (e.g. a skill's base directory); check the tools against its plugin.json version"}
55
+ - {name: --root, type: path, help: 'repo root (default: nearest git root of cwd)'}
56
+ - {name: --contract-hash, type: flag, help: print the bundled contract hash and exit}
57
+ - {name: --require-config, type: flag,
58
+ help: 'report that neither trmv.yaml nor living-architecture.yaml is at the repo root'}
59
+ - {name: --twin, type: flag, internal: true, help: 'print this twin''s language, version and contract hash'}
60
+
61
+ trmv-typecheck:
62
+ help: >-
63
+ Run each applicable language's type checker against its committed baseline, which only ever shrinks.
64
+ A language applies when commands.typecheck sets it, or when the repo has its files and a root marker.
65
+ exit: {0: no errors outside the baseline, 1: new errors, 2: 'usage, config or checker error, or format refusal'}
66
+ options:
67
+ - {name: --write-baseline, type: flag,
68
+ help: 'write the baseline of each applicable language that has none (once, when adopting the gate)'}
69
+ - {name: --realign-from, type: string, metavar: REF,
70
+ help: 'move each Python baseline entry to where its error is now, given a commit where the baseline matched,
71
+ then check'}
72
+ - {name: --language, type: string, choices: [python, typescript], internal: true,
73
+ help: check only this language}
74
+ exclusive: [[write_baseline, realign_from]]
75
+
76
+ trmv-refactor:
77
+ native: [python, typescript]
78
+ help: >-
79
+ IDE-grade refactors (Python via la's own renames and rope's moves, TypeScript via its language service): rename,
80
+ rename-map, generate-map, retarget, move-symbol, move-module. Rewrites every import and reference across the project and keeps the type-check
81
+ baseline aligned. Dry-run by default; pass --apply to write. Symbol location comes from --symbol (the
82
+ declaration's path inside --file, e.g. Class.method), --offset, or --line/--col (1-based, as an editor/LSP
83
+ reports).
84
+ exit: {0: ok, 1: refactor error, 2: 'usage error, locator or map error, or format refusal'}
85
+ prose_extensions: [.md, .rst, .txt]
86
+ options:
87
+ - {name: --project, type: path, default: ., help: 'project root (default: cwd)'}
88
+ - {name: --apply, type: flag, help: 'write changes (default: dry-run)'}
89
+ - {name: --timings, type: flag, help: "print each phase's wall time on stderr after all other output"}
90
+ subcommands:
91
+ rename:
92
+ help: >-
93
+ rename the symbol at a location, or with no locator the module --file names (its file moves and every import
94
+ follows); Python: also on an import that names a module
95
+ exclusive: [[offset, line, symbol]]
96
+ options:
97
+ - {name: --file, type: path, required: true,
98
+ help: 'file holding the symbol (with no locator: the module to rename)'}
99
+ - {name: --offset, type: int, help: 0-based character offset}
100
+ - {name: --line, type: int, help: 1-based line}
101
+ - {name: --col, type: int, help: 1-based column}
102
+ - {name: --symbol, type: string, metavar: PATH,
103
+ help: "the declaration's path in --file: Class.method, func.<locals>.inner, func(param), Alias['value'],
104
+ '*.<locals>.name' (every local of that name)"}
105
+ - {name: --new-name, type: string, required: true, help: the new name}
106
+ - {name: --no-in-hierarchy, type: flag, dest: in_hierarchy, store: false,
107
+ help: 'disable hierarchy rename (on by default: also renames overrides in sub/superclasses; Python only)'}
108
+ - {name: --unsure, type: string, choices: [skip, include], default: skip,
109
+ help: 'occurrences the checker cannot resolve: skip (default) or include (risky; Python only)'}
110
+ - {name: --allow-blindspots, type: flag,
111
+ help: 'list the blind spots of the old name (untyped receivers, unlinked keywords) and rename anyway (default: refuse)'}
112
+ - {name: --with, type: string, dest: with_stand_ins, metavar: PATH:LINE, repeatable: true,
113
+ help: 'rename the stand-ins declared on this line too, with their hierarchies; PATH relative to --project (repeatable)'}
114
+ - {name: --without, type: string, dest: without_stand_ins, metavar: PATH:LINE, repeatable: true,
115
+ help: 'leave the stand-ins declared on this line, with their hierarchies; PATH relative to --project (repeatable)'}
116
+ - {name: --keep, type: string, metavar: 'PATH[:LINE]', repeatable: true,
117
+ help: 'leave every edit on this line, in this file or under this directory; PATH relative to --project (repeatable)'}
118
+ - {name: --docs, type: flag,
119
+ help: 'also rewrite mentions in comments, docstrings, strings and prose files; list the rest'}
120
+ - {name: --docs-pick, type: string, metavar: 'PATH:LINE[=ENTRY]', repeatable: true,
121
+ help: 'with --docs: rewrite the mentions listed on this line, with =ENTRY only those of that entry''s old
122
+ name (repeatable)'}
123
+ - {name: --keep-literal, type: string, metavar: KEY, repeatable: true,
124
+ help: 'leave every edit inside a dict or object literal that holds the key KEY (repeatable)'}
125
+ - {name: --words, type: path, metavar: TABLE,
126
+ help: "a word table whose carve-outs leave matching stand-ins and list matching --docs mentions"}
127
+ - {name: --fail-fast, type: flag,
128
+ help: 'stop at the first entry with a refusal (default: compute every entry and report every refusal)'}
129
+ - {name: --stub, type: string, metavar: REMOVAL,
130
+ help: 'Python module rename: leave a stub at the old path, refactor.python.moved_module_stub with {removal}
131
+ set to REMOVAL'}
132
+ rename-map:
133
+ help: >-
134
+ apply a YAML list of rename and retarget entries as one refactor: every entry resolved against the code
135
+ before the map, one diff, one refusal report, written all or nothing
136
+ positionals:
137
+ - {name: map, help: 'the map file: entries {file, symbol | line [col] | offset, new_name | retarget} or {module, new_name}'}
138
+ options:
139
+ - {name: --no-in-hierarchy, type: flag, dest: in_hierarchy, store: false,
140
+ help: 'disable hierarchy rename (on by default: also renames overrides in sub/superclasses; Python only)'}
141
+ - {name: --unsure, type: string, choices: [skip, include], default: skip,
142
+ help: 'occurrences the checker cannot resolve: skip (default) or include (risky; Python only)'}
143
+ - {name: --allow-blindspots, type: flag,
144
+ help: 'list the blind spots of the old name (untyped receivers, unlinked keywords) and rename anyway (default: refuse)'}
145
+ - {name: --with, type: string, dest: with_stand_ins, metavar: PATH:LINE, repeatable: true,
146
+ help: 'rename the stand-ins declared on this line too, with their hierarchies; PATH relative to --project (repeatable)'}
147
+ - {name: --without, type: string, dest: without_stand_ins, metavar: PATH:LINE, repeatable: true,
148
+ help: 'leave the stand-ins declared on this line, with their hierarchies; PATH relative to --project (repeatable)'}
149
+ - {name: --keep, type: string, metavar: 'PATH[:LINE]', repeatable: true,
150
+ help: 'leave every edit on this line, in this file or under this directory; PATH relative to --project (repeatable)'}
151
+ - {name: --docs, type: flag,
152
+ help: 'also rewrite mentions in comments, docstrings, strings and prose files; list the rest'}
153
+ - {name: --docs-pick, type: string, metavar: 'PATH:LINE[=ENTRY]', repeatable: true,
154
+ help: 'with --docs: rewrite the mentions listed on this line, with =ENTRY only those of that entry''s old
155
+ name (repeatable)'}
156
+ - {name: --keep-literal, type: string, metavar: KEY, repeatable: true,
157
+ help: 'leave every edit inside a dict or object literal that holds the key KEY (repeatable)'}
158
+ - {name: --words, type: path, metavar: TABLE,
159
+ help: "a word table whose carve-outs leave matching stand-ins and list matching --docs mentions"}
160
+ - {name: --fail-fast, type: flag,
161
+ help: 'stop at the first entry with a refusal (default: compute every entry and report every refusal)'}
162
+ - {name: --stub, type: string, metavar: REMOVAL,
163
+ help: 'Python module renames: leave a stub at each moved module file''s old path, refactor.python.moved_module_stub
164
+ with {removal} set to REMOVAL'}
165
+ generate-map:
166
+ help: >-
167
+ write a rename map for a word table: one entry per declaration and module whose name holds a word,
168
+ leaving out and listing what a carve-out matches
169
+ positionals:
170
+ - {name: table, help: 'the word table: words {from, to}, carve_outs {words, annotated | paths | symbols} and entries'}
171
+ options:
172
+ - {name: --language, type: string, choices: [python, typescript],
173
+ help: 'the language to generate for (required when the project holds both)'}
174
+ retarget:
175
+ help: rewrite the references to an alias to name its target, declared or imported in the same class or module
176
+ exclusive: [[offset, line, symbol]]
177
+ options:
178
+ - {name: --file, type: path, required: true, help: file holding the alias}
179
+ - {name: --offset, type: int, help: 0-based character offset}
180
+ - {name: --line, type: int, help: 1-based line}
181
+ - {name: --col, type: int, help: 1-based column}
182
+ - {name: --symbol, type: string, metavar: PATH, help: "the alias's path in --file"}
183
+ - {name: --target, type: string, metavar: PATH, required: true, help: "the target's path in --file"}
184
+ - {name: --allow-blindspots, type: flag,
185
+ help: 'list the blind spots of the old name (untyped receivers, unlinked keywords) and rename anyway (default: refuse)'}
186
+ - {name: --with, type: string, dest: with_stand_ins, metavar: PATH:LINE, repeatable: true,
187
+ help: 'rewrite the stand-ins declared on this line too, with their hierarchies; PATH relative to --project (repeatable)'}
188
+ - {name: --without, type: string, dest: without_stand_ins, metavar: PATH:LINE, repeatable: true,
189
+ help: 'leave the stand-ins declared on this line, with their hierarchies; PATH relative to --project (repeatable)'}
190
+ - {name: --keep, type: string, metavar: 'PATH[:LINE]', repeatable: true,
191
+ help: 'leave every edit on this line, in this file or under this directory; PATH relative to --project (repeatable)'}
192
+ - {name: --docs, type: flag,
193
+ help: 'also rewrite mentions in comments, docstrings, strings and prose files; list the rest'}
194
+ - {name: --words, type: path, metavar: TABLE,
195
+ help: "a word table whose carve-outs leave matching stand-ins and list matching --docs mentions"}
196
+ - {name: --fail-fast, type: flag,
197
+ help: 'stop at the first entry with a refusal (default: compute every entry and report every refusal)'}
198
+ move-symbol:
199
+ help: move a top-level declaration to another module
200
+ exclusive: [[offset, line, symbol]]
201
+ options:
202
+ - {name: --file, type: path, required: true, help: file holding the symbol}
203
+ - {name: --offset, type: int, help: 0-based character offset}
204
+ - {name: --line, type: int, help: 1-based line}
205
+ - {name: --col, type: int, help: 1-based column}
206
+ - {name: --symbol, type: string, metavar: PATH, help: "the top-level declaration's name in --file"}
207
+ - {name: --dest, type: path, required: true, help: destination module of the same language (must exist)}
208
+ move-module:
209
+ help: move a module file or directory into a package/dir
210
+ options:
211
+ - {name: --module, type: path, required: true, help: source module file or directory}
212
+ - {name: --dest, type: path, required: true, help: destination package directory (must exist)}
213
+
214
+ trmv-compliance:
215
+ native: [python, typescript]
216
+ help: >-
217
+ Report constructs that make a rename un-verifiable, with each file's language's checks (Python:
218
+ untyped-def, unannotated-attr, explicit-any, mock, rope-walk, attr-blindspot, string-blindspot; TypeScript:
219
+ tsconfig, explicit-any, untyped-def, mock, attr-blindspot, string-blindspot). attr-blindspot and string-blindspot
220
+ need --attr NAME: x.NAME accesses, and accesses naming NAME by a string, whose receiver is untyped.
221
+ exit: {0: clean, 1: violations, 2: usage error or format refusal}
222
+ positionals:
223
+ - {name: paths, nargs: '+', help: files or directories}
224
+ options:
225
+ - {name: --select, type: string, help: 'comma-separated checks (default: every check of each file''s language)'}
226
+ - {name: --attr, type: string, repeatable: true,
227
+ help: 'a member name attr-blindspot and string-blindspot check (repeatable; requires either selected)'}
228
+
229
+ trmv-mock-lint:
230
+ native: [python, typescript]
231
+ help: >-
232
+ Every test double must be bound to the real type: a unittest.mock double to a spec; a Vitest/Jest fn() or
233
+ module factory to a type.
234
+ exit: {0: clean, 1: violations, 2: 'usage error, unresolvable base or format refusal'}
235
+ positionals:
236
+ - {name: paths, nargs: '+', help: files or directories}
237
+ options:
238
+ - {name: --base, type: string,
239
+ help: 'base branch (compared as origin/BRANCH): print only the findings the base lacks'}
@@ -0,0 +1,8 @@
1
+ # The committed config files at the repo root a trmv command reads, in order: the first that exists. la's file carries
2
+ # trmv's keys too, so a repo using la keeps one file.
3
+ files: [trmv.yaml, living-architecture.yaml]
4
+ # Per file, every released format (its `format` key), oldest first: the release that introduced it. The last is the
5
+ # format the file's package reads and writes; la-arch-migrate converts living-architecture.yaml from each earlier one.
6
+ formats:
7
+ trmv.yaml: [0.14.0]
8
+ living-architecture.yaml: [0.4.0, 0.14.0]
@@ -0,0 +1,212 @@
1
+ # Every finding, verdict and hint a command prints, by stable id. `{name}` inserts the value as text (a
2
+ # non-string value as its canonical repr); `{name!r}` inserts the canonical repr; `{{` and `}}` are literal
3
+ # braces. Callers pre-format numbers that need padding or fixed decimals. See README.md.
4
+
5
+ findings:
6
+ # ---- the YAML profile
7
+ yaml.duplicate-key: 'duplicate key {key!r} at lines {first} and {second}'
8
+
9
+ # ---- OS and YAML errors
10
+ os.error: '{path}: {reason}'
11
+ os.not-found: no such file or directory
12
+ os.permission-denied: permission denied
13
+ os.is-a-directory: is a directory
14
+ os.not-a-directory: not a directory
15
+ os.other: 'OS error {code}'
16
+ yaml.invalid: '{path}: invalid YAML'
17
+ yaml.invalid-because: '{path}: invalid YAML: {error}'
18
+
19
+ # ---- diagrams: why the index.yaml diagrams block is unusable
20
+ c4.index-invalid-yaml: index.yaml is not valid YAML
21
+ c4.index-duplicate-key: 'index.yaml is not valid YAML: {error}'
22
+
23
+ # ---- the repo format check, before every command the CLI manifest does not mark `format: exempt`
24
+ format.missing: 'living-architecture.yaml declares no format, but this la reads format {current}: run la-arch-migrate to convert the repo'
25
+ format.invalid: 'living-architecture.yaml: format {value!r} is not a version (three dot-separated integers); this la reads format {current}'
26
+ format.newer: 'living-architecture.yaml declares format {declared}, but this la reads format {current}: upgrade la to {declared} or later'
27
+ format.older: 'living-architecture.yaml declares format {declared}, but this la reads format {current}: run la-arch-migrate to convert the repo'
28
+ format.trmv-missing: 'trmv.yaml declares no format, but this trmv reads format {current}: add the line `format: {current}`'
29
+ format.trmv-invalid: 'trmv.yaml: format {value!r} is not a version (three dot-separated integers); this trmv reads format {current}'
30
+ format.trmv-newer: 'trmv.yaml declares format {declared}, but this trmv reads format {current}: upgrade trmv to {declared} or later'
31
+ format.trmv-older: 'trmv.yaml declares format {declared}, but this trmv reads format {current}'
32
+
33
+ # ---- the config files
34
+ config.both-files: '{first} and {second} are both at the repo root; keep one: a repo using la keeps {second}'
35
+
36
+ # ---- la-config and trmv-config
37
+ config.error: '{prog}: {error}'
38
+ config.unknown-key: '{prog}: unknown key {key!r}'
39
+ config.not-git: '{prog}: not inside a git repository'
40
+ config.git-failed: git ls-files failed, so the repo's files cannot be listed
41
+ # `get lang.<language>.waiver`: the language's waiver comment.
42
+ config.waiver: '{prefix} ALLOW(<rule>): <reason>'
43
+ # `la-config show`, on stderr: one per key the local file sets.
44
+ config.local-override: '{prog}: {key} from {file}'
45
+
46
+ # ---- twin forwarding
47
+ twin.error: '{prog}: {error}'
48
+ twin.unavailable: 'the {language} twin ({package} {version}) is not reachable; install it with: {install}'
49
+ twin.forward-refused: refusing to forward to the {language} twin from a forwarded process (LA_FORWARDED=1)
50
+ twin.launch-failed: 'the {language} twin could not run {command}'
51
+
52
+ # ---- the change set
53
+ changes.git-failed: git {args} failed
54
+
55
+ # ---- trmv-typecheck
56
+ typecheck.error: 'trmv-typecheck: {error}'
57
+ typecheck.header: 'trmv-typecheck: checking {language} with {command}'
58
+ typecheck.not-git: 'trmv-typecheck: not inside a git repository'
59
+ typecheck.no-languages: 'trmv-typecheck: nothing to check (no language is configured or has source files and a root marker)'
60
+ typecheck.not-found: 'trmv-typecheck: {language}: {command} not found in {local_bin} or on PATH'
61
+ typecheck.bad-command: 'trmv-typecheck: commands.typecheck.{language} is not a command: {command!r}'
62
+ typecheck.not-native: '{language} type checks run only in the {language} twin'
63
+ typecheck.skip: 'trmv-typecheck: {language}: {baseline} exists, skipped'
64
+ typecheck.refusal: 'trmv-typecheck: every applicable language already has a baseline; nothing written'
65
+ typecheck.write: 'trmv-typecheck: {language}: wrote {baseline}'
66
+ typecheck.new-error: '{file}({line},{col}): error {code}: {message}'
67
+ typecheck.count: '{file}({line},{col}): error {code}: {message} (baseline {baseline}, now {now})'
68
+ typecheck.new-errors: 'trmv-typecheck: {language}: {count} new error(s) not in {baseline}'
69
+ typecheck.shrink: 'trmv-typecheck: {language}: {count} fixed error(s) removed from {baseline}'
70
+ typecheck.global-diagnostic: 'trmv-typecheck: {language}: the checker reported an error without a file'
71
+ typecheck.checker-failed: 'trmv-typecheck: {language}: {command} exited {code} without a parsable diagnostic'
72
+ typecheck.bad-ref: 'trmv-typecheck: {ref} is not a commit'
73
+ typecheck.realign: 'trmv-typecheck: {language}: {count} entr(ies) of {baseline} realigned from {ref}'
74
+ typecheck.realign-hint: 'trmv-typecheck: {language}: if an edit moved errors that {baseline} held, run trmv-typecheck --realign-from <commit where it matched>'
75
+ typecheck.baseline-invalid: 'trmv-typecheck: {language}: {baseline} is malformed'
76
+ typecheck.patch-not-applied: 'trmv-typecheck: python: {command} loaded no basedpyright, so the pyright#11919 patch was not applied; run basedpyright under Node and keep NODE_OPTIONS'
77
+ typecheck.patch-unverified: 'trmv-typecheck: python: the pyright#11919 patch is verified for basedpyright {verified}, but {version} is installed; pin a verified version'
78
+ typecheck.patch-mismatch: 'trmv-typecheck: python: basedpyright {version} has the pyright#11919 line {count} times, not once; reinstall basedpyright'
79
+
80
+ # ---- trmv-refactor
81
+ refactor.line-out-of-range: line {line} out of range (file has {count} lines)
82
+ refactor.no-locator: provide one of --offset, --line [--col], or --symbol
83
+ refactor.outside-project: 'path is not inside the project: {path}'
84
+ refactor.unsure-warning: 'WARNING: --unsure=include also renames occurrences the checker cannot resolve; it may rewrite unrelated attributes or keywords of the same name.'
85
+ refactor.applied: "\nAPPLIED. {count} file(s) changed:"
86
+ refactor.applied-file: ' {path}'
87
+ refactor.dry-run: "\nDRY-RUN. {count} file(s) would change. Re-run with --apply."
88
+ refactor.unsupported-extension: 'not a source file of a supported language: {path}'
89
+ refactor.cross-language-dest: '--dest {dest} is not a {language} file'
90
+ refactor.skipped: '{prog}: not a source file, skipped: {path}'
91
+ refactor.rename-header: 'Renaming <{old}> to <{new}>:'
92
+ refactor.move-symbol-header: 'Moving global <{name}>:'
93
+ refactor.move-module-header: 'Moving module <{name}>:'
94
+ refactor.moved: "rename from {old}\nrename to {new}"
95
+ refactor.ts-outside-project: no TypeScript project includes {path}
96
+ refactor.ts-not-supported: '{option} is not supported for TypeScript'
97
+ refactor.ts-tsconfig-missing: 'architecture/index.yaml names tsconfig {path}, which does not exist'
98
+ refactor.col-out-of-range: column {col} out of range (line {line} has {count} characters)
99
+ refactor.offset-out-of-range: offset {offset} out of range (file has {count} characters)
100
+ refactor.cannot-rename: the element at this location cannot be renamed
101
+ refactor.not-movable: 'nothing to move here: the location must name a top-level declaration of {path}'
102
+ refactor.conflicting-edits: projects disagree on an edit in {path}
103
+ refactor.destination-exists: 'destination already exists: {path}'
104
+ refactor.destination-missing: 'destination does not exist: {path}'
105
+ refactor.destination-inside-source: '{path} is inside {source}, which cannot move into itself'
106
+ refactor.unparsable: '{path} does not parse as Python, so nothing was refactored'
107
+ refactor.file-undecodable: '{path} does not decode as {encoding}, so nothing was refactored'
108
+ refactor.ambiguous-module: '{module} names more than one file ({paths}), so nothing was refactored'
109
+ refactor.unencodable: '{path} cannot hold its new text in its encoding {encoding}, so nothing was refactored'
110
+ refactor.resolution-changed: '{path}:{line}: {name} would not resolve as it does now, so nothing was refactored; move it by hand'
111
+ refactor.source-missing: 'source does not exist: {path}'
112
+ refactor.mixed-languages: '{path} holds sources of more than one language: {languages}'
113
+ refactor.rope-walk: 'rope cannot follow {path}:{line}, so nothing was refactored (a rope bug, not a source error); trmv-compliance --select rope-walk lists every such file'
114
+ refactor.name-conflict: '{name} already names something else at {path}:{line}, so nothing was refactored'
115
+ refactor.guarded-import: '{path}:{line}: the moved code reads a name this guarded import binds; move it by hand'
116
+ refactor.pyright-failed: 'basedpyright could not find the references, so nothing was refactored'
117
+ refactor.unresolved-base: '{name} has a base basedpyright cannot resolve at {path}:{line}, so nothing was refactored; run trmv-refactor in the project environment'
118
+ refactor.file-changed: '{path} changed while trmv-refactor ran, so nothing was refactored'
119
+ refactor.blindspots: '{count} blind spot(s) of {names}: type or resolve them, or pass --allow-blindspots'
120
+ refactor.unlinked-keyword: '{path}:{line}: unlinked-keyword: {callee}({old}=...) — the checker does not link {old}= to the renamed declaration, so a rename of {old} is unverifiable'
121
+ refactor.unresolved-target: '{path}:{line}: unresolved-target: {target} names .{attr} but does not resolve'
122
+ refactor.mixed-target: '{path}:{line}: mixed-target: {receiver}.{attr} lands on renamed and unchanged declarations'
123
+ refactor.stand-in: '{path}:{line}: stand-in: {cls}.{attr} is outside the renamed hierarchy; pass --with {path}:{line} to rename it too or --without {path}:{line} to leave it'
124
+ refactor.not-stand-in: '{site} is not a stand-in of this rename, so nothing was refactored'
125
+ refactor.computed-stand-in: '{path}:{line}: computed-stand-in: {cls}.{attr} is declared by a computed name; pass --without {path}:{line} and rename it by hand'
126
+ refactor.keep-unmatched: '--keep {site} matches nothing this rename touches, so nothing was refactored'
127
+ refactor.keep-unmatched-near: '--keep {site} matches nothing this rename touches; the nearest edited line is {path}:{line}, so nothing was refactored'
128
+ refactor.keep-unneeded: 'WARNING: --keep {site} matches nothing this rename touches'
129
+ refactor.keep-literal-unneeded: 'WARNING: --keep-literal {key} matches nothing this rename touches'
130
+ refactor.leftover: '{path}:{line}: leftover: {where} mentions {old}'
131
+ refactor.pick-needs-docs: '--docs-pick needs --docs, so nothing was refactored'
132
+ refactor.pick-unmatched: '--docs-pick {site} names no listed mention, so nothing was refactored'
133
+ refactor.pick-ambiguous: '--docs-pick {site}: entries {first} and {second} both mention {old} here; add =ENTRY, so nothing was refactored'
134
+ refactor.unresolved-name: '{path}:{line}: unresolved-name: {old} resolves to no declaration here, so it is left unchanged'
135
+ refactor.undecodable: '{path}: undecodable: the file does not decode as {encoding}, so it is left unchanged although it may mention {old}'
136
+ refactor.stub-not-module: '--stub applies only to the rename of a Python module file, so nothing was refactored'
137
+ refactor.stub-unconfigured: '--stub needs refactor.python.moved_module_stub in living-architecture.yaml, so nothing was refactored'
138
+ refactor.symbol-unresolved: '{path}: {symbol} names no declaration; candidates: {candidates}'
139
+ refactor.symbol-ambiguous: '{path}: {symbol} names more than one declaration: {candidates}'
140
+ refactor.map-invalid: '{map}: entry {index} is not a valid rename-map entry'
141
+ refactor.map-mixed-languages: '{map} holds entries of more than one language: {languages}'
142
+ refactor.map-duplicate: '{map}: entries {first} and {second} locate the same symbol with different changes'
143
+ refactor.map-conflict: '{path}:{line}: entries {first} and {second} rewrite this site differently, so nothing was refactored'
144
+ refactor.words-invalid: '{table}: {section} item {index} is not valid'
145
+ refactor.carved: '{path}:{line}: carve-out: {name} keeps {word} ({matcher})'
146
+ refactor.not-generated: '{path}:{line}: not-generated: {name} spells {word}, but no map entry can rename it'
147
+ refactor.generate-empty: '{table}: no declaration in the project spells a word of the table'
148
+ refactor.generate-language: 'the project holds sources of more than one language ({languages}); pass --language'
149
+ refactor.symbol-wildcard: '{path}: {symbol} names every matching local, which only a rename takes'
150
+ refactor.retarget-header: 'Retargeting <{old}> to <{new}>:'
151
+ refactor.retarget-scope: '{target} is not declared or imported in the class or module that declares {alias}'
152
+ refactor.retarget-override: '{path}:{line}: {cls}.{name} overrides the alias, so nothing was refactored'
153
+ refactor.retarget-shadowed: '{path}:{line}: {name} names something else here, so nothing was refactored'
154
+ refactor.retarget-unbound: '{path}:{line}: {module} does not bind {name}, so nothing was refactored'
155
+ refactor.write-failed: 'could not write {path}; the files already written are restored, so nothing was refactored'
156
+ refactor.rollback-failed: 'could not write {path}; restoring failed, so these paths are left changed: {paths}'
157
+ refactor.baseline-ambiguous: 'WARNING: {baseline}: the {code} entry of {path} cannot follow the refactor; left unchanged'
158
+ refactor.baseline-failed: 'the {language} type checker failed, so the baseline cannot be realigned and nothing was refactored'
159
+ refactor.literal-value: '--new-name {value!r} holds a quote, backtick, backslash, ${{, NUL or line break, which a literal member cannot'
160
+ refactor.literal-unresolved: '{path}:{line}: literal-unresolved: the checker needs {old!r} here, where no string literal can be rewritten'
161
+ refactor.unverified-read: '{path}:{line}: unverified-read: {name} holds {old!r}, rewritten at {source_path}:{source_line}; this read is not proven to name the renamed member'
162
+ refactor.compound: '{path}:{line}: leftover: declaration {name} contains {old}'
163
+ refactor.site-missing: '{option} {site} names no file, directory or line in the project'
164
+ refactor.checker-exit: ' the checker exited with code {code}; its stderr:'
165
+ refactor.checker-not-started: ' the checker could not start: {error}'
166
+ refactor.checker-error: ' the checker answered: {error}'
167
+ refactor.checker-no-report: no JSON report on stdout
168
+ refactor.progress-phase: '[{phase}]'
169
+ refactor.progress-item: '[{phase} {n}/{count}] {entries}: {old} -> {new}'
170
+ refactor.progress-clean: '[{phase} {n}/{count}] {entries}: {old} -> {new}: clean'
171
+ refactor.progress-refused: '[{phase} {n}/{count}] {entries}: {old} -> {new}: {refusals} refusal(s)'
172
+ refactor.progress-entry: 'entry {index}'
173
+ refactor.progress-entries: 'entries {indexes}'
174
+ refactor.entry-refusal: '{entries} ({locator}): {text}'
175
+ refactor.timing: 'timing: {phase} {seconds}s'
176
+
177
+ # ---- trmv-compliance
178
+ compliance.untyped-def: '{path}:{line}: untyped-def: {name}() missing {missing}'
179
+ compliance.untyped-params: params {params}
180
+ compliance.untyped-return: return
181
+ compliance.unannotated-attr: '{path}:{line}: unannotated-attr: {cls}.{attr} assigned without a type annotation'
182
+ compliance.attr-blindspot: '{path}:{line}: attr-blindspot: {receiver}.{attr} — {receiver} is {type}, so a rename of .{attr} is unverifiable'
183
+ compliance.string-blindspot: '{path}:{line}: string-blindspot: {site} — {receiver} is {type}, so a rename of .{attr} is unverifiable'
184
+ compliance.string-blindspot-silent: '{path}:{line}: string-blindspot: {site} — {receiver} is {type}, so a rename of .{attr} is unverifiable and a miss raises no error'
185
+ compliance.pyright-failed: 'basedpyright could not type the receivers of .{attr}'
186
+ compliance.parse-error: '{path}:{line}: parse-error: {error}'
187
+ compliance.rope-walk: '{path}:{line}: rope-walk: rope cannot follow this construct, so trmv-refactor would refuse this file (a rope bug, not a source error)'
188
+ compliance.unknown-checks: 'unknown check(s): {checks}'
189
+ compliance.tsconfig: '{path}: tsconfig: {flag} is not enabled'
190
+ compliance.explicit-any: '{path}:{line}: explicit-any: an `{any}` type — use a real type or `{top}`'
191
+ compliance.ts-untyped-def: '{path}:{line}: untyped-def: {name} is implicitly any'
192
+ compliance.attr-required: '--select {check} needs --attr NAME'
193
+ compliance.attr-unselected: '--attr needs attr-blindspot or string-blindspot among the selected checks'
194
+
195
+ # ---- trmv-mock-lint
196
+ mock-lint.patch: '{path}:{line}: {call}() without autospec=True/new=/spec= — stale members go undetected'
197
+ mock-lint.mock: '{path}:{line}: {call}() without spec=/spec_set= — bind it to the real class (or use create_autospec)'
198
+ mock-lint.fn: '{path}:{line}: {call}() without a type argument or implementation — type it as {call}<typeof real>()'
199
+ mock-lint.module: "{path}:{line}: {call}() factory not typed against a resolvable module — pass import('<module>') (Vitest) or <typeof import('<module>')> (Jest)"
200
+ mock-lint.cast: '{path}:{line}: double assertion through {via} — build a typed double instead'
201
+
202
+ # ---- trmv-doctor and la-doctor
203
+ doctor.ok: 'ok: {package} tools {version}; config from {source}'
204
+ doctor.version-mismatch: 'installed {package} tools are {installed}, but plugin {expected} needs {series}.x; reinstall them with: {install}'
205
+ doctor.plugin-behind: 'installed {package} tools are {installed}, but plugin {expected} is older; update the plugin: claude plugin marketplace update living-architecture && claude plugin update {package}@living-architecture'
206
+ doctor.no-config-file: defaults (no config file)
207
+ doctor.fail: 'FAIL: {problem}'
208
+ doctor.missing-executable: '`{exe}` not found on PATH'
209
+ doctor.plugin-not-found: no .claude-plugin/plugin.json at or above {dir}
210
+ doctor.plugin-invalid: '{path} is not valid JSON with a "version" of the form <major>.<minor>.<rest>'
211
+ doctor.plugin-unreadable: cannot inspect {path}
212
+ doctor.trmv-config-missing: no trmv.yaml or living-architecture.yaml at the repo root; run /trmv:init to onboard this repo
@@ -0,0 +1,146 @@
1
+ # Per-language facts. `markers` are the repo-root files that, with a file of the language, make it a repo language;
2
+ # `executables` are what the doctors require on PATH when it is one; `compliance_checks` are its trmv-compliance check
3
+ # ids; `declaration_globs` and `excluded_dirs` (directory names) are never expanded or checked by trmv-*; `local_bin`
4
+ # is where the repo installs its checker; `baseline_file` is the checker's committed baseline. `runner` runs a command through the language's twin of `{package}` at `{version}`
5
+ # (the command is appended); `install` is, per package, the hint shown when that twin is unreachable; `unit_separator` joins a unit's
6
+ # segments (`pkg.api`, `src/api`); `imports_non_source` means its imports can reach files of no language (JSON
7
+ # modules), so la-affected-tests computes it for a change to such a file. `checker_patch_versions` (python) lists
8
+ # the basedpyright versions trmv-typecheck's pyright#11919 patch is verified for; any other installed version is
9
+ # refused. `checker_export_versions` (python) lists the basedpyright versions the occurrence-export preload of
10
+ # trmv-refactor's language server is verified for; `cache_dir_variable` (python) names the environment variable holding
11
+ # the directory of trmv-refactor's occurrence-index cache. `any_type` and `top_type` spell the language's any type and its safe top type in explicit-any findings.
12
+ # `root_members` (python) are the members of the implicit root class `object` over every supported Python version (as
13
+ # the typeshed of the shipped basedpyright declares them), which a member rename may not take.
14
+ # `string_member_calls` are the calls that name a member by a string, which a rename rewrites and attr-blindspot
15
+ # checks: `call` names the form; the callee resolves to it when its declaration is `qualname` in `module` (python)
16
+ # or when it is spelled `call` with a head declared outside the project's sources (typescript); `syntax` is the
17
+ # callee's dotted tail an unresolved callee must still match (python); `object` and `member` are the argument
18
+ # positions of the object and its member's name, `target` the position of a dotted target string (python); `silent`
19
+ # marks a call whose miss raises no error, and `default` the argument position whose presence makes it so (python).
20
+ # `name_decorators` (python) are the decorators whose positional arguments each name a member of the decorated
21
+ # method's class; `name_reads` (python) are the attributes holding a class's member names, read by a string in the
22
+ # listed `shapes` (`subscript`: `X.attr["name"]`, `get`: `X.attr.get("name")`, `in`: `"name" in X.attr` and `not in`);
23
+ # both match by the declaration `qualname` in `module`. `name_class_values` (python) are the class-body assignments
24
+ # whose value names members of the class, in the listed `shapes` (`element` of a tuple, list or set display, the
25
+ # whole `string`, a dict display's `key`).
26
+ # `fixture_decorators` are the decorators, as dotted names, under which a method is a test fixture: a stand-in a
27
+ # rename leaves by default.
28
+ # Test globs use the contract glob dialect (contract README: matched against the POSIX repo-relative path;
29
+ # case-sensitive; `*` stays within one segment; `**` is zero or more whole segments).
30
+
31
+ python:
32
+ markers: [pyproject.toml, setup.py]
33
+ source_extensions: [.py]
34
+ files_label: .py
35
+ imports_non_source: false
36
+ unit_separator: .
37
+ test_globs:
38
+ - '**/tests/**/*'
39
+ - '**/test/**/*'
40
+ - '**/test_*'
41
+ - '**/*_test.py'
42
+ - '**/conftest.py'
43
+ declaration_globs: []
44
+ excluded_dirs: [.git, .hg, .mypy_cache, .pytest_cache, .ropeproject, .svn, .tox, .venv, _svn, venv]
45
+ compliance_checks: [untyped-def, unannotated-attr, explicit-any, mock, rope-walk, attr-blindspot, string-blindspot]
46
+ string_member_calls:
47
+ - {call: getattr, module: builtins, qualname: getattr, syntax: getattr, object: 0, member: 1, default: 2}
48
+ - {call: setattr, module: builtins, qualname: setattr, syntax: setattr, object: 0, member: 1}
49
+ - {call: hasattr, module: builtins, qualname: hasattr, syntax: hasattr, object: 0, member: 1, silent: true}
50
+ - {call: delattr, module: builtins, qualname: delattr, syntax: delattr, object: 0, member: 1}
51
+ - {call: pytest.MonkeyPatch.setattr, module: _pytest.monkeypatch, qualname: MonkeyPatch.setattr, syntax: setattr,
52
+ object: 0, member: 1, target: 0}
53
+ - {call: pytest.MonkeyPatch.delattr, module: _pytest.monkeypatch, qualname: MonkeyPatch.delattr, syntax: delattr,
54
+ object: 0, member: 1, target: 0}
55
+ - {call: unittest.mock.patch.object, module: unittest.mock, qualname: _patcher.object, syntax: patch.object,
56
+ object: 0, member: 1}
57
+ - {call: pytest_mock.MockerFixture.patch.object, module: pytest_mock.plugin, qualname: MockerFixture._Patcher.object,
58
+ syntax: patch.object, object: 0, member: 1}
59
+ - {call: unittest.mock.patch, module: unittest.mock, qualname: patch, syntax: patch, target: 0}
60
+ - {call: pytest_mock.MockerFixture.patch, module: pytest_mock.plugin, qualname: MockerFixture.patch, syntax: patch,
61
+ target: 0}
62
+ name_decorators:
63
+ - {call: pydantic.field_validator, module: pydantic.functional_validators, qualname: field_validator}
64
+ - {call: pydantic.field_serializer, module: pydantic.functional_serializers, qualname: field_serializer}
65
+ name_reads:
66
+ - {attribute: model_fields, module: pydantic.main, qualname: BaseModel.model_fields, shapes: [subscript, get, in]}
67
+ - {attribute: model_fields_set, module: pydantic.main, qualname: BaseModel.model_fields_set, shapes: [in]}
68
+ name_class_values:
69
+ - {name: __slots__, shapes: [element, string, key]}
70
+ - {name: __match_args__, shapes: [element]}
71
+ fixture_decorators: [pytest.fixture, pytest_asyncio.fixture]
72
+ any_type: Any
73
+ top_type: object
74
+ executables: []
75
+ comment_prefix: '#'
76
+ suppression: '# pyright: ignore[<rule>]'
77
+ local_bin: .venv/bin
78
+ baseline_file: .basedpyright/baseline.json
79
+ checker_patch_versions: ['1.40.2']
80
+ checker_export_versions: ['1.40.2']
81
+ cache_dir_variable: LA_CACHE_DIR
82
+ root_members: [__annotations__, __class__, __delattr__, __dict__, __dir__, __doc__, __eq__, __format__,
83
+ __getattribute__, __getstate__, __hash__, __init__, __init_subclass__, __module__, __ne__, __new__,
84
+ __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__]
85
+ runner: uvx --from {package}=={version}
86
+ install:
87
+ type-rename-move: uv tool install type-rename-move=={version}
88
+ living-architecture: uv tool install living-architecture=={version} --with-executables-from type-rename-move
89
+
90
+ typescript:
91
+ markers: [tsconfig.json]
92
+ source_extensions: [.ts, .tsx, .mts, .cts, .js, .jsx, .mjs, .cjs]
93
+ files_label: TS/JS
94
+ imports_non_source: true
95
+ unit_separator: /
96
+ test_globs:
97
+ - '**/*.test.*'
98
+ - '**/*.spec.*'
99
+ - '**/__tests__/**/*'
100
+ - '**/__mocks__/**/*'
101
+ - '**/tests/**/*'
102
+ - '**/test/**/*'
103
+ declaration_globs: ['**/*.d.ts', '**/*.d.mts', '**/*.d.cts']
104
+ excluded_dirs: [node_modules]
105
+ compliance_checks: [tsconfig, explicit-any, untyped-def, mock, attr-blindspot, string-blindspot]
106
+ string_member_calls:
107
+ - {call: vi.spyOn, object: 0, member: 1}
108
+ - {call: jest.spyOn, object: 0, member: 1}
109
+ - {call: Reflect.get, object: 0, member: 1}
110
+ - {call: Reflect.set, object: 0, member: 1}
111
+ - {call: Reflect.has, object: 0, member: 1}
112
+ - {call: Reflect.deleteProperty, object: 0, member: 1}
113
+ - {call: Reflect.defineProperty, object: 0, member: 1}
114
+ - {call: Reflect.getOwnPropertyDescriptor, object: 0, member: 1}
115
+ - {call: Object.defineProperty, object: 0, member: 1}
116
+ - {call: Object.getOwnPropertyDescriptor, object: 0, member: 1}
117
+ fixture_decorators: []
118
+ # Mock calls naming a module by path: the framework receivers (a named import from `module`, or the unshadowed global
119
+ # of that name) and their calls taking a module path as argument 0, with the factory's argument index where one is taken.
120
+ mock_receivers:
121
+ - {name: vi, module: vitest}
122
+ - {name: jest, module: '@jest/globals'}
123
+ mock_module_calls:
124
+ - {call: mock, factory: 1}
125
+ - {call: doMock, factory: 1}
126
+ - {call: unstable_mockModule, factory: 1}
127
+ - {call: unmock}
128
+ - {call: doUnmock}
129
+ - {call: dontMock}
130
+ - {call: setMock}
131
+ - {call: importActual}
132
+ - {call: importMock}
133
+ - {call: requireActual}
134
+ - {call: requireMock}
135
+ - {call: createMockFromModule}
136
+ any_type: any
137
+ top_type: unknown
138
+ executables: [node, npx]
139
+ comment_prefix: '//'
140
+ suppression: '// @ts-expect-error — <reason>'
141
+ local_bin: node_modules/.bin
142
+ baseline_file: .tsc-baseline.json
143
+ runner: npx -y -p {package}@{version}
144
+ install:
145
+ type-rename-move: npm install -g type-rename-move@{version}
146
+ living-architecture: npm install -g living-architecture@{version} type-rename-move@{version}
@@ -0,0 +1,28 @@
1
+ # Portable regex subset
2
+
3
+ `issue_key_pattern` and each pattern of `refactor.string_forms` must use only constructs that Python `re` and
4
+ JavaScript `RegExp` (no flags) read identically on ASCII input. The accept/reject vectors are in
5
+ `vectors/regex-subset.yaml`.
6
+
7
+ - `issue_key_pattern` is applied with full-match semantics. A tag id containing any non-ASCII character never
8
+ matches, in every twin, whatever the pattern.
9
+ - A `refactor.string_forms` pattern is searched anywhere in a string literal's source text and must hold exactly
10
+ one capturing group. A literal part containing any non-ASCII character never matches, in every twin, whatever
11
+ the pattern.
12
+
13
+ Allowed:
14
+
15
+ - literal characters, except the unescaped metacharacters `{` `}` `[` `]` `(` `)` outside their constructs
16
+ - `.`
17
+ - escapes: `\d \D \w \W \s \S`, the anchor `\b`, and a backslash before any ASCII punctuation character
18
+ - character classes `[...]` and `[^...]` holding literals, ranges `a-z`, the class escapes above and escaped
19
+ punctuation; a `[` inside a class must be escaped
20
+ - quantifiers `*`, `+`, `?`, `{m}`, `{m,}`, `{m,n}`, each optionally followed by `?` (lazy)
21
+ - anchors `^` and `$`
22
+ - groups `( … )` and non-capturing groups `(?: … )`
23
+ - alternation `|`
24
+
25
+ Rejected: every other construct, including lookahead and lookbehind, named groups (`(?P<n>…)`, `(?<n>…)`),
26
+ backreferences, inline flags (`(?i)`, `(?i:…)`), possessive quantifiers (`*+`, `++`, `?+`, `{m,n}+`),
27
+ atomic groups (`(?>…)`), conditionals, comments (`(?#…)`), `\A`, `\Z`, `\z`, and any pattern that does not
28
+ compile.