|
26 | 26 | # OR OTHER DEALINGS IN THE SOFTWARE.
|
27 | 27 | #
|
28 | 28 |
|
| 29 | +# stdlib |
| 30 | +from typing import Any |
| 31 | + |
29 | 32 | # 3rd party
|
30 | 33 | from flake8.formatting.base import BaseFormatter # type: ignore
|
31 | 34 |
|
|
35 | 38 | __version__: str = "0.1.1"
|
36 | 39 | __email__: str = "dominic@davis-foster.co.uk"
|
37 | 40 |
|
38 |
| -__all__ = ["GitHubFormatter"] |
| 41 | +__all__ = ("GitHubFormatter", ) |
39 | 42 |
|
40 | 43 |
|
41 | 44 | class GitHubFormatter(BaseFormatter):
|
42 | 45 | """
|
43 | 46 | Custom Flake8 formatter for GitHub actions.
|
44 | 47 | """
|
45 | 48 |
|
46 |
| - def write_line(self, line): |
| 49 | + reported_errors_count: int |
| 50 | + |
| 51 | + def write_line(self, line: str) -> None: |
47 | 52 | """
|
48 | 53 | Override write for convenience.
|
49 | 54 | """
|
50 | 55 | self.write(line, None)
|
51 | 56 |
|
52 |
| - def start(self): # noqa: D102 |
| 57 | + def start(self) -> None: # noqa: D102 |
53 | 58 | super().start()
|
54 | 59 | self.files_reported_count = 0
|
55 | 60 |
|
56 |
| - def beginning(self, filename): |
| 61 | + def beginning(self, filename: Any) -> None: |
57 | 62 | """
|
58 | 63 | We're starting a new file.
|
59 | 64 | """
|
60 | 65 |
|
61 | 66 | self.reported_errors_count = 0
|
62 | 67 |
|
63 |
| - def finished(self, filename): |
| 68 | + def finished(self, filename: Any) -> None: |
64 | 69 | """
|
65 | 70 | We've finished processing a file.
|
66 | 71 | """
|
67 | 72 |
|
68 | 73 | self.files_reported_count += 1
|
69 | 74 |
|
70 |
| - def format(self, violation): # noqa: A003 # pylint: disable=redefined-builtin |
| 75 | + def format(self, violation) -> None: # noqa: A003 # pylint: disable=redefined-builtin |
71 | 76 | """
|
72 | 77 | Format a violation.
|
73 | 78 | """
|
|
0 commit comments