Skip to content

Chore/update linting tools#43

Merged
chpolste merged 9 commits intodevelopfrom
chore/update-linting-tools
Mar 17, 2026
Merged

Chore/update linting tools#43
chpolste merged 9 commits intodevelopfrom
chore/update-linting-tools

Conversation

@mcocdawc
Copy link
Copy Markdown
Contributor

@mcocdawc mcocdawc commented Mar 16, 2026

Description

Updated and unified the pre-commit hooks in all earthkit packages.
Some of them were failing the test suite just because of the pre-commit hooks.
Fixing this it was a good opportunity to unify settings.

Uses now ruff for formatting (former black), linting, and import sort (former isort)

The following PRs do the same changes in all the earthkit packages:

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

mcocdawc and others added 8 commits March 16, 2026 12:04
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates and unifies linting/formatting tooling across the repository, moving formatting/linting/import sorting to Ruff and aligning pre-commit + CI configuration accordingly.

Changes:

  • Update .pre-commit-config.yaml to newer ruff-pre-commit and adjust Ruff hook arguments/exclusions.
  • Update pyproject.toml Ruff configuration (line length, lint settings) and normalize optional dependency declarations.
  • Apply formatting-only changes across scripts, tests, and documentation notebooks/YAML/workflows to match the new tooling.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/xclim_wrappers_generator.py Formatting-only updates to align with new formatter.
tests/unit/utils/test_conversions.py Import formatting normalized.
tests/unit/conftest.py Formatting-only updates for dataset fixtures.
src/earthkit/climate/utils/percentile.py Formatting-only change in sel(...) call.
pyproject.toml Update Ruff config + rework optional-dependencies declaration.
docs/notebooks/performance_analysis.ipynb Formatting-only changes inside notebook code cells.
docs/notebooks/climate_indices_analysis.ipynb Formatting-only import line change in notebook cell.
.readthedocs.yaml Whitespace cleanup only.
.pre-commit-config.yaml Ruff hook rev bump + new args/exclude configuration.
.github/workflows/qa.yml Whitespace cleanup only.
.github/workflows/label-public-pr.yml Whitespace cleanup only.
.github/workflows/cd-test-pypi.yml Whitespace cleanup only.
.github/workflows/cd-pypi.yml Whitespace cleanup only.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mcocdawc mcocdawc requested a review from chpolste March 16, 2026 16:04
@chpolste chpolste merged commit 4779a38 into develop Mar 17, 2026
9 checks passed
@mcocdawc mcocdawc mentioned this pull request Mar 18, 2026
mcocdawc added a commit to ecmwf/earthkit-plots that referenced this pull request Mar 23, 2026
Updated and unified the pre-commit hooks in all earthkit packages. 
Some of them were failing the test suite just because of the pre-commit hooks. 
Fixing this it was a good opportunity to unify settings.

Uses now `ruff` for formatting (former `black`), linting, and import sort (former `isort`)

The following PRs do the same changes in all the earthkit packages:

- ecmwf/earthkit-climate#43
- ecmwf/earthkit-data#927
- ecmwf/earthkit-geo#39
- ecmwf/earthkit-hydro#178
- ecmwf/earthkit-meteo#125
- #176
- ecmwf/earthkit-time#14
- ecmwf/earthkit-transforms#87
- ecmwf/earthkit-workflows#173

In `earthkit-plots` in particular, it prevents now directly pushing to `develop` and checks the pre-commit hooks as part of the CI.
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.

3 participants