MCPcopy Index your code
hub / github.com/python/mypy / format_error

Method format_error

mypy/util.py:862–879  ·  view source on GitHub ↗

Format a short summary in case of errors.

(
        self,
        n_errors: int,
        n_files: int,
        n_sources: int,
        *,
        blockers: bool = False,
        use_color: bool = True,
    )

Source from the content-addressed store, hash-verified

860 return self.style(msg, "green", bold=True)
861
862 def format_error(
863 self,
864 n_errors: int,
865 n_files: int,
866 n_sources: int,
867 *,
868 blockers: bool = False,
869 use_color: bool = True,
870 ) -> str:
871 """Format a short summary in case of errors."""
872 msg = f"Found {n_errors} error{plural_s(n_errors)} in {n_files} file{plural_s(n_files)}"
873 if blockers:
874 msg += " (errors prevented further checking)"
875 else:
876 msg += f" (checked {n_sources} source file{plural_s(n_sources)})"
877 if not use_color:
878 return msg
879 return self.style(msg, "red", bold=True)
880
881
882def is_typeshed_file(typeshed_dir: str | None, file: str) -> bool:

Callers 2

mainFunction · 0.95
pretty_messagesMethod · 0.80

Calls 2

styleMethod · 0.95
plural_sFunction · 0.85

Tested by

no test coverage detected