OxL Reference

III.4 Static analyzer

Runs in oxl check, oxl build and LSP. Errors (E) cancel the build; warnings (W) are configured in [lint].

CodeLevelCheck
schema-breakEa breaking schema change (§9.2)
sendEa non-transferable value goes to another task (§7.3)
effectsEa call of a function with a disallowed effect (§6.2)
unhandled-errorEan unhandled result with an error (§6.5)
retry-unsafeE@retry without @idempotent/@readonly
saga-idempotencyEa saga step or compensation without @idempotent
missing-policyEan rpc is inaccessible to anyone: no allow/@public/@internal and no internal calls (§13.4)
unhostedEa service, actor, topic or saga without a role (§12.1)
magic-literalWthe same duration, size, retry count or limit literal occurs in attributes or arguments 2+ times — extract it into a const (part IV)
n-plus-oneWa query in a loop over the result of another query
scatter-gatherWa query to a sharded table without a shard key
durable-non-idempotentWa durable pipeline step calls a non-idempotent rpc
actor-cycleWa possible cyclic wait of actors
secret-leakEsecret.reveal() gets into a log, string or response
blocking-in-taskWa blocking FFI call without blocking
time-mixEmixing kinds of time (§17.2)
unusedWunused imports, variables, dep
must-closeEa 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.

bad-allow, lint-plugin, missing-policy, n-plus-one, unknown-lint, unused

Source: docs/spec/oxl-standard.en.md