From nobody Wed Feb 11 05:17:53 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=1616175616; cv=none; d=zohomail.com; s=zohoarc; b=DxwiMJfrxE7ZKpJJrp+AbjUQ33ZRiVeZ4Ltu7CVlh7zZPTi4lIP/eBWcejZDOEWMekWIAH47OqfAnxo8scYkkgdMa8NrIbQY4NWX27GC6TTk2Gqq9s4xgdWhxUWyfGYUaGiJg5gXjMdNRjst/I1P+9oVbCjEz/+TgJUuB4L+f0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616175616; h=Content-Type:Content-Transfer-Encoding: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=vWaCuYZD8wIZlwq6Q1zMO3NdVl/3CGvOOk34JR3ezA4=; b=Go32rggq1aX8kE2owXA29ksdoGa5Ta1s5yV/i7Kd75G3ZHAnMH2XX4ws/qNpPZPxAsXhe2blNSKrqIg1oPpMYpM5oTllsUi5t19wocA1se1+Z6n/98SY8l5yT3BVvPwx2MtYuEilOdKAIR9Q0KUpE+OD9a76KQcXt2W7JQAKVD4= 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 1616175616052718.4959424919855; Fri, 19 Mar 2021 10:40:16 -0700 (PDT) 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-55-qfCHfiKwPSCIakZ6UbleGw-1; Fri, 19 Mar 2021 13:40:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E16F4190B2B7; Fri, 19 Mar 2021 17:40:01 +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 9E7EC5D72E; Fri, 19 Mar 2021 17:40:01 +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 45BB04BB7C; Fri, 19 Mar 2021 17:40:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12JHdhXW018662 for ; Fri, 19 Mar 2021 13:39:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id B00A05C237; Fri, 19 Mar 2021 17:39:43 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9E215C1BB for ; Fri, 19 Mar 2021 17:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616175615; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=vWaCuYZD8wIZlwq6Q1zMO3NdVl/3CGvOOk34JR3ezA4=; b=G6MwVNuhxy3+Ni+D7X50AXYUYDuovirvIusfNdy3v3WTpIcRUDWlIpmZb8pFc+GWQLzrl4 YqikSmUbT6EaE8+pVdJlDiK5uPTxouHUNKSdJmGqbuPaawMPg0+HR10fXS58ixrvXkpGIP Xs7lv9QRjMcO5KWy6FmZw6jzC25y7mk= X-MC-Unique: qfCHfiKwPSCIakZ6UbleGw-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 3/3] syntax-check: Run flake8 on all Python scripts Date: Fri, 19 Mar 2021 18:39:31 +0100 Message-Id: <20210319173931.360685-4-abologna@redhat.com> In-Reply-To: <20210319173931.360685-1-abologna@redhat.com> References: <20210319173931.360685-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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.15 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" Currenty we only check files that end in .py, but we have at least a couple of scripts that don't have that suffix and we nonetheless want to keep compliant with the code style. Extend the sc_flake8 syntax-check rule so that any file that contains a Python 3 shebang is fed to flake8 too. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- build-aux/syntax-check.mk | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 2bd7e2aae4..51a498a897 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -877,8 +877,10 @@ FLAKE8_IGNORE =3D E501,W504 =20 sc_flake8: @if [ -n "$(FLAKE8)" ]; then \ - $(VC_LIST_EXCEPT) | $(GREP) '\.py$$' | xargs \ - $(FLAKE8) --ignore $(FLAKE8_IGNORE) --show-source; \ + DOT_PY=3D$$($(VC_LIST_EXCEPT) | $(GREP) '\.py$$'); \ + BANG_PY=3D$$($(VC_LIST_EXCEPT) | xargs grep -l '^#!/usr/bin/env python3$= $'); \ + ALL_PY=3D$$(printf "%s\n%s" "$$DOT_PY" "$$BANG_PY" | sort -u); \ + echo "$$ALL_PY" | xargs $(FLAKE8) --ignore $(FLAKE8_IGNORE) --show-sourc= e; \ else \ echo '$(ME): skipping test $@: flake8 not installed' 1>&2; \ fi --=20 2.26.3