aboutsummaryrefslogtreecommitdiff
path: root/src_py/hatter/common.py
blob: ae314a5132549a7e83d69274383411bd3d7ead14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from pathlib import Path
import enum
import typing

from hat import json


package_path: Path = Path(__file__).parent

json_schema_repo: json.SchemaRepository = json.SchemaRepository(
    json.json_schema_repo,
    json.SchemaRepository.from_json(package_path / 'json_schema_repo.json'))


class Order(enum.Enum):
    ASC = 'ASC'
    DESC = 'DESC'


class Status(enum.Enum):
    PENDING = 0
    RUNNING = 1
    SUCCESS = 2
    FAILURE = 3


class Commit(typing.NamedTuple):
    repo: str
    hash: str
    change: int
    status: Status
    output: str