Skip to content

Setup pre-commit hooks and apply linters#439

Merged
iainrussell merged 3 commits intoecmwf:masterfrom
observingClouds:maint/precommit
Dec 3, 2025
Merged

Setup pre-commit hooks and apply linters#439
iainrussell merged 3 commits intoecmwf:masterfrom
observingClouds:maint/precommit

Conversation

@observingClouds
Copy link
Contributor

@observingClouds observingClouds commented Nov 28, 2025

Description

The setup.cfg and pyproject.toml have settings for linters like black, isort, mypy setup but are not applied to the codebase.
This PR applies the linters and adds a .pre-commit-config.yaml so e.g. the pre-commit.ci could be set up to ensure linting in the future.

Contributor Declaration

By opening this pull request, I affirm the following:

  • 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.

@github-actions
Copy link

Caution

This pull request contains changes to GitHub workflows!
Proceed with caution and if not sure, contact your GitHub admin.

@github-actions
Copy link

Caution

This pull request contains changes to GitHub workflows!
Proceed with caution and if not sure, contact your GitHub admin.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.76%. Comparing base (44ecc62) to head (c572173).

Files with missing lines Patch % Lines
cfgrib/cfmessage.py 0.00% 1 Missing ⚠️
cfgrib/dataset.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #439   +/-   ##
=======================================
  Coverage   41.76%   41.76%           
=======================================
  Files          26       26           
  Lines        2227     2227           
  Branches      195      195           
=======================================
  Hits          930      930           
  Misses       1297     1297           

☔ 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.

@iainrussell iainrussell merged commit a1714e0 into ecmwf:master Dec 3, 2025
133 of 134 checks passed
@iainrussell
Copy link
Member

Many thanks @observingClouds - a useful addition!

@observingClouds observingClouds deleted the maint/precommit branch December 4, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants