panch mukesh
panch mukesh

Reputation: 119

How to disable mypy error code at package level?

variable=[]

Error:

 error: Need type annotation for 'variable' (hint: "variable: List[<type>] = ...")

In config file: mypy.ini

disallow_any_expr=False

Is there any way to override this error by a flag in config file?

Upvotes: 7

Views: 4750

Answers (1)

Laurent
Laurent

Reputation: 13518

First, run mypy --show-error-code your_module.py to get the the error codes inside square brackets.

Then, in mypy.ini, add disable_error_code = code1,code2.

Upvotes: 9

Related Questions