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 #899

Closed
3 of 5 tasks
lkstrp opened this issue May 22, 2024 · 0 comments · Fixed by #917
Closed
3 of 5 tasks

Use ruff #899

lkstrp opened this issue May 22, 2024 · 0 comments · Fixed by #917

Comments

@lkstrp
Copy link
Member

lkstrp commented May 22, 2024

Ruff is a very fast linter and formatter. It combines some of the tools we use right now and offers many more. We could simplify the existing linting and give all developers more direct feedback/ enforce more lint rules when using it, via pre-commit + uniform and better IDE/ CLI feedback.

Advantages:

  • Better CLI/ IDE integration than pre-commit. Like black but with linting.
  • Allows for dev feedback on things which the linter can't solve (like bare excepts, docstrings etc.)
  • Many more rules could be added
  • Fast
  • Fewer dependencies to track

We could add it in multiple steps:

Nothing of this is urgent. I just added a PR for the first step, so people can play around and are not buried in warnings.

Tools:

In use right now (pre-commit).

Formatter:

  • black
    • Ruff equivalent: yes

Linter:

  • isort
    • Ruff equivalent: yes
  • absolufy-imports
    • Ruff equivalent: yes
  • codespell
    • Ruff equivalent: I don't think so
  • docformatter
    • Ruff equivalent: similar rules exist
  • jupyter remove output
    • Ruff equivalent: I don't think so
  • pretty yaml
    • Ruff equivalent: I don't think so
  • end of file fixer/ trailing whitespaces, mixed line ending etc.
    • Ruff equivalent: I think so

Static type checker

  • mypy (not in use yet but planned)
    • Ruff equivalent: Not implemented yet but in dev

And tons of more stuff can be set up: Rules - Ruff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant