@@ -446,21 +446,10 @@ def _clang_tidy_test_impl(ctx):
446446clang_tidy_test = rule (
447447 implementation = _clang_tidy_test_impl ,
448448 attrs = {
449- "platform" : attr .string (
450- default = "" , #"@platforms//os:linux",
451- doc = "Platform to build for" ,
452- ),
453- "targets" : attr .label_list (
454- aspects = [
455- compile_info_aspect ,
456- ],
457- cfg = platforms_transition ,
458- doc = "List of compilable targets which should be checked." ,
459- ),
460- "options" : attr .string_list (
461- # Since clang-tidy-22 clang-tidy fails if no checkers are enabled
462- default = ["--checks=bugprone-*" ],
463- doc = "List of clang-tidy options, e.g.: --checks=" ,
449+ "config_file" : attr .label (
450+ default = None ,
451+ allow_single_file = True ,
452+ doc = "Clang-tidy config file (usually .clang-tidy)" ,
464453 ),
465454 "default_options" : attr .string_list (
466455 default = [
@@ -472,18 +461,29 @@ clang_tidy_test = rule(
472461 ],
473462 doc = "List of default clang-tidy options" ,
474463 ),
475- "config_file" : attr .label (
476- default = None ,
477- allow_single_file = True ,
478- doc = "Clang-tidy config file (usually .clang-tidy)" ,
479- ),
480464 "executable" : attr .label (
481465 default = None ,
482466 allow_single_file = True ,
483467 executable = True ,
484468 cfg = "exec" ,
485469 doc = "Clang-tidy executable" ,
486470 ),
471+ "options" : attr .string_list (
472+ # Since clang-tidy-22 clang-tidy fails if no checkers are enabled
473+ default = ["--checks=bugprone-*" ],
474+ doc = "List of clang-tidy options, e.g.: --checks=" ,
475+ ),
476+ "platform" : attr .string (
477+ default = "" , #"@platforms//os:linux",
478+ doc = "Platform to build for" ,
479+ ),
480+ "targets" : attr .label_list (
481+ aspects = [
482+ compile_info_aspect ,
483+ ],
484+ cfg = platforms_transition ,
485+ doc = "List of compilable targets which should be checked." ,
486+ ),
487487 } | version_specific_attributes (),
488488 outputs = {
489489 "test_script" : "%{name}.test_script.sh" ,
@@ -497,20 +497,10 @@ def _clang_analyze_test_impl(ctx):
497497clang_analyze_test = rule (
498498 implementation = _clang_analyze_test_impl ,
499499 attrs = {
500- "platform" : attr .string (
501- default = "" , #"@platforms//os:linux",
502- doc = "Platform to build for" ,
503- ),
504- "targets" : attr .label_list (
505- aspects = [
506- compile_info_aspect ,
507- ],
508- cfg = platforms_transition ,
509- doc = "List of compilable targets which should be checked." ,
510- ),
511- "options" : attr .string_list (
512- default = [],
513- doc = "List of clang options, e.g.: -fcolor-diagnostics" ,
500+ "config_file" : attr .label (
501+ default = None ,
502+ allow_single_file = True ,
503+ doc = "?" , # FIXME: configuration file for clang -analyze?
514504 ),
515505 "default_options" : attr .string_list (
516506 default = [
@@ -527,18 +517,28 @@ clang_analyze_test = rule(
527517 ],
528518 doc = "List of default clang options" ,
529519 ),
530- "config_file" : attr .label (
531- default = None ,
532- allow_single_file = True ,
533- doc = "?" , # FIXME: configuration file for clang -analyze?
534- ),
535520 "executable" : attr .label (
536521 default = None ,
537522 allow_single_file = True ,
538523 executable = True ,
539524 cfg = "exec" ,
540525 doc = "Clang executable" ,
541526 ),
527+ "options" : attr .string_list (
528+ default = [],
529+ doc = "List of clang options, e.g.: -fcolor-diagnostics" ,
530+ ),
531+ "platform" : attr .string (
532+ default = "" , #"@platforms//os:linux",
533+ doc = "Platform to build for" ,
534+ ),
535+ "targets" : attr .label_list (
536+ aspects = [
537+ compile_info_aspect ,
538+ ],
539+ cfg = platforms_transition ,
540+ doc = "List of compilable targets which should be checked." ,
541+ ),
542542 } | version_specific_attributes (),
543543 outputs = {
544544 "test_script" : "%{name}.test_script.sh" ,
0 commit comments