Skip to content

Commit 32d55fe

Browse files
committed
Replace black with ruff in the contributing guides
1 parent 07d8f96 commit 32d55fe

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

CORE_TEAM_GUIDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ resources such as:
271271
[NumPy documentation guide](https://numpy.org/devdocs/dev/howto-docs.html#documentation-style)
272272
for docstring conventions.
273273
- [`pre-commit`](https://pre-commit.com) hooks for autoformatting.
274-
- [`black`](https://github.com/psf/black) autoformatting.
275-
- [`flake8`](https://github.com/PyCQA/flake8) linting.
274+
- [`ruff`](https://github.com/astral-sh/ruff) autoformatting and linting.
276275
- [python-xarray](https://stackoverflow.com/questions/tagged/python-xarray) on Stack Overflow.
277276
- [@xarray_dev](https://twitter.com/xarray_dev) on Twitter.
278277
- [xarray-dev](https://discord.gg/bsSGdwBn) discord community (normally only used for remote synchronous chat during sprints).

ci/min_deps_check.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
CHANNELS = ["conda-forge", "defaults"]
1919
IGNORE_DEPS = {
20-
"black",
2120
"coveralls",
2221
"flake8",
2322
"hypothesis",

ci/requirements/all-but-dask.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- black
76
- aiobotocore
87
- array-api-strict
98
- boto3

doc/contributing.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,7 @@ Code Formatting
549549

550550
xarray uses several tools to ensure a consistent code format throughout the project:
551551

552-
- `Black <https://black.readthedocs.io/en/stable/>`_ for standardized
553-
code formatting,
554-
- `blackdoc <https://blackdoc.readthedocs.io/en/stable/>`_ for
555-
standardized code formatting in documentation,
556-
- `ruff <https://github.com/charliermarsh/ruff/>`_ for code quality checks and standardized order in imports
552+
- `ruff <https://github.com/astral-sh/ruff>`_ for formatting, code quality checks and standardized order in imports
557553
- `absolufy-imports <https://github.com/MarcoGorelli/absolufy-imports>`_ for absolute instead of relative imports from different files,
558554
- `mypy <http://mypy-lang.org/>`_ for static type checking on `type hints
559555
<https://docs.python.org/3/library/typing.html>`_.
@@ -1069,7 +1065,7 @@ PR checklist
10691065
- Test the code using `Pytest <http://doc.pytest.org/en/latest/>`_. Running all tests (type ``pytest`` in the root directory) takes a while, so feel free to only run the tests you think are needed based on your PR (example: ``pytest xarray/tests/test_dataarray.py``). CI will catch any failing tests.
10701066
- By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a ``[test-upstream]`` tag to the first line of the commit message. For documentation-only commits, you can skip the CI per commit by adding a ``[skip-ci]`` tag to the first line of the commit message.
10711067
1072-
- **Properly format your code** and verify that it passes the formatting guidelines set by `Black <https://black.readthedocs.io/en/stable/>`_ and `Flake8 <http://flake8.pycqa.org/en/latest/>`_. See `"Code formatting" <https://docs.xarray.dev/en/stablcontributing.html#code-formatting>`_. You can use `pre-commit <https://pre-commit.com/>`_ to run these automatically on each commit.
1068+
- **Properly format your code** and verify that it passes the formatting guidelines set by `ruff <https://github.com/astral-sh/ruff>`_. See `"Code formatting" <https://docs.xarray.dev/en/stablcontributing.html#code-formatting>`_. You can use `pre-commit <https://pre-commit.com/>`_ to run these automatically on each commit.
10731069
10741070
- Run ``pre-commit run --all-files`` in the root directory. This may modify some files. Confirm and commit any formatting changes.
10751071

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ extend-exclude = [
233233

234234
[tool.ruff.lint]
235235
# E402: module level import not at top of file
236-
# E501: line too long - let black worry about that
236+
# E501: line too long - let the formatter worry about that
237237
# E731: do not assign a lambda expression, use a def
238238
extend-safe-fixes = [
239239
"TID252", # absolute imports

0 commit comments

Comments
 (0)