Skip to content

Commit

Permalink
fix: make None default size if unspecified (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
qartik authored May 6, 2024
1 parent 35ce3d4 commit 3d73c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repos:
- id: check-json

- repo: https://github.com/crate-ci/typos
rev: v1.20.10
rev: v1.21.0
hooks:
- id: typos
args: []
Expand Down Expand Up @@ -43,7 +43,7 @@ repos:
- black==23.10.1

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
rev: v0.4.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion phir/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CVarDefine(Data):
data: Literal["cvar_define"]
data_type: Literal["i64", "i32", "u64", "u32"]
variable: Sym
size: PositiveInt | None = Field(strict=True)
size: PositiveInt | None = Field(default=None, strict=True)

@model_validator(mode="after")
def check_size(self: CVarDefine) -> CVarDefine:
Expand Down
4 changes: 2 additions & 2 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@
"type": "null"
}
],
"default": null,
"title": "Size"
}
},
"required": [
"data",
"data_type",
"variable",
"size"
"variable"
],
"title": "CVarDefine",
"type": "object"
Expand Down

0 comments on commit 3d73c55

Please sign in to comment.