acton check
Reference manual for the acton check command
Synopsis
acton check [options] [target]
Description
Run the Tolk linter on the whole project, a specific contract name from
Acton.toml, or a single .tolk file.
By default, Acton checks contracts from Acton.toml together with workspace
test files and standalone script roots that define main(). The command also
supports machine-readable output formats and rule explanations.
Options
Check Options
Contract name from Acton.toml or path to a .tolk file.
Apply available fixes automatically.
Works only in plain output mode.
Output format for diagnostics.
plain, json, sarif, github, gitlab
Write output to a file instead of standard output.
Enable only selected lint rules, for example E001,S001.
Print an explanation for a lint rule.
Display Options
Control when to use colored output.
auto, always, never
Project Options
Path to the Acton.toml file to use for this invocation.
Use this when running the command outside the project directory or when the manifest lives at a non-default location.
Path to the project root to use for configuration discovery and relative defaults.
This conflicts with --manifest-path.
Behavior
--list-lint-rulesis a hidden machine-readable helper that prints JSON entries with rulenameand markdowndescription- for a human-readable catalog with rule codes, lifecycle status, and quick-fix availability, use the web rules index
--fixapplies edits only inplainoutput mode--fixrewrites files only for fixes marked as automatically applicable- when a diagnostic offers multiple fixes,
--fixapplies only the first one - non-plain output formats report diagnostics without rewriting source files
githubemits GitHub Actions workflow annotations- output format resolution is: CLI flag, then
[lint].output-format, then defaultplain --output-fileis not valid withplainformat- project-wide mode includes workspace
*.test.tolkfiles and standalone script roots that definemain() - project-wide discovery skips built-in directories such as
.git,.github,.idea,.acton,node_modules,target,tolk-stdlib,.codex, and.claude - contracts with non-
.tolksources such as precompiled.bocentries are not lint roots - single-file mode relaxes
E014 (acton-import-in-contract) - targets ending with
.tolkare treated as file paths; other targets are resolved as contract names fromActon.toml - use an explicit
.tolkpath such as./contracts/Counter.tolkwhen a name could be mistaken for a contract name - inline suppressions use rule names, for example
// check-disable-next-line unused-variable, write-only-variable - suppressions apply only to the immediately following line and match
diagnostic names, including
compiler-errorandparse-error; diagnostic codes such asC001are not matched --fixapplies only linter-provided fixes; diagnostics without a safe fix remain in the report--enable-onlyis applied after config is loaded: selected rules keep their configured severity, selected rules that werealloware re-enabled at the default severity, and every unselected rule is forced toallow--enable-onlyselectors must resolve to exactly one rule; in practice, use full rule codes such asE003for stability- excluded files still participate in import/type resolution, but lint diagnostics for excluded non-root files are filtered out
- explicit targets still run even if they match
[lint].exclude - in project-wide runs, excluded contract roots are skipped entirely, so their compiler errors and lint diagnostics are not reported
- compiler errors are still shown for roots that are actually checked, including explicit targets
--fixcan still exit with status1when unfixed diagnostics or warning threshold violations remain after rewriting
Exit Status
0: No lint errors were reported, warning thresholds were respected, and any requested autofixes completed successfully.1: Lint errors were found, warning limits were exceeded, autofix failed, or configuration/target resolution failed.
Examples
-
Check the whole project:
acton check -
Check a specific contract by name:
acton check Counter -
Check one file:
acton check ./contracts/Counter.tolk -
Emit SARIF to a file:
acton check --output-format sarif --output-file build/reports/lint.sarif -
Run only selected rules:
acton check --enable-only E001,S001 -
List rule metadata as JSON:
acton check --list-lint-rules -
Emit GitHub Actions annotations in CI:
acton check --output-format github -
Apply local autofixes where available:
acton check --fix
See Also
acton help fmt- Linting guide
- Linter rules
Last updated on