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,
)
| 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 | |
| 882 | def is_typeshed_file(typeshed_dir: str | None, file: str) -> bool: |
no test coverage detected