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 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", 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")