From 72a5ccedf0810bcb9099eb3ab13336950b9115e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 17 Jan 2023 13:01:59 -0500 Subject: [PATCH] build-aux: skip E203 and W503 flake8 checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flake8 check W503 does not want a line break before binary operator. This is contrary to the style that the 'black' formatting tool wants to use. Defer to 'black' as it is intended to be an opinionated formatting tool standardizing python code style, and thus not to be customized per project. The flake8 check E203 does not want whitespace before a ':'. This is, however, desirable when indexing array slices eg self.lookahead[skip : skip + 1] which is a format that 'black' produces. Reviewed-by: Michal Privoznik Signed-off-by: Daniel P. Berrangé --- build-aux/syntax-check.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 7af7d20d70..070737842e 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -581,15 +581,22 @@ sc_prohibit_python_without_env: # We're intentionally ignoring a few warnings # +# E302: whitespace before ':'. This is something that is +# desirable when indexing array slices and is used by the +# 'black' formatting tool +# # E501: Force breaking lines at < 80 characters results in # some really unnatural code formatting which harms # readability. # +# W503: line break before binary operator, because this +# is contrary to what 'black' formatting tool wants +# # W504: Knuth code style requires the operators "or" and "and" etc # to be at the start of line in a multi-line conditional. # This the opposite to what is normal libvirt practice. # -FLAKE8_IGNORE = E501,W504 +FLAKE8_IGNORE = E203,E501,W503,W504 sc_flake8: @if [ -n "$(FLAKE8)" ]; then \