Linting rules
Overview
Reference for all Tolk linter checks
The acton check command validates your Tolk code and reports diagnostics for lint rules.
Use acton check --explain <CODE> to read a detailed explanation for any specific rule right in the terminal.
acton check --list-lint-rules also exists as a hidden machine-readable helper, but it only prints rule names and markdown descriptions. This index is the human-readable catalog with rule codes, lifecycle status, and quick-fix availability.
Lifecycle states currently used in the catalog are mainly Stable and Preview. The generator also supports future Deprecated and Removed statuses when rules eventually transition.
For setup, configuration, and CI usage, start with Linting.
| Code | Rule | Status | Quick fix | What it does |
|---|---|---|---|---|
| C001 | compiler-error | Stable since v0.0.1 | not available | Reports compiler and parse errors. |
| E001 | field-init-can-be-folded | Stable since v0.0.1 | always available | Checks for struct initialization where the field name and the variable used to initialize it are the same. |
| E002 | unused-variable | Stable since v0.0.1 | always available | Checks for variables and parameters that are declared but never used. |
| E003 | mutable-variable-can-be-immutable | Stable since v0.0.1 | sometimes available | Checks for variables that are declared as mutable (var) but are never mutated. |
| E004 | deprecated-symbol-use | Stable since v0.0.1 | not available | Checks for usage of deprecated symbols in code. |
| E005 | write-only-variable | Stable since v0.0.1 | not available | Checks for variables that are written to but never read. |
| E006 | unused-import | Stable since v0.0.1 | sometimes available | Checks for imports that are never used in the file. |
| E007 | pure-function-call-unused | Stable since v0.0.1 | not available | Checks for calls to @pure functions where the result is not used. |
| E008 | no-bounce-handler | Stable since v0.0.1 | not available | No description provided. |
| E009 | method-can-be-static | Stable since v0.0.1 | not available | Checks for instance methods where self is unnecessary. |
| E010 | used-ignored-identifier | Stable since v0.0.1 | always available | Checks for usages of identifiers explicitly marked as unused with a leading underscore. |
| E011 | message-should-be-named | Stable since v0.0.1 | not available | Checks for messages created with createMessage(...) but named as generic msg. |
| E012 | create-message-inline-send | Stable since v0.0.1 | not available | Checks for inline sending of newly created messages: createMessage(...).send(...). |
| E013 | mutable-parameter-can-be-immutable | Stable since v0.0.1 | always available | Checks for parameters that are declared as mutable (mutate) but are never mutated. |
| E014 | acton-import-in-contract | Stable since v0.0.1 | not available | Forbids importing files from .acton in contract dependency trees. |
| E015 | asm-function-missing-safety-comment | Stable since v0.0.1 | not available | Requires documenting safety requirements for every declaration with an asm body. |
| E016 | send-mode-literal | Stable since v0.0.1 | sometimes available | Warns when send mode is passed as numeric literal instead of SEND_MODE_* constants. |
| E017 | unauthorized-access | Preview since v0.0.1 | sometimes available | Detects storage mutations (contract.setData(...), *.save()) that are reachable without a preceding admin sender check. |
| E018 | import-path-can-use-mappings | Stable since v0.0.1 | sometimes available | Warns when a relative import path can be replaced with a configured @mapping/... path. |
| E019 | several-not-null-assertions | Stable since v0.0.1 | always available | Detects repeated not-null assertions like foo!!. |
| E020 | reserve-mode-literal | Stable since v0.0.1 | sometimes available | Warns when reserve mode is passed as numeric literal instead of RESERVE_MODE_* constants. |
| E021 | dangerous-send-mode-missing-safety-comment | Stable since v0.0.1 | not available | Requires a SAFETY comment for msg.send(...) calls that use dangerous send-mode flags. |
| E022 | negated-is-type-can-use-not-is | Stable since v0.0.1 | always available | Detects negated type checks written as !(a is T). |
| E023 | bless-call-missing-safety-comment | Stable since v0.0.1 | not available | Requires a SAFETY comment for calls to transformSliceToContinuation and for calls to any asm function that uses BLESS. |
| E024 | random-requires-initialization | Preview since v0.0.1 | sometimes available | Requires random generator initialization before random value generation calls. |
| E025 | divide-before-multiply | Preview since v0.0.1 | sometimes available | Detects cases where division is evaluated before multiplication. |
| E026 | duplicated-condition | Stable since v0.0.1 | not available | Detects duplicated conditions in if / else if chains. |
| E027 | identical-conditional-branches | Stable since v0.0.1 | not available | Detects conditionals where both branches are structurally identical. |
| E028 | no-global-variables | Stable since v0.0.1 | not available | Disallows top-level global variable declarations. |
| E029 | incoming-messages-duplicate-opcode | Stable since v0.0.1 | not available | Checks contract header field incomingMessages for duplicate message opcodes. |
| E030 | enum-cast-missing-safety-comment | Stable since v0.0.1 | not available | Requires a SAFETY comment for non-literal as casts to enum types. |
| E031 | missing-contract-header | Stable since v0.0.1 | not available | Warns when a contract source defines standard contract entrypoints but omits the contract header. |
| E032 | unused-expression | Stable since v0.0.1 | not available | Warns when an expression statement computes a value that is immediately discarded. |
| E033 | dict-type-use | Stable since v0.0.1 | not available | Warns when code uses the low-level dict type. |
| E034 | throw-requires-errors-enum | Stable since v0.0.1 | not available | Warns when symbolic throw codes are referenced as bare constants. |
| E035 | create-message-body-to-cell | Stable since v0.0.1 | not available | Warns about MyMessage { ... }.toCell() inside createMessage({ body: ... }) initializer. |
| E036 | throw-requires-documented-error-value | Preview since v0.0.1 | not available | Requires documentation for enum values used as throw codes. |
| S001 | name-case-checker | Stable since v0.0.1 | always available | Checks identifier naming style and suggests consistent casing. |
| S002 | explicit-return-type | Stable since v0.0.1 | sometimes available | Requires explicit return types for function declarations. |
Last updated on