Skip to content

ci: Replace isort and flake8 with ruff check - #265

Open
fsbraun wants to merge 3 commits into
masterfrom
chore/ruff
Open

fsbraun wants to merge 3 commits into
masterfrom
chore/ruff

Conversation

@fsbraun

@fsbraun fsbraun commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Replaces isort and flake8 with ruff check.

  • Remove the flake8/isort lint GitHub action: linting is covered by pre-commit
  • Replace the flake8, isort and yesqa (flake8-based) pre-commit hooks with ruff-check (v0.16.10)
  • Move the flake8/isort configuration into [tool.ruff] in pyproject.toml (line length, excludes, import sections incl. django/cms, first-party package, lines after imports)
  • Replace flake8/isort tox envs with a ruff env and drop flake8/isort from test requirements
  • Apply ruff check --fix (import sorting only) so the codebase passes

🤖 Generated with Claude Code

Summary by Sourcery

Replace the separate flake8 and isort linting stack with Ruff across development hooks, configuration, and tox environments.

Enhancements:

  • Consolidate Python linting and import sorting under Ruff with equivalent project-specific rules and automatic fixes.

Build:

  • Replace the separate flake8, isort, and yesqa tooling and tox environments with Ruff, and remove the redundant lint dependencies.

CI:

  • Remove the standalone lint GitHub Actions workflow because linting is handled by pre-commit.

Chores:

  • Apply Ruff's import-order corrections across the codebase and clean up related configuration formatting.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Migrates linting and import sorting from Flake8/isort to Ruff, using a Ruff pre-commit hook with autofix, consolidated pyproject configuration, and a tox/test-dependency update; the resulting import-only source changes make the codebase pass the new checks.

File-Level Changes

Change Details Files
Replace the existing Flake8/isort linting workflow with Ruff-based pre-commit checks.
  • Delete the dedicated GitHub Actions lint workflow.
  • Replace Flake8, isort, and yesqa hooks with Ruff pre-commit at v0.16.10.
  • Enable Ruff autofixing for import sorting.
.github/workflows/lint.yml
.pre-commit-config.yaml
Consolidate lint and import-order configuration under Ruff.
  • Configure line length, exclusions, E/W/F/I rule selection, and Django/CMS import sections.
  • Preserve the first-party package and import-spacing settings in Ruff's isort-compatible configuration.
pyproject.toml
Update project source and test tooling to satisfy the Ruff migration.
  • Apply Ruff import reordering in the affected Django modules.
  • Replace Flake8/isort tox environments and remove their test requirements.
djangocms_link/fields.py
djangocms_link/models.py
tests/requirements/base.txt
tox.ini

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.29%. Comparing base (a87be01) to head (fc39813).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #265      +/-   ##
==========================================
- Coverage   95.31%   95.29%   -0.02%     
==========================================
  Files          29       29              
  Lines         789      787       -2     
  Branches      112      112              
==========================================
- Hits          752      750       -2     
  Misses         16       16              
  Partials       21       21              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fsbraun and others added 2 commits October 6, 2026 08:05
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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