Skip to content

Unused section warning with warn_unused_configs and cache #5957

Closed
@The-Compiler

Description

@The-Compiler

With mypy 0.641 or the latest git master, and a config file like:

[mypy]
warn_unused_configs = True
[mypy-bdb]
ignore_missing_imports = True

checking a file like

import bdb

suppresses the error: No library stub file for standard library module 'bdb' error as expected.

However, when running mypy a second time, I assume results are retrieved from its cache, and it shows:

Warning: unused section(s) in mypy.ini: [mypy-bdb]

which means I can only use --warn-unused-configs selectively (like after editing the config), as otherwise, I'd get a lot of bogus warnings in day-to-day usage.

This is probably somewhat similar to #2960, which is the same kind of issue for --warn-unused-ignores.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions