-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Inline config 'disable-error-code = attr-defined' does not disable errors #11462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Same issue. Going through the config file didn't work either:
|
When I did the same as @Ayenem, MyPy told me: |
Also ran into this and ended up having to work around by putting # type: ignore on all the relevant lines where dynamic attributes were involved in lieu of a better solution. |
Per-module error code handling was added in mypy 0.981 or something. https://mypy.readthedocs.io/en/stable/error_codes.html#per-module-enabling-disabling-error-codes |
For multiple error codes: # mypy: disable-error-code="misc,arg-type,type-arg,valid-type,assignment,return-value" |
Bug Report
Setting
# mypy: disable-error-code = attr-defined
within a module does not disable those errors.To Reproduce
mypy example.py
Expected Behavior
mypy should not complain about any errors:
Actual Behavior
mypy complains about line 3:
Your Environment
mypy.ini
(and other config files): None$ pip list Package Version ----------------- -------- mypy 0.910 mypy-extensions 0.4.3 pip 21.3.1 setuptools 58.5.2 toml 0.10.2 typed-ast 1.4.3 # for Python 3.6 typing-extensions 3.10.0.2 wheel 0.37.0
Other Notes
--disable-error-code attr-defined
from the CLI works:mypy.ini
file in the same directory asexample.py
and populating it with:mypy.ini
config file is not an option..mypy-cache
directory does not resolve the issue..mypy-cache
is required to get back to a state where the inline-config fails to applyThe text was updated successfully, but these errors were encountered: