Skip to content

Conversation

wyattscarpenter
Copy link
Contributor

Fix issue where ignore misc ignores reveal_type. Fixes #19840.

Since everything defaults to a code of misc, many notes with no code actually have code of misc...

This comment has been minimized.

@wyattscarpenter wyattscarpenter changed the title thub.… Make notes default to None code Sep 18, 2025

This comment has been minimized.

@wyattscarpenter
Copy link
Contributor Author

wyattscarpenter commented Sep 18, 2025

Probably the key to mopping up the rest is to make notes inherit code if they are attached to something...

(Wait... doesn't that already happen? Hmm...)

This comment has been minimized.

This comment has been minimized.

this is found in mypy_primer's corpus, but wasn't in our local tests. This covers silencing associated notes
This reverts commit 18ca5cf.

This will allow the PR that fixes this problem to be more focused.

This comment has been minimized.

This comment has been minimized.

@wyattscarpenter
Copy link
Contributor Author

I suspect these plugins aren't parenting their notes, and are instead just generating notes as well as errors for the same line, which means changing the default type of notes would be a slight backwards compatibility issue, for basically no benefit (although, little downside, either). I need to investigate this more, though.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/db/models/enums.pyi:41: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
+ django-stubs/db/models/enums.pyi:61: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members
+ django-stubs/db/models/enums.pyi:77: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members

AutoSplit (https://github.com/Toufool/AutoSplit)
-   File "/tmp/mypy_primer/mypy_old/venv/bin/mypy", line 7, in <module>
+   File "/tmp/mypy_primer/mypy_new/venv/bin/mypy", line 7, in <module>
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/__main__.py", line 15, in console_entry
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/main.py", line 127, in main
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 127, in main
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/main.py", line 211, in run_build
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/main.py", line 211, in run_build
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 196, in build
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 196, in build
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 272, in _build
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 272, in _build
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 2946, in dispatch
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 2946, in dispatch
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 3346, in process_graph
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 3346, in process_graph
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 3475, in process_stale_scc
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 3475, in process_stale_scc
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/build.py", line 2493, in write_cache
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/build.py", line 2493, in write_cache
-   File "/tmp/mypy_primer/mypy_old/venv/lib/python3.13/site-packages/mypy/cache.py", line 28, in __init__
+   File "/tmp/mypy_primer/mypy_new/venv/lib/python3.13/site-packages/mypy/cache.py", line 28, in __init__

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disable_error_code-misc would also mute reveal_type?
1 participant