cli
ruff_sync.cli ¶
Synchronize Ruff linter configuration across Python projects.
This module provides a CLI tool and library for downloading, parsing, and merging Ruff configuration from upstream sources (like GitHub/GitLab) into local projects.
ColoredFormatter ¶
Bases: Formatter
Logging Formatter to add colors.
Source code in src/ruff_sync/cli.py
COLORS
class-attribute
¶
COLORS = {
DEBUG: "\x1b[36m",
INFO: "\x1b[32m",
WARNING: "\x1b[33m",
ERROR: "\x1b[31m",
CRITICAL: "\x1b[1;31m",
}
__init__ ¶
format ¶
Format the log record with colors if the output is a TTY.
Source code in src/ruff_sync/cli.py
Arguments ¶
Bases: NamedTuple
CLI arguments for the ruff-sync tool.
Source code in src/ruff_sync/cli.py
fields
cached
classmethod
¶
get_config
cached
¶
Read [tool.ruff-sync] configuration from pyproject.toml.
Examples:
>>> import pathlib
>>> config = get_config(pathlib.Path("."))
>>> if "upstream" in config:
... print(f"Syncing from {config['upstream']}")
Source code in src/ruff_sync/cli.py
main ¶
Run the ruff-sync CLI.