diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d62a8811..2e5bac56 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -66,7 +66,7 @@ repos: args: [--py310-plus] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.10 + rev: v0.5.0 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/pyproject.toml b/pyproject.toml index 576beb2a..23395128 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,8 @@ force-exclude = ''' [tool.ruff] line-length = 120 + +[tool.ruff.lint] select = [ "E", "F", diff --git a/tests/test_pyvex.py b/tests/test_pyvex.py index d059ccf2..647b2e01 100644 --- a/tests/test_pyvex.py +++ b/tests/test_pyvex.py @@ -319,7 +319,7 @@ def test_irstmt_dirty(self): args = [pyvex.IRExpr.RdTmp.get_instance(i) for i in range(10)] m = pyvex.IRStmt.Dirty("test_dirty", pyvex.IRConst.U8(1), args, 15, "Ifx_None", 0, 1, 0) assert m.cee == "test_dirty" - assert type(m.guard) == pyvex.IRConst.U8 + assert isinstance(m.guard, pyvex.IRConst.U8) assert m.tmp == 15 assert m.mFx == "Ifx_None" assert m.nFxState == 0 diff --git a/tests/test_spotter.py b/tests/test_spotter.py index 9b52d375..44d3be6b 100644 --- a/tests/test_spotter.py +++ b/tests/test_spotter.py @@ -100,9 +100,9 @@ def test_tmrs(): ins = b"\xef\xf3\x08\x82" b = pyvex.block.IRSB(ins, 1, arch) assert b.jumpkind == "Ijk_Boring" - assert type(b.statements[1].data) == pyvex.expr.Get + assert isinstance(b.statements[1].data, pyvex.expr.Get) assert arch.translate_register_name(b.statements[1].data.offset) in ["sp", "r13"] - assert type(b.statements[2]) == pyvex.stmt.Put + assert isinstance(b.statements[2], pyvex.stmt.Put) def test_tmsr(): @@ -110,9 +110,9 @@ def test_tmsr(): inss = b"\x82\xf3\x08\x88" b = pyvex.block.IRSB(inss, 1, arch, opt_level=3) assert b.jumpkind == "Ijk_Boring" - assert type(b.statements[1].data) == pyvex.expr.Get + assert isinstance(b.statements[1].data, pyvex.expr.Get) assert arch.translate_register_name(b.statements[1].data.offset) == "r2" - assert type(b.statements[2]) == pyvex.stmt.Put + assert isinstance(b.statements[2], pyvex.stmt.Put) if __name__ == "__main__":