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

Use ruff #1986

Closed
adamjstewart opened this issue Apr 7, 2024 · 0 comments · Fixed by #1994
Closed

Use ruff #1986

adamjstewart opened this issue Apr 7, 2024 · 0 comments · Fixed by #1994
Assignees
Labels
dependencies Packaging and dependencies good first issue A good issue for a new contributor to work on
Milestone

Comments

@adamjstewart
Copy link
Collaborator

Summary

I'm starting to seriously consider using ruff to replace the following style tools we currently use:

  • black
  • flake8
  • isort
  • pydocstyle
  • pyupgrade

It doesn't yet handle static type analysis (mypy), but the devs would like to

Rationale

A few reasons:

  • It supports pyproject.toml, unlike flake8/pre-commit/pyupgrade
  • Fewer dependencies to track and manage
  • It's a single tool to run instead of multiple (although pre-commit slightly alleviates this)
  • It's fast (only really matters for isort which contains a bug where gitignore is not ignored)
  • My favorite style tool, pydocstyle, is now deprecated and contains known bugs
  • It's rapidly gaining popularity, including recent adoption by PyTorch

Implementation

Easy to implement, only need to decide on the exact configuration details. Just curious to see how many files change and what new issues get flagged.

Alternatives

A lot of users have suggested this to me. I'm unaware of any popular alternatives.

Additional information

Only downside is that ruff is built in rust. This doesn't matter for pip/conda users, but rust is non-trivial to build from source. But kornia also requires rust now, so we can't really avoid that anyway. Seems like rust is the future of Python, and will become harder to avoid in the future.

@adamjstewart adamjstewart added good first issue A good issue for a new contributor to work on dependencies Packaging and dependencies labels Apr 7, 2024
@adamjstewart adamjstewart added this to the 0.6.0 milestone Apr 12, 2024
@adamjstewart adamjstewart mentioned this issue Apr 13, 2024
8 tasks
@adamjstewart adamjstewart self-assigned this Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Packaging and dependencies good first issue A good issue for a new contributor to work on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant