Enable --pretty by default for better error messages#20768
Open
veeceey wants to merge 1 commit intopython:masterfrom
Open
Enable --pretty by default for better error messages#20768veeceey wants to merge 1 commit intopython:masterfrom
veeceey wants to merge 1 commit intopython:masterfrom
Conversation
Changed the default value of --pretty from False to True to provide visually nicer output by default. Users can still disable it with --no-pretty if they prefer more concise error messages. Updated defaults in: - mypy/options.py: Changed self.pretty = False to True - mypy/main.py: Changed default=False to default=True for --pretty flag - docs/source/command_line.rst: Added note about default and --no-pretty Fixes python#19108
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: beartype (https://github.com/beartype/beartype)
- beartype/typing/__init__.py:250: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/typing/__init__.py:250: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from typing import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/typing/__init__.py:268: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/typing/__init__.py:268: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from typing import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/typing/__init__.py:275: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/typing/__init__.py:275: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from typing import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/typing/__init__.py:285: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/typing/__init__.py:285: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from typing import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/typing/__init__.py:306: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from collections.abc import ByteString as ByteString # type: igno...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/typing/__init__.py:320: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from typing import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/typing/__init__.py:306: error: Unused "type: ignore" comment [unused-ignore]
- beartype/typing/__init__.py:320: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/kind/maplike/utilmaptest.py:97: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_cave/_cavefast.py:183: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_cave/_cavefast.py:1268: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/text/utiltextjoin.py:123: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncwrap.py:349: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncframe.py:779: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfunccodeobj.py:244: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfunccodeobj.py:306: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/error/utilerrwarn.py:60: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/error/utilerrwarn.py:83: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/api/external/utilclick.py:104: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/api/external/utilclick.py:111: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/kind/maplike/utilmapfrozen.py:155: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_util/kind/maplike/utilmaptest.py:97: error: Unused "type: ignore"
+ comment [unused-ignore]
+ mapping_keys_shared = mapping_a.keys() & mapping_b # type: ignore...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- beartype/_util/func/utilfuncmake.py:27: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncmake.py:310: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncmake.py:315: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncmake.py:357: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/utilfuncmake.py:358: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep649.py:153: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep649.py:229: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep649.py:567: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/arg/utilfuncargiter.py:404: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/arg/utilfuncargiter.py:419: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/func/arg/utilfuncargiter.py:424: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/utilhintfactory.py:46: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/api/external/utilnumpy.py:253: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_conf/_confoverrides.py:89: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_cave/_cavefast.py:183: error: Unused "type: ignore" comment
- beartype/_util/hint/pep/proposal/pep646692.py:481: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep646692.py:518: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep646692.py:607: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep585.py:373: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep557.py:81: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep544.py:428: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep544.py:481: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep544.py:488: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484604.py:150: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484604.py:278: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484604.py:283: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/pep484585args.py:61: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484/pep484union.py:87: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484/pep484generic.py:149: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484/pep484generic.py:177: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:90: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:277: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:508: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:649: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:874: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/cls/pep/clspep3119.py:994: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_conf/confmain.py:1386: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/metadata/hint/hintsane.py:392: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/utilpepget.py:911: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ from types import ( # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_cave/_cavefast.py:1268: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from annotationlib import Format as Format # type: ignore[import-...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/text/utiltextjoin.py:123: error: Unused "type: ignore" comment
+ [unused-ignore]
+ return strs[0] # type: ignore[no-any-return]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/func/utilfuncwrap.py:349: error: Unused "type: ignore" comment
+ [unused-ignore]
+ func = func.__wrapped__ # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/func/utilfuncframe.py:779: error: Unused "type: ignore" comment
+ [unused-ignore]
+ func_frame = get_frame(ignore_frames + 1) # type: ignore[misc...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/func/utilfunccodeobj.py:244: error: Unused "type: ignore"
+ comment [unused-ignore]
+ func_codeobj = (unwrap_func_all(func) if is_unwrap else func)....
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/func/utilfunccodeobj.py:306: error: Unused "type: ignore"
+ comment [unused-ignore]
+ func_codeobj.co_qualname # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/_util/hint/pep/utilpepget.py:1045: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_util/error/utilerrwarn.py:60: error: Unused "type: ignore" comment
+ [unused-ignore]
+ with catch_warnings(action='ignore'): # type: ignore[call-ove...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/error/utilerrwarn.py:83: error: Unused "type: ignore" comment
+ [unused-ignore]
+ warn(message, cls, skip_file_prefixes=_ISSUE_WARNING_IGNORE_DI...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/api/external/utilclick.py:104: error: Unused "type: ignore"
+ comment [unused-ignore]
+ func_checked = beartype_func(func=func, **kwargs) # type: ignore[...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/api/external/utilclick.py:111: error: Unused "type: ignore"
+ comment [unused-ignore]
+ return click_command # type: ignore[return-value]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/kind/maplike/utilmapfrozen.py:155: error: Unused "type: ignore"
+ comment [unused-ignore]
+ dict_united: dict = super().__or__(dict(other)) # type: ignor...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/func/utilfuncmake.py:27: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from linecache import cache as linecache_cache # type: ignore[attr-de...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/func/utilfuncmake.py:310: error: Unused "type: ignore" comment
+ [unused-ignore]
+ func: Callable = func_locals[func_name] # type: ignore[assignment...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/func/utilfuncmake.py:315: error: Unused "type: ignore" comment
+ [unused-ignore]
+ f'{func_label or func_labeller()} ' # type: ignore[misc]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- beartype/_util/hint/pep/proposal/pep484585/pep484585func.py:108: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_decor/_nontype/_decordescriptor.py:92: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_decor/_nontype/_decordescriptor.py:143: error: Unused "type: ignore[assignment, union-attr]" comment [unused-ignore]
- beartype/_decor/_nontype/_decordescriptor.py:144: error: Unused "type: ignore[assignment, union-attr]" comment [unused-ignore]
- beartype/_decor/_nontype/_decordescriptor.py:145: error: Unused "type: ignore[assignment, union-attr]" comment [unused-ignore]
- beartype/_decor/_nontype/_decordescriptor.py:263: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_redrecurse.py:228: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_pep/pep484585/redpep484585itemsview.py:70: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_pep/pep484585/redpep484585itemsview.py:80: error: Unused "type: ignore[assignment]" comment [unused-ignore]
- beartype/_check/pep/checkpep484typevar.py:167: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_nonpep/api/redapinumpy.py:101: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_nonpep/api/redapinumpy.py:189: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/convert/_reduce/_nonpep/api/redapinumpy.py:239: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:300: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:374: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:395: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:451: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:521: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:544: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:575: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:576: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:611: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:715: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:716: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:740: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:981: error: Item "object" of "object | Any" has no attribute "__qualname__" [union-attr]
- beartype/_check/forward/reference/fwdrefmeta.py:61: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:265: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:270: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:298: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:327: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:380: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:443: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmeta.py:543: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefabc.py:107: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmake.py:89: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_check/forward/reference/fwdrefmake.py:150: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/proposal/pep695.py:585: error: Unused "type: ignore" comment [unused-ignore]
- beartype/_util/hint/pep/utilpepsign.py:481: error: Item "object" of "object | Any" has no attribute "__qualname__" [union-attr]
- beartype/_util/hint/pep/utilpepsign.py:592: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_util/func/utilfuncmake.py:357: error: Unused "type: ignore" comment
+ [unused-ignore]
+ linecache_cache[func_filename] = ( # type: ignore[assignment]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ beartype/_util/func/utilfuncmake.py:358: error: Unused "type: ignore" comment
+ [unused-ignore]
+ len(func_code), # type: ignore[assignment] # Y u gotta b...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ beartype/_util/hint/pep/proposal/pep649.py:153: error: Unused "type: ignore"
+ comment [unused-ignore]
... (truncated 820 lines) ...
pyinstrument (https://github.com/joerick/pyinstrument)
- pyinstrument/vendor/appdirs.py:533: error: Cannot find implementation or library stub for module named "com.sun" [import-not-found]
- pyinstrument/vendor/appdirs.py:534: error: Cannot find implementation or library stub for module named "com.sun.jna.platform" [import-not-found]
+ pyinstrument/vendor/appdirs.py:533: error: Cannot find implementation or
+ library stub for module named "com.sun" [import-not-found]
+ from com.sun import jna
+ ^
+ pyinstrument/vendor/appdirs.py:534: error: Cannot find implementation or
+ library stub for module named "com.sun.jna.platform" [import-not-found]
+ from com.sun.jna.platform import win32
+ ^
- pyinstrument/vendor/appdirs.py:559: error: Module "ctypes" has no attribute "windll" [attr-defined]
+ pyinstrument/vendor/appdirs.py:559: error: Module "ctypes" has no attribute
- pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or library stub for module named "com.sun.jna" [import-not-found]
- pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or library stub for module named "com" [import-not-found]
- pyinstrument/magic/_utils.py:73: error: Unused "type: ignore" comment [unused-ignore]
- pyinstrument/magic/_utils.py:74: error: Unused "type: ignore" comment [unused-ignore]
+ "windll" [attr-defined]
+ from ctypes import windll
+ ^~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or
+ library stub for module named "com.sun.jna" [import-not-found]
+ import com.sun.jna
+ ^
+ pyinstrument/vendor/appdirs.py:562: error: Cannot find implementation or
+ library stub for module named "com" [import-not-found]
+ import com.sun.jna
+ ^
+ pyinstrument/magic/_utils.py:73: error: Unused "type: ignore" comment
+ [unused-ignore]
+ self.try_ = self.core.body[0].body = [] # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/magic/_utils.py:74: error: Unused "type: ignore" comment
+ [unused-ignore]
+ self.fin = self.core.body[0].finalbody = [] # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ def file_path(self) -> str | None:
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ def line_no(self) -> int | None:
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- pyinstrument/frame.py:220: error: Name "attributes" already defined on line 67 [no-redef]
+ pyinstrument/frame.py:220: error: Name "attributes" already defined on line 67
- pyinstrument/frame.py:274: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/frame.py:277: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/frame.py:346: error: Unused "type: ignore" comment [unused-ignore]
+ [no-redef]
+ attributes: dict[str, float]
+ ^~~~~~~~~~
+ pyinstrument/frame.py:274: error: Incompatible types in assignment (expression
+ has type "float", variable has type "int") [assignment]
+ await_time += self.time
+ ^~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/frame.py:277: error: Incompatible types in assignment (expression
+ has type "float", variable has type "int") [assignment]
+ await_time += child.await_time()
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/frame.py:346: error: Unused "type: ignore" comment
+ [unused-ignore]
+ encode_str = typing.cast(Callable[[str], str], json.encoder.en...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- pyinstrument/vendor/decorator.py:55: error: All conditional function variants must have identical signatures [misc]
+ pyinstrument/vendor/decorator.py:55: error: All conditional function variants
+ must have identical signatures [misc]
+ def getfullargspec(f):
+ ^~~~~~~~~~~~~~~~~~~~~~
- pyinstrument/vendor/decorator.py:66: error: Incompatible redefinition (redefinition with type "Callable[[Any], Any]", original type overloaded function) [misc]
- pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no attribute "GeneratorContextManager"; maybe "_GeneratorContextManager", "_GeneratorContextManagerBase", or "_AsyncGeneratorContextManager"? [attr-defined]
- pyinstrument/vendor/decorator.py:279: error: Name "_GeneratorContextManager" already defined (possibly by an import) [no-redef]
- pyinstrument/vendor/decorator.py:295: error: Cannot assign to a method [method-assign]
- pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment (expression has type "def __init__(self: Any, g: Any, *a: Any, **k: Any) -> Any", variable has type "Callable[[_GeneratorContextManagerBase[Generator[Any, None, None]], Callable[..., Generator[Any, None, None]], tuple[Any, ...], dict[str, Any]], None]") [assignment]
+ pyinstrument/vendor/decorator.py:66: error: Incompatible redefinition
+ (redefinition with type "Callable[[Any], Any]", original type overloaded
+ function) [misc]
+ def iscoroutinefunction(f):
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/vendor/decorator.py:279: error: Module "contextlib" has no
+ attribute "GeneratorContextManager"; maybe "_GeneratorContextManager",
+ "_GeneratorContextManagerBase", or "_AsyncGeneratorContextManager"?
+ [attr-defined]
+ from contextlib import GeneratorContextManager as _GeneratorContex...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ pyinstrument/vendor/decorator.py:279: error: Name "_GeneratorContextManager"
+ already defined (possibly by an import) [no-redef]
+ from contextlib import GeneratorContextManager as _GeneratorContex...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- pyinstrument/vendor/decorator.py:301: error: Cannot assign to a method [method-assign]
+ pyinstrument/vendor/decorator.py:295: error: Cannot assign to a method
- pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment (expression has type "def __init__(self: Any, g: Any, *a: Any, **k: Any) -> Any", variable has type "Callable[[_GeneratorContextManagerBase[Generator[Any, None, None]], Callable[..., Generator[Any, None, None]], tuple[Any, ...], dict[str, Any]], None]") [assignment]
- pyinstrument/low_level/pyi_timing_thread_python.py:18: error: Need type annotation for "subscribers" (hint: "subscribers: list[<type>] = ...") [var-annotated]
- pyinstrument/processors.py:90: error: Unused "type: ignore" comment [unused-ignore]
- pyinstrument/stack_sampler.py:102: error: Unused "type: ignore" comment [unused-ignore]
- pyinstrument/stack_sampler.py:312: error: Incompatible types in string interpolation (expression has type "int | None", placeholder has type "int | float | SupportsInt") [str-format]
- pyinstrument/renderers/pstatsrenderer.py:50: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/renderers/pstatsrenderer.py:53: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/renderers/pstatsrenderer.py:54: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/renderers/pstatsrenderer.py:64: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/renderers/pstatsrenderer.py:66: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/renderers/pstatsrenderer.py:67: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
- pyinstrument/profiler.py:246: error: Unused "type: ignore" comment [unused-ignore]
- pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has incompatible type "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]"; expected "float" [arg-type]
- pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has incompatible type "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]"; expected "Literal['enabled', 'disabled', 'strict']" [arg-type]
- pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has incompatible type "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]"; expected "bool | None" [arg-type]
- pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has incompatible type "**dict[str, object]"; expected "float" [arg-type]
- pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has incompatible type "**dict[str, object]"; expected "Literal['enabled', 'disabled', 'strict']" [arg-type]
- pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has incompatible type "**dict[str, object]"; expected "bool | None" [arg-type]
- pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has incompatible type "**dict[str, object]"; expected "Renderer | None" [arg-type]
- pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has incompatible type "**dict[str, object]"; expected "str | None" [arg-type]
- pyinstrument/context_manager.py:71: error: Unused "type: ignore" comment [unused-ignore]
+ [method-assign]
+ ContextManager.__init__ = __init__
+ ^~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/vendor/decorator.py:295: error: Incompatible types in assignment
+ (expression has type
+ "def __init__(self: Any, g: Any, *a: Any, **k: Any) -> Any", variable has type
+ "Callable[[_GeneratorContextManagerBase[Generator[Any, None, None]], Callable[..., Generator[Any, None, None]], tuple[Any, ...], dict[str, Any]], None]")
+ [assignment]
+ ContextManager.__init__ = __init__
+ ^~~~~~~~
+ pyinstrument/vendor/decorator.py:301: error: Cannot assign to a method
+ [method-assign]
+ ContextManager.__init__ = __init__
+ ^~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/vendor/decorator.py:301: error: Incompatible types in assignment
+ (expression has type
+ "def __init__(self: Any, g: Any, *a: Any, **k: Any) -> Any", variable has type
+ "Callable[[_GeneratorContextManagerBase[Generator[Any, None, None]], Callable[..., Generator[Any, None, None]], tuple[Any, ...], dict[str, Any]], None]")
+ [assignment]
+ ContextManager.__init__ = __init__
+ ^~~~~~~~
+ pyinstrument/low_level/pyi_timing_thread_python.py:18: error: Need type
+ annotation for "subscribers" (hint: "subscribers: list[<type>] = ...")
+ [var-annotated]
+ subscribers = []
+ ^~~~~~~~~~~
+ pyinstrument/processors.py:90: error: Unused "type: ignore" comment
+ [unused-ignore]
+ frame._children.sort(key=lambda c: c.time, reverse=True) # type: ...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ pyinstrument/stack_sampler.py:102: error: Unused "type: ignore" comment
+ [unused-ignore]
+ subscriber = next(s for s in self.subscribers if s.target ...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ pyinstrument/stack_sampler.py:312: error: Incompatible types in string
+ interpolation (expression has type "int | None", placeholder has type
+ "int | float | SupportsInt") [str-format]
+ thread_identifier = "%s\x00%s\x00%i" % (thread.name, "<thread>", t...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ pyinstrument/renderers/pstatsrenderer.py:50: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ ..._time, number_calls, total_time, cumulative_time, callers = stats[key]
+ ^
+ pyinstrument/renderers/pstatsrenderer.py:53: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ total_time += frame.total_self_time
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/renderers/pstatsrenderer.py:54: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ cumulative_time += frame.time
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/renderers/pstatsrenderer.py:64: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ ... p_number_calls, p_total_time, p_cumulative_time = callers[parent_key]
+ ^
+ pyinstrument/renderers/pstatsrenderer.py:66: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ p_total_time += frame.total_self_time
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/renderers/pstatsrenderer.py:67: error: Incompatible types in
+ assignment (expression has type "float", variable has type "int") [assignment]
+ p_cumulative_time += frame.time
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/profiler.py:246: error: Unused "type: ignore" comment
+ [unused-ignore]
+ self.start(caller_frame=inspect.currentframe().f_back) # type...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
+ pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has
+ incompatible type
+ "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]";
+ expected "float" [arg-type]
+ self.profiler = Profiler(**profiler_options)
+ ^~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has
+ incompatible type
+ "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]";
+ expected "Literal['enabled', 'disabled', 'strict']" [arg-type]
+ self.profiler = Profiler(**profiler_options)
+ ^~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:40: error: Argument 1 to "Profiler" has
+ incompatible type
+ "**dict[str, Literal['enabled', 'disabled', 'strict'] | float | bool | None]";
+ expected "bool | None" [arg-type]
+ self.profiler = Profiler(**profiler_options)
+ ^~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has
+ incompatible type "**dict[str, object]"; expected "float" [arg-type]
+ return ProfileContext(**{**self.options, **kwargs})
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has
+ incompatible type "**dict[str, object]"; expected
+ "Literal['enabled', 'disabled', 'strict']" [arg-type]
+ return ProfileContext(**{**self.options, **kwargs})
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has
+ incompatible type "**dict[str, object]"; expected "bool | None" [arg-type]
+ return ProfileContext(**{**self.options, **kwargs})
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has
+ incompatible type "**dict[str, object]"; expected "Renderer | None" [arg-type]
+ return ProfileContext(**{**self.options, **kwargs})
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:63: error: Argument 1 to "ProfileContext" has
+ incompatible type "**dict[str, object]"; expected "str | None" [arg-type]
+ return ProfileContext(**{**self.options, **kwargs})
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~
+ pyinstrument/context_manager.py:71: error: Unused "type: ignore" comment
+ [unused-ignore]
+ caller_frame = inspect.currentframe().f_back # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- pyinstrument/__main__.py:284: error: Unused "type: ignore" comment [unused-ignore]
+ pyinstrument/__main__.py:284: error: Unused "type: ignore" comment
+ [unused-ignore]
... (truncated 82 lines) ...
spack (https://github.com/spack/spack)
- lib/spack/spack/util/elf.py:220: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/util/elf.py:220: error: Unused "type: ignore" comment
+ [unused-ignore]
+ if ph.p_filesz == 0: # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/util/elf.py:225: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/util/elf.py:225: error: Unused "type: ignore" comment
+ [unused-ignore]
+ if ph.p_type == ELF_CONSTANTS.PT_LOAD: # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/util/elf.py:226: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/util/elf.py:226: error: Unused "type: ignore" comment
+ [unused-ignore]
+ elf.pt_load.append((ph.p_offset, ph.p_vaddr)) # type: ign...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/util/elf.py:228: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/util/elf.py:228: error: Unused "type: ignore" comment
- lib/spack/spack/util/elf.py:229: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:230: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ elif ph.p_type == ELF_CONSTANTS.PT_INTERP: # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/util/elf.py:233: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/util/elf.py:229: error: Unused "type: ignore" comment
- lib/spack/spack/util/elf.py:234: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/util/elf.py:235: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ elf.pt_interp_p_offset = ph.p_offset # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/util/elf.py:230: error: Unused "type: ignore" comment
+ [unused-ignore]
+ elf.pt_interp_p_filesz = ph.p_filesz # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/util/elf.py:233: error: Unused "type: ignore" comment
+ [unused-ignore]
+ elif ph.p_type == ELF_CONSTANTS.PT_DYNAMIC: # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/util/elf.py:234: error: Unused "type: ignore" comment
+ [unused-ignore]
+ elf.pt_dynamic_p_offset = ph.p_offset # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/util/elf.py:235: error: Unused "type: ignore" comment
+ [unused-ignore]
+ elf.pt_dynamic_p_filesz = ph.p_filesz # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/llnl/util/lang.py:788: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/llnl/util/lang.py:788: error: Unused "type: ignore" comment
+ [unused-ignore]
+ import importlib.metadata # type: ignore # novermin
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/llnl/util/filesystem.py:3000: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/llnl/util/filesystem.py:3000: error: Unused "type: ignore"
+ comment [unused-ignore]
+ get_file_attributes = ctypes.windll.kernel32.GetFileAttributesW #...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/operating_systems/windows_os.py:52: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/operating_systems/windows_os.py:52: error: Unused
+ "type: ignore" comment [unused-ignore]
+ paths = subprocess.check_output( # type: ignore[call-...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/config.py:517: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/config.py:517: error: Unused "type: ignore" comment
+ [unused-ignore]
+ return next(self.scopes.reversed_values()) # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/config.py:546: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/config.py:546: error: Unused "type: ignore" comment
+ [unused-ignore]
+ mark = included_scope.path._start_mark # type: ig...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/fetch_strategy.py:523: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/fetch_strategy.py:523: error: Unused "type: ignore" comment
+ [unused-ignore]
+ @property # type: ignore # decorated properties unsupported in my...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/patch.py:187: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/patch.py:187: error: Unused "type: ignore" comment
+ [unused-ignore]
+ for cls in pkg_cls.__mro__: # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/spec.py:3705: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/spec.py:3705: error: Unused "type: ignore" comment
+ [unused-ignore]
+ @property # type: ignore[misc] # decorated prop not supported in ...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/database.py:1764: error: Unused "type: ignore[call-overload]" comment [unused-ignore]
+ lib/spack/spack/database.py:1764: error: Unused "type: ignore[call-overload]"
+ comment [unused-ignore]
+ results.sort() # type: ignore[call-arg,call-overload]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/install_test.py:259: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/install_test.py:259: error: Unused "type: ignore" comment
+ [unused-ignore]
+ self.counts: "Counter" = Counter() # type: ignore[attr-define...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/install_test.py:409: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/install_test.py:409: error: Unused "type: ignore" comment
+ [unused-ignore]
+ total = self.counts.total() # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/install_test.py:514: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/install_test.py:514: error: Unused "type: ignore" comment
- lib/spack/spack/install_test.py:830: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ ) # type: ignore[assignment]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/install_test.py:830: error: Unused "type: ignore" comment
+ [unused-ignore]
+ total = counts.total() # type: ignore[attr-defined]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/installer.py:228: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/installer.py:228: error: Unused "type: ignore" comment
+ [unused-ignore]
+ phases = spack.builder.create(pkg).phases # type: ignore[attr-def...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/installer.py:2411: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/installer.py:2411: error: Unused "type: ignore" comment
+ [unused-ignore]
+ if not isinstance(exc, spack.error.SpackError) or not exc....
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/installer.py:2650: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/installer.py:2650: error: Unused "type: ignore" comment
+ [unused-ignore]
+ f"{self.pre} Building {self.pkg_id} [{self.pkg.build_s...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/solver/asp.py:385: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/solver/asp.py:385: error: Unused "type: ignore" comment
+ [unused-ignore]
+ return self._concrete_specs_by_input # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/solver/asp.py:2924: error: Unused "type: ignore[call-overload]" comment [unused-ignore]
+ lib/spack/spack/solver/asp.py:2924: error: Unused "type: ignore[call-overload]"
+ comment [unused-ignore]
+ self.possible_compilers.sort() # type: ignore[call-arg,call-o...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/test/sbang.py:58: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/sbang.py:58: error: Unused "type: ignore" comment
+ [unused-ignore]
+ @pytest.fixture # type: ignore[no-redef]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/entry_points.py:105: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/entry_points.py:105: error: Unused "type: ignore" comment
+ [unused-ignore]
+ import importlib.metadata # type: ignore # novermin
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/directives.py:264: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/directives.py:264: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert ExamplePackage._dependencies is None # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/directives.py:265: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/directives.py:265: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert ExamplePackage._extendees is None # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/directives.py:266: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/directives.py:266: error: Unused "type: ignore" comment
- lib/spack/spack/test/directives.py:270: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/directives.py:271: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ assert ExamplePackage._variants is None # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/directives.py:272: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/directives.py:270: error: Unused "type: ignore" comment
- lib/spack/spack/test/directives.py:273: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/directives.py:288: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/directives.py:296: error: Unused "type: ignore" comment [unused-ignore]
+ [unused-ignore]
+ dependencies = ExamplePackage.dependencies # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/config.py:1815: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/directives.py:271: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert type(ExamplePackage._dependencies) is dict # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/test/directives.py:272: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert type(ExamplePackage._extendees) is dict # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/test/directives.py:273: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert ExamplePackage._variants is None # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/test/directives.py:288: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert not PatchesDependencies.patches # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/test/directives.py:296: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert DoesNotPatchDependencies.patches # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ lib/spack/spack/test/config.py:1815: error: Unused "type: ignore" comment
+ [unused-ignore]
+ assert os.path.basename(scope.path) in paths # type: ignore[u...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/cmd/unit_test.py:17: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/cmd/unit_test.py:17: error: Unused "type: ignore" comment
+ [unused-ignore]
+ pytest = None # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/cmd/python.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/cmd/python.py:94: error: Unused "type: ignore" comment
+ [unused-ignore]
+ import IPython # type: ignore[import]
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/buildcache_prune.py:233: error: Redundant cast to "URLBuildcacheEntry" [redundant-cast]
+ lib/spack/spack/buildcache_prune.py:233: error: Redundant cast to
- lib/spack/spack/test/cmd/versions.py:44: error: Unused "type: ignore" comment, use narrower [import-not-found] instead of [import] code [unused-ignore]
+ "URLBuildcacheEntry" [redundant-cast]
+ cache_entry = cast(URLBuildcacheEntry, read_fn(manifest))
+ ^
- lib/spack/spack/test/cmd/edit.py:56: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/cmd/versions.py:44: error: Unused "type: ignore" comment,
+ use narrower [import-not-found] instead of [import] code [unused-ignore]
+ from spack_repo.builtin_mock.packages.brillig.package import Brill...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/test/cmd/dev_build.py:35: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/cmd/edit.py:56: error: Unused "type: ignore" comment
+ [unused-ignore]
+ from spack_repo.builtin_mock.build_systems import autotools, c...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/test/cmd/dev_build.py:36: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/cmd/dev_build.py:35: error: Unused "type: ignore" comment
+ [unused-ignore]
+ with open(spec.package.filename, "w", encoding="utf-8") as f: ...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
- lib/spack/spack/test/cmd/dev_build.py:53: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:54: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:58: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:59: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:60: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/cmd/dev_build.py:36: error: Unused "type: ignore" comment
+ [unused-ignore]
+ f.write(spec.package.original_string) # type: ignore
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- lib/spack/spack/test/cmd/dev_build.py:71: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:72: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:76: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:77: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:78: error: Unused "type: ignore" comment [unused-ignore]
- lib/spack/spack/test/cmd/dev_build.py:383: error: Unused "type: ignore" comment [unused-ignore]
+ lib/spack/spack/test/cmd/dev_build.py:53: error: Unused "type: ignore" comment
+ [unused-ignore]
+ with open(spec.package.filename, "w", encoding="utf-8") as f: ...
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
... (truncated 16785 lines) ...``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR enables the
--prettyflag by default to provide visually nicer output in error messages. The--prettyoption shows error lines with highlighting, uses soft word wrap, and displays source code snippets.Changes
self.pretty = Falsetoself.pretty = Trueinmypy/options.pydefault=Falsetodefault=Truefor the--prettyflag inmypy/main.pydocs/source/command_line.rstto reflect the new default and mention--no-prettyExample Output
With
--prettyenabled (new default):Without
--pretty(using--no-pretty):Rationale
The additional context makes it easier to see what is wrong. For example, there may be multiple possible expressions which can generate the error, and the highlighting makes this obvious.
Fixes #19108