Passed
Push — main ( 2e1b6b...3a0c28 )
by Douglas
02:06
created

mandos.search.hmdb.HmdbSearch.__init__()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nop 3
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
import abc
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
from typing import TypeVar
3
4
from pocketutils.core.exceptions import XValueError
0 ignored issues
show
introduced by
Unable to import 'pocketutils.core.exceptions'
Loading history...
5
6
from mandos.model.apis.hmdb_api import HmdbApi
7
from mandos.model.hits import AbstractHit
8
from mandos.model.searches import Search
9
10
H = TypeVar("H", bound=AbstractHit, covariant=True)
0 ignored issues
show
Coding Style Naming introduced by
Class name "H" doesn't conform to PascalCase naming style ('[^\\W\\da-z][^\\W_]+$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
11
12
13
class HmdbSearch(Search[H], metaclass=abc.ABCMeta):
0 ignored issues
show
introduced by
Missing class docstring
Loading history...
14
    def __init__(self, key: str, api: HmdbApi):
15
        if api is None:
16
            raise XValueError(f"{self.__class__.__name__} got a null API")
17
        super().__init__(key)
18
        self.api = api
19
20
21
__all__ = ["HmdbSearch"]
22