sifr fmt for deterministic source formatting and sifr lint for suppressible policy-rule diagnostics. Neither command runs the type-checker or produces binaries, so both are fast to invoke in editors, pre-commit hooks, and CI pipelines.
sifr fmt — format source files
sifr fmt formats .sifr source files using the same parser, AST, and formatter that the Sifr language server uses for editor formatting. The formatter is syntax-aware, deterministic, and idempotent — running it twice produces the same output as running it once.
sifr fmt formats the current directory. File and directory inputs discover .sifr files, respect formatter excludes, and honour .gitignore by default.
Common usage
Flags
Configuration in sifr.toml
Place formatter configuration under the [format] section of sifr.toml.
Formatter pragmas
The formatter respects inline pragma comments at Sifr syntax boundaries:Style conventions
The formatter canonicalises Sifr’s ownership-qualifier syntax. For example:Editor formatting is LSP-first. Editors should invoke
sifr lsp --stdio and request formatting through standard LSP methods — not call sifr fmt directly. See the LSP page for details.sifr lint — run policy diagnostics
sifr lint runs Sifr-owned policy rules against your source. It operates independently of the compiler — it does not type-check, does not produce binaries, and does not make hard compiler errors suppressible.
sifr lint checks the current directory. Targets may be individual files, directories, or - for stdin.
Common usage
Flags
Available rules
These are Sifr-owned rule IDs. Python rule IDs, Ruff prefixes, and
# noqa comments have no effect in sifr lint.Configuration in sifr.toml
Place lint configuration under the [lint] section of sifr.toml.
Suppressing a diagnostic inline
Suppress a policy diagnostic on a specific line with a# sifr: ignore[rule-id] comment:
--ignore-suppressions to run lint as if no inline comments were present.
Fixing violations automatically
sifr lint --fix writes all available safe fixes to disk. Use --diff first to preview what would change:
