mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-09-12 08:04:35 +08:00
adds pyupgrade pre-commit
This commit is contained in:
parent
f4918288b1
commit
b944008487
3 changed files with 9 additions and 4 deletions
|
@ -35,6 +35,11 @@ repos:
|
||||||
rev: v3.9.0
|
rev: v3.9.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: reorder-python-imports
|
- id: reorder-python-imports
|
||||||
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
|
rev: v3.2.0
|
||||||
|
hooks:
|
||||||
|
- id: pyupgrade
|
||||||
|
args: [--py3-plus]
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.10.0
|
rev: 22.10.0
|
||||||
hooks:
|
hooks:
|
||||||
|
|
|
@ -191,7 +191,7 @@ class Failed(Exception):
|
||||||
def list_in_text(text, search_list, match_all=False):
|
def list_in_text(text, search_list, match_all=False):
|
||||||
if isinstance(search_list, list):
|
if isinstance(search_list, list):
|
||||||
search_list = set(search_list)
|
search_list = set(search_list)
|
||||||
contains = set([x for x in search_list if " " in x])
|
contains = {x for x in search_list if " " in x}
|
||||||
exception = search_list - contains
|
exception = search_list - contains
|
||||||
if match_all:
|
if match_all:
|
||||||
if all(x == m for m in text.split(" ") for x in exception) or all(x in text for x in contains):
|
if all(x == m for m in text.split(" ") for x in exception) or all(x in text for x in contains):
|
||||||
|
@ -278,7 +278,7 @@ def nohardlink(file):
|
||||||
# Load json file if exists
|
# Load json file if exists
|
||||||
def load_json(file):
|
def load_json(file):
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
f = open(file, "r")
|
f = open(file)
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
f.close()
|
f.close()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -496,9 +496,9 @@ if __name__ == "__main__":
|
||||||
logger.info_center(" _ _ _ ") # noqa: W605
|
logger.info_center(" _ _ _ ") # noqa: W605
|
||||||
logger.info_center(" | | (_) | ") # noqa: W605
|
logger.info_center(" | | (_) | ") # noqa: W605
|
||||||
logger.info_center(" __ _| |__ _| |_ _ __ ___ __ _ _ __ __ _ __ _ ___ ") # noqa: W605
|
logger.info_center(" __ _| |__ _| |_ _ __ ___ __ _ _ __ __ _ __ _ ___ ") # noqa: W605
|
||||||
logger.info_center(" / _` | '_ \| | __| | '_ ` _ \ / _` | '_ \ / _` |/ _` |/ _ \\") # noqa: W605
|
logger.info_center(" / _` | '_ \\| | __| | '_ ` _ \\ / _` | '_ \\ / _` |/ _` |/ _ \\") # noqa: W605
|
||||||
logger.info_center(" | (_| | |_) | | |_ | | | | | | (_| | | | | (_| | (_| | __/") # noqa: W605
|
logger.info_center(" | (_| | |_) | | |_ | | | | | | (_| | | | | (_| | (_| | __/") # noqa: W605
|
||||||
logger.info_center(" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605
|
logger.info_center(r" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605
|
||||||
logger.info_center(" | | ______ __/ | ") # noqa: W605
|
logger.info_center(" | | ______ __/ | ") # noqa: W605
|
||||||
logger.info_center(" |_| |______| |___/ ") # noqa: W605
|
logger.info_center(" |_| |______| |___/ ") # noqa: W605
|
||||||
logger.info(f" Version: {version}")
|
logger.info(f" Version: {version}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue