From: Zbigniew Jędrzejewski-Szmek Date: Sun, 6 Jun 2021 17:41:32 +0000 (+0200) Subject: Add typing to make mypy happy X-Git-Tag: v10~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F730%2Fhead;p=thirdparty%2Fmkosi.git Add typing to make mypy happy Co-authored-by: Jörg Behrmann --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 5dd44a6bf..cb01ff7b6 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4697,7 +4697,7 @@ class WithNetworkAction(BooleanAction): class CustomHelpFormatter(argparse.HelpFormatter): - def _format_action_invocation(self, action): + def _format_action_invocation(self, action: argparse.Action) -> str: if not action.option_strings or action.nargs == 0: return super()._format_action_invocation(action) default = self._get_default_metavar_for_optional(action) @@ -4744,12 +4744,10 @@ class ArgumentParserMkosi(argparse.ArgumentParser): self._ini_file_list_mode = False # Add config files to be parsed - super().__init__( - *kargs, - **kwargs, - fromfile_prefix_chars=ArgumentParserMkosi.fromfile_prefix_chars, - formatter_class=CustomHelpFormatter, - ) + kwargs["fromfile_prefix_chars"] = ArgumentParserMkosi.fromfile_prefix_chars + kwargs["formatter_class"] = CustomHelpFormatter + + super().__init__(*kargs, **kwargs) @staticmethod def _camel_to_arg(camel: str) -> str: