III.4 Static analyzer
Runs in oxl check, oxl build and LSP. Errors (E) cancel the build; warnings (W) are configured in [lint].
| Code | Level | Check |
|---|---|---|
schema-break | E | a breaking schema change (§9.2) |
send | E | a non-transferable value goes to another task (§7.3) |
effects | E | a call of a function with a disallowed effect (§6.2) |
unhandled-error | E | an unhandled result with an error (§6.5) |
retry-unsafe | E | @retry without @idempotent/@readonly |
saga-idempotency | E | a saga step or compensation without @idempotent |
missing-policy | E | an rpc is inaccessible to anyone: no allow/@public/@internal and no internal calls (§13.4) |
unhosted | E | a service, actor, topic or saga without a role (§12.1) |
magic-literal | W | the same duration, size, retry count or limit literal occurs in attributes or arguments 2+ times — extract it into a const (part IV) |
n-plus-one | W | a query in a loop over the result of another query |
scatter-gather | W | a query to a sharded table without a shard key |
durable-non-idempotent | W | a durable pipeline step calls a non-idempotent rpc |
actor-cycle | W | a possible cyclic wait of actors |
secret-leak | E | secret.reveal() gets into a log, string or response |
blocking-in-task | W | a blocking FFI call without blocking |
time-mix | E | mixing kinds of time (§17.2) |
unused | W | unused imports, variables, dep |
| must-close | E | a value of a type with @must_close may leave scope without close() or a transfer of ownership (§4.3) |
User rules are comptime functions over the AST (std.comptime), plugged in via [lint] plugins.
Suppression on a declaration: @allow(lint: rule, reason: "text") on any declaration (item, method, field, variant, rpc, msg) switches the rule off for the whole declaration (attributes, signature, body). rule is a name from the table above, a diagnostic code or a plugin rule; reason is required and non-empty (bad-allow); an unknown rule is unknown-lint; a rule whose violation is an error (E) cannot be suppressed (bad-allow) (D-8064; D-7830).
Implementation-defined. Analyzer plugins (D-8056; DIV-043; HANDOFF §3). This implementation shows plugins the expressions flat, without computed types.
Related diagnostics
bad-allow, lint-plugin, missing-policy, n-plus-one, unknown-lint, unused
Source: docs/spec/oxl-standard.en.md