Skip to content

Commit 3d73c55

Browse files
authored
fix: make None default size if unspecified (#84)
1 parent 35ce3d4 commit 3d73c55

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: check-json
1616

1717
- repo: https://github.com/crate-ci/typos
18-
rev: v1.20.10
18+
rev: v1.21.0
1919
hooks:
2020
- id: typos
2121
args: []
@@ -43,7 +43,7 @@ repos:
4343
- black==23.10.1
4444

4545
- repo: https://github.com/astral-sh/ruff-pre-commit
46-
rev: v0.4.2
46+
rev: v0.4.3
4747
hooks:
4848
- id: ruff
4949
args: [--fix, --exit-non-zero-on-fix]

phir/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class CVarDefine(Data):
4545
data: Literal["cvar_define"]
4646
data_type: Literal["i64", "i32", "u64", "u32"]
4747
variable: Sym
48-
size: PositiveInt | None = Field(strict=True)
48+
size: PositiveInt | None = Field(default=None, strict=True)
4949

5050
@model_validator(mode="after")
5151
def check_size(self: CVarDefine) -> CVarDefine:

schema.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@
190190
"type": "null"
191191
}
192192
],
193+
"default": null,
193194
"title": "Size"
194195
}
195196
},
196197
"required": [
197198
"data",
198199
"data_type",
199-
"variable",
200-
"size"
200+
"variable"
201201
],
202202
"title": "CVarDefine",
203203
"type": "object"

0 commit comments

Comments
 (0)