File tree Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Expand file tree Collapse file tree 5 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ def main():
177177 parser .add_argument (
178178 "-j" ,
179179 type = int ,
180- default = 1 ,
180+ default = 0 ,
181181 help = "number of tidy instances to be run in parallel." ,
182182 )
183183 parser .add_argument (
@@ -318,6 +318,7 @@ def main():
318318 if max_task_count == 0 :
319319 max_task_count = multiprocessing .cpu_count ()
320320 max_task_count = min (len (lines_by_file ), max_task_count )
321+ print (f"Running clang-tidy in { max_task_count } threads..." )
321322
322323 combine_fixes = False
323324 export_fixes_dir = None
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ async def main() -> None:
548548 files = {f for f in files if file_name_re .search (f )}
549549
550550 print (
551- "Running clang-tidy for" ,
551+ f "Running clang-tidy in { max_task } threads for" ,
552552 len (files ),
553553 "files out of" ,
554554 number_files_in_database ,
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ Improvements to clang-query
9393Improvements to clang-tidy
9494--------------------------
9595
96+ - The :program: `run-clang-tidy.py ` and :program: `clang-tidy-diff.py ` scripts
97+ now run checks in parallel by default using all available hardware threads.
98+ Both scripts display the number of threads being used in their output.
99+
96100New checks
97101^^^^^^^^^^
98102
Original file line number Diff line number Diff line change 11// REQUIRES: shell
22// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
33// RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
4- // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s
4+ // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-JMAX
55// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -quiet -- -std=c++11 2>&1 | FileCheck -check-prefix=CHECK-QUIET %s
66// RUN: mkdir -p %T/compilation-database-test/
77// RUN: echo '[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp", "file": "%t.cpp"}]' > %T/compilation-database-test/compile_commands.json
88// RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -path %T/compilation-database-test 2>&1 | FileCheck -check-prefix=CHECK %s
9+
10+ // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -j 1 -- -std=c++11 2>&1 | FileCheck %s --check-prefix=CHECK-J1
11+ // CHECK-J1: Running clang-tidy in 1 threads...
912struct A {
1013 virtual void f () {}
1114 virtual void g () {}
1215};
16+ // CHECK-JMAX: Running clang-tidy in {{[1-9][0-9]*}} threads...
1317// CHECK-NOT: warning:
1418// CHECK-QUIET-NOT: warning:
1519struct B : public A {
Original file line number Diff line number Diff line change 88// RUN: echo " modernize-use-auto.MinTypeNameLength: '0'" >> %t/.clang-tidy
99// RUN: cp "%s" "%t/test.cpp"
1010// RUN: cd "%t"
11- // RUN: not %run_clang_tidy "test.cpp"
11+ // RUN: not %run_clang_tidy "test.cpp" 2>&1 | FileCheck %s --check-prefix=CHECK-JMAX
12+ // CHECK-JMAX: Running clang-tidy in {{[1-9][0-9]*}} threads for
13+
14+ // RUN: not %run_clang_tidy -j 1 "test.cpp" 2>&1 | FileCheck %s --check-prefix=CHECK-J1
15+ // CHECK-J1: Running clang-tidy in 1 threads for
1216
1317int main ()
1418{
You can’t perform that action at this time.
0 commit comments