]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Add typing to make mypy happy 730/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 6 Jun 2021 17:41:32 +0000 (19:41 +0200)
committerGitHub <noreply@github.com>
Sun, 6 Jun 2021 17:41:32 +0000 (19:41 +0200)
Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
mkosi/__init__.py

index 5dd44a6bf8914bb347ccf539935b130be642ae23..cb01ff7b6a513093a8e4f6c93794d5c3cb579b30 100644 (file)
@@ -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: