From 152dc76e4f21f6e8aa3fa19304e7f1c7623d2217 Mon Sep 17 00:00:00 2001 From: seria Date: Sat, 13 Apr 2024 12:22:34 +0900 Subject: [PATCH 1/3] chore(deps): Remove sort-all from requirements --- genshin-dev/reformat-requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/genshin-dev/reformat-requirements.txt b/genshin-dev/reformat-requirements.txt index 1cf5c13f..6b7ba109 100644 --- a/genshin-dev/reformat-requirements.txt +++ b/genshin-dev/reformat-requirements.txt @@ -1,3 +1,2 @@ black -ruff -sort-all \ No newline at end of file +ruff \ No newline at end of file From 91ada6edda16a018e504f19f37a230e96476c1f8 Mon Sep 17 00:00:00 2001 From: seria Date: Sat, 13 Apr 2024 12:22:49 +0900 Subject: [PATCH 2/3] chore(nox): Update reformat session --- noxfile.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/noxfile.py b/noxfile.py index 3da55b37..93c6c5a4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -60,12 +60,21 @@ def reformat(session: nox.Session) -> None: """Reformat this project's modules to fit the standard style.""" install_requirements(session, "reformat") session.run("python", "-m", "black", *GENERAL_TARGETS, *verbose_args()) - session.run("python", "-m", "ruff", "check", "--fix-only", "--fixable", "ALL", *GENERAL_TARGETS, *verbose_args()) - - session.log("sort-all") - LOGGER.disabled = True - session.run("sort-all", *map(str, pathlib.Path(PACKAGE).glob("**/*.py")), success_codes=[0, 1]) - LOGGER.disabled = False + # sort __all__ and format imports + session.run( + "python", + "-m", + "ruff", + "check", + "--preview", + "--select", + "RUF022,I", + "--fix", + *GENERAL_TARGETS, + *verbose_args(), + ) + # fix all fixable linting errors + session.run("ruff", "check", "--fix", *GENERAL_TARGETS, *verbose_args()) @nox.session(name="test") From 167fc0df24e933f08437e29b89b4f5282e6e7211 Mon Sep 17 00:00:00 2001 From: seria Date: Sat, 13 Apr 2024 12:23:00 +0900 Subject: [PATCH 3/3] style: Format `__all__` --- genshin/client/routes.py | 2 +- genshin/errors.py | 2 +- genshin/models/honkai/chronicle/modes.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/genshin/client/routes.py b/genshin/client/routes.py index a24d048c..908143c2 100644 --- a/genshin/client/routes.py +++ b/genshin/client/routes.py @@ -28,7 +28,6 @@ "MI18N", "RECORD_URL", "REWARD_URL", - "Route", "TAKUMI_URL", "TEAPOT_URL", "VERIFY_EMAIL_URL", @@ -36,6 +35,7 @@ "WEBSTATIC_URL", "WEB_LOGIN_URL", "YSULOG_URL", + "Route", ] diff --git a/genshin/errors.py b/genshin/errors.py index f62ade2f..b5225000 100644 --- a/genshin/errors.py +++ b/genshin/errors.py @@ -3,13 +3,13 @@ import typing __all__ = [ + "ERRORS", "AccountNotFound", "AlreadyClaimed", "AuthkeyException", "AuthkeyTimeout", "CookieException", "DataNotPublic", - "ERRORS", "GeetestTriggered", "GenshinException", "InvalidAuthkey", diff --git a/genshin/models/honkai/chronicle/modes.py b/genshin/models/honkai/chronicle/modes.py index 92067ebd..50a85116 100644 --- a/genshin/models/honkai/chronicle/modes.py +++ b/genshin/models/honkai/chronicle/modes.py @@ -18,8 +18,8 @@ from genshin.models.model import Aliased, APIModel, Unique __all__ = [ - "Boss", "ELF", + "Boss", "ElysianRealm", "MemorialArena", "MemorialBattle",