Completed
Push — develop ( 51e53a...40e7fd )
by Jace
15s queued 11s
created

gitman.models.group   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A Group.__repr__() 0 2 1
A Group.__lt__() 0 2 1
A Group.__ne__() 0 2 1
A Group.__eq__() 0 2 1
A Group.__str__() 0 3 1
1
from dataclasses import dataclass
2
from typing import List
3
4
5
@dataclass
6
class Group:
7
    """A group with sources."""
8
9
    name: str
10
    members: List[str]
11
12
    def __repr__(self):
13
        return "<group {}>".format(self)
14
15
    def __str__(self):
16
        pattern = "['{n}']"
17
        return pattern.format(n=self.name)
18
19
    def __eq__(self, other):
20
        return self.name == other.name
21
22
    def __ne__(self, other):
23
        return self.name != other.name
24
25
    def __lt__(self, other):
26
        return self.name < other.name
27