Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 26, 2024
1 parent 463cc3d commit 7616505
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,12 @@ def get_choice(self, argdict: dict, path=None) -> "Argument":
return self.choice_dict[self.choice_alias[tag]]
else:
raise ArgumentValueError(
path, f"get invalid choice `{tag}` for flag key `{self.flag_name}`." + did_you_mean(tag, list(self.choice_dict.keys()) + list(self.choice_alias.keys()))
path,
f"get invalid choice `{tag}` for flag key `{self.flag_name}`."
+ did_you_mean(
tag,
list(self.choice_dict.keys()) + list(self.choice_alias.keys()),
),
)
elif self.optional:
return self.choice_dict[self.default_tag]
Expand Down Expand Up @@ -1046,7 +1051,7 @@ def did_you_mean(choice: str, choices: List[str]) -> str:
----------

Check warning on line 1051 in dargs/dargs.py

View check run for this annotation

Codecov / codecov/patch

dargs/dargs.py#L1051

Added line #L1051 was not covered by tests
choice : str
the user's wrong choice
choices: list[str]
choices : list[str]
all the choices
Returns
Expand Down

0 comments on commit 7616505

Please sign in to comment.