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: Add the check-untyped-defs option for mypy. #629

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GuillaumeCrowdcomfort
Copy link

@GuillaumeCrowdcomfort GuillaumeCrowdcomfort commented Aug 17, 2023

Description

  • Add the ability to specify check-untyped-defs in the options section for mypy.

Related Issue

Feature request: #628

Motivation and Context

It is not required, but helping with better code quality is excellent.

How Has This Been Tested?

The protocol followed has been:

  • Create a file with a function without types
  • Run the current prospector version.
  • Get the message "By default, the bodies of untyped functions are not checked. Consider using --check-untyped-defs [annotation-unchecked]"
  • Apply the changes from the PR.
  • Add the option check-untyped-defs in the prospector.yaml such as:
mypy:
  run: true
  options:
    ignore-missing-imports: true
    check-untyped-defs: true
  • Install it locally with python3 install -e .
  • Rerun, the prospector.
  • Get correct type inferences and checks.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change requires a change to the dependencies
  • I have updated the dependencies accordingly
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All existing passing tests passed.
  • All new and existing tests passed.

* Add the ability to specify `check-untyped-defs` in the
  options section for mypy.

Signed-off-by: G <px9e@gmx.fr>
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.

None yet

3 participants