@@ -76,6 +76,10 @@ def __init__(
7676 self ._binary_name = task_node [Tags .BINARY_NAME_TAG ]
7777 self ._build_timeout = task_node [Tags .BUILD_TIMEOUT_TAG ]
7878
79+ self ._style_checkers = []
80+ if Tags .STYLE_CHECKERS_TAG in task_node :
81+ self ._style_checkers = task_node [Tags .STYLE_CHECKERS_TAG ]
82+
7983 self ._test_nodes = []
8084 if Tags .TESTS_TAG in task_node :
8185 self ._test_nodes = task_node [Tags .TESTS_TAG ]
@@ -137,9 +141,16 @@ def run_all_tests(
137141 run_all_tests (test_node = test_node , executable_folder = build_folder )
138142 )
139143
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
143154 return results
144155
145156 def __get_folders_to_inject (
@@ -177,7 +188,7 @@ def _build_if_needed(self: Task, code_folder: Path):
177188 return None , code_folder
178189
179190 @abc .abstractmethod
180- def _code_style_errors (self : Task ):
191+ def _code_style_errors (self : Task , checker_name : str ):
181192 return None
182193
183194
@@ -219,8 +230,12 @@ def _build_if_needed(
219230 code_folder ,
220231 )
221232
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 ]:
223236 """Check if code conforms to Google Style."""
237+ if checker_name != "cpplint" :
238+ return None
224239 command = (
225240 "cpplint --counting=detailed "
226241 + "--filter=-legal,-readability/todo,"
@@ -298,7 +313,7 @@ def __init__(self: BashTask, task_node: dict, root_folder: Path, job_file: Path)
298313 def _build_if_needed (self : BashTask , code_folder : Path ):
299314 return None , code_folder # There is nothing to build in Bash.
300315
301- def _code_style_errors (self : BashTask ):
316+ def _code_style_errors (self : BashTask , checker_name : str ):
302317 return None
303318
304319 def _run_test (
0 commit comments