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

Support package and module in config file #13404

Merged
merged 12 commits into from
Oct 4, 2022
Merged

Support package and module in config file #13404

merged 12 commits into from
Oct 4, 2022

Conversation

sameer-here
Copy link
Contributor

@sameer-here sameer-here commented Aug 13, 2022

Description

Closes #10728

Specifying module(s) to check was supported only via CLI, this PR adds
the ability to specify a module from a config file.

Test Plan

This is a pretty small change, I tested it by creating a mypy.ini file and verifying that adding the new options leads to expected outcomes (for example, specifying a package and files together will error here

mypy/mypy/main.py

Lines 957 to 960 in ea93326

if code_methods == 0 and not options.install_types:
parser.error("Missing target module, package, files, or command.")
elif code_methods > 1:
parser.error("May only specify one of: module/package, files, or command.")
). If there's a unit test to which I should contribute, I'd be happy to.

Do I need to rebuild the documentation after changing config_file.rst? If so, how is that done?

Thanks!

Specifying module(s) to check was supported only via CLI, this PR adds
the ability to specify a module from a config file.

Fixes #9883
@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks, this looks reasonable. Can we make packages and modules plural everywhere for consistency with files and the option names?

`modules` and `packages` should be plural for consistency
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@sameer-here
Copy link
Contributor Author

@hauntsaninja looks like all checks are passing, is anything else needed?

package and modules are *not* interchangeable
@github-actions

This comment has been minimized.

mypy/options.py Outdated Show resolved Hide resolved
mypy/options.py Outdated Show resolved Hide resolved
sameer-here and others added 2 commits October 4, 2022 08:03
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@github-actions

This comment has been minimized.

@sameer-here sameer-here requested review from JelleZijlstra and hauntsaninja and removed request for hauntsaninja and JelleZijlstra October 4, 2022 16:41
@sameer-here sameer-here requested review from JelleZijlstra and hauntsaninja and removed request for JelleZijlstra and hauntsaninja October 4, 2022 16:41
@JelleZijlstra JelleZijlstra requested review from hauntsaninja and removed request for JelleZijlstra October 4, 2022 17:06
mypy/options.py Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

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.

Support package and module in config files
3 participants