You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CONFIG_FILES=CONFIG_FILE+SHARED_CONFIG_FILES+USER_CONFIG_FILES# type: Final
a shared config file (which may exist for several other purposes) shadows any user config files even in the case when
the shared config file contains no mypy section.
Steps to reproduce:
Create an empty setup.cfg in the current directory, and also have one of the USER_CONFIG_FILE versions of a mypy config file.
Run mypy
Notice that only the setup.cfg file was read, even though it had no mypy section.
`
Proposal
The logic which checks for a mypy section in the parser object (https://github.com/python/mypy/blob/master/mypy/config_parser.py#L127) should be used to check whether the parser.read call actually loaded anything meaningful from the config file. If no mypy section was loaded, then the loop over the config_files should continue instead of breaking.
This should at least be the case for any shared config files which may exist for entirely other reasons.
The text was updated successfully, but these errors were encountered:
As the config file read order defined by the order of the lists at https://github.com/python/mypy/blob/master/mypy/defaults.py#L15
is
a shared config file (which may exist for several other purposes) shadows any user config files even in the case when
the shared config file contains no
mypy
section.Steps to reproduce:
setup.cfg
in the current directory, and also have one of theUSER_CONFIG_FILE
versions of a mypy config file.setup.cfg
file was read, even though it had nomypy
section.`
Proposal
The logic which checks for a
mypy
section in theparser
object (https://github.com/python/mypy/blob/master/mypy/config_parser.py#L127) should be used to check whether theparser.read
call actually loaded anything meaningful from the config file. If nomypy
section was loaded, then the loop over theconfig_files
should continue instead of breaking.This should at least be the case for any shared config files which may exist for entirely other reasons.
The text was updated successfully, but these errors were encountered: