From 757cc989e5f4ef535345bb1c2525fd4ab241ab3a Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Fri, 18 Nov 2022 22:58:36 +0100 Subject: [PATCH 1/2] STYLE enable pylint: subprocess-run-check --- asv_bench/benchmarks/package.py | 2 +- pyproject.toml | 1 - scripts/run_autotyping.py | 1 + scripts/validate_docstrings.py | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asv_bench/benchmarks/package.py b/asv_bench/benchmarks/package.py index 34fe4929a752b..257c82cba8878 100644 --- a/asv_bench/benchmarks/package.py +++ b/asv_bench/benchmarks/package.py @@ -11,7 +11,7 @@ def time_import(self): # measurement of the import time we actually care about, # without the subprocess or interpreter overhead cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"] - p = subprocess.run(cmd, stderr=subprocess.PIPE) + p = subprocess.run(cmd, stderr=subprocess.PIPE, check=True) line = p.stderr.splitlines()[-1] field = line.split(b"|")[-2].strip() diff --git a/pyproject.toml b/pyproject.toml index 1ccf577538db7..bf6d6cfabdceb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,7 +147,6 @@ disable = [ "self-assigning-variable", "self-cls-assignment", "signature-differs", - "subprocess-run-check", "super-init-not-called", "try-except-raise", "undefined-loop-variable", diff --git a/scripts/run_autotyping.py b/scripts/run_autotyping.py index f537b8d16c77a..032f742200a07 100644 --- a/scripts/run_autotyping.py +++ b/scripts/run_autotyping.py @@ -28,6 +28,7 @@ def main(argv: Sequence[str] | None = None) -> None: *args.paths, "--aggressive", ], + check=True, ) sys.exit(output.returncode) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index cbf02bc0a0156..e43f11c0ca7c3 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -211,7 +211,7 @@ def validate_pep8(self): file.write(content) file.flush() cmd = ["python", "-m", "flake8", "--quiet", "--statistics", file.name] - response = subprocess.run(cmd, capture_output=True, text=True) + response = subprocess.run(cmd, capture_output=True, check=True, text=True) stdout = response.stdout stdout = stdout.replace(file.name, "") messages = stdout.strip("\n") From 8df291b3148286bedcb92a2789a18edd4e1127c3 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Sat, 19 Nov 2022 11:48:27 +0100 Subject: [PATCH 2/2] STYLE enable pylint: subprocess-run-check II --- scripts/validate_docstrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index e43f11c0ca7c3..a86630eba7d5d 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -211,7 +211,7 @@ def validate_pep8(self): file.write(content) file.flush() cmd = ["python", "-m", "flake8", "--quiet", "--statistics", file.name] - response = subprocess.run(cmd, capture_output=True, check=True, text=True) + response = subprocess.run(cmd, capture_output=True, check=False, text=True) stdout = response.stdout stdout = stdout.replace(file.name, "") messages = stdout.strip("\n")