Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coherence/journal/a8c20833df2abb361.a46f7968.jsonl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .coherence/runs/a8c20833df2abb361.ef76c476.jsonl

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ test setup per runner, as [docs/config.md](docs/config.md#more-than-one-language
Rust chokepoints are graded through rust-analyzer, found on the machine rather
than installed by npm ([docs/enforcement.md](docs/enforcement.md#rust)); the
economy and Scope readings read Rust's text by its crates' folder layout, and detect its
binaries, build scripts, routes and foreign exports as entrances.
binaries, examples, build scripts, routes and foreign exports (C, wasm-bindgen and
UniFFI, an exported impl's methods among them) as entrances; a declared mirror
reads a Rust list from the array a const or static is set to.
Go is an opt-in bundled plugin, `"plugins": { "go": "bundled" }`, graded
through gopls ([docs/plugins.md](docs/plugins.md#go)); a language Coherence
lacks is a plugin you can write, held by `coherence plugin check` to what every
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ reading first asks for that slot:
| `source` | the economy and mass | `SourceSyntax` |
| `declares` | the observation's interface map | `(line) => "type" \| "value" \| "body" \| "unknown"` |
| `notice` | the session start | `(root) => string` |
| `lists` | declared mirrors | `(text, name) => Literal \| undefined` |
| `lists` | declared mirrors, for a list in the language's files; a file of a language whose plugin fills none is read as TypeScript | `(text, name) => Literal \| undefined` |
| `topLevel` | the spec model's check that a handler, guard or mirror is declared | `(text, name) => boolean` |
| `boundaries` | `scaffold import` and adoption | `BoundarySource`: a tool's declaration file read into modules, as tach's |

Expand Down
20 changes: 17 additions & 3 deletions plugins/rust/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"serverExtensions": [
".rs"
],
"testFiles": [
"^tests\\.rs$"
],
"basisFiles": [
"^Cargo\\.toml$",
"^Cargo\\.lock$",
Expand Down Expand Up @@ -51,16 +54,26 @@
{
"rule": "foreign export",
"plural": "foreign exports",
"detects": "a function carrying #[no_mangle], #[unsafe(no_mangle)], #[export_name = …] or #[wasm_bindgen], which code outside Rust calls by name"
"detects": "a function code outside Rust calls by name: a fn carrying #[no_mangle], #[unsafe(no_mangle)], #[export_name = …], #[wasm_bindgen] (#[wasm_bindgen(start)] included) or #[uniffi::export]; each pub method or constructor of a #[wasm_bindgen] impl, named Type::method; and each pub method of a #[uniffi::export] impl (every method of a trait impl), named Type::method; never a fn of an extern block, which the host provides"
},
{
"rule": "example",
"plural": "examples",
"detects": "the main of an example at Cargo's default paths, examples/x.rs or examples/x/main.rs, which cargo run --example x runs"
}
],
"notDetected": "a router built in a helper and merged in, a route macro of another framework (warp filters, poem), a trait a framework calls (a tonic gRPC service, a tower Service), a message consumer and a proc-macro are not detected"
"notDetected": "a router built in a helper and merged in, a route macro of another framework (warp filters, poem), a trait a framework calls (a tonic gRPC service, a tower Service), a message consumer, a proc-macro, an export a macro generates, a function a UniFFI .udl file declares, the getters and setters wasm-bindgen generates for an exported struct's pub fields, and an example Cargo.toml places away from Cargo's default paths are not detected"
},
"markedFolders": [
{
"name": "target",
"beside": "Cargo.toml",
"reason": "Cargo build folder"
},
{
"name": "pkg",
"beside": "Cargo.toml",
"reason": "wasm-pack output"
}
],
"ladder": {
Expand All @@ -85,6 +98,7 @@
"interfaces": "rust-scope.ts#RUST_INTERFACES",
"source": "rust-source.ts#RUST_SOURCE",
"declares": "rust-interfaces.ts#rustDeclares",
"topLevel": "rust-top-level.ts#rustDeclaresAtTop"
"topLevel": "rust-top-level.ts#rustDeclaresAtTop",
"lists": "rust-lists.ts#rustListOf"
}
}
Loading
Loading