Skip to content

Migrate from Black to Ruff#1750

Merged
JrooTJunior merged 4 commits intodev-3.xfrom
misc/dev-improvements
Jan 4, 2026
Merged

Migrate from Black to Ruff#1750
JrooTJunior merged 4 commits intodev-3.xfrom
misc/dev-improvements

Conversation

@JrooTJunior
Copy link
Member

@JrooTJunior JrooTJunior commented Jan 4, 2026

Migrated from Black and isort to Ruff for code formatting and linting, a modern, blazingly fast formatter and linter written in Rust.

Enabled additional ruff rule sets.

For end users:

No changes required. This is purely a development tooling change that doesn't affect the library API or behavior.

For contributors:

  • Use make reformat or uv run ruff format to format code (replaces black and isort)
  • Use make lint to check code quality (now includes formatting, linting, and type checking)
  • Pre-commit hooks automatically updated to use ruff and ruff-format
  • CI/CD pipelines updated to use ruff in GitHub Actions workflows

Benefits:

  • 10-100x faster formatting and linting compared to Black + isort + flake8
  • Single tool for formatting, import sorting, and linting
  • More comprehensive code quality checks out of the box
  • Auto-fixes for many common issues (33 issues auto-fixed during migration)
  • Better integration with modern Python development workflows

This change improves the developer experience and code quality while maintaining the same code style standards.

@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Jan 4, 2026
@github-actions
Copy link

github-actions bot commented Jan 4, 2026

✔️ Changelog found.

Thank you for adding a description of the changes

@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a4a3f42) to head (2a7e955).
⚠️ Report is 1 commits behind head on dev-3.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1750   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          598       598           
  Lines        14202     14207    +5     
=========================================
+ Hits         14202     14207    +5     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
aiogram/client/bot.py 100.00% <100.00%> (ø)
aiogram/client/session/aiohttp.py 100.00% <100.00%> (ø)
aiogram/client/session/base.py 100.00% <100.00%> (ø)
aiogram/dispatcher/flags.py 100.00% <100.00%> (ø)
aiogram/filters/chat_member_updated.py 100.00% <ø> (ø)
aiogram/filters/command.py 100.00% <100.00%> (ø)
aiogram/fsm/scene.py 100.00% <100.00%> (ø)
aiogram/methods/base.py 100.00% <100.00%> (ø)
aiogram/types/__init__.py 100.00% <100.00%> (ø)
aiogram/types/custom.py 100.00% <100.00%> (ø)
... and 5 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JrooTJunior JrooTJunior marked this pull request as ready for review January 4, 2026 19:34
@JrooTJunior JrooTJunior merged commit ec7da0f into dev-3.x Jan 4, 2026
23 checks passed
@JrooTJunior JrooTJunior deleted the misc/dev-improvements branch January 4, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Issue or PR for stable 3.x version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant