-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/136 add mypy tool to project #139
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A PR to add mypy support to the project while improving type annotations and clarifying behavior in key modules.
- Key changes:
- Added mypy configuration in pyproject.toml and a new GitHub Actions job for mypy checks.
- Updated type hints and return types in various modules (e.g. utils, model, action_inputs) to leverage stricter typing.
- Refactored test assertions to check call count explicitly instead of relying on an ambiguous assertion helper.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tests/test_release_notes_generator.py | Updated log assertions to explicitly verify the number of calls. |
release_notes_generator/utils/utils.py | Changed the return type of get_change_url from Optional[str] to str. |
release_notes_generator/utils/github_rate_limiter.py | Improved type hinting for decorated functions. |
release_notes_generator/utils/gh_action.py | Added type ignore for os.getenv to comply with type checking. |
release_notes_generator/utils/constants.py | Introduced explicit type annotations for constants. |
release_notes_generator/model/service_chapters.py | Refactored default parameter handling to use Optional types. |
release_notes_generator/model/record.py | Enhanced type hints and added safety checks when retrieving pull commit counts. |
release_notes_generator/model/chapter.py | Refined default initialization for list parameters using Optional types. |
release_notes_generator/generator.py | Updated handling of optional releases and type annotations in release processing. |
release_notes_generator/action_inputs.py | Modified get_skip_release_notes_labels return type from string to list[str]. |
pyproject.toml | Added configuration options for mypy. |
main.py | Updated action output to handle missing release notes gracefully. |
README.md | Documented instructions for running mypy locally. |
.github/workflows/test.yml | Introduced a new job for mypy type checking in the CI workflow. |
Comments suppressed due to low confidence (1)
release_notes_generator/action_inputs.py:151
- Changing the return type from str to list[str] may affect code that consumes this method. Please verify that all call sites and documentation are updated to handle a list of strings.
def get_skip_release_notes_labels() -> list[str]:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many # type: ignore...
sections, consider adding comments as to why the sections are ignored.
Addressed in commit - 0e6c959 |
Release Notes:
Closes #136