From nobody Sat Feb 7 09:37:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1570625957; cv=none; d=zoho.com; s=zohoarc; b=hNpfVJDowFpQQTSlpfTGT01A2WxpiXNIrPvAYnNdKzB4j09YCNHXZ+xheFY0tU3xckdykt7zqV/6JQyhbomlD+j4Q6xVDw4p2YQKs4Y6lOC1XaBmOomMSM02Ddjb83nuCHh+YbDtuZ+HOnw9dL/REYEG4kUzITxNLmkGg8NQZOk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570625957; 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=NB20BBVX4mIGKDocvNYsOdwiOHZdvlP3APyCa7VfWz8=; b=iRQ7rv9SC1Y+ZqMMEVg3mFFAoKuA3hPARzlPyr96II9JI6rQaXZS5Cp3NOuTgFhTNAAE0w85hc3R4blBhvd4flYRbEbGOS7+WG6XbUnyJovmb4U1D+4t/Foqd1x2a7bEwXYqm4kvZasL/RnStWRBQ8hXlRQjfKnZ0FyJqS34a4Y= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570625957996379.386476856077; Wed, 9 Oct 2019 05:59:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A628C05243E; Wed, 9 Oct 2019 12:59:16 +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 E7F285D9CD; Wed, 9 Oct 2019 12:59:15 +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 99C244EE6E; Wed, 9 Oct 2019 12:59:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x99CwvYA002930 for ; Wed, 9 Oct 2019 08:58:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 044A05DAAD; Wed, 9 Oct 2019 12:58:57 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-67.ams2.redhat.com [10.36.112.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74BDF5D9CD; Wed, 9 Oct 2019 12:58:53 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 9 Oct 2019 13:58:36 +0100 Message-Id: <20191009125844.18202-3-berrange@redhat.com> In-Reply-To: <20191009125844.18202-1-berrange@redhat.com> References: <20191009125844.18202-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/10] build: change flake8 to use blacklist instead of whitelist 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 09 Oct 2019 12:59:16 +0000 (UTC) The current flake8 check only looks at one item (semicolons at end of line). This means that our code quality will continue to get worse, violating an increasing number of checks. Switching to a whitelist means that we freeze the badness at its current level & can incrementally fix things up. We are excluding the folllowing... Indentation: E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E121 continuation line under-indented for hanging indent E125 continuation line with same indent as next logical line E126 continuation line over-indented for hanging indent E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E129 visually indented line with same indent as next logical line E131 continuation line unaligned for hanging indent Whitespace: E211 whitespace before =E2=80=98(=E2=80=98 E221 multiple spaces before operator E222 multiple spaces after operator E225 missing whitespace around operator E226 missing whitespace around arithmetic operator E231 missing whitespace after =E2=80=98,=E2=80=99, =E2=80=98;=E2=80=99, o= r =E2=80=98:=E2=80=99 E261 at least two spaces before inline comment Blank lines E301 expected 1 blank line, found 0 E302 expected 2 blank lines, found 0 E303 too many blank lines (3) E305 expected 2 blank lines after end of function or class Line length E501 line too long (82 > 79 characters) Statements E722 do not use bare except, specify exception instead E741 do not use variables named =E2=80=98l=E2=80=99, =E2=80=98O=E2=80=99,= or =E2=80=98I=E2=80=99 Errors: F821 undefined name 'name' Warnings: W504 line break after binary operator W605 invalid escape sequence =E2=80=98x=E2=80=99 Signed-off-by: Daniel P. Berrang=C3=A9 --- build-aux/syntax-check.mk | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 8345703b3e..1ad0c626e1 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -878,11 +878,28 @@ sc_require_enum_last_marker: { echo '$(ME): enum impl needs _LAST marker on second line' 1>&2; \ exit 1; } || : =20 -# In Python files we don't want to end lines with a semicolon like in C +# Validate many python style rules +FLAKE8_INDENTATION =3D E114,E115,E116,E121,E125,E126,E127,E128,E129,E131 +FLAKE8_WHITESPACE =3D E211,E221,E222,E225,E226,E231,E261 +FLAKE8_BLANK_LINES =3D E301,E302,E303,E305 +FLAKE8_LINE_LENGTH =3D E501 +FLAKE8_STATEMENTS =3D E722,E741 +FLAKE8_ERRORS =3D F821 +FLAKE8_WARNINGS =3D W504,W605 + +FLAKE8_IGNORE =3D $(FLAKE8_INDENTATION),$\ + $(FLAKE8_WHITESPACE),$\ + $(FLAKE8_BLANK_LINES),$\ + $(FLAKE8_LINE_LENGTH),$\ + $(FLAKE8_STATEMENTS),$\ + $(FLAKE8_ERRORS),$\ + $(FLAKE8_WARNINGS) \ + $(NULL) + sc_flake8: @if [ -n "$(FLAKE8)" ]; then \ $(VC_LIST_EXCEPT) | $(GREP) '\.py$$' | xargs \ - $(FLAKE8) --select E703 --show-source; \ + $(FLAKE8) --ignore $(FLAKE8_IGNORE) --show-source; \ else \ echo '$(ME): skipping test $@: flake8 not installed' 1>&2; \ fi --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list