Skip to content

style: correcting all outstanding mypy errors - #113

Merged
ns-rse merged 1 commit into
mainfrom
ns-rse/32-improve-typehints
Jun 12, 2026
Merged

style: correcting all outstanding mypy errors#113
ns-rse merged 1 commit into
mainfrom
ns-rse/32-improve-typehints

Conversation

@ns-rse

@ns-rse ns-rse commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Closes #32

Fixing almost all outstanding mypy typing errors.

There are a few where I have used the # type: ignore[<rule>] as I couldn't work out how to resolve things but this
should mean that mypy passes both locally and in pre-commit.ci and so going forward we can stay on top of the
type-hints and ensure things always pass.

Explicitly exclude tests/ from type checking.


Before submitting a Pull Request please check the following.

  • Existing tests pass.
  • Documentation has been updated and builds.
  • Pre-commit checks pass.
  • New functions/methods have typehints and docstrings.
  • New functions/methods have tests which check the intended behaviour is correct.

@ns-rse ns-rse added the style Issues relating to style and linting label Jun 11, 2026
@ns-rse
ns-rse requested a review from fisher568 June 11, 2026 15:10
Fixing almost all outstanding `mypy` typing errors.

There are a few where I have used the `# type: ignore[<rule>]` as I couldn't work out how to resolve things but this
should mean that `mypy` passes both locally and in `pre-commit.ci` and so going forward we can stay on top of the
type-hints and ensure things always pass.

Explicitly exclude `tests/` from type checking.
@ns-rse
ns-rse force-pushed the ns-rse/32-improve-typehints branch from fa5899c to 9e1d7db Compare June 11, 2026 15:21
@ns-rse

ns-rse commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

pre-commit.ci is failing as its running on tests/ this pull-request includes removal of tests from the mypy
configuration of pyproject.toml and so subsequent to this being merged that directory should be ignored and
pre-commit.ci should pass.

@fisher568 fisher568 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mypy passes on my machine if I run it as part of pre-commit (e.g. by making a perfunctory change and attempting to commit it). I think this is good to merge, but why is the tests folder explicitly being ignored now, I get quite a few failures when I run mypy on all files?

@ns-rse

ns-rse commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

why is the tests folder explicitly being ignored now, I get quite a few failures when I run mypy on all files?

I was keen to get the src/ directory passing and keep pull requests small and incremental. I too have mypy failing on tests/ but I'm mindful of time and want to push on with the dataclasses and felt my time would be better spent focusing on that.

I've noted it as a task in #115.

Thanks for the ✅

@ns-rse
ns-rse merged commit 24a0462 into main Jun 12, 2026
11 of 12 checks passed
@ns-rse
ns-rse deleted the ns-rse/32-improve-typehints branch June 12, 2026 12:41
@ns-rse ns-rse added the typing Issues related to typing label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

style Issues relating to style and linting typing Issues related to typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce typehints and static type analysis

2 participants