KEMBAR78
dmypy ignores flags and config file · Issue #12249 · python/mypy · GitHub
Skip to content

dmypy ignores flags and config file #12249

@sehyun-hwang

Description

@sehyun-hwang

Bug Report

dmypy ignores flags and config file
#11396 (comment)

@sehyun-hwang This seems like a dmypy bug. It seems that dmypy ignores cli flags or config file flags in certain cases.

Here's a file structure:

$ tree .
.
├── a.py
├── b.py
└── mypy.ini

And mypy.ini contains the following:

[mypy]
strict = True

a.py and b.py both contain:

def foo(): pass

This way mypy a.py won't show errors but mypy --strict a.py will. When alternating between dmypy check a.py and dmypy check b.py, at some point dmypy stops showing strict output. For the same reason it might be forgetting the --output flag being set as well.

To Reproduce

With the file structure above,

Expected Behavior

--strict flag and other arguments should be applied.

Actual Behavior
--strict flag of the last command gets ignored.

root@f24a1f5cf5c6:/mnt# dmypy run -- --strict foo.py
Daemon started
foo.py:1: error: Function is missing a return type annotation
foo.py:1: note: Use "-> None" if function does not return a value
Found 1 error in 1 file (checked 25 source files)
root@f24a1f5cf5c6:/mnt# dmypy run -- --strict bar.py
bar.py:1: error: Function is missing a return type annotation
bar.py:1: note: Use "-> None" if function does not return a value
Found 1 error in 1 file (checked 1 source file)
root@f24a1f5cf5c6:/mnt# dmypy run -- --strict foo.py
Success: no issues found in 1 source file

Your Environment

  • Mypy version used: Latest version hosted in pip
  • Mypy command-line flags: --strict
  • Mypy configuration options from mypy.ini (and other config files):
    strict = true or no config file
  • Python version used: 3.10
  • Operating system and version: Latest Python Docker image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions