1 // RUN: clang-tidy -dump-config %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-BASE 2 // CHECK-BASE: Checks: {{.*}}from-parent 3 // CHECK-BASE: HeaderFilterRegex: parent 4 // RUN: clang-tidy -dump-config %S/Inputs/config-files/1/- -- | FileCheck %s -check-prefix=CHECK-CHILD1 5 // CHECK-CHILD1: Checks: {{.*}}from-child1 6 // CHECK-CHILD1: HeaderFilterRegex: child1 7 // RUN: clang-tidy -dump-config %S/Inputs/config-files/2/- -- | FileCheck %s -check-prefix=CHECK-CHILD2 8 // CHECK-CHILD2: Checks: {{.*}}from-parent 9 // CHECK-CHILD2: HeaderFilterRegex: parent 10 // RUN: clang-tidy -dump-config %S/Inputs/config-files/3/- -- | FileCheck %s -check-prefix=CHECK-CHILD3 11 // CHECK-CHILD3: Checks: {{.*}}from-parent,from-child3 12 // CHECK-CHILD3: HeaderFilterRegex: child3 13 // RUN: clang-tidy -dump-config -checks='from-command-line' -header-filter='from command line' %S/Inputs/config-files/- -- | FileCheck %s -check-prefix=CHECK-COMMAND-LINE 14 // CHECK-COMMAND-LINE: Checks: {{.*}}from-parent,from-command-line 15 // CHECK-COMMAND-LINE: HeaderFilterRegex: from command line 16 17 // For this test we have to use names of the real checks because otherwise values are ignored. 18 // RUN: clang-tidy -dump-config %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD4 19 // CHECK-CHILD4: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto 20 // CHECK-CHILD4-DAG: - key: llvm-qualified-auto.AddConstToQualified{{ *[[:space:]] *}}value: 'true' 21 // CHECK-CHILD4-DAG: - key: modernize-loop-convert.MaxCopySize{{ *[[:space:]] *}}value: '20' 22 // CHECK-CHILD4-DAG: - key: modernize-loop-convert.MinConfidence{{ *[[:space:]] *}}value: reasonable 23 // CHECK-CHILD4-DAG: - key: modernize-use-using.IgnoreMacros{{ *[[:space:]] *}}value: 'false' 24 25 // RUN: clang-tidy --explain-config %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-EXPLAIN 26 // CHECK-EXPLAIN: 'llvm-qualified-auto' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}44{{[/\\]}}.clang-tidy. 27 // CHECK-EXPLAIN: 'modernize-loop-convert' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}.clang-tidy. 28 // CHECK-EXPLAIN: 'modernize-use-using' is enabled in the {{.*}}{{[/\\]}}Inputs{{[/\\]}}config-files{{[/\\]}}4{{[/\\]}}.clang-tidy. 29 30 // RUN: clang-tidy -dump-config \ 31 // RUN: --config='{InheritParentConfig: true, \ 32 // RUN: Checks: -llvm-qualified-auto, \ 33 // RUN: CheckOptions: [{key: modernize-loop-convert.MaxCopySize, value: 21}]}' \ 34 // RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD5 35 // CHECK-CHILD5: Checks: {{.*}}modernize-loop-convert,modernize-use-using,llvm-qualified-auto,-llvm-qualified-auto 36 // CHECK-CHILD5-DAG: - key: modernize-loop-convert.MaxCopySize{{ *[[:space:]] *}}value: '21' 37 // CHECK-CHILD5-DAG: - key: modernize-loop-convert.MinConfidence{{ *[[:space:]] *}}value: reasonable 38 // CHECK-CHILD5-DAG: - key: modernize-use-using.IgnoreMacros{{ *[[:space:]] *}}value: 'false' 39 40 // RUN: clang-tidy -dump-config \ 41 // RUN: --config='{InheritParentConfig: false, \ 42 // RUN: Checks: -llvm-qualified-auto}' \ 43 // RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD6 44 // CHECK-CHILD6: Checks: {{.*-llvm-qualified-auto'? *$}} 45 // CHECK-CHILD6-NOT: - key: modernize-use-using.IgnoreMacros 46