Skip to content

Support package and module in config file - #13404

Merged
hauntsaninja merged 12 commits into
python:masterfrom
sameer-here:master
Oct 4, 2022
Merged

Support package and module in config file#13404
hauntsaninja merged 12 commits into
python:masterfrom
sameer-here:master

Conversation

@sameer-here

@sameer-heresameer-here commented Aug 13, 2022

Copy link
Copy Markdown
Contributor

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

ifcode_methods==0andnotoptions.install_types:
parser.error("Missing target module, package, files, or command.")
elifcode_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.

@hauntsaninjahauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
ContributorAuthor

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

package and modules are *not* interchangeable
Comment threaddocs/source/config_file.rst Outdated
@github-actions

This comment has been minimized.

Comment threadmypy/options.py Outdated
Comment threadmypy/options.py Outdated
sameer-hereand 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 JelleZijlstra and hauntsaninjaOctober 4, 2022 16:41
@sameer-here
sameer-here requested review from JelleZijlstra and hauntsaninja and removed request for JelleZijlstra and hauntsaninjaOctober 4, 2022 16:41
@JelleZijlstra
JelleZijlstra requested review from hauntsaninja and removed request for JelleZijlstraOctober 4, 2022 17:06
Comment threadmypy/options.py Outdated
@github-actions

Copy link
Copy Markdown
Contributor

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

@hauntsaninjahauntsaninja left a comment

Copy link
Copy Markdown
Collaborator

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 freeto 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

@sameer-here@JelleZijlstra@hauntsaninja