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

allow packages/modules as args with files in cfg #9834

Merged
merged 2 commits into from Jan 6, 2021

Conversation

trws
Copy link
Contributor

@trws trws commented Dec 23, 2020

Description

Currently only files can be specified on the command line if files are
specified in mypy.ini. This looks a great deal like a bug, especially
since packages and modules cannot be specified in the configuration
file.

This PR changes the logic to only use the files from the ini
file if none of (modules/packages/files) are specified on the command
line and adds tests to verify the new behavior.

I would also like to add packages and modules keys to the configuration file so a project I work on can use packages as its default without arguments, but want to gauge interest in that first, where this looked like it was probably a mistake with a straightforward solution.

Test Plan

Three new tests have been added to the codlin.test file that test that the conflict is still noted when both are placed on the command line, as well as two tests that ensure the right package/module is selected and checked when a package or module is on the command line with files in the config.

This is my first time working with this test format, pytest runs them and gives reliable results on my machine for these new tests, but if these are outside of style or similar I'll be happy to fix them.

Currently only files can be specified on the command line if files are
specified in mypy.ini.  This looks a great deal like a bug, especially
since packages and modules cannot be specified in the configuration
file.  This commit changes the logic to only use the files from the ini
file if none of (modules/packages/files) are specified on the command
line and adds tests to verify the new behavior.
This should solve the python version issue in the initial commit.
@JukkaL
Copy link
Collaborator

JukkaL commented Jan 6, 2021

I would also like to add packages and modules keys to the configuration file so a project I work on can use packages as its default without arguments, but want to gauge interest in that first, where this looked like it was probably a mistake with a straightforward solution.

This sounds like a useful feature. If you want to pursue this, please open an issue and describe how this would work in some detail.

Copy link
Collaborator

@JukkaL JukkaL 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 the PR! The original behavior looks like a mistake, and the new behavior is clearly more logical.

@JukkaL JukkaL merged commit b55bfe0 into python:master Jan 6, 2021
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.

None yet

2 participants