Completed
Push — master ( 3c108b...266306 )
by Oleksandr
03:35
created

BaseCommand.make_parser()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nop 2
1
import abc
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
import argparse
3
4
from typing import Callable
0 ignored issues
show
Unused Code introduced by
Unused Callable imported from typing
Loading history...
5
from typing import List
6
from typing import Text
7
from typing import Type
8
9
from .lang import classproperty_readonly
10
from .utils import print_out
11
12
13
class BaseCommandExecutor(abc.ABC):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
14
15
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
16
  def __init__(self, args: argparse.Namespace) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
17
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
18
19
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
20
  def __call__(self) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
21
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
22
23
  @staticmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
24
  def _print_input_args(**kwargs) -> None:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
25
    print_out(f"input args: {kwargs}")
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
26
27
28
class BaseCommand(abc.ABC):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
29
30
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
31
  def name(self) -> Text:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
32
    raise NotImplementedError
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
33
34
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
35
  def aliases(self) -> List[Text]:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
36
    return []
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
37
38
  @classproperty_readonly
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
39
  def executor_class(self) -> Type[BaseCommandExecutor]:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
40
    raise NotImplementedError
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
41
42
  @classmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
43
  def make_executor(cls, args=argparse.Namespace) -> BaseCommandExecutor:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
44
    return cls.executor_class(args)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
45
46
  @classmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
47
  @abc.abstractmethod
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
48
  def make_parser(cls, factory=argparse.ArgumentParser) -> argparse.ArgumentParser:
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 4 spaces were expected, but 2 were found.
Loading history...
introduced by
Missing function or method docstring
Loading history...
49
    ...
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 4 were found.
Loading history...
50