[Go to site: main page, start]

Docs
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.

Rule code prefixes are not CLI severity. Most linter rules emit warnings by default; acton-import-in-contract emits an error, and compiler/parse diagnostics are errors outside per-rule lint processing.

Preview status does not necessarily mean enabled by default. unauthorized-access and throw-requires-documented-error-value are currently disabled (allow) by default unless you enable them in [lint.rules]; for focused runs, use acton check --enable-only E013 or acton check --enable-only E030.

For setup, configuration, and CI usage, start with Linting.

CodeRuleStatusQuick fixWhat it does
C001compiler-errorStable since v1.0.0not availableReports compiler and parse errors.
E001unused-variableStable since v1.0.0always availableChecks for variables and parameters that are declared but never used.
E002mutable-variable-can-be-immutableStable since v1.0.0sometimes availableChecks for variables that are declared as mutable (var) but are never mutated.
E003deprecated-symbol-useStable since v1.0.0not availableChecks for usage of deprecated symbols in code.
E004write-only-variableStable since v1.0.0not availableChecks for variables that are written to but never read.
E005unused-importStable since v1.0.0sometimes availableChecks for imports that are never used in the file.
E006pure-function-call-unusedStable since v1.0.0not availableChecks for calls to @pure functions where the result is not used.
E007no-bounce-handlerStable since v1.0.0not availableReports createMessage({ bounce: BounceMode.<...> }) calls reachable from onInternalMessage when the contract file does not declare onBouncedMessage.
E008used-ignored-identifierStable since v1.0.0always availableChecks for usages of identifiers explicitly marked as unused with a leading underscore.
E009mutable-parameter-can-be-immutableStable since v1.0.0always availableChecks for parameters that are declared as mutable (mutate) but are never mutated.
E010acton-import-in-contractStable since v1.0.0not availableForbids importing files from .acton in contract dependency trees.
E011asm-function-missing-safety-commentStable since v1.0.0not availableRequires documenting safety requirements for every declaration with an asm body.
E012send-mode-literalStable since v1.0.0sometimes availableWarns when send mode is passed as numeric literal instead of SEND_MODE_* constants.
E013unauthorized-accessPreview since v1.0.0not availableDetects storage mutations (contract.setData(...), *.save()) that are reachable without a preceding admin sender check.
E014several-not-null-assertionsStable since v1.0.0always availableDetects repeated not-null assertions like foo!!.
E015reserve-mode-literalStable since v1.0.0sometimes availableWarns when reserve mode is passed as numeric literal instead of RESERVE_MODE_* constants.
E016dangerous-send-mode-missing-safety-commentStable since v1.0.0not availableRequires a SAFETY comment for msg.send(...) calls that use dangerous send-mode flags.
E017bless-call-missing-safety-commentStable since v1.0.0not availableRequires a SAFETY comment for calls to transformSliceToContinuation and for calls to any asm function that uses BLESS.
E018random-requires-initializationPreview since v1.0.0not availableRequires random generator initialization before random value generation calls.
E019divide-before-multiplyPreview since v1.0.0not availableDetects cases where division is evaluated before multiplication.
E020duplicated-conditionStable since v1.0.0not availableDetects duplicated conditions in if / else if chains.
E021identical-conditional-branchesStable since v1.0.0not availableDetects conditionals where both branches are structurally identical.
E022no-global-variablesStable since v1.0.0not availableDisallows top-level global variable declarations.
E024enum-cast-missing-safety-commentStable since v1.0.0not availableRequires a SAFETY comment for non-literal as casts to enum types.
E025missing-contract-headerStable since v1.0.0not availableWarns when a contract source defines standard contract entrypoints but omits the contract header.
E026unused-expressionStable since v1.0.0not availableWarns when an expression statement computes a value that is immediately discarded.
E027dict-type-useStable since v1.0.0not availableWarns when code uses the low-level dict type.
E028throw-requires-errors-enumStable since v1.0.0not availableWarns when symbolic throw codes are referenced as bare constants.
E029create-message-body-to-cellStable since v1.0.0not availableWarns about MyMessage { ... }.toCell() inside createMessage({ body: ... }) initializer.
E030throw-requires-documented-error-valuePreview since v1.0.0not availableRequires documentation for enum values used as throw codes.
E031unnecessary-not-null-assertionStable since v1.2.0sometimes availableDetects a not-null assertion when the expression's inferred type cannot be null.
S001name-case-checkerStable since v1.0.0always availableChecks identifier naming style and suggests consistent casing.
S002explicit-return-typeStable since v1.0.0sometimes availableRequires explicit return types for function declarations.
S003field-init-can-be-foldedStable since v1.0.0always availableChecks for struct initialization where the field name and the variable used to initialize it are the same.
S004method-can-be-staticStable since v1.0.0not availableChecks for instance methods where self is unnecessary.
S005message-should-be-namedStable since v1.0.0not availableChecks for messages created with createMessage(...) but named as generic msg or message.
S006create-message-inline-sendStable since v1.0.0not availableChecks for inline sending of newly created messages: createMessage(...).send(...).
S007import-path-can-use-mappingsStable since v1.0.0sometimes availableWarns when a relative import path can be replaced with a configured @mapping/... path.
S008negated-is-type-can-use-not-isStable since v1.0.0always availableDetects negated type checks written as !(a is T).
S009prefer-gramsStable since v1.2.0sometimes availableReplaces the standard library's ton() alias with grams().

Last updated on