diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2ac9ca0..66bdd7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/phir/cli.py b/phir/cli.py index b80e421..7b24c68 100644 --- a/phir/cli.py +++ b/phir/cli.py @@ -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 diff --git a/phir/model.py b/phir/model.py index 3d2ecde..1063324 100644 --- a/phir/model.py +++ b/phir/model.py @@ -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 @@ -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: @@ -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 _: