Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ repos:
- id: check-json

- repo: https://github.com/crate-ci/typos
rev: v1
rev: typos-dict-v0.14.2
hooks:
- id: typos
args: []

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.23.0
rev: v0.23.3
hooks:
- id: markdownlint-cli2

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.37.4
rev: 0.38.2
hooks:
- id: check-github-workflows
- id: check-metaschema
Expand All @@ -36,14 +36,14 @@ repos:
args: ["--schemafile", "schema.json"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.20
rev: v0.16.10
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v2.1.0
rev: v2.4.0
hooks:
- id: mypy
pass_filenames: false
Expand Down
2 changes: 1 addition & 1 deletion phir/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pathlib import Path

from pydantic import ValidationError
from rich import print # noqa: A004
from rich import print # ruff: ignore[builtin-import-shadowing]

from phir.model import PHIRModel

Expand Down
8 changes: 4 additions & 4 deletions phir/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def check_size(self: CVarDefine) -> CVarDefine:
if self.size:
match self.data_type:
case "i64" | "u64":
if self.size > 64: # noqa: PLR2004
if self.size > 64: # ruff: ignore[magic-value-comparison]
raise ValueError(msg)
case "i32" | "u32":
if self.size > 32: # noqa: PLR2004
if self.size > 32: # ruff: ignore[magic-value-comparison]
raise ValueError(msg)
return self

Expand Down Expand Up @@ -161,7 +161,7 @@ def check_angles(self: SQOp) -> SQOp:
msg = "Incorrect number of angles for the given gate."
match self.qop:
case "R1XY":
if not self.angles or len(self.angles[0]) != 2: # noqa: PLR2004
if not self.angles or len(self.angles[0]) != 2: # ruff: ignore[magic-value-comparison]
raise ValueError(msg)
case "RX" | "RY" | "RZ":
if not self.angles or len(self.angles[0]) != 1:
Expand Down Expand Up @@ -205,7 +205,7 @@ def check_angles(self: TQOp) -> TQOp:
msg = f"{self.qop} gate requires exactly one angle parameter."
raise ValueError(msg)
case "R2XXYYZZ":
if not self.angles or len(self.angles[0]) != 3: # noqa: PLR2004
if not self.angles or len(self.angles[0]) != 3: # ruff: ignore[magic-value-comparison]
msg = f"{self.qop} gate requires three angle parameters."
raise ValueError(msg)
case _:
Expand Down
Loading