adds pyupgrade pre-commit

This commit is contained in:
bobokun 2022-11-01 11:32:02 -04:00
parent f4918288b1
commit b944008487
No known key found for this signature in database
GPG key ID: B73932169607D927
3 changed files with 9 additions and 4 deletions

View file

@ -35,6 +35,11 @@ repos:
rev: v3.9.0
hooks:
- 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
rev: 22.10.0
hooks:

View file

@ -191,7 +191,7 @@ class Failed(Exception):
def list_in_text(text, search_list, match_all=False):
if isinstance(search_list, 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
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):
@ -278,7 +278,7 @@ def nohardlink(file):
# Load json file if exists
def load_json(file):
if os.path.isfile(file):
f = open(file, "r")
f = open(file)
data = json.load(f)
f.close()
else:

View file

@ -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(r" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605
logger.info_center(" | | ______ __/ | ") # noqa: W605
logger.info_center(" |_| |______| |___/ ") # noqa: W605
logger.info(f" Version: {version}")