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

Experiment - Add Ruff formatter/linter #2114

Merged
merged 26 commits into from
Sep 12, 2024
Merged

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Feb 16, 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 changes separately... 🤦

Before:

image

After:

image

After first run with cache:

image

- Remove black, isort, flake8 as Ruff is a drop in replacement for each
  of these.
- Added the poetry plugin poetry-plugin-sort, organizes dependencies in
  pyproject.toml
@whabanks whabanks changed the title Add Ruff formatter/linter Experiment - Add Ruff formatter/linter Feb 19, 2024
whabanks and others added 6 commits February 19, 2024 11:31
- Added configs for leniency on doc string and comment length
- Removed the Ruff GH action in favour of our current style of checking in run_tests.sh
- Fixed an unnecessary mock causing test failures
@whabanks whabanks marked this pull request as ready for review February 23, 2024 19:02
@jzbahrai jzbahrai marked this pull request as draft May 1, 2024 19:04
@whabanks whabanks marked this pull request as ready for review June 21, 2024 17:47
@whabanks whabanks merged commit 5764ae6 into main Sep 12, 2024
4 checks passed
@whabanks whabanks deleted the experiment/migrate-to-ruff branch September 12, 2024 19:22
jzbahrai added a commit that referenced this pull request Sep 16, 2024
jzbahrai added a commit that referenced this pull request Sep 16, 2024
whabanks added a commit that referenced this pull request Sep 27, 2024
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