Skip to content

fix: make ruff format work outside of pre-commit#6388

Open
benedikt-bartscher wants to merge 2 commits intoreflex-dev:mainfrom
benedikt-bartscher:configure-ruff-via-pyproject
Open

fix: make ruff format work outside of pre-commit#6388
benedikt-bartscher wants to merge 2 commits intoreflex-dev:mainfrom
benedikt-bartscher:configure-ruff-via-pyproject

Conversation

@benedikt-bartscher
Copy link
Copy Markdown
Contributor

No description provided.

@benedikt-bartscher benedikt-bartscher requested review from a team and Alek99 as code owners April 25, 2026 21:40
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 25, 2026

Greptile Summary

This PR moves the --preview flag out of the ruff format pre-commit hook command and into the [tool.ruff] configuration block of docs/app/pyproject.toml, making preview mode active whenever ruff format is invoked—whether inside or outside of pre-commit. The root pyproject.toml already contained preview = true, so this change brings docs/app/pyproject.toml into parity and the hook itself into alignment with both configs.

Confidence Score: 5/5

Safe to merge — clean two-line config-only fix with no logic changes.

Both changed files are configuration-only. The root pyproject.toml already had preview = true, so docs/app/pyproject.toml is simply brought into parity. Removing the CLI flag from the hook is the correct way to ensure consistent behaviour across invocation contexts.

No files require special attention.

Important Files Changed

Filename Overview
.pre-commit-config.yaml Removes the --preview CLI flag from the ruff-format hook entry; preview mode is now sourced from pyproject.toml config instead.
docs/app/pyproject.toml Adds preview = true to [tool.ruff], matching the root pyproject.toml so ruff format respects preview mode in all invocation contexts.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[ruff format invoked] --> B{How invoked?}
    B -->|pre-commit| C["pre-commit hook\n(entry: ruff format)"]
    B -->|standalone CLI| D["ruff format ."]
    C --> E[ruff searches for config]
    D --> E
    E --> F["pyproject.toml\n[tool.ruff]\npreview = true"]
    F --> G[ruff format runs with preview mode]
Loading

Reviews (1): Last reviewed commit: "fix: make `ruff format` work outside of ..." | Re-trigger Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 25, 2026

Merging this PR will not alter performance

✅ 9 untouched benchmarks


Comparing benedikt-bartscher:configure-ruff-via-pyproject (84ca0fb) with main (1a64caa)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant