mirror of https://github.com/zulip/zulip.git
python: Use ‘not in’ for negated membership tests
Fixes “E713 Test for membership should be `not in`” found by ruff (https://github.com/charliermarsh/ruff). Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
83523328c9
commit
403837e52d
|
@ -129,7 +129,7 @@ def check_other_queues(queue_counts_dict: Dict[str, int]) -> List[Dict[str, Any]
|
||||||
|
|
||||||
def check_rabbitmq_queues() -> None:
|
def check_rabbitmq_queues() -> None:
|
||||||
pattern = re.compile(r"(\w+)\t(\d+)\t(\d+)")
|
pattern = re.compile(r"(\w+)\t(\d+)\t(\d+)")
|
||||||
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")
|
print("This script must be run as the root or rabbitmq user")
|
||||||
|
|
||||||
list_queues_output = subprocess.check_output(
|
list_queues_output = subprocess.check_output(
|
||||||
|
|
|
@ -1193,7 +1193,7 @@ def apply_event(
|
||||||
state["starred_messages"] = [
|
state["starred_messages"] = [
|
||||||
message
|
message
|
||||||
for message in state["starred_messages"]
|
for message in state["starred_messages"]
|
||||||
if not (message in event["messages"])
|
if message not in event["messages"]
|
||||||
]
|
]
|
||||||
elif event["type"] == "realm_domains":
|
elif event["type"] == "realm_domains":
|
||||||
if event["op"] == "add":
|
if event["op"] == "add":
|
||||||
|
|
Loading…
Reference in New Issue