Skip to content

Chore/update linting tools#39

Open
mcocdawc wants to merge 12 commits intodevelopfrom
chore/update-linting-tools
Open

Chore/update linting tools#39
mcocdawc wants to merge 12 commits intodevelopfrom
chore/update-linting-tools

Conversation

@mcocdawc
Copy link
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 10 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>
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.32%. Comparing base (ec3acf1) to head (98bc861).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #39      +/-   ##
===========================================
- Coverage    97.44%   97.32%   -0.13%     
===========================================
  Files            7        7              
  Lines          235      224      -11     
  Branches         7        7              
===========================================
- Hits           229      218      -11     
  Misses           3        3              
  Partials         3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

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 standardizes the repository’s linting/formatting tooling (primarily via pre-commit), switching to Ruff for formatting, linting, and import sorting, and then applies the resulting auto-formatting across code, tests, docs, and CI/config YAML/TOML files.

Changes:

  • Replace Black/isort-based pre-commit setup with Ruff-based checks/formatting plus unified YAML/TOML formatters.
  • Apply Ruff/import/docstring formatting cleanups across Python sources and tests.
  • Reformat various YAML/TOML configs (GitHub Actions workflows, conda env files, Read the Docs config) and a docs notebook cell.

Reviewed changes

Copilot reviewed 14 out of 22 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.pre-commit-config.yaml Switches to Ruff check/format hooks and updates formatting hooks for YAML/TOML and docs linting.
pyproject.toml Adds/expands Ruff configuration and applies TOML formatting/normalization.
environment.yml YAML reformatting of the dev environment definition.
tests/environment-unit-tests.yml YAML reformatting of the unit-test environment definition.
.readthedocs.yml YAML reformatting of Read the Docs configuration.
.github/workflows/ci.yml YAML reformatting of CI workflow triggers/paths-ignore.
.github/workflows/legacy-ci.yml YAML reformatting of legacy CI workflow structure/steps.
.github/workflows/cd-pypi.yml YAML reformatting of tag trigger definition.
.github/workflows/notify-new-pr.yml YAML reformatting of PR notification workflow.
.github/workflows/notify-new-issue.yml YAML reformatting of issue notification workflow.
src/earthkit/geo/rotate.py Import consolidation and docstring formatting.
src/earthkit/geo/distance.py Import consolidation.
src/earthkit/geo/gisco.py Minor string formatting simplification (URL template and error message).
src/earthkit/geo/constants.py Module docstring formatting.
src/earthkit/geo/cartography.py Error message string formatting simplification.
src/earthkit/geo/figure.py Docstring punctuation normalization.
src/earthkit/geo/__init__.py Import consolidation.
tests/test_rotate.py Import consolidation.
tests/test_distance.py Import consolidation and minor tuple literal simplification in parametrization.
tests/test_coord.py Import consolidation.
tests/test_cartography.py Import consolidation.
docs/examples/rotate.ipynb Notebook code cell formatted (quote style).

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

@mcocdawc mcocdawc requested a review from sandorkertesz March 17, 2026 13:02
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