Skip to content

Conversation

@sdavtaker
Copy link

Description

Describe:

  • This pull request add type-hints for mypy to be able to validate the codebase has not typing issues.

The code was tested by running mypy before and after, there is no behavioural change.

Before:

giturlparse/platforms/base.py:22: error: Need type annotation for "DEFAULTS" (hint: "DEFAULTS: dict[<type>, <type>] = ...")  [var-annotated]
giturlparse/platforms/gitlab.py:31: error: Incompatible types in assignment (expression has type "tuple[str, str]", base class "BasePlatform" defined the type as "None")  [assignment]
giturlparse/platforms/github.py:27: error: Incompatible types in assignment (expression has type "tuple[str, str]", base class "BasePlatform" defined the type as "None")  [assignment]
giturlparse/platforms/friendcode.py:5: error: Incompatible types in assignment (expression has type "tuple[str]", base class "BasePlatform" defined the type as "None")  [assignment]
giturlparse/platforms/bitbucket.py:19: error: Incompatible types in assignment (expression has type "tuple[str]", base class "BasePlatform" defined the type as "None")  [assignment]
giturlparse/platforms/assembla.py:5: error: Incompatible types in assignment (expression has type "tuple[str]", base class "BasePlatform" defined the type as "None")  [assignment]
Found 6 errors in 6 files (checked 15 source files)

After

mypy .                                 
Success: no issues found in 15 source files

To be able to run the checks, mypy and types sub for invoke and setuptools are required.

pip install mypy
pip install types-invoke
pip install types-setuptools

Checklist

  • Code lint checked via inv lint
  • [-] Tests added

No test added since its not adding functionallity.
I was not able to run inv lint, neither precommit. I run into some issues trying to run it, I will open a Issue about it.

I also tried to follow the format specified here for the commit and changes in the changes file but couldn't understand where should I get the from.
If you can guide me a little I can update the PR to adhere to the convention.

@protoroto protoroto self-requested a review October 23, 2025 06:59
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18725611978

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 96.364%

Totals Coverage Status
Change from base Build 18711408716: 0.1%
Covered Lines: 241
Relevant Lines: 251

💛 - Coveralls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants