Skip to content

Commit

Permalink
python: Use ‘not in’ for more negated membership tests.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
andersk committed Sep 26, 2022
1 parent 4ba9853 commit b267b17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/nagios/check-rabbitmq-consumers
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down
2 changes: 1 addition & 1 deletion tools/test-js-with-node
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b267b17

Please sign in to comment.