Replies: 6 comments 18 replies
-
TODO for Bob: short tutorial of how to run clang tidy to extract the actual instances associated with one of the errors |
Beta Was this translation helpful? Give feedback.
-
The above list, reformatted as a task list.
|
Beta Was this translation helpful? Give feedback.
-
Output from the python script I made to parse clang-tidy output [cert-dcl50-cpp] 1 [clang-analyzer-valist.Uninitialized] 1 [hicpp-use-emplace 1 modernize-use-emplace] 1 [clang-analyzer-core.uninitialized.Assign] 1 [modernize-use-bool-literals] 1 [bugprone-signed-char-misuse 1 cert-str34-c] 1 [clang-analyzer-optin.performance.Padding] 1 [google-readability-namespace-comments 1 llvm-namespace-comment] 1 [modernize-loop-convert] 2 [google-build-using-namespace] 2 [bugprone-branch-clone] 2 [hicpp-multiway-paths-covered] 2 [bugprone-integer-division] 2 [bugprone-assignment-in-if-condition] 2 [performance-faster-string-find] 2 [modernize-use-default-member-init] 2 [performance-inefficient-vector-operation] 3 [readability-simplify-boolean-expr] 3 [cert-msc32-c 3 cert-msc51-cpp] 3 [performance-for-range-copy] 3 [cert-env33-c] 3 [bugprone-string-integer-assignment] 3 [hicpp-use-auto 4 modernize-use-auto] 4 [cppcoreguidelines-virtual-class-destructor] 4 [readability-const-return-type] 6 [cert-err58-cpp] 7 [clang-diagnostic-unused-command-line-argument] 7 [clang-analyzer-core.UndefinedBinaryOperatorResult] 8 [clang-analyzer-core.CallAndMessage] 10 [readability-convert-member-functions-to-static] 11 [performance-unnecessary-value-param] 11 [misc-confusable-identifiers] 11 [cppcoreguidelines-pro-bounds-constant-array-index] 12 [hicpp-use-noexcept 13 modernize-use-noexcept] 13 |
Beta Was this translation helpful? Give feedback.
-
import os
import sys
number_of_violations_to_print = 40
counter = {}
def process(filename):
with open(filename,'r') as ofile:
data = ofile.readlines()
for line in data:
if 'warning:' in line:
ls = line.split()
code_file_path = ls[0]
code_file = code_file_path.split('/')[-1]
violation_string = ls[-1]
violations = violation_string.split(',')
for violation in violations:
if violation not in counter:
counter[violation] = {}
if code_file not in counter[violation]:
counter[violation][code_file] = 0
counter[violation][code_file] += 1
process('tidy_results_cpp.log')
process('tidy_results_c.log')
process('tidy_results_gpu.log')
def get_total_count(key):
return sum(counter[key].values())
vios = sorted(list(counter.keys()),key=get_total_count)
for i in range(number_of_violations_to_print):
print()
print(vios[i],get_total_count(vios[i]))
for key in counter[vios[i]]:
print(key,counter[vios[i]][key]) |
Beta Was this translation helpful? Give feedback.
-
About @evaneschneider and @alwinm, I'd like your input on this. |
Beta Was this translation helpful? Give feedback.
-
The last two
For both of these the bulk of the errors are because we use |
Beta Was this translation helpful? Give feedback.
-
First column is total warnings, second column is percent of total failures, third column is the check
Glossary of checks in clang-tidy 15
Beta Was this translation helpful? Give feedback.
All reactions