Skip to content

feat: Add type coverage support using mypy#62

Merged
houfu merged 3 commits into
houfu:mainfrom
FallenDeity:feat/type-coverage
Oct 11, 2025
Merged

feat: Add type coverage support using mypy#62
houfu merged 3 commits into
houfu:mainfrom
FallenDeity:feat/type-coverage

Conversation

@FallenDeity
Copy link
Copy Markdown
Contributor

@FallenDeity FallenDeity commented Oct 9, 2025

Completely resolves #56 and partially addresses #54

#56

  • Audit existing type hints
  • Add missing type hints to public APIs
  • Add missing type hints to internal functions
  • Add py.typed marker file to package
  • Configure mypy in strict mode in pyproject.toml
  • Update CI to run mypy checks
  • Use modern type syntax (e.g., list[str] instead of List[str])
  • Add type tests using pytest with type checking, (added mypy static type checking in ci, other option was using this https://github.com/realpython/pytest-mypy but don't think an extra dep is needed)
  • Document type annotations in docstrings

#54

  • Bump python version in pyproject.toml
  • Update ci/cd matrix
  • Reviewed all deps for 3.10+ and 3.14 compatibility, ran ci/cd workflow https://github.com/FallenDeity/redlines/actions/runs/18381510195 (all passed for new matrix)
  • Code modernization done for most part (except match/case in redlines.py)
  • Added a note using sys in cli.py regarding python version required

Pending or Not Done

  • bump package version (needs review of existing changes before making the final commit)
  • docs changes
    • I think a separate pr is in order for there where something like pre-commit is setup which runs mypy, black, isort, pytest etc automatically and contributing.md can be updated accordingly this creates a unified workflow than documenting each tool separately.
    • Also Add Python 3.14 support and drop Python 3.8/3.9 #54 says mention update versions in readme i see no such existing mention maybe we just add a badge like this? py
    • No changelogs present so far either, I think that should be done along with release when bumping the package version and maybe creating a tag from maintainer side, could be a nice tool for this https://github.com/cookpete/auto-changelog

cc: @houfu

Copy link
Copy Markdown
Owner

@houfu houfu left a comment

Choose a reason for hiding this comment

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

Looks good overall! Left a few minor suggestions but nothing blocking. Feel free to merge as-is or address them—up to you.

Comment thread .gitignore Outdated
Comment thread pyproject.toml Outdated
@houfu
Copy link
Copy Markdown
Owner

houfu commented Oct 10, 2025

Great work on this PR! 🎉

I noticed that GitHub will automatically close both issues #54 and #56 when this PR is merged, even though the PR description says "partially resolves #54".

GitHub's parser detected the keyword "resolves" next to #54 and is treating it as an auto-close trigger, ignoring the "partially" qualifier.

Since #54 is only partially completed (with docs changes and version bump still pending), you might want to update the PR description to prevent it from auto-closing:

Current:

Completely resolves #56 and partially resolves #54

Suggested:

Resolves #56 and partially addresses #54

This way only #56 will close automatically, and #54 will remain open for the remaining work (version bump, docs, pre-commit setup, etc.).

@FallenDeity
Copy link
Copy Markdown
Contributor Author

thx :) updated the pr desc and made the minor changes, rest of the release work can be carried over as part of #54

@houfu houfu merged commit 502e639 into houfu:main Oct 11, 2025
5 checks passed
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.

Complete type hint coverage and add py.typed marker

2 participants