Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to the Ruff formatter #300

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented May 24, 2024

Summary | Résumé

This experimental PR migrates our linters/formatters to Ruff which:

  • Has drop in feature parity with black, isort, and flake8
  • Is written in Rust and hence faster than black, isort and flake8
  • Has supporting Github actions and VSCode extensions
  • Caches results for even snappier analysis after an initial run

Changelog:

  • Replaced black, isort, and flake8 with Ruff
  • Added the poetry plugin poetry-plugin-sort which organizes dependencies in pyproject.toml
  • Added the Ruff plugin to devcontainer.json
  • Updated the betterTOML plugin as it was deprecated
  • Removed deprecated linter settings in devcontainer.json

File change list (excludes formatting changes):

Because I wasn't smart enough to commit the formatting separately... 🤦

Before:

image

After:

image

After first run with cache:

image

- Address deprecated linting configs per: https://github.com/microsoft/vscode-python/wiki/Migration-to-Python-Tools-Extensions
- Formatted the codebase with Ruff
- Added poetry-plugin-sort and sorted pyproject.toml with it
- Removed flake8 config file
Copy link
Collaborator

@jzbahrai jzbahrai left a comment

Choose a reason for hiding this comment

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

I went through this - it is a lot of files so take with a grain of salt, but I think there is no functionality change - and it looks good !

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.

None yet

2 participants