-
Notifications
You must be signed in to change notification settings - Fork 5
Support syncing other pyproject.toml tool configurations (e.g., mypy, pytest) #69
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, ruff-sync is highly focused on syncing the [tool.ruff] section of pyproject.toml. While Ruff is becoming the standard for many Python linting and formatting tasks, many projects still use other tools that store their configuration in pyproject.toml, such as:
- mypy:
[tool.mypy] - pytest:
[tool.pytest.ini_options] - coverage:
[tool.coverage.run],[tool.coverage.report]
It would be great if ruff-sync could be generalized to sync a user-defined list of tools from the upstream pyproject.toml.
Proposed Changes
- Generalize the configuration: Add a
toolsoption to[tool.ruff-sync]inpyproject.toml.[tool.ruff-sync] # upstream = "..." tools = ["ruff", "mypy", "pytest"] # Default: ["ruff"]
- CLI argument: Add a
--toolor--toolsflag to specify which tools to sync.ruff-sync <URL> --tool mypy --tool ruff
- Mapping tool names to table paths: Most tools use
[tool.<name>], but some might need more specific paths (e.g.,pytestoften uses[tool.pytest.ini_options]). We might need a way to handle these or just support top-level[tool.<name>]by default.
Implementation Ideas
- Refactor
get_ruff_tool_tableandmerge_ruff_tomlto be generic (e.g.,get_tool_table(doc, tool_name)andmerge_tool_config(source, upstream, tool_name)). - Iterate through the list of requested tools and perform the sync/merge for each.
Why?
This would make ruff-sync even more powerful for maintaining organization-wide standards across multiple repositories beyond just Ruff settings.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request