Skip to content

Commit c1464a9

Browse files
JukkaLwesleywright
authored andcommitted
Revert "Fix disappearing errors when re-running dmypy check (#14835)" (#15179)
This reverts commit a9ee618. The original fix doesn't work in all cases. Reverting it since fixing remaining issues is non-trivial, and it's better not to include regressions or partially implemented features in mypy 1.3. See #9655 for context.
1 parent d887e9c commit c1464a9

File tree

3 files changed

+0
-99
lines changed

3 files changed

+0
-99
lines changed

Diff for: mypy/errors.py

-4
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,6 @@ def generate_unused_ignore_errors(self, file: str) -> None:
668668
False,
669669
False,
670670
False,
671-
origin=(self.file, [line]),
672-
target=self.target_module,
673671
)
674672
self._add_error_info(file, info)
675673

@@ -722,8 +720,6 @@ def generate_ignore_without_code_errors(
722720
False,
723721
False,
724722
False,
725-
origin=(self.file, [line]),
726-
target=self.target_module,
727723
)
728724
self._add_error_info(file, info)
729725

Diff for: mypy/server/update.py

-6
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,6 @@ def restore(ids: list[str]) -> None:
667667
state.type_check_first_pass()
668668
state.type_check_second_pass()
669669
state.detect_possibly_undefined_vars()
670-
state.generate_unused_ignore_notes()
671-
state.generate_ignore_without_code_notes()
672670
t2 = time.time()
673671
state.finish_passes()
674672
t3 = time.time()
@@ -1029,10 +1027,6 @@ def key(node: FineGrainedDeferredNode) -> int:
10291027
if graph[module_id].type_checker().check_second_pass():
10301028
more = True
10311029

1032-
graph[module_id].detect_possibly_undefined_vars()
1033-
graph[module_id].generate_unused_ignore_notes()
1034-
graph[module_id].generate_ignore_without_code_notes()
1035-
10361030
if manager.options.export_types:
10371031
manager.all_types.update(graph[module_id].type_map())
10381032

Diff for: test-data/unit/daemon.test

-89
Original file line numberDiff line numberDiff line change
@@ -522,92 +522,3 @@ class A:
522522
x: int
523523
class B:
524524
x: int
525-
526-
[case testUnusedTypeIgnorePreservedOnRerun]
527-
-- Regression test for https://github.com/python/mypy/issues/9655
528-
$ dmypy start -- --warn-unused-ignores --no-error-summary
529-
Daemon started
530-
$ dmypy check -- bar.py
531-
bar.py:2: error: Unused "type: ignore" comment
532-
== Return code: 1
533-
$ dmypy check -- bar.py
534-
bar.py:2: error: Unused "type: ignore" comment
535-
== Return code: 1
536-
537-
[file foo/__init__.py]
538-
[file foo/empty.py]
539-
[file bar.py]
540-
from foo.empty import *
541-
a = 1 # type: ignore
542-
543-
[case testTypeIgnoreWithoutCodePreservedOnRerun]
544-
-- Regression test for https://github.com/python/mypy/issues/9655
545-
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
546-
Daemon started
547-
$ dmypy check -- bar.py
548-
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
549-
== Return code: 1
550-
$ dmypy check -- bar.py
551-
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
552-
== Return code: 1
553-
554-
[file foo/__init__.py]
555-
[file foo/empty.py]
556-
[file bar.py]
557-
from foo.empty import *
558-
a = 1 # type: ignore
559-
560-
[case testUnusedTypeIgnorePreservedAfterChange]
561-
-- Regression test for https://github.com/python/mypy/issues/9655
562-
$ dmypy start -- --warn-unused-ignores --no-error-summary
563-
Daemon started
564-
$ dmypy check -- bar.py
565-
bar.py:2: error: Unused "type: ignore" comment
566-
== Return code: 1
567-
$ {python} -c "print('\n')" >> bar.py
568-
$ dmypy check -- bar.py
569-
bar.py:2: error: Unused "type: ignore" comment
570-
== Return code: 1
571-
572-
[file foo/__init__.py]
573-
[file foo/empty.py]
574-
[file bar.py]
575-
from foo.empty import *
576-
a = 1 # type: ignore
577-
578-
[case testTypeIgnoreWithoutCodePreservedAfterChange]
579-
-- Regression test for https://github.com/python/mypy/issues/9655
580-
$ dmypy start -- --enable-error-code ignore-without-code --no-error-summary
581-
Daemon started
582-
$ dmypy check -- bar.py
583-
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
584-
== Return code: 1
585-
$ {python} -c "print('\n')" >> bar.py
586-
$ dmypy check -- bar.py
587-
bar.py:2: error: "type: ignore" comment without error code [ignore-without-code]
588-
== Return code: 1
589-
590-
[file foo/__init__.py]
591-
[file foo/empty.py]
592-
[file bar.py]
593-
from foo.empty import *
594-
a = 1 # type: ignore
595-
596-
[case testPossiblyUndefinedVarsPreservedAfterUpdate]
597-
-- Regression test for https://github.com/python/mypy/issues/9655
598-
$ dmypy start -- --enable-error-code possibly-undefined --no-error-summary
599-
Daemon started
600-
$ dmypy check -- bar.py
601-
bar.py:4: error: Name "a" may be undefined [possibly-undefined]
602-
== Return code: 1
603-
$ dmypy check -- bar.py
604-
bar.py:4: error: Name "a" may be undefined [possibly-undefined]
605-
== Return code: 1
606-
607-
[file foo/__init__.py]
608-
[file foo/empty.py]
609-
[file bar.py]
610-
from foo.empty import *
611-
if False:
612-
a = 1
613-
a

0 commit comments

Comments
 (0)