40
40
match_types = {
41
41
"matchlines" : "line" ,
42
42
"match" : "line" , # called by matchlines
43
- "matchtasks " : "task" ,
44
- "matchtask " : "task" , # called by matchtasks
45
- "matchyaml " : "yaml" ,
46
- "matchplay" : "play" , # called by matchyaml
47
- "matchdir " : "dir" ,
43
+ "match_tasks " : "task" ,
44
+ "match_task " : "task" , # called by match_tasks
45
+ "match_file " : "yaml" ,
46
+ "matchplay" : "play" , # called by match_file
47
+ "match_dir " : "dir" ,
48
48
}
49
49
RE_JINJA_EXPRESSION = re .compile (r"{{.+?}}" )
50
50
RE_JINJA_STATEMENT = re .compile (r"{%.+?%}" )
@@ -72,7 +72,7 @@ def unjinja(text: str) -> str:
72
72
return text
73
73
74
74
# pylint: disable=too-many-arguments,too-many-positional-arguments
75
- def create_matcherror (
75
+ def create_match_error (
76
76
self ,
77
77
message : str = "" ,
78
78
lineno : int = 1 ,
@@ -143,20 +143,20 @@ def matchlines(self, file: Lintable) -> list[MatchError]:
143
143
message = ""
144
144
if isinstance (result , str ):
145
145
message = result
146
- matcherror = self .create_matcherror (
146
+ match_error = self .create_match_error (
147
147
message = message ,
148
148
lineno = prev_line_no + 1 ,
149
149
details = line ,
150
150
filename = file ,
151
151
)
152
- matches .append (matcherror )
152
+ matches .append (match_error )
153
153
return matches
154
154
155
- def matchtasks (self , file : Lintable ) -> list [MatchError ]:
156
- """Call matchtask for each task inside file and return aggregate results.
155
+ def match_tasks (self , file : Lintable ) -> list [MatchError ]:
156
+ """Call match_task for each task inside file and return aggregate results.
157
157
158
- Most rules will never need to override matchtasks because its main
159
- purpose is to call matchtask for each task/handlers in the same file,
158
+ Most rules will never need to override match_tasks because its main
159
+ purpose is to call match_task for each task/handlers in the same file,
160
160
and to aggregate the results.
161
161
"""
162
162
matches : list [MatchError ] = []
@@ -185,7 +185,7 @@ def matchtasks(self, file: Lintable) -> list[MatchError]:
185
185
if self .needs_raw_task :
186
186
task .normalized_task ["__raw_task__" ] = task .raw_task
187
187
188
- result = self .matchtask (task , file = file )
188
+ result = self .match_task (task , file = file )
189
189
if not result :
190
190
continue
191
191
@@ -212,7 +212,7 @@ def matchtasks(self, file: Lintable) -> list[MatchError]:
212
212
message = ""
213
213
if isinstance (result , str ):
214
214
message = result
215
- match = self .create_matcherror (
215
+ match = self .create_match_error (
216
216
message = message ,
217
217
lineno = task .line ,
218
218
filename = file ,
@@ -222,7 +222,7 @@ def matchtasks(self, file: Lintable) -> list[MatchError]:
222
222
matches .append (match )
223
223
return matches
224
224
225
- def matchyaml (self , file : Lintable ) -> list [MatchError ]:
225
+ def match_file (self , file : Lintable ) -> list [MatchError ]:
226
226
matches : list [MatchError ] = []
227
227
if str (file .base_kind ) != "text/yaml" :
228
228
return matches
0 commit comments