From 34d1e47ff77a424562062daba661d4bb27948102 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 8 Jan 2025 05:14:39 -0800 Subject: [PATCH] Fixed PLR6201 (literal-membership): Use a set literal when testing for membership --- tools/readable_bash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/readable_bash.py b/tools/readable_bash.py index 54703339..85bbaeb0 100644 --- a/tools/readable_bash.py +++ b/tools/readable_bash.py @@ -130,7 +130,7 @@ def generate_documentation(): fn = parser.parse_string(line).filename() except: continue - if fn in ("setup/start.sh", "setup/preflight.sh", "setup/questions.sh", "setup/firstuser.sh", "setup/management.sh"): + if fn in {"setup/start.sh", "setup/preflight.sh", "setup/questions.sh", "setup/firstuser.sh", "setup/management.sh"}: continue import sys @@ -323,7 +323,7 @@ def quasitokenize(bashscript): elif c == "\\": # Escaping next character. escape_next = True - elif quote_mode is None and c in ('"', "'"): + elif quote_mode is None and c in {'"', "'"}: # Starting a quoted word. quote_mode = c elif c == quote_mode: @@ -400,7 +400,7 @@ class BashScript(Grammar): @staticmethod def parse(fn): - if fn in ("setup/functions.sh", "/etc/mailinabox.conf"): return "" + if fn in {"setup/functions.sh", "/etc/mailinabox.conf"}: return "" with open(fn, encoding="utf-8") as f: string = f.read()