-
Notifications
You must be signed in to change notification settings - Fork 5
Feature Roadmap: Config Validation #116
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This issue breaks out item #10 from #100 into a dedicated feature roadmap for Config Validation.
When running ruff-sync pull, validating the merged configuration before applying it ensures that we don't introduce syntax errors, conflicting versions, or deprecated rules into the target repository.
Proposed Features & Prioritization
🔴 Priority 1: Basic Syntax and CLI Validation (Must Have)
Before writing the final pyproject.toml or ruff.toml, ruff-sync should verify that the resulting file is structurally valid and accepted by Ruff.
- TOML Syntax Check: Ensure the merged config is valid TOML and doesn't introduce parsing errors.
- Tool Integrity Check: Optionally (or by default) run
ruff check --isolated --config <merged-temp-file> <some-dummy-file>or rely on Ruff's native config validation to ensure Ruff accepts the configuration keys and structure. - Fail Fast: If the resulting config is broken or rejected by Ruff,
ruff-syncshould abort the operation, log an error, and leave the local file untouched.
🟠 Priority 2: Python Version Consistency (Should Have)
A common issue is syncing an upstream config designed for a different Python version than the downstream project.
- Cross-check
target-version: Warn the user if the merged[tool.ruff] target-version(e.g.,py311) conflicts with the local project's[project] requires-python(e.g.,>=3.10). - Extend to other tools (if applicable): For instance, check
[tool.mypy] python_versionagainstrequires-pythonif multi-tool syncing (Support syncing other pyproject.toml tool configurations (e.g., mypy, pytest) #69) is implemented.
🟡 Priority 3: Rule Deprecation Warnings (Could Have)
Ruff evolves quickly, and upstream central configs might contain deprecated rules that cause noise when applied downstream.
- Detect Deprecated Rules: Warn if rules in
select,extend-select, orignoreare marked as deprecated in the target project's installed version of Ruff. - Contextual Output: Provide helpful CLI warnings:
Warning: Upstream config uses deprecated rule 'UP036', which may be removed in future Ruff versions.
🟢 Priority 4: Strict Mode (Nice to Have)
Provide an option to upgrade warnings to protective errors.
--strictflag: When passed toruff-sync pull, any version conflicts or deprecated rules will cause the sync to fail entirely rather than just warning the user, protecting CI pipelines from downstream breakages.
Related
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request