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():
177
177
parser .add_argument (
178
178
"-j" ,
179
179
type = int ,
180
- default = 1 ,
180
+ default = 0 ,
181
181
help = "number of tidy instances to be run in parallel." ,
182
182
)
183
183
parser .add_argument (
@@ -318,6 +318,7 @@ def main():
318
318
if max_task_count == 0 :
319
319
max_task_count = multiprocessing .cpu_count ()
320
320
max_task_count = min (len (lines_by_file ), max_task_count )
321
+ print (f"Running clang-tidy in { max_task_count } threads..." )
321
322
322
323
combine_fixes = False
323
324
export_fixes_dir = None
Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ async def main() -> None:
548
548
files = {f for f in files if file_name_re .search (f )}
549
549
550
550
print (
551
- "Running clang-tidy for" ,
551
+ f "Running clang-tidy in { max_task } threads for" ,
552
552
len (files ),
553
553
"files out of" ,
554
554
number_files_in_database ,
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ Improvements to clang-query
93
93
Improvements to clang-tidy
94
94
--------------------------
95
95
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
+
96
100
New checks
97
101
^^^^^^^^^^
98
102
Original file line number Diff line number Diff line change 1
1
// REQUIRES: shell
2
2
// RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
3
3
// 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
5
5
// 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
6
6
// RUN: mkdir -p %T/compilation-database-test/
7
7
// RUN: echo '[{"directory": "%T", "command": "clang++ -o test.o -std=c++11 %t.cpp", "file": "%t.cpp"}]' > %T/compilation-database-test/compile_commands.json
8
8
// 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...
9
12
struct A {
10
13
virtual void f () {}
11
14
virtual void g () {}
12
15
};
16
+ // CHECK-JMAX: Running clang-tidy in {{[1-9][0-9]*}} threads...
13
17
// CHECK-NOT: warning:
14
18
// CHECK-QUIET-NOT: warning:
15
19
struct B : public A {
Original file line number Diff line number Diff line change 8
8
// RUN: echo " modernize-use-auto.MinTypeNameLength: '0'" >> %t/.clang-tidy
9
9
// RUN: cp "%s" "%t/test.cpp"
10
10
// 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
12
16
13
17
int main ()
14
18
{
You can’t perform that action at this time.
0 commit comments