Skip to content

Commit bc51ee1

Browse files
committed
Lint
1 parent da19146 commit bc51ee1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

flake8_strftime/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# 3rd party
4141
import flake8_helper
4242

43-
__all__ = ["Visitor", "Plugin", "STRFTIME001", "STRFTIME002"]
43+
__all__ = ("Visitor", "Plugin", "STRFTIME001", "STRFTIME002")
4444

4545
__author__ = "Dominic Davis-Foster"
4646
__copyright__ = "2020-2021 Dominic Davis-Foster"
@@ -51,15 +51,15 @@
5151
STRFTIME001 = "STRFTIME001 Linux-specific strftime code used."
5252
STRFTIME002 = "STRFTIME002 Windows-specific strftime code used."
5353

54-
_linux_re = re.compile(r"%-[dmHIMSj]")
55-
_win_re = re.compile(r"%#[dmHIMSj]")
56-
5754

5855
class Visitor(flake8_helper.Visitor):
5956
"""
6057
AST node visitor for identifying platform specific strftime codes.
6158
""" # noqa: RST303
6259

60+
_linux_re = re.compile(r"%-[dmHIMSj]")
61+
_win_re = re.compile(r"%#[dmHIMSj]")
62+
6363
def __init__(self) -> None:
6464
super().__init__()
6565
self._from_imports: Dict[str, str] = {}
@@ -98,11 +98,11 @@ def _check_linux(self, node: Union[ast.Str, ast.Constant]) -> None:
9898
:param node: The node being visited
9999
"""
100100

101-
for match in _linux_re.finditer(node.s):
101+
for match in self._linux_re.finditer(node.s): # pylint: disable=use-list-copy
102102
self.errors.append((
103103
node.lineno,
104104
node.col_offset + match.span()[0],
105-
STRFTIME001,
105+
STRFTIME001, # pylint: disable=loop-global-usage
106106
))
107107

108108
def _check_windows(self, node: Union[ast.Str, ast.Constant]) -> None:
@@ -112,11 +112,11 @@ def _check_windows(self, node: Union[ast.Str, ast.Constant]) -> None:
112112
:param node: The node being visited
113113
"""
114114

115-
for match in _win_re.finditer(node.s):
115+
for match in self._win_re.finditer(node.s): # pylint: disable=use-list-copy
116116
self.errors.append((
117117
node.lineno,
118118
node.col_offset + match.span()[0],
119-
STRFTIME002,
119+
STRFTIME002, # pylint: disable=loop-global-usage
120120
))
121121

122122

0 commit comments

Comments
 (0)