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

Merged
merged 9 commits into from
Jul 22, 2024
Merged

Migrate to the Ruff formatter #300

merged 9 commits into from
Jul 22, 2024

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

whabanks added 4 commits May 23, 2024 15:39
- 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 !

@whabanks whabanks merged commit 56c2f9f into main Jul 22, 2024
4 checks passed
@whabanks whabanks deleted the experiment/migrate-to-ruff branch July 22, 2024 20:08
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