Merged
Conversation
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
Signed-off-by: John Pennycook <john.pennycook@intel.com>
For now, run with the default configuration and no arguments. This configuration will detect errors and inconsistencies in type hints, but will not complain about missing or incomplete type hints. Signed-off-by: John Pennycook <john.pennycook@intel.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes broken type hints throughout the codebase to resolve mypy errors and improves type safety. The changes address inconsistent type annotations, missing type information, and variable redefinition issues that could lead to confusion.
- Updates type annotations to use modern union syntax and more precise types
- Fixes variable shadowing issues where variables were redefined with different types
- Adds mypy to pre-commit hooks to prevent future type hint regressions
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| codebasin/util.py | Updated parameter types to accept both str and PathLike, fixed string operations on path objects |
| codebasin/report.py | Corrected type annotations for setmap parameters and return types, fixed variable shadowing |
| codebasin/preprocessor.py | Fixed incorrect type annotation for lines field |
| codebasin/finder.py | Updated setmap type annotation to be more precise |
| codebasin/config.py | Replaced Self with explicit return types, updated action method signatures |
| codebasin/main.py | Fixed variable shadowing issue with lines variable |
| codebasin/init.py | Added proper type annotations and type casting for JSON loading |
| .pre-commit-config.yaml | Added mypy hook with necessary type stub dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Proposed changes
mypydue to broken or inconsistent type hints.mypyto GitHub Actions to ensure that we don't introduce any new broken type hints.