Commands¶
$ rattle COMMAND [OPTIONS] ...
Use -h or --help on any command to print its supported options.
lint¶
Check files for Rattle violations. Use - PATH to check code from standard
input as PATH.
$ rattle lint [OPTIONS] [PATH ...]
fix¶
Apply available autofixes to files. Use - PATH to fix code from standard
input as PATH and write the fixed code to standard output.
$ rattle fix [OPTIONS] [--interactive] [PATH ...]
--interactive / -i¶
Prompt before applying each autofix. Press y to apply, n to skip, or q to
stop prompting and leave the remaining fixes unapplied. This option cannot be
used with standard input.
lsp¶
Start the language server providing IDE features over
LSP.
This command is only available if Rattle is installed with the lsp extras,
for example pip install "rattle-lint[lsp]". See IDE for more
details.
$ rattle lsp [--no-stdio] [--tcp PORT | --ws PORT]
--config / -c CONFIG¶
Use a specific config file instead of discovered configuration.
--no-stdio¶
Disable the default stdio transport when serving over TCP or WebSocket.
--tcp PORT¶
Serve LSP over TCP on PORT.
--ws PORT¶
Serve LSP over WebSocket on PORT.
--debounce-interval SECONDS¶
Delay diagnostics after document changes, in seconds. Default: 0.5.
rules¶
Display the lint rules enabled for the current configuration. Pass paths to see the rules resolved for those files or directories.
$ rattle rules [OPTIONS] [PATH ...]
--config / -c CONFIG¶
Use a specific config file instead of discovered configuration.
--test¶
Test enabled lint rules using their VALID and
INVALID test cases.
explain¶
Display detailed information about one lint rule.
$ rattle explain [OPTIONS] RULE
--config / -c CONFIG¶
Use a specific config file instead of discovered configuration.
--json¶
Print rule information as JSON.
validate¶
Validate Rattle configuration. When no path is provided, Rattle validates
pyproject.toml from the current directory.
$ rattle validate
$ rattle validate pyproject.toml
Environment variables¶
RATTLE_DEBUG=1¶
Enable debug logging.
RATTLE_METRICS=1¶
Print internal run metrics for lint and fix.