Title: local / in-folder setup.cfg without mypy section shadows any additional user config files · Issue #9113 · python/mypy · GitHub
Open Graph Title: local / in-folder setup.cfg without mypy section shadows any additional user config files · Issue #9113 · python/mypy
X Title: local / in-folder setup.cfg without mypy section shadows any additional user config files · Issue #9113 · python/mypy
Description: 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 CONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_FILES # type: Final a shared config file...
Open Graph Description: 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 CONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_...
X Description: 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 CONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_...
Opengraph URL: https://github.com/python/mypy/issues/9113
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"local / in-folder setup.cfg without mypy section shadows any additional user config files","articleBody":"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\r\nis \r\n\r\n```python\r\nCONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_FILES # type: Final\r\n```\r\na shared config file (which may exist for several other purposes) shadows any user config files even in the case when \r\nthe shared config file contains no `mypy` section. \r\n\r\n## Steps to reproduce:\r\n\r\n* Create an empty `setup.cfg` in the current directory, and also have one of the `USER_CONFIG_FILE` versions of a mypy config file.\r\n* Run mypy\r\n* Notice that only the `setup.cfg` file was read, even though it had no `mypy` section. \r\n`\r\n## Proposal \r\n\r\nThe 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. \r\n\r\nThis should _at least_ be the case for any *shared config* files which may exist for entirely other reasons. \r\n\r\n\r\n","author":{"url":"https://github.com/jmetz","@type":"Person","name":"jmetz"},"datePublished":"2020-07-09T06:38:29Z","url":"https://github.com/python/mypy/issues/9113"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b6f6639f-9612-889b-dac3-89a4bbe051fb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D1E:1EE22E:37453B:4D0E1E:6B005E47 |
| html-safe-nonce | 1f9e1d90f8ae396b121aa6cbdf263f9050d10dd48dfc25e19b67dea1f851a94d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDFFOjFFRTIyRTozNzQ1M0I6NEQwRTFFOjZCMDA1RTQ3IiwidmlzaXRvcl9pZCI6IjI0NzY2MDcxOTEyNTYxNjE4NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 46ad1f791b10a9329218ab0f7da031c543d70b5451e1d6a4d2f21818b429294c |
| hovercard-subject-tag | issue:653804671 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/9113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f1a53fd0ec1a93dc118fedc781b5f77c5e49eabc4cb15898a0328e72812a26d/python/mypy/issues/9113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f1a53fd0ec1a93dc118fedc781b5f77c5e49eabc4cb15898a0328e72812a26d/python/mypy/issues/9113 |
| og:image:alt | 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 CONFIG_FILES = CONFIG_FILE + SHARED_CONFIG_FILES + USER_CONFIG_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jmetz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width