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

Add mypy pre-commit hook #52

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add mypy pre-commit hook #52

wants to merge 4 commits into from

Conversation

lewisjared
Copy link
Contributor

@lewisjared lewisjared commented Jan 10, 2025

Description

Adds pre-commit hook for mypy

Checklist

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Changelog item added to changelog/

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

@lewisjared
Copy link
Contributor Author

Closes #50

@bouweandela
Copy link
Contributor

Since mypy is now run using pre-commit, this job could be removed, right?

mypy:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: mypy
run: make mypy

Could we also run the pre-commit hooks on draft pull requests, so I have a bit more confidence that what I'm doing is up to standards even when it's not yet ready for review? I.e. take out this line?

if: ${{ !github.event.pull_request.draft }}

Unrelated, but in the same file: since we have the readthedocs build enabled for pull requests, we don't need this action anymore either, do we?

docs:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
env:
REF_DATA_ROOT: ${{ github.workspace }}/tests/test-data/sample-data
REF_OUTPUT_ROOT: ${{ github.workspace }}/out
REF_DATABASE_URL: "sqlite:///${{ github.workspace }}/.ref/db/ref.db"
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: docs
run: |
mkdir -p ${{ github.workspace }}/.ref/db
make fetch-test-data
uv run ref datasets ingest --source-type cmip6 $REF_DATA_ROOT
uv run mkdocs build --strict

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.

2 participants