Skip to content

ci: migrate from flake8 to ruff (#2120)#2126

Open
cfxegbert wants to merge 4 commits into
AcademySoftwareFoundation:mainfrom
cfxegbert:ci/2120-migrate-from-flake8-to-ruff
Open

ci: migrate from flake8 to ruff (#2120)#2126
cfxegbert wants to merge 4 commits into
AcademySoftwareFoundation:mainfrom
cfxegbert:ci/2120-migrate-from-flake8-to-ruff

Conversation

@cfxegbert
Copy link
Copy Markdown
Contributor

@cfxegbert cfxegbert commented May 31, 2026

See #2120

New files

.github/workflows/ruff.yaml

  • Runs ruff check on PR/push when Python sources or lint config change
  • Skips vendor/, data/, and _version.py
  • Uses pinned actions/checkout and astral-sh/ruff-action

ruff.toml

  • Python 3.8 target, 120-char lines
  • Excludes src/rez/vendor and src/rez/data
  • Enables rule sets that mirror flake8 (pycodestyle E/W, Pyflakes F, DTZ, ISC, etc.)
  • Global ignores:
    • E722— bare except
    • E741— ambiguous variable names

Per-file ignores for known existing violations (no code changes in this branch):

File Rule Reason
src/rezgui/widgets/TimestampWidget.py E731 Lambda assigned to variable (fn = lambda ...)
src/rez/package_order.py E721 Type comparisons
src/rezgui/objects/Config.py E721 Type comparisons
install.py E402, F401 Late imports / unused import
setup.py E402 Late imports
release-rez.py E402, DTZ011 Late imports / date.today()
src/rez/tests/*.py F821 Undefined names (rex builtins)
src/rez/bind/_pymodule.py F821 Undefined names (bind env)
src/rez/utils/filesystem.py F821 Undefined names
src/rez/resolver.py F821 Undefined names
src/rez/cli/release.py F821 Undefined names
src/rezplugins/release_vcs/git.py F821 Undefined names
src/rez/cli/_main.py ISC002 Multi-line string concatenation
src/rez/tests/test_formatter.py E742 Ambiguous class name I
src/rezgui/widgets/ContextToolsWidget.py F401 Unused import
src/support/package_utils/set_authors.py INP001 Implicit namespace package

Out of scope (this branch)

  • No application logic changes
  • No whitespace or comment refactors

Summary

Infrastructure-only slice of the flake8 → Ruff migration: add Ruff config and CI with per-file exemptions so lint passes on the existing codebase without touching source files yet.

I used some help from an LLM to create the summary for this PR

@cfxegbert cfxegbert requested a review from a team as a code owner May 31, 2026 18:33
@JeanChristopheMorinPerso JeanChristopheMorinPerso added this to the Next milestone Jun 5, 2026
@JeanChristopheMorinPerso
Copy link
Copy Markdown
Member

Hi @cfxegbert, is there parity with flake8 rules? If so, I think it would be safe to completely replace flake8 with ruff and delete the flake8 job from the CI.

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.

2 participants