sync ruff¶
Copy ruff configuration from sub-repos to the root.
Usage¶
Description¶
The sync ruff command searches all sub-repositories for ruff.toml files and copies them to the root directory. This is useful for maintaining consistent Python linting configuration across your workspace.
How It Works¶
- Scans all sub-repositories for
ruff.tomlfiles - Copies found configurations to the root workspace directory
Why Use This?¶
Ruff is a fast Python linter and formatter. When working with multiple Python repositories, you often want consistent linting rules across all of them.
By syncing ruff configuration to the root:
- VS Code's Ruff extension can find the configuration
- Running
ruff checkfrom the root uses consistent settings - All sub-repos share the same linting standards
Example¶
Given this structure:
Running multi sync ruff copies the configuration:
my-workspace/
├── ruff.toml # Copied from a sub-repo
├── api-repo/
│ ├── ruff.toml
│ └── src/
└── shared-lib/
├── ruff.toml
└── src/
Notes¶
- If multiple sub-repos have
ruff.toml, one will be chosen (order not guaranteed) - For consistent results, ensure your sub-repos use the same ruff configuration
- This command only syncs
ruff.toml, notpyproject.tomlruff sections