|
5 | 5 |
|
6 | 6 | from pydantic import BaseModel, model_validator |
7 | 7 |
|
8 | | -from ..common import Change, CodeTFWriter, Finding |
| 8 | +from ..common import Change, CodeTFWriter, Finding, FixQuality |
9 | 9 | from ..v2.codetf import Finding as V2Finding |
10 | 10 |
|
11 | 11 |
|
@@ -41,14 +41,14 @@ class FixStatus(BaseModel): |
41 | 41 | """Metadata describing fix outcome""" |
42 | 42 |
|
43 | 43 | status: FixStatusType |
44 | | - reason: Optional[str] |
45 | | - details: Optional[str] |
| 44 | + reason: Optional[str] = None |
| 45 | + details: Optional[str] = None |
46 | 46 |
|
47 | 47 |
|
48 | 48 | class ChangeSet(BaseModel): |
49 | 49 | path: str |
50 | 50 | diff: str |
51 | | - changes: list[Change] |
| 51 | + changes: list[Change] = [] |
52 | 52 |
|
53 | 53 |
|
54 | 54 | class Reference(BaseModel): |
@@ -88,27 +88,16 @@ class FixMetadata(BaseModel): |
88 | 88 | summary: str |
89 | 89 | # A detailed description of the fix |
90 | 90 | description: str |
91 | | - references: list[Reference] |
| 91 | + references: list[Reference] = [] |
92 | 92 | generation: GenerationMetadata |
93 | 93 |
|
94 | 94 |
|
95 | | -class Rating(BaseModel): |
96 | | - score: int |
97 | | - description: Optional[str] = None |
98 | | - |
99 | | - |
100 | | -class FixQuality(BaseModel): |
101 | | - safetyRating: Rating |
102 | | - effectivenessRating: Rating |
103 | | - cleanlinessRating: Rating |
104 | | - |
105 | | - |
106 | 95 | class FixResult(BaseModel): |
107 | 96 | """Result corresponding to a single finding""" |
108 | 97 |
|
109 | 98 | finding: Finding | V2Finding |
110 | 99 | fixStatus: FixStatus |
111 | | - changeSets: list[ChangeSet] |
| 100 | + changeSets: list[ChangeSet] = [] |
112 | 101 | fixMetadata: Optional[FixMetadata] = None |
113 | 102 | fixQuality: Optional[FixQuality] = None |
114 | 103 | # A description of the reasoning process that led to the fix |
|
0 commit comments