@@ -76,6 +76,10 @@ def __init__(
76
76
self ._binary_name = task_node [Tags .BINARY_NAME_TAG ]
77
77
self ._build_timeout = task_node [Tags .BUILD_TIMEOUT_TAG ]
78
78
79
+ self ._style_checkers = []
80
+ if Tags .STYLE_CHECKERS_TAG in task_node :
81
+ self ._style_checkers = task_node [Tags .STYLE_CHECKERS_TAG ]
82
+
79
83
self ._test_nodes = []
80
84
if Tags .TESTS_TAG in task_node :
81
85
self ._test_nodes = task_node [Tags .TESTS_TAG ]
@@ -137,9 +141,16 @@ def run_all_tests(
137
141
run_all_tests (test_node = test_node , executable_folder = build_folder )
138
142
)
139
143
140
- style_errors = self ._code_style_errors ()
141
- if style_errors :
142
- results [STYLE_ERROR_TAG ] = style_errors
144
+ if self ._style_checkers :
145
+ for checker in self ._style_checkers :
146
+ checker_name = checker [Tags .NAME_TAG ]
147
+ style_errors = self ._code_style_errors (checker_name )
148
+ if style_errors :
149
+ results [
150
+ "{tag} {checker}" .format (
151
+ tag = STYLE_ERROR_TAG , checker = checker_name
152
+ )
153
+ ] = style_errors
143
154
return results
144
155
145
156
def __get_folders_to_inject (
@@ -177,7 +188,7 @@ def _build_if_needed(self: Task, code_folder: Path):
177
188
return None , code_folder
178
189
179
190
@abc .abstractmethod
180
- def _code_style_errors (self : Task ):
191
+ def _code_style_errors (self : Task , checker_name : str ):
181
192
return None
182
193
183
194
@@ -219,8 +230,12 @@ def _build_if_needed(
219
230
code_folder ,
220
231
)
221
232
222
- def _code_style_errors (self : CppTask ) -> Optional [tools .CmdResult ]:
233
+ def _code_style_errors (
234
+ self : CppTask , checker_name : str
235
+ ) -> Optional [tools .CmdResult ]:
223
236
"""Check if code conforms to Google Style."""
237
+ if checker_name != "cpplint" :
238
+ return None
224
239
command = (
225
240
"cpplint --counting=detailed "
226
241
+ "--filter=-legal,-readability/todo,"
@@ -298,7 +313,7 @@ def __init__(self: BashTask, task_node: dict, root_folder: Path, job_file: Path)
298
313
def _build_if_needed (self : BashTask , code_folder : Path ):
299
314
return None , code_folder # There is nothing to build in Bash.
300
315
301
- def _code_style_errors (self : BashTask ):
316
+ def _code_style_errors (self : BashTask , checker_name : str ):
302
317
return None
303
318
304
319
def _run_test (
0 commit comments