[PATCH v3 10/15] python: only check qemu/ subdir with flake8

John Snow posted 15 patches 4 years, 7 months ago
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Eduardo Habkost <ehabkost@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Willian Rampazzo <willianr@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>, Cleber Rosa <crosa@redhat.com>
[PATCH v3 10/15] python: only check qemu/ subdir with flake8
Posted by John Snow 4 years, 7 months ago
flake8 is a little eager to check everything it can. Limit it to
checking inside the qemu namespace directory only. Update setup.cfg now
that the exclude patterns are no longer necessary.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/setup.cfg       | 2 --
 python/tests/flake8.sh | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/python/setup.cfg b/python/setup.cfg
index e730f208d3..11f71d5312 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -62,8 +62,6 @@ console_scripts =
 [flake8]
 extend-ignore = E722  # Prefer pylint's bare-except checks to flake8's
 exclude = __pycache__,
-          .venv,
-          .tox,
 
 [mypy]
 strict = True
diff --git a/python/tests/flake8.sh b/python/tests/flake8.sh
index 51e0788462..1cd7d40fad 100755
--- a/python/tests/flake8.sh
+++ b/python/tests/flake8.sh
@@ -1,2 +1,2 @@
 #!/bin/sh -e
-python3 -m flake8
+python3 -m flake8 qemu/
-- 
2.31.1


Re: [PATCH v3 10/15] python: only check qemu/ subdir with flake8
Posted by Willian Rampazzo 4 years, 7 months ago
On Tue, Jun 29, 2021 at 6:43 PM John Snow <jsnow@redhat.com> wrote:
>
> flake8 is a little eager to check everything it can. Limit it to
> checking inside the qemu namespace directory only. Update setup.cfg now
> that the exclude patterns are no longer necessary.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  python/setup.cfg       | 2 --
>  python/tests/flake8.sh | 2 +-
>  2 files changed, 1 insertion(+), 3 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>


Re: [PATCH v3 10/15] python: only check qemu/ subdir with flake8
Posted by Wainer dos Santos Moschetta 4 years, 7 months ago
On 6/29/21 6:43 PM, John Snow wrote:
> flake8 is a little eager to check everything it can. Limit it to
> checking inside the qemu namespace directory only. Update setup.cfg now
> that the exclude patterns are no longer necessary.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   python/setup.cfg       | 2 --
>   python/tests/flake8.sh | 2 +-
>   2 files changed, 1 insertion(+), 3 deletions(-)

Tested-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>

How I tested it:

$ make check-dev
VENV .dev-venv
ACTIVATE .dev-venv
INSTALL qemu[devel] .dev-venv
ACTIVATE .dev-venv
make[1]: Entering directory '/home/wmoschet/src/qemu/python'
JOB ID     : 41162d4a9e93095abb66c219227b6af27edbcf43
JOB LOG    : 
/home/wmoschet/avocado/job-results/job-2021-06-30T11.50-41162d4/job.log
  (1/4) tests/flake8.sh: PASS (0.30 s)
  (2/4) tests/isort.sh: PASS (0.12 s)
  (3/4) tests/mypy.sh: PASS (0.32 s)
  (4/4) tests/pylint.sh: PASS (4.46 s)
RESULTS    : PASS 4 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | 
CANCEL 0
JOB TIME   : 8.46 s
make[1]: Leaving directory '/home/wmoschet/src/qemu/python'

>
> diff --git a/python/setup.cfg b/python/setup.cfg
> index e730f208d3..11f71d5312 100644
> --- a/python/setup.cfg
> +++ b/python/setup.cfg
> @@ -62,8 +62,6 @@ console_scripts =
>   [flake8]
>   extend-ignore = E722  # Prefer pylint's bare-except checks to flake8's
>   exclude = __pycache__,
> -          .venv,
> -          .tox,
>   
>   [mypy]
>   strict = True
> diff --git a/python/tests/flake8.sh b/python/tests/flake8.sh
> index 51e0788462..1cd7d40fad 100755
> --- a/python/tests/flake8.sh
> +++ b/python/tests/flake8.sh
> @@ -1,2 +1,2 @@
>   #!/bin/sh -e
> -python3 -m flake8
> +python3 -m flake8 qemu/