Skip to content

NAS-145296 / 28.0.0-BETA.1 / replace flake8 with ruff and format the code with ruff - #113

Merged
yocalebo merged 3 commits into
masterfrom
ruff
Nov 17, 2026
Merged

yocalebo merged 3 commits into
masterfrom
ruff

Conversation

@yocalebo

Copy link
Copy Markdown
Contributor

This replaces flake8 with ruff and formats the code with ruff.

  • ruff check replaces flake8 in the lint job. It runs the same pyflakes and pycodestyle rules. Its settings now live in pyproject.toml, so tox.ini is removed.
  • The code is formatted with ruff format using its default settings. One type ignore comment moved with its argument so mypy still applies it.
  • The lint job now also runs ruff format --check on the Python and Markdown files a pull request adds or changes. Files the pull request does not touch are not checked, so a new ruff release that formats differently will not fail unrelated pull requests.
  • Ruff is installed with astral-sh/ruff-action. The job keeps the name lint, so existing required checks still match.

The formatting commit is large but changes no behavior. The other two commits are easiest to review on their own.

Ruff runs the same pyflakes and pycodestyle rules as flake8 and passes on the current code. Its settings now live in pyproject.toml, so tox.ini is no longer needed. The job keeps the name lint so existing required checks still match.
This is the output of ruff format with its default settings. One type ignore comment moved with its argument so mypy still applies it.
Pull requests now fail when a new or changed Python or Markdown file does not match ruff format. Files a pull request does not touch are not checked.
@yocalebo
yocalebo requested a review from a team November 17, 2026 17:33
@bugclerk bugclerk changed the title replace flake8 with ruff and format the code with ruff NAS-145296 / 28.0.0-BETA.1 / replace flake8 with ruff and format the code with ruff Nov 17, 2026
@bugclerk

Copy link
Copy Markdown

@yocalebo

Copy link
Copy Markdown
Contributor Author

time 01:00

@yocalebo
yocalebo merged commit 78b93ae into master Nov 17, 2026
4 checks passed
@yocalebo
yocalebo deleted the ruff branch November 17, 2026 17:55
@bugclerk

Copy link
Copy Markdown

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Nov 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants