diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1b1bef..e15cac7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: check-toml # Python - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.9.3 hooks: - id: ruff args: [ --fix ] diff --git a/dargs/__init__.py b/dargs/__init__.py index af2f59b..77ec18d 100644 --- a/dargs/__init__.py +++ b/dargs/__init__.py @@ -2,4 +2,4 @@ from .dargs import Argument, ArgumentEncoder, Variant -__all__ = ["Argument", "Variant", "ArgumentEncoder"] +__all__ = ["Argument", "ArgumentEncoder", "Variant"] diff --git a/dargs/dargs.py b/dargs/dargs.py index caf8dc6..3d7734b 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -460,7 +460,7 @@ def _check_exist(self, argdict: dict, path=None): return if self.name not in argdict: raise ArgumentKeyError( - path, f"key `{self.name}` is required " "in arguments but not found" + path, f"key `{self.name}` is required in arguments but not found" ) def _check_data(self, value: Any, path=None): @@ -862,8 +862,7 @@ def get_choice(self, argdict: dict, path=None) -> Argument: else: raise ArgumentKeyError( path, - f"key `{self.flag_name}` is required " - "to choose variant but not found.", + f"key `{self.flag_name}` is required to choose variant but not found.", ) def flatten_sub(self, argdict: dict, path=None) -> dict[str, Argument]: