From nobody Wed Feb 11 05:17:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1613136436; cv=none; d=zohomail.com; s=zohoarc; b=TIdUWsrCbGF00liJuGmN1NQpSbZnWHsm/X0zq25oC8mpf01zML2Es5QlelKuTX3SlqEkgJ9ckhPYhNqOcDkA4guaJKnHS45kmE1X5jZYJhGrdd7MWZp6MgSntfdPCifk9YLgCBs+wZK5EbIdcqaS7tHqMihsYCvTkXIG9eytw7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613136436; 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=ndjsyIs33ps/PJxAMrIUiqCbbFZ7Cv9YwnMdKSbZ01E=; b=l0whaNIIPtKzh2bi//1aKV0yHew7yRTQ7zMjJAvYGRT9QyeI5buxTD3ck0mHuYxFaC1RNdbTpRMu2nxcjqUG98F938bLNEBOaF3hL6ksI7CpCb4N8/yPSEkBKZfgz44O/oxSwSuZoycRhOMldlI0rkhMRQjVaPwlFrMzl3SMp/4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 161313643561428.65034810215741; Fri, 12 Feb 2021 05:27:15 -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-481-Txe8UUO8MOKwPpLBIqZR2A-1; Fri, 12 Feb 2021 08:26:20 -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 1F9BD6EE26; Fri, 12 Feb 2021 13:26:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE2ED60BE5; Fri, 12 Feb 2021 13:26:13 +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 B48BF5807B; Fri, 12 Feb 2021 13:26:13 +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 11CDPk9t008663 for ; Fri, 12 Feb 2021 08:25:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id E395A6E405; Fri, 12 Feb 2021 13:25:46 +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 360F3614EB; Fri, 12 Feb 2021 13:25:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613136434; 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=ndjsyIs33ps/PJxAMrIUiqCbbFZ7Cv9YwnMdKSbZ01E=; b=Jy9684Rgrlaa37ZH3fVkqnQx3wRCTVFoLcPF0usRCTByjc7xiGsyItlBZz1Kf/ssiAJPf6 e5VwUIoEPHuv43OpK4uijdEBcjpS/OwkHHFHCM+8P6vh6AFXP06pQ+bYtfp4sltViHejSw 0NKPjGENScH8XxomZW3xVOsnKYJop0Y= X-MC-Unique: Txe8UUO8MOKwPpLBIqZR2A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/10] clang-tidy: Make list of checks explicit Date: Fri, 12 Feb 2021 14:25:32 +0100 Message-Id: <20210212132534.29066-9-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" Preparation for next patch. Signed-off-by: Tim Wiederhake --- scripts/run-clang-tidy.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/run-clang-tidy.py b/scripts/run-clang-tidy.py index 1d1038df0f..945a1f75d4 100755 --- a/scripts/run-clang-tidy.py +++ b/scripts/run-clang-tidy.py @@ -75,6 +75,7 @@ def run_clang_tidy(item): cmd =3D ( "clang-tidy", "--warnings-as-errors=3D*", + "--checks=3D-*,%s" % ",".join(checks), "-p", item["directory"], item["file"]) @@ -90,7 +91,7 @@ def run_clang_tidy(item): } =20 =20 -def cache_name(item): +def cache_name(item, checks): if not args.cache: return None =20 @@ -117,6 +118,7 @@ def cache_name(item): =20 hashsum =3D hashlib.sha256() hashsum.update(item["command"].encode()) + hashsum.update("\n".join(checks).encode()) hashsum.update(result.stdout.encode()) =20 basename =3D "".join([c if c.isalnum() else "_" for c in item["output"= ]]) @@ -145,7 +147,7 @@ def cache_write(filename, result): json.dump(result, f) =20 =20 -def worker(): +def worker(checks): while True: item =3D items.get() if args.timeout and args.timeout < time.time(): @@ -156,7 +158,7 @@ def worker(): =20 os.chdir(item["directory"]) =20 - cache =3D cache_name(item) + cache =3D cache_name(item, checks) result =3D cache_read(cache) with lock: print(item["file"], "" if result is None else "(from cache)") @@ -177,9 +179,19 @@ def worker(): items.task_done() =20 =20 +def list_checks(): + output =3D subprocess.check_output( + ["clang-tidy", "-checks=3D*", "-list-checks"], + universal_newlines=3DTrue).split("\n")[1:] + + output =3D [line.strip() for line in output] + return output + + args =3D parse_args() items =3D queue.Queue() lock =3D threading.Lock() +checks =3D list_checks() findings =3D list() =20 if args.cache: @@ -189,8 +201,12 @@ if args.cache: if args.timeout: args.timeout =3D time.time() + args.timeout * 60 =20 +print("Enabled checks:") +for check in checks: + print(" %s" % check) + for _ in range(args.thread_num): - threading.Thread(target=3Dworker, daemon=3DTrue).start() + threading.Thread(target=3Dworker, daemon=3DTrue, args=3D[checks]).star= t() =20 with open(os.path.join(args.build_dir, "compile_commands.json")) as f: compile_commands =3D json.load(f) --=20 2.26.2