@@ -673,6 +673,19 @@ def cpp_configs(cls, unit, flat_args, spec_args):
673
673
assert_file_exists (unit , config )
674
674
return serialize_list ([config ])
675
675
676
+ @classmethod
677
+ def custom_explicit_configs (cls , unit , flat_args , spec_args ):
678
+ # default global config only
679
+ linter_name = spec_args ['NAME' ][0 ]
680
+ default_configs_path = spec_args .get ('CONFIGS' )[0 ]
681
+ assert_file_exists (unit , default_configs_path )
682
+ config = get_linter_configs (unit , default_configs_path ).get (linter_name )
683
+ if not config :
684
+ message = f"Default config in { default_configs_path } can't be found for a linter { linter_name } "
685
+ raise DartValueError (message )
686
+ assert_file_exists (unit , config )
687
+ return serialize_list ([config ])
688
+
676
689
677
690
class LintExtraParams :
678
691
KEY = 'LINT-EXTRA-PARAMS'
@@ -1222,6 +1235,9 @@ class TestFiles:
1222
1235
'maps/b2bgeo/mvrp_solver/aws_docker' ,
1223
1236
)
1224
1237
1238
+ # XXX: this is a temporarty fence allowing only taxi to use STYLE_JSON macro
1239
+ _TAXI_JSON_PREFIX = 'taxi'
1240
+
1225
1241
@classmethod
1226
1242
def value (cls , unit , flat_args , spec_args ):
1227
1243
data_re = re .compile (r"sbr:/?/?(\d+)=?.*" )
@@ -1339,6 +1355,31 @@ def cpp_linter_files(cls, unit, flat_args, spec_args):
1339
1355
files_dart = _reference_group_var ("ALL_SRCS" , consts .STYLE_CPP_ALL_EXTS )
1340
1356
return files_dart
1341
1357
1358
+ @classmethod
1359
+ def from_macro_args (cls , unit , flat_args , spec_args ):
1360
+ files = spec_args .get ('FILES' , [])
1361
+ if not files :
1362
+ raise HaltDartConstruction ()
1363
+ else :
1364
+ upath = unit .path ()[3 :]
1365
+ lint_name = spec_args ['NAME' ][0 ]
1366
+
1367
+ if lint_name == 'clang_format_json' and not upath .startswith (cls ._TAXI_JSON_PREFIX ):
1368
+ raise DartValueError ("Presently only projects in taxi/ are allowed with STYLE_JSON" )
1369
+ resolved_files = []
1370
+ for path in files :
1371
+ if path .endswith ('ya.make' ):
1372
+ raise DartValueError ("Can't have ya.make in collected files" )
1373
+ resolved = _common .resolve_common_const (path ) # files can come from glob
1374
+ if resolved .startswith (SOURCE_ROOT_SHORT ):
1375
+ resolved_files .append (resolved )
1376
+ else :
1377
+ resolved = unit .resolve_arc_path ([path ])
1378
+ if resolved .startswith (SOURCE_ROOT_SHORT ):
1379
+ resolved_files .append (resolved )
1380
+ test_files = serialize_list (resolved_files )
1381
+ return test_files
1382
+
1342
1383
1343
1384
class TestEnv :
1344
1385
KEY = 'TEST-ENV'
0 commit comments