Skip to content
Myr

apply ruff fixes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 3ec3ac5 · Browse files · 4 files+6 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+6 added−7 removed

  • other:+6 added−7 removed

4 files+6 added−7 removed

modified:src/click/core.py+4 added-4 removed
623 unmodified lines
624 return node625626 def find_object(self, object_type: t.Type[V]) -> t.Optional[V]:627 """Finds the closest object of a given type."""628 node: t.Optional["Context"] = self628 node: t.Optional[Context] = self629630 while node is not None:631 if isinstance(node.obj, object_type):632 return node.obj
335 unmodified lines
968 .. versionadded:: 8.0969 """970 from click.shell_completion import CompletionItem971972 results: t.List["CompletionItem"] = []972 results: t.List[CompletionItem] = []973974 while ctx.parent is not None:975 ctx = ctx.parent976
239 unmodified lines
1216 self.callback = callback1217 #: the list of parameters for this command in the order they1218 #: should show up in the help page and execute. Eager parameters1219 #: will automatically be handled before non eager ones.1220 self.params: t.List["Parameter"] = params or []1220 self.params: t.List[Parameter] = params or []1221 self.help = help1222 self.epilog = epilog1223 self.options_metavar = options_metavar1224 self.short_help = short_help
214 unmodified lines
1439 .. versionadded:: 8.01440 """1441 from click.shell_completion import CompletionItem14421443 results: t.List["CompletionItem"] = []1443 results: t.List[CompletionItem] = []14441445 if incomplete and not incomplete[0].isalnum():1446 for param in self.get_params(ctx):1447 if (
1585 unmodified lines
modified:src/click/exceptions.py+1 added-1 removed
56 unmodified lines
5758 def __init__(self, message: str, ctx: t.Optional["Context"] = None) -> None:59 super().__init__(message)60 self.ctx = ctx61 self.cmd: t.Optional["Command"] = self.ctx.command if self.ctx else None61 self.cmd: t.Optional[Command] = self.ctx.command if self.ctx else None6263 def show(self, file: t.Optional[t.IO[t.Any]] = None) -> None:64 if file is None:65 file = get_text_stderr()
223 unmodified lines
modified:src/click/parser.py+1 added-1 removed
247 unmodified lines
248 def __init__(self, rargs: t.List[str]) -> None:249 self.opts: t.Dict[str, t.Any] = {}250 self.largs: t.List[str] = []251 self.rargs = rargs252 self.order: t.List["CoreParameter"] = []252 self.order: t.List[CoreParameter] = []253254255class OptionParser:256 """The option parser is an internal class that is ultimately used to
275 unmodified lines
modified:pyproject.toml-1 removed