hadome 0.6.0 → 0.8.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.
- package/README.md +18 -9
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -106,7 +106,7 @@ npx hadome check
|
|
|
106
106
|
<summary>Python (uv, pip)</summary>
|
|
107
107
|
|
|
108
108
|
```sh
|
|
109
|
-
uv add --dev hadome==0.
|
|
109
|
+
uv add --dev hadome==0.8.0 # or pip install hadome==0.8.0
|
|
110
110
|
uv run hadome check
|
|
111
111
|
```
|
|
112
112
|
|
|
@@ -117,7 +117,7 @@ uv run hadome check
|
|
|
117
117
|
|
|
118
118
|
```kotlin
|
|
119
119
|
// build.gradle.kts
|
|
120
|
-
plugins { id("io.github.rerorets.hadome") version "0.
|
|
120
|
+
plugins { id("io.github.rerorets.hadome") version "0.8.0" }
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
Run it with `./gradlew hadomeCheck`.
|
|
@@ -132,7 +132,7 @@ Run it with `./gradlew hadomeCheck`.
|
|
|
132
132
|
<plugin>
|
|
133
133
|
<groupId>io.github.rerorets</groupId>
|
|
134
134
|
<artifactId>hadome-maven-plugin</artifactId>
|
|
135
|
-
<version>0.
|
|
135
|
+
<version>0.8.0</version>
|
|
136
136
|
</plugin>
|
|
137
137
|
```
|
|
138
138
|
|
|
@@ -164,7 +164,7 @@ go tool -modfile=tools.mod hadome check
|
|
|
164
164
|
<summary>Rust (cargo binstall)</summary>
|
|
165
165
|
|
|
166
166
|
```sh
|
|
167
|
-
cargo binstall hadome@0.
|
|
167
|
+
cargo binstall hadome@0.8.0
|
|
168
168
|
hadome check
|
|
169
169
|
```
|
|
170
170
|
|
|
@@ -182,7 +182,7 @@ You can also install from an archive on the [releases](https://github.com/rerore
|
|
|
182
182
|
|
|
183
183
|
```powershell
|
|
184
184
|
# Windows (PowerShell); on an arm64 machine, use windows_arm64
|
|
185
|
-
Invoke-WebRequest https://github.com/rerorets/hadome/releases/latest/download/hadome_0.
|
|
185
|
+
Invoke-WebRequest https://github.com/rerorets/hadome/releases/latest/download/hadome_0.8.0_windows_amd64.zip -OutFile hadome.zip
|
|
186
186
|
Expand-Archive hadome.zip -DestinationPath "$HOME\hadome"
|
|
187
187
|
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$HOME\hadome", "User")
|
|
188
188
|
# open a new terminal, then:
|
|
@@ -191,8 +191,8 @@ hadome version
|
|
|
191
191
|
|
|
192
192
|
```sh
|
|
193
193
|
# macOS and Linux; linux_arm64, darwin_amd64 and darwin_arm64 are there too
|
|
194
|
-
curl -LO https://github.com/rerorets/hadome/releases/latest/download/hadome_0.
|
|
195
|
-
tar -xzf hadome_0.
|
|
194
|
+
curl -LO https://github.com/rerorets/hadome/releases/latest/download/hadome_0.8.0_linux_amd64.tar.gz
|
|
195
|
+
tar -xzf hadome_0.8.0_linux_amd64.tar.gz
|
|
196
196
|
sudo mkdir -p /usr/local/bin && sudo mv hadome /usr/local/bin/
|
|
197
197
|
hadome version
|
|
198
198
|
```
|
|
@@ -229,7 +229,7 @@ This repository uses hadome to stop regressions in code and tests.
|
|
|
229
229
|
- When you ask about `3`, give what hadome listed (the rule and its `why`), why you made that change, and the other way you would take if it is not accepted, with what that costs. Leave the decision to the person; do not tell them it is fine.
|
|
230
230
|
- Never add `gate:allow` to get a check to pass. Add one only when the rule truly does not apply, with a specific reason, and tell the person.
|
|
231
231
|
- When a test guards a product-specific invariant, add `guards: <id>` to its doc comment; for `durable`, `erasable`, `append-only` and `fail-closed`, add `guards: <type> <target>`. `idempotent`, `round-trip` and `isolated` are recognised from the test's calls. `hadome explain invariants` lists them.
|
|
232
|
-
- When `hadome check` lists invariant candidates and one covers behaviour that matters, propose it to the person instead of adding it yourself.
|
|
232
|
+
- When `hadome check` lists invariant candidates and one covers behaviour that matters, or when `.hadome.yml` has no dependency diagram (`rules.deps.diagram`), propose it to the person instead of adding it yourself. `hadome suggest diagram` and `hadome suggest calls` draft the diagrams.
|
|
233
233
|
- Before changing `.hadome.yml`, run `hadome explain <key>`. After changing it, run `hadome config check`.
|
|
234
234
|
- When a person asks to stop a kind of change (for example SQL that rewrites production data, or a key in the code), write it as a gate or an invariant. Examples: https://github.com/rerorets/hadome/blob/main/docs/for-agents.md#stopping-changes-that-must-not-be-made
|
|
235
235
|
<!-- hadome:end -->
|
|
@@ -242,7 +242,7 @@ This repository uses hadome to stop regressions in code and tests.
|
|
|
242
242
|
| Group | Rules |
|
|
243
243
|
|---|---|
|
|
244
244
|
| `tests/` | `scope-shrunk` (what tests guard shrank) · `invariant-unguarded` · `no-clock` · `no-sleep` · `always-true` · `skip-without-reason` · `no-mock` (mocks in tests of pure code) · `guards-nothing` (tests that call no product code) · `no-assertion` (tests without an assertion) · `duplicate` (tests with the same body) · `purity-lost` and `target-unknown` (review) |
|
|
245
|
-
| `deps/` | `not-in-diagram` (imports your dependency diagram does not draw) · `call-not-in-diagram` (calls your call diagram does not draw) · `diagram-stale` (boxes that name nothing) |
|
|
245
|
+
| `deps/` | `not-in-diagram` (imports your dependency diagram does not draw) · `call-not-in-diagram` (calls your call diagram does not draw) · `diagram-stale` (boxes that name nothing) · `cycle` (imports that make a new cycle between units, with or without a diagram) · `layer` (imports from an inner layer to an outer one) |
|
|
246
246
|
| `size/` | `file-lines` · `function-lines` · `params` · `complexity` · `interface-methods` |
|
|
247
247
|
| `comments/` | `todo-format` (TODOs without a when) · `missing-doc` · `broken-reference` (comments pointing at missing documents) |
|
|
248
248
|
| `unknown/` | `unread` (review): a file hadome could not read · `import` (review): an import whose destination is decided only at run time |
|
|
@@ -275,6 +275,15 @@ Settings go in `.hadome.yml`: limits, the dependency diagram, invariants and so
|
|
|
275
275
|
|
|
276
276
|
`hadome init` writes a minimal `.hadome.yml`; it never overwrites one that exists. To have the output in Japanese every time, add `messages: ja` to it. `--lang`, when given, comes first.
|
|
277
277
|
|
|
278
|
+
`hadome suggest diagram` drafts the dependency diagram, and `hadome suggest calls` the call diagram, drawn as the code is now. Write them to files and name them in `rules.deps.diagram` and `rules.deps.calls`, and a change that makes things worse than the diagrams fails.
|
|
279
|
+
|
|
280
|
+
```sh
|
|
281
|
+
hadome suggest diagram > docs/dependencies.md
|
|
282
|
+
hadome suggest calls > docs/calls.md
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Examples of keeping the direction between inner and outer layers, or GoF patterns, are in [Keeping design patterns](docs/patterns.md).
|
|
286
|
+
|
|
278
287
|
Changing the settings and proposing invariants is the agents' job. Agents read the specification with `hadome explain <key>` ([the guide for agents](docs/for-agents.md)). People decide which proposals to accept and whether to allow a change that loosens the rules. Such a change stops with exit code `3` for a person's review.
|
|
279
288
|
|
|
280
289
|
### Writing an exception
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hadome",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://github.com/rerorets/hadome",
|
|
6
6
|
"repository": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"THIRD_PARTY_NOTICES"
|
|
19
19
|
],
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"hadome-linux-x64": "0.
|
|
22
|
-
"hadome-linux-arm64": "0.
|
|
23
|
-
"hadome-darwin-x64": "0.
|
|
24
|
-
"hadome-darwin-arm64": "0.
|
|
25
|
-
"hadome-win32-x64": "0.
|
|
21
|
+
"hadome-linux-x64": "0.8.0",
|
|
22
|
+
"hadome-linux-arm64": "0.8.0",
|
|
23
|
+
"hadome-darwin-x64": "0.8.0",
|
|
24
|
+
"hadome-darwin-arm64": "0.8.0",
|
|
25
|
+
"hadome-win32-x64": "0.8.0"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=18"
|