Skip to content

Feature Roadmap: Config Validation #116

@Kilo59

Description

@Kilo59

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-sync should 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.

🟡 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, or ignore are 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.

  • --strict flag: When passed to ruff-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions