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

add config option to skip package checking #3789

Closed
wants to merge 2 commits into from

Conversation

yedpodtrzitko
Copy link
Contributor

@yedpodtrzitko yedpodtrzitko commented Aug 1, 2017

Hi,
this could be partially related to #626.

This PR adds a new option into the per-module section in config file, which would allow to skip typechecks in a given package.

Example for skipping any packages in kiwi.schemas:

[mypy-kiwi.schemas.*]
skip = true

Thanks for any feedback.

@sobolevn
Copy link
Member

sobolevn commented Dec 18, 2017

👍 Real life use-case: I need to exclude everything in my_django_app/migrations/ package.

@ethanhs
Copy link
Collaborator

ethanhs commented Feb 25, 2018

Closing. This is already taken care of by e.g.

[mypy-kiwi.schemas.*]
ignore_missing_imports = True
follow_imports = skip

though thank you for the contribution @yedpodtrzitko.

@ethanhs ethanhs closed this Feb 25, 2018
@yedpodtrzitko
Copy link
Contributor Author

yedpodtrzitko commented Feb 25, 2018

@ethanhs thanks for your response, however the indended behaviour/purpose of skip is different than combination of follow_imports & ignore_missing_imports in your example.

Having the following directory structure (see below), and running mypy check for the whole kw package will go through the schemas submodule anyway. It wont report any errors from there whatsoever, but it will parse the content in there. My main reason for (not) doing that is #3796. And the behaviour of skip works exactly that way.

kw
|-bar
|-foo
|-schemas # <- want to skip parsing anything in here, since it takes eternity
  |-schema_1.py
  |-schema_n.py

However I can understand having such option is not a desired design, so until #3796 will be solved, I'm just gonna keep using my fork.

Cheers,
yed

@gvanrossum
Copy link
Member

  1. If # type: ignore on a line by itself worked, would that satisfy you?
  2. Maybe we could make follow_imports = skip work this way?

@yedpodtrzitko
Copy link
Contributor Author

Maybe we could make follow_imports = skip work this way?

I'd be happy with this solution ^^

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

Successfully merging this pull request may close these issues.

4 participants