-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod_types.py
More file actions
97 lines (79 loc) · 2.8 KB
/
mod_types.py
File metadata and controls
97 lines (79 loc) · 2.8 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# type: ignore (for mirror)
from dataclasses import dataclass
from datetime import datetime
from types import ModuleType
from typing import Literal
from vdbpy.types.shared import (
EntryId,
EntryStatus,
EntryTuple,
EntryType,
UserEdit,
UserId,
VersionId,
VersionTuple,
)
type RuleId = int
type ReportId = int
type ReportType = Literal[
"InvalidInfo", "Duplicate", "Inappropriate", "Other", "InvalidTag", "BrokenPV"
]
@dataclass
class RuleTableRow:
rule_name: str
rule_entry_types_strings: list[str]
rule_entry_status: EntryStatus
rule_tag_id: int
rule_mikumodded: bool | Literal["Planned"]
rule_complete: bool
rule_autofixed: bool | Literal["Partially"]
@dataclass
class EntryReport:
report_id: ReportId
entry_type: EntryType
entry_id: EntryId
date: datetime
report_type: ReportType
notes: str
author: str | None
SavedEditCheckResult = Literal[
"Valid", "Not applicable", "Rule violation", "Possible rule violation"
]
EditCheckResult = Literal[SavedEditCheckResult, "Unrelated fields", "No data"]
RuleModuleResult = Literal[SavedEditCheckResult, "Wrong entry type", "Unrelated fields"]
SavedEntryCheckResult = Literal[
SavedEditCheckResult, "Deleted", "Too old", "Unrelated fields", "No autofix"
]
type CheckResult = Literal[
SavedEntryCheckResult, "Wrong entry type", "No data"
]
ReportResult = Literal[
"Success", "Permanent skip", "Temporary skip", "Error", "Deleted"
]
type EntryWithVersionIds = tuple[EntryTuple, VersionId, VersionId]
type RuleModules = dict[RuleId, tuple[str, ModuleType]]
type ReportWithVersionIdAndRelevantEntries = tuple[
EntryReport, VersionId, list[EntryTuple]
]
type ParsedReports = list[ReportWithVersionIdAndRelevantEntries]
type ParsedReportsByRuleId = dict[RuleId, ParsedReports]
type MikuModReports = dict[UserId, ParsedReportsByRuleId]
type EntriesBySavedEditCheckResult = dict[SavedEditCheckResult, set[EntryTuple]]
type EditCheckMemory = dict[RuleId, EntriesBySavedEditCheckResult]
type ReportsToSend = dict[UserId, dict[RuleId, tuple[str, list[EntryWithVersionIds]]]]
type EntriesByRuleId = dict[RuleId, set[EntryTuple]]
type EntryCheckData = tuple[VersionId, CheckResult, VersionId, UserId]
type EntryCheckMemory = dict[
RuleId,
dict[EntryTuple, EntryCheckData],
]
type CorrectEditCheckTestResult = dict[RuleModuleResult, list[VersionTuple]]
type CorrectEntryCheckTestResult = dict[
CheckResult, list[tuple[VersionId, UserId, VersionTuple]]
]
type CorrectTestResults = tuple[CorrectEditCheckTestResult, CorrectEntryCheckTestResult]
StatColumns = Literal[
"Valid", "Rule violation", "Possible rule violation", "Not applicable", "No autofix"
]
type EntryCheckStatsByRuleId = dict[RuleId, dict[EntryTuple, StatColumns]]
type EditByEntryTypeAndId = dict[EntryType, dict[EntryId, UserEdit]]