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.
__all__
module-attribute
¶
OutputFormat ¶
Bases: str, Enum
Output formats for the CLI.
Source code in src/ruff_sync/constants.py
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
¶
ResolvedArgs ¶
Bases: NamedTuple
Internal container for resolved arguments.
Source code in src/ruff_sync/cli.py
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.
Source code in src/ruff_sync/cli.py
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | |