Skip to content

Allow disabling active config files. #6664

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

Merged
merged 3 commits into from
Apr 12, 2019
Merged

Allow disabling active config files. #6664

merged 3 commits into from
Apr 12, 2019

Conversation

brandtbucher
Copy link
Member

With this change, passing --config-file= from the command line disables any active config files.

With this change, passing `--config-file=` from the command line disables any active config files.
@gvanrossum
Copy link
Member

Why not use /dev/null?

@brandtbucher
Copy link
Member Author

brandtbucher commented Apr 11, 2019

$ mypy --config-file /dev/null .
/dev/null: No [mypy] section in config file

This cuts down on unnecessary noise, and to me it personally feels like less of a hack.

Copy link
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

I think this makes sense. In addition, you won't have to remember NUL vs /dev/null. Maybe we should document this behavior if we merge this?

@gvanrossum
Copy link
Member

OK, this sounds like a good idea. But yeah, please update the docs. Also please add a unittest to test-data/unit/check-flags.test, e.g. show that options in mypy.ini are ignored with --config-file=.

@brandtbucher
Copy link
Member Author

Ok, added documentation and testing!

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Thanks! All looks good.

@ilevkivskyi ilevkivskyi merged commit 75d4686 into python:master Apr 12, 2019
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