From nobody Wed Feb 11 06:32:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613136374; cv=none; d=zohomail.com; s=zohoarc; b=RoCLz2ROVxoY288cKrjcJbzfHN73f75/ajGrXk2QasCmR5kMd4e07OaJzl3NZdzQZYLhg/Z+YqbNjfX9DTWFRCWALKRN6IjHQZSHsWKjnNmHFiWxSgrcPubIQO8kH4h17Udbr2qOVJxUXdGY0Ng468laJ0qah8nhqULXkvmoy6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613136374; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nW8yiBvbys+iiABjJEyQ2gG7a4nU1veFppHZMhrg3mo=; b=La4ZfZly0ypSQW5XrcaTCKHMyPtBC6LLU4V+kixFj4Z15m5mNfxkRzFdpbrFQvy1GEn+dA+dqAd10kLm7R6ByRPPom4FJYB1J/8G6T5Pv+xL/Ub4uu50zWeLs7TvuwUgBfBmi4HwjInURatM4KICPscIpfSqipYE/SBiWo57j3g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1613136373676357.63366672501854; Fri, 12 Feb 2021 05:26:13 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-285-N3e5IB-jP9SMkSYBQeYGsQ-1; Fri, 12 Feb 2021 08:26:10 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E512B107ACF7; Fri, 12 Feb 2021 13:26:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFC5F60C47; Fri, 12 Feb 2021 13:26:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 83A7318095C9; Fri, 12 Feb 2021 13:26:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11CDPlR9008671 for ; Fri, 12 Feb 2021 08:25:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id F03516E405; Fri, 12 Feb 2021 13:25:47 +0000 (UTC) Received: from work.redhat.com (ovpn-112-223.ams2.redhat.com [10.36.112.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41DDB614EB; Fri, 12 Feb 2021 13:25:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613136372; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=nW8yiBvbys+iiABjJEyQ2gG7a4nU1veFppHZMhrg3mo=; b=SA4xEZKyauXpG4dQ/2G7mpAP3g1jLLD9iUlza8lmVZaqDme26ZUebeO461rvYDdoHBEIh9 ktSIv3gpd6K29xouP6cW/WSIB1CFB1G46EDHhAGyraDCpxT+cOgti0l49V1NJr8DX7kdVG TSxhp0ktHukNIXWSRs+bMMnwzTs0qjc= X-MC-Unique: N3e5IB-jP9SMkSYBQeYGsQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/10] clang-tidy: Disable irrelevant and failing checks Date: Fri, 12 Feb 2021 14:25:33 +0100 Message-Id: <20210212132534.29066-10-twiederh@redhat.com> In-Reply-To: <20210212132534.29066-1-twiederh@redhat.com> References: <20210212132534.29066-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" clang-tidy's focus is on c++. Disable all checks that do not apply to the libVirt code base. Also disable all checks that are currently failing, to prevent introduction of new issues, while we work down the list of existing issues and / or decide on disabling some checks permanently. Signed-off-by: Tim Wiederhake --- scripts/run-clang-tidy.py | 326 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 326 insertions(+) diff --git a/scripts/run-clang-tidy.py b/scripts/run-clang-tidy.py index 945a1f75d4..24bc034682 100755 --- a/scripts/run-clang-tidy.py +++ b/scripts/run-clang-tidy.py @@ -25,6 +25,331 @@ spam =3D [ ] =20 =20 +disabled_checks =3D [ + # aliases for other checks + "bugprone-narrowing-conversions", + "cert-dcl03-c", + "cert-dcl16-c", + "cert-dcl54-cpp", + "cert-dcl59-cpp", + "cert-err61-cpp", + "cert-fio38-c", + "cert-msc30-c", + "cert-msc32-c", + "cert-oop11-cpp", + "cert-oop54-cpp", + "cert-pos44-c", + "cppcoreguidelines-avoid-c-arrays", + "cppcoreguidelines-avoid-magic-numbers", + "cppcoreguidelines-c-copy-assignment-signature", + "cppcoreguidelines-explicit-virtual-functions", + "cppcoreguidelines-non-private-member-variables-in-classes", + "fuchsia-header-anon-namespaces", + "google-readability-braces-around-statements", + "google-readability-function-size", + "google-readability-namespace-comments", + "hicpp-avoid-c-arrays", + "hicpp-avoid-goto", + "hicpp-braces-around-statements", + "hicpp-deprecated-headers", + "hicpp-explicit-conversions", + "hicpp-function-size", + "hicpp-invalid-access-moved", + "hicpp-member-init", + "hicpp-move-const-arg", + "hicpp-named-parameter", + "hicpp-new-delete-operators", + "hicpp-no-array-decay", + "hicpp-no-malloc", + "hicpp-special-member-functions", + "hicpp-static-assert", + "hicpp-uppercase-literal-suffix", + "hicpp-use-auto", + "hicpp-use-emplace", + "hicpp-use-equals-default", + "hicpp-use-equals-delete", + "hicpp-use-noexcept", + "hicpp-use-nullptr", + "hicpp-use-override", + "hicpp-vararg", + "llvm-qualified-auto", + + # only relevant for c++ + "bugprone-copy-constructor-init", + "bugprone-dangling-handle", + "bugprone-exception-escape", + "bugprone-fold-init-type", + "bugprone-forward-declaration-namespace", + "bugprone-forwarding-reference-overload", + "bugprone-inaccurate-erase", + "bugprone-lambda-function-name", + "bugprone-move-forwarding-reference", + "bugprone-parent-virtual-call", + "bugprone-sizeof-container", + "bugprone-string-constructor", + "bugprone-string-integer-assignment", + "bugprone-swapped-arguments", + "bugprone-throw-keyword-missing", + "bugprone-undelegated-constructor", + "bugprone-unhandled-self-assignment", + "bugprone-unused-raii", + "bugprone-unused-return-value", + "bugprone-use-after-move", + "bugprone-virtual-near-miss", + "cert-dcl21-cpp", + "cert-dcl50-cpp", + "cert-dcl58-cpp", + "cert-err09-cpp", + "cert-err52-cpp", + "cert-err58-cpp", + "cert-err60-cpp", + "cert-mem57-cpp", + "cert-msc50-cpp", + "cert-msc51-cpp", + "cert-oop58-cpp", + "clang-analyzer-cplusplus.InnerPointer", + "clang-analyzer-cplusplus.Move", + "clang-analyzer-cplusplus.NewDelete", + "clang-analyzer-cplusplus.NewDeleteLeaks", + "clang-analyzer-cplusplus.PureVirtualCall", + "clang-analyzer-cplusplus.SelfAssignment", + "clang-analyzer-cplusplus.SmartPtr", + "clang-analyzer-cplusplus.VirtualCallModeling", + "clang-analyzer-optin.cplusplus.UninitializedObject", + "clang-analyzer-optin.cplusplus.VirtualCall", + "cppcoreguidelines-no-malloc", + "cppcoreguidelines-owning-memory", + "cppcoreguidelines-pro-bounds-array-to-pointer-decay", + "cppcoreguidelines-pro-bounds-constant-array-index", + "cppcoreguidelines-pro-bounds-pointer-arithmetic", + "cppcoreguidelines-pro-type-const-cast", + "cppcoreguidelines-pro-type-cstyle-cast", + "cppcoreguidelines-pro-type-member-init", + "cppcoreguidelines-pro-type-reinterpret-cast", + "cppcoreguidelines-pro-type-static-cast-downcast", + "cppcoreguidelines-pro-type-union-access", + "cppcoreguidelines-pro-type-vararg", + "cppcoreguidelines-slicing", + "cppcoreguidelines-special-member-functions", + "fuchsia-default-arguments-calls", + "fuchsia-default-arguments-declarations", + "fuchsia-multiple-inheritance", + "fuchsia-overloaded-operator", + "fuchsia-statically-constructed-objects", + "fuchsia-trailing-return", + "fuchsia-virtual-inheritance", + "google-build-explicit-make-pair", + "google-build-namespaces", + "google-build-using-namespace", + "google-default-arguments", + "google-explicit-constructor", + "google-global-names-in-headers", + "google-readability-casting", + "google-runtime-operator", + "google-runtime-references", + "hicpp-exception-baseclass", + "hicpp-noexcept-move", + "hicpp-undelegated-constructor", + "llvm-namespace-comment", + "llvm-prefer-isa-or-dyn-cast-in-conditionals", + "llvm-prefer-register-over-unsigned", + "llvm-twine-local", + "misc-new-delete-overloads", + "misc-non-private-member-variables-in-classes", + "misc-throw-by-value-catch-by-reference", + "misc-unconventional-assign-operator", + "misc-uniqueptr-reset-release", + "misc-unused-using-decls", + "modernize-avoid-bind", + "modernize-avoid-c-arrays", + "modernize-concat-nested-namespaces", + "modernize-deprecated-headers", + "modernize-deprecated-ios-base-aliases", + "modernize-loop-convert", + "modernize-make-shared", + "modernize-make-unique", + "modernize-pass-by-value", + "modernize-raw-string-literal", + "modernize-redundant-void-arg", + "modernize-replace-auto-ptr", + "modernize-replace-random-shuffle", + "modernize-return-braced-init-list", + "modernize-shrink-to-fit", + "modernize-unary-static-assert", + "modernize-use-auto", + "modernize-use-bool-literals", + "modernize-use-default-member-init", + "modernize-use-emplace", + "modernize-use-equals-default", + "modernize-use-equals-delete", + "modernize-use-nodiscard", + "modernize-use-noexcept", + "modernize-use-nullptr", + "modernize-use-override", + "modernize-use-trailing-return-type", + "modernize-use-transparent-functors", + "modernize-use-uncaught-exceptions", + "modernize-use-using", + "performance-faster-string-find", + "performance-for-range-copy", + "performance-implicit-conversion-in-loop", + "performance-inefficient-algorithm", + "performance-inefficient-string-concatenation", + "performance-inefficient-vector-operation", + "performance-move-const-arg", + "performance-move-constructor-init", + "performance-no-automatic-move", + "performance-noexcept-move-constructor", + "performance-trivially-destructible", + "performance-type-promotion-in-math-fn", + "performance-unnecessary-copy-initialization", + "performance-unnecessary-value-param", + "portability-simd-intrinsics", + "readability-container-size-empty", + "readability-convert-member-functions-to-static", + "readability-deleted-default", + "readability-make-member-function-const", + "readability-qualified-auto", + "readability-redundant-access-specifiers", + "readability-redundant-member-init", + "readability-redundant-smartptr-get", + "readability-redundant-string-cstr", + "readability-redundant-string-init", + "readability-simplify-subscript-expr", + "readability-static-accessed-through-instance", + "readability-static-definition-in-anonymous-namespace", + "readability-string-compare", + "readability-uniqueptr-delete-release", + "zircon-temporary-objects", + + # only relevant for objective c + "clang-analyzer-nullability.NullableDereferenced", + "clang-analyzer-nullability.NullablePassedToNonnull", + "clang-analyzer-nullability.NullableReturnedFromNonnull", + "clang-analyzer-nullability.NullPassedToNonnull", + "clang-analyzer-nullability.NullReturnedFromNonnull", + "clang-analyzer-optin.osx.cocoa.localizability." + + "EmptyLocalizationContextChecker", + "clang-analyzer-optin.osx.cocoa.localizability." + + "NonLocalizedStringChecker", + "clang-analyzer-optin.osx.OSObjectCStyleCast", + "clang-analyzer-optin.performance.GCDAntipattern", + "google-objc-avoid-nsobject-new", + "google-objc-avoid-throwing-exception", + "google-objc-function-naming", + "google-objc-global-variable-declaration", + "objc-avoid-nserror-init", + "objc-forbidden-subclassing", + "objc-missing-hash", + "objc-property-declaration", + "objc-super-self", + + # only relevant for certain libraries + "abseil-duration-addition", + "abseil-duration-comparison", + "abseil-duration-conversion-cast", + "abseil-duration-division", + "abseil-duration-factory-float", + "abseil-duration-factory-scale", + "abseil-duration-subtraction", + "abseil-duration-unnecessary-conversion", + "abseil-faster-strsplit-delimiter", + "abseil-no-internal-dependencies", + "abseil-no-namespace", + "abseil-redundant-strcat-calls", + "abseil-str-cat-append", + "abseil-string-find-startswith", + "abseil-time-comparison", + "abseil-time-subtraction", + "abseil-upgrade-duration-conversions", + "boost-use-to-string", + "clang-analyzer-optin.mpi.MPI-Checker", + "google-readability-avoid-underscore-in-googletest-name", + "google-upgrade-googletest-case", + "mpi-buffer-deref", + "mpi-type-mismatch", + "openmp-exception-escape", + "openmp-use-default-none", + + # only relevant for osx + "clang-analyzer-osx.API", + "clang-analyzer-osx.cocoa.AtSync", + "clang-analyzer-osx.cocoa.AutoreleaseWrite", + "clang-analyzer-osx.cocoa.ClassRelease", + "clang-analyzer-osx.cocoa.Dealloc", + "clang-analyzer-osx.cocoa.IncompatibleMethodTypes", + "clang-analyzer-osx.cocoa.Loops", + "clang-analyzer-osx.cocoa.MissingSuperCall", + "clang-analyzer-osx.cocoa.NilArg", + "clang-analyzer-osx.cocoa.NonNilReturnValue", + "clang-analyzer-osx.cocoa.NSAutoreleasePool", + "clang-analyzer-osx.cocoa.NSError", + "clang-analyzer-osx.cocoa.ObjCGenerics", + "clang-analyzer-osx.cocoa.RetainCount", + "clang-analyzer-osx.cocoa.RetainCountBase", + "clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak", + "clang-analyzer-osx.cocoa.SelfInit", + "clang-analyzer-osx.cocoa.SuperDealloc", + "clang-analyzer-osx.cocoa.UnusedIvars", + "clang-analyzer-osx.cocoa.VariadicMethodTypes", + "clang-analyzer-osx.coreFoundation.CFError", + "clang-analyzer-osx.coreFoundation.CFNumber", + "clang-analyzer-osx.coreFoundation.CFRetainRelease", + "clang-analyzer-osx.coreFoundation.containers.OutOfBounds", + "clang-analyzer-osx.coreFoundation.containers.PointerSizedValues", + "clang-analyzer-osx.MIG", + "clang-analyzer-osx.NSOrCFErrorDerefChecker", + "clang-analyzer-osx.NumberObjectConversion", + "clang-analyzer-osx.ObjCProperty", + "clang-analyzer-osx.OSObjectRetainCount", + "clang-analyzer-osx.SecKeychainAPI", + "darwin-avoid-spinlock", + "darwin-dispatch-once-nonstatic", + + # failing checks + "android-cloexec-dup", + "android-cloexec-fopen", + "android-cloexec-open", + "android-cloexec-pipe", + "bugprone-branch-clone", + "bugprone-integer-division", + "bugprone-macro-parentheses", + "bugprone-signed-char-misuse", + "bugprone-sizeof-expression", + "bugprone-suspicious-missing-comma", + "bugprone-suspicious-string-compare", + "cert-err34-c", + "clang-analyzer-core.CallAndMessage", + "clang-analyzer-core.NonNullParamChecker", + "clang-analyzer-core.NullDereference", + "clang-analyzer-core.UndefinedBinaryOperatorResult", + "clang-analyzer-core.uninitialized.Branch", + "clang-analyzer-deadcode.DeadStores", + "clang-analyzer-optin.performance.Padding", + "clang-analyzer-security.insecureAPI.strcpy", + "clang-analyzer-unix.Malloc", + "cppcoreguidelines-init-variables", + "cppcoreguidelines-interfaces-global-init", + "cppcoreguidelines-narrowing-conversions", + "hicpp-multiway-paths-covered", + "hicpp-no-assembler", + "hicpp-signed-bitwise", + "llvm-include-order", + "readability-braces-around-statements", + "readability-else-after-return", + "readability-function-size", + "readability-inconsistent-declaration-parameter-name", + "readability-isolate-declaration", + "readability-magic-numbers", + "readability-misleading-indentation", + "readability-named-parameter", + "readability-non-const-parameter", + "readability-redundant-control-flow", + "readability-redundant-declaration", + "readability-uppercase-literal-suffix", +] + + def remove_spam(output): retval =3D list() for line in output.split("\n"): @@ -185,6 +510,7 @@ def list_checks(): universal_newlines=3DTrue).split("\n")[1:] =20 output =3D [line.strip() for line in output] + output =3D [line for line in output if line not in disabled_checks] return output =20 =20 --=20 2.26.2