Skip to content

Commit 27d82a7

Browse files
committed
Add missing type hints.
1 parent 6cfb4f6 commit 27d82a7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

flake8_strftime/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self) -> None:
6666

6767
if sys.version_info < (3, 8): # pragma: no cover (PY38+)
6868

69-
def visit_Str(self, node: ast.Str):
69+
def visit_Str(self, node: ast.Str) -> None:
7070
"""
7171
Visit an AST Str node.
7272
@@ -78,7 +78,7 @@ def visit_Str(self, node: ast.Str):
7878

7979
else: # pragma: no cover (<PY38)
8080

81-
def visit_Constant(self, node: ast.Constant):
81+
def visit_Constant(self, node: ast.Constant) -> None:
8282
"""
8383
Visit an AST Constant node.
8484
@@ -91,7 +91,7 @@ def visit_Constant(self, node: ast.Constant):
9191
self._check_linux(node)
9292
self._check_windows(node)
9393

94-
def _check_linux(self, node: Union[ast.Str, ast.Constant]):
94+
def _check_linux(self, node: Union[ast.Str, ast.Constant]) -> None:
9595
"""
9696
Perform the check for Linux-specific codes.
9797
@@ -105,7 +105,7 @@ def _check_linux(self, node: Union[ast.Str, ast.Constant]):
105105
STRFTIME001,
106106
))
107107

108-
def _check_windows(self, node: Union[ast.Str, ast.Constant]):
108+
def _check_windows(self, node: Union[ast.Str, ast.Constant]) -> None:
109109
"""
110110
Perform the check for Windows-specific codes.
111111

tests/flake8_strftime_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# stdlib
22
import ast
3+
from typing import Set
34

45
# 3rd party
56
import pytest
@@ -8,7 +9,7 @@
89
from flake8_strftime import Plugin
910

1011

11-
def results(s):
12+
def results(s) -> Set[str]:
1213
return {"{}:{}: {}".format(*r) for r in Plugin(ast.parse(s)).run()}
1314

1415

0 commit comments

Comments
 (0)