From b267b17677d9606cf022d0147dada2f07d0bb4d1 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 25 Sep 2022 16:56:42 -0700 Subject: [PATCH] =?UTF-8?q?python:=20Use=20=E2=80=98not=20in=E2=80=99=20fo?= =?UTF-8?q?r=20more=20negated=20membership=20tests.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes “E713 Test for membership should be `not in`” found by ruff (now that I’ve fixed it not to ignore scripts lacking a .py extension). Signed-off-by: Anders Kaseorg --- scripts/nagios/check-rabbitmq-consumers | 2 +- tools/test-js-with-node | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/nagios/check-rabbitmq-consumers b/scripts/nagios/check-rabbitmq-consumers index 1bd526b471..03f346bb60 100755 --- a/scripts/nagios/check-rabbitmq-consumers +++ b/scripts/nagios/check-rabbitmq-consumers @@ -19,7 +19,7 @@ states = { 3: "UNKNOWN", } -if "USER" in os.environ and not os.environ["USER"] in ["root", "rabbitmq"]: +if "USER" in os.environ and os.environ["USER"] not in ["root", "rabbitmq"]: print("This script must be run as the root or rabbitmq user") diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 01b08b08b0..55f1a93d13 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -399,7 +399,7 @@ def enforce_proper_coverage(coverage_json: Any) -> bool: coverage_lost = False for relative_path in enforce_fully_covered: path = ROOT_DIR + "/" + relative_path - if not (path in coverage_json): + if path not in coverage_json: coverage_lost = True print_error(f"{relative_path} has no node test coverage") continue