| 1152 | |
| 1153 | @attr.s(eq=False, auto_attribs=True) |
| 1154 | class ReprFileLocation(TerminalRepr): |
| 1155 | path: str = attr.ib(converter=str) |
| 1156 | lineno: int |
| 1157 | message: str |
| 1158 | |
| 1159 | def toterminal(self, tw: TerminalWriter) -> None: |
| 1160 | # Filename and lineno output for each entry, using an output format |
| 1161 | # that most editors understand. |
| 1162 | msg = self.message |
| 1163 | i = msg.find("\n") |
| 1164 | if i != -1: |
| 1165 | msg = msg[:i] |
| 1166 | tw.write(self.path, bold=True, red=True) |
| 1167 | tw.line(f":{self.lineno}: {msg}") |
| 1168 | |
| 1169 | |
| 1170 | @attr.s(eq=False, auto_attribs=True) |
no outgoing calls