Skip to content

Switch Python linting and formatting to Ruff#2310

Open
KristopherKubicki wants to merge 1 commit intostagingfrom
codex/switch-from-flake-and-black-to-ruff
Open

Switch Python linting and formatting to Ruff#2310
KristopherKubicki wants to merge 1 commit intostagingfrom
codex/switch-from-flake-and-black-to-ruff

Conversation

@KristopherKubicki
Copy link
Owner

Summary

  • replace the black/flake8 setup with Ruff across pyproject settings, pre-commit hooks, the Makefile, and CI workflows
  • refresh developer documentation and agent guidance to direct contributors to ruff format/ruff check
  • regenerate the lock file and remove the obsolete .flake8 configuration so dependency metadata matches the new toolchain

Testing

  • uv run ruff format --check . (fails: offline environment cannot download cached coverage wheel)

Codex Task

Copilot AI review requested due to automatic review settings November 14, 2025 04:35
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 14, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/switch-from-flake-and-black-to-ruff

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 3 to +5
format:
uv run black .
prettier --write app/static/js/**/*.js app/static/css/**/*.css
uv run ruff format .
prettier --write app/static/js/**/*.js app/static/css/**/*.css

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore tabs in Makefile recipes for format/lint

The format and lint targets now use space indentation for their commands instead of tabs (uv run ruff… lines), so GNU Make treats those lines as malformed and exits with *** missing separator. Running make format or make lint currently fails before any Ruff tooling runs. Replacing the leading spaces with tabs (as still used by the test target below) restores working developer workflows.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the Python linting and formatting toolchain by replacing Black, Flake8, and isort with Ruff, consolidating three tools into one faster alternative. The migration updates all configuration files, developer documentation, CI workflows, and removes obsolete dependencies.

Key Changes:

  • Replaces Black, Flake8, and isort with Ruff for Python code formatting and linting
  • Updates pre-commit hooks to use ruff format and ruff check commands
  • Refreshes developer documentation and agent guidance files to reference the new tooling

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uv.lock Removes black, flake8, pycodestyle, pyflakes packages; retains mccabe and isort as transitive pylint dependencies
pyproject.toml Removes [tool.black] and [tool.isort] sections; adds [tool.ruff.format] and [tool.ruff.lint] configuration; removes old tools from dev dependencies
.pre-commit-config.yaml Replaces isort, black, and flake8 hooks with ruff-format and ruff check hooks
.flake8 Deletes obsolete Flake8 configuration file
Makefile Updates format and lint targets to use ruff commands (contains critical indentation bug)
.github/workflows/release-packages.yml Replaces flake8 lint steps with ruff format and check commands
README.md Updates development instructions to reference ruff commands
docs/testing.md Changes linting instructions from flake8 to ruff
docs/developer_guide.md Updates test instructions to use ruff; removes stray command line
docs/ci_checks.md Updates CI documentation to reflect Ruff usage
AGENTS.md Updates agent guidance to reference ruff format and ruff check
app/AGENTS.md Changes formatting reference from black to ruff format
tests/AGENTS.md Updates pre-commit command reference to ruff check
app/routes.py Changes noqa comment from flake8 to ruff format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +5
uv run ruff format .
prettier --write app/static/js/**/*.js app/static/css/**/*.css
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile recipes must be indented with tabs, not spaces. Lines 4, 5, 8, 11, 12, 13, and 25 use spaces, which will cause Make to fail with an error like "*** missing separator". Replace the space indentation with tabs for all recipe lines.

Copilot uses AI. Check for mistakes.
prettier --write app/static/js/**/*.js app/static/css/**/*.css

format-yaml:
prettier --write '*.yml'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile recipe must be indented with a tab, not spaces. Replace the space indentation with a tab.

Suggested change
prettier --write '*.yml'
prettier --write '*.yml'

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +13
uv run ruff format --check .
uv run ruff check .
eslint 'app/static/js/**/*.js'
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile recipes must be indented with tabs, not spaces. Replace the space indentation with tabs for all three recipe lines.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Stale pull request message

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants