Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ton-blockchain/acton/llms.txt
Use this file to discover all available pages before exploring further.
acton fmt formats .tolk source files using the built-in Tolk formatter. By
default it rewrites files in place; --check mode instead validates formatting
and exits non-zero when any file needs changes, making it suitable for
pre-commit hooks and CI. For editor integrations, --stdin reads a source
buffer from standard input and writes the formatted result to standard output
without touching any files.
Synopsis
PATHS is omitted, Acton scans the resolved project root recursively.
Arguments & options
Format options
| Flag | Type | Default | Description |
|---|---|---|---|
[PATHS...] | paths | project root | Files or directories to format. Repeatable. Conflicts with --stdin. |
--check | flag | false | Validate formatting without rewriting. Prints a unified diff for each misformatted file and exits non-zero if any changes are needed. |
--stdin | flag | false | Read Tolk source from stdin and write formatted output to stdout. Intended for editor integrations. Conflicts with PATHS. |
--stdin-filepath <PATH> | string | — | Virtual file path shown in stdin diagnostics. Accepted only with --stdin. Acton does not read or write this path. |
--range <startLine:startChar-endLine:endChar> | string | — | Format only the specified zero-based source range (zero-based lines, zero-based UTF-8 byte columns). Disables import reordering. Requires exactly one explicit .tolk file path (or --stdin). |
Global flags
| Flag | Type | Default | Description |
|---|---|---|---|
--color <WHEN> | auto | always | never | auto | Control coloured output. |
--manifest-path <PATH> | path | — | Path to Acton.toml. Conflicts with --project-root. |
--project-root <PATH> | path | — | Path to project root. Conflicts with --manifest-path. |
Acton.toml configuration
Acton.toml
| Key | Type | Default | Description |
|---|---|---|---|
width | integer | 80 | Maximum formatted line width. |
ignore | glob[] | [] | Additional exclude globs applied during directory traversal. Explicit file arguments bypass these globs. |
separate-import-groups | bool | false | Insert blank lines between import groups. |
Import sorting
Imports are sorted into groups in this order, lexicographically within each group:@stdlib@acton- Other
@…mappings - Plain imports
./…relative../…relative
Behaviour notes
- Only
.tolkfiles are formatted; directory traversal is recursive. - Built-in excludes always apply:
node_modules,.git,target,.acton. - Explicit file arguments are formatted even when they match
[fmt].ignore. [fmt].ignoreapplies only to directory traversal, not to explicit paths.- Syntax errors are reported to stderr and cause a non-zero exit.
--stdin --checkcompares stdin with the formatted output and prints a unified diff.--rangedisables import reordering for that invocation.- Editor integrations that expose Unicode scalar or UTF-16 positions must
convert them to UTF-8 byte columns before invoking
--range.
Examples
CI recipe
.github/workflows/ci.yml