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 for formatting #8760

Open
etienneschalk opened this issue Feb 17, 2024 · 0 comments · May be fixed by #8761
Open

Use ruff for formatting #8760

etienneschalk opened this issue Feb 17, 2024 · 0 comments · May be fixed by #8761

Comments

@etienneschalk
Copy link
Contributor

What is your issue?

Use ruff for formatting

Context

Ruff was introduced in #7458. Arguments in favor were that it is faster, and combines multiple tools in a single tool (eg flake8, pyflakes, isort, pyupgrade ).

This switches our primary linter to Ruff. As adervertised, Ruff is very fast. Plust we get the benefit of using a single tool that combines the previous functionality of pyflakes, isort, and pyupgrade.

Suggestion

Suggestion: To move on with ruff replacement of tools, introduce ruff-format to replace black (See ruff Usage for integration with pre-commit). See issue

Pandas uses ruff and ruff-format:
https://github.com/pandas-dev/pandas/blob/63dc0f76faa208450b8aaa57246029fcf94d015b/.pre-commit-config.yaml#L24

Ruff is capable of dosctring formatting:
https://docs.astral.sh/ruff/formatter/#docstring-formatting

Ruff can format Jupyter Notebooks:
https://docs.astral.sh/ruff/faq/#does-ruff-support-jupyter-notebooks

So, introducing the ruff formatter might remove the need for black and blackdoc

@etienneschalk etienneschalk added the needs triage Issue that has not been reviewed by xarray team member label Feb 17, 2024
@max-sixty max-sixty added topic-internals and removed needs triage Issue that has not been reviewed by xarray team member labels Feb 26, 2024
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.

2 participants