Skip to content

Commit fc4e863

Browse files
committed
fix generator
1 parent 2dc45ef commit fc4e863

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

validators.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Import:
1616

1717

1818
@dataclass
19-
class ValidatorType:
19+
class Type:
2020
name: str
2121
constraint: str
2222

@@ -26,7 +26,7 @@ class Validator:
2626
name: str
2727
internal: bool
2828
desc: str
29-
types: list[ValidatorType]
29+
types: list[Type]
3030
embed: Optional[str]
3131
aliased: Optional[str]
3232

@@ -54,16 +54,12 @@ def read(path: str) -> Data:
5454
validators: list[Validator] = []
5555

5656
for entry in data["validators"]:
57-
types: list[ValidatorType] = []
57+
types: list[Type] = []
5858

5959
for type_ in entry["types"]:
60-
validator_type = ValidatorType(
61-
name=type_["name"], constraint=type_["constraint"]
62-
)
60+
validator_type = Type(name=type_["name"], constraint=type_["constraint"])
6361

64-
types.append(
65-
ValidatorType(name=type_["name"], constraint=type_["constraint"])
66-
)
62+
types.append(validator_type)
6763

6864
if "." in validator_type.constraint:
6965
pkg = validator_type.constraint.split(".")[0]

0 commit comments

Comments
 (0)