3535import sys
3636from typing import Any , Dict , Generator , List , Tuple , Type , Union
3737
38+ __all__ = ["Visitor" , "Plugin" , "STRFTIME001" , "STRFTIME002" ]
39+
3840__author__ = "Dominic Davis-Foster"
3941__copyright__ = "2020 Dominic Davis-Foster"
4042__license__ = "MIT"
@@ -55,6 +57,7 @@ def __init__(self) -> None:
5557
5658 def visit_Str (self , node : ast .Str ):
5759 """
60+ Visit an AST Str node.
5861
5962 :param node: The node being visited
6063 """
@@ -66,6 +69,7 @@ def visit_Str(self, node: ast.Str):
6669
6770 def visit_Constant (self , node : ast .Constant ):
6871 """
72+ Visit an AST Constant node.
6973
7074 :param node: The node being visited
7175 """
@@ -75,6 +79,7 @@ def visit_Constant(self, node: ast.Constant):
7579
7680 def _check_linux (self , node : Union [ast .Str , ast .Constant ]):
7781 """
82+ Perform the check for Linux-specific codes.
7883
7984 :param node: The node being visited
8085 """
@@ -88,6 +93,7 @@ def _check_linux(self, node: Union[ast.Str, ast.Constant]):
8893
8994 def _check_windows (self , node : Union [ast .Str , ast .Constant ]):
9095 """
96+ Perform the check for Windows-specific codes.
9197
9298 :param node: The node being visited
9399 """
@@ -101,13 +107,23 @@ def _check_windows(self, node: Union[ast.Str, ast.Constant]):
101107
102108
103109class Plugin :
110+ """
111+ The flake8 plugin.
112+
113+ :param tree:
114+ """
115+
104116 name : str = __name__
105117 version : str = __version__
106118
107119 def __init__ (self , tree : ast .AST ):
108120 self ._tree = tree
109121
110122 def run (self ) -> Generator [Tuple [int , int , str , Type [Any ]], None , None ]:
123+ """
124+ Run the plugin.
125+ """
126+
111127 visitor = Visitor ()
112128 visitor .visit (self ._tree )
113129
0 commit comments