Skip to content
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

mypy improvement #1054

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

mypy improvement #1054

wants to merge 4 commits into from

Conversation

Lee-W
Copy link
Member

@Lee-W Lee-W commented Apr 5, 2024

Description

This is part of #1053, which intends to catch errors earlier through a more strict mypy setting.

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

Steps to Test This Pull Request

Additional context

#1053

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.57%. Comparing base (120d514) to head (06eef86).
Report is 413 commits behind head on master.

Files Patch % Lines
commitizen/commands/check.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1054      +/-   ##
==========================================
+ Coverage   97.33%   97.57%   +0.23%     
==========================================
  Files          42       55      +13     
  Lines        2104     2518     +414     
==========================================
+ Hits         2048     2457     +409     
- Misses         56       61       +5     
Flag Coverage Δ
unittests 97.57% <95.00%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lee-W Lee-W changed the title Mypy improvement mypy improvement Aug 22, 2024
@Lee-W Lee-W marked this pull request as ready for review August 22, 2024 03:02
@Lee-W Lee-W linked an issue Aug 22, 2024 that may be closed by this pull request
17 tasks
def example(self) -> str | None:
return self.custom_settings.get("example")
def example(self) -> str:
return self.custom_settings.get("example") or ""
Copy link
Member

@woile woile Aug 22, 2024

Choose a reason for hiding this comment

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

You can set the default for the .get, right?

Copy link
Member

@woile woile left a comment

Choose a reason for hiding this comment

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

Lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turn on mypy check_untyped_defs = true
2 participants