mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-01-24 12:47:05 +00:00
Fixed PLR6201 (literal-membership): Use a set literal when testing for membership
This commit is contained in:
parent
ee240c654d
commit
34d1e47ff7
@ -130,7 +130,7 @@ def generate_documentation():
|
|||||||
fn = parser.parse_string(line).filename()
|
fn = parser.parse_string(line).filename()
|
||||||
except:
|
except:
|
||||||
continue
|
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
|
continue
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@ -323,7 +323,7 @@ def quasitokenize(bashscript):
|
|||||||
elif c == "\\":
|
elif c == "\\":
|
||||||
# Escaping next character.
|
# Escaping next character.
|
||||||
escape_next = True
|
escape_next = True
|
||||||
elif quote_mode is None and c in ('"', "'"):
|
elif quote_mode is None and c in {'"', "'"}:
|
||||||
# Starting a quoted word.
|
# Starting a quoted word.
|
||||||
quote_mode = c
|
quote_mode = c
|
||||||
elif c == quote_mode:
|
elif c == quote_mode:
|
||||||
@ -400,7 +400,7 @@ class BashScript(Grammar):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse(fn):
|
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:
|
with open(fn, encoding="utf-8") as f:
|
||||||
string = f.read()
|
string = f.read()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user