diff --git a/cratedb_toolkit/retention/strategy/delete.py b/cratedb_toolkit/retention/strategy/delete.py index f096666e..46e86eac 100644 --- a/cratedb_toolkit/retention/strategy/delete.py +++ b/cratedb_toolkit/retention/strategy/delete.py @@ -10,6 +10,7 @@ In CrateDB, tables for storing retention policies need to be created once manually. See the file setup/schema.sql in this repository. """ + import dataclasses import logging diff --git a/cratedb_toolkit/retention/strategy/reallocate.py b/cratedb_toolkit/retention/strategy/reallocate.py index fdd7c5ee..a8976a89 100644 --- a/cratedb_toolkit/retention/strategy/reallocate.py +++ b/cratedb_toolkit/retention/strategy/reallocate.py @@ -12,6 +12,7 @@ - Tables for storing retention policies need to be created once manually in CrateDB. See the file setup/schema.sql in this repository. """ + import dataclasses import logging diff --git a/cratedb_toolkit/retention/strategy/snapshot.py b/cratedb_toolkit/retention/strategy/snapshot.py index 8626eed9..c538860c 100644 --- a/cratedb_toolkit/retention/strategy/snapshot.py +++ b/cratedb_toolkit/retention/strategy/snapshot.py @@ -10,6 +10,7 @@ In CrateDB, tables for storing retention policies need to be created once manually. See the file setup/schema.sql in this repository. """ + import dataclasses import logging diff --git a/cratedb_toolkit/wtf/recorder.py b/cratedb_toolkit/wtf/recorder.py index 3c90d477..08cf5756 100644 --- a/cratedb_toolkit/wtf/recorder.py +++ b/cratedb_toolkit/wtf/recorder.py @@ -40,7 +40,8 @@ def record_once(self): ) ) self.adapter.connection.execute( - sa.text(f"INSERT INTO {table} (info) VALUES (:info)"), {"info": sample.to_dict()["data"]} # noqa: S608 + sa.text(f"INSERT INTO {table} (info) VALUES (:info)"), # noqa: S608 + {"info": sample.to_dict()["data"]}, ) def record_forever(self): diff --git a/examples/cloud_import.py b/examples/cloud_import.py index 62df562b..45c6326a 100644 --- a/examples/cloud_import.py +++ b/examples/cloud_import.py @@ -32,6 +32,7 @@ python examples/cloud_import.py e1e38d92-a650-48f1-8a70-8133f2d5c400 """ + import logging import os import sys diff --git a/examples/retention_edit.py b/examples/retention_edit.py index d25d1630..bae7f267 100644 --- a/examples/retention_edit.py +++ b/examples/retention_edit.py @@ -27,6 +27,7 @@ python examples/retention_edit.py crate://localhost:4200 """ + import logging import os diff --git a/examples/retention_retire_cutoff.py b/examples/retention_retire_cutoff.py index 310b9539..f093636a 100644 --- a/examples/retention_retire_cutoff.py +++ b/examples/retention_retire_cutoff.py @@ -33,6 +33,7 @@ python examples/retention_retire_cutoff.py crate://localhost:4200 """ + import logging import os diff --git a/pyproject.toml b/pyproject.toml index 11d25051..479cb2bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,10 +113,10 @@ datasets = [ ] develop = [ "black[jupyter]<25", - "mypy==1.8.0", + "mypy<1.10", "poethepoet<0.26", "pyproject-fmt<1.8", - "ruff==0.3.4", + "ruff<0.4", "validate-pyproject<0.17", ] influxdb = [ @@ -215,7 +215,7 @@ markers = [ [tool.ruff] line-length = 120 -select = [ +lint.select = [ # Bandit "S", # Bugbear @@ -243,7 +243,7 @@ select = [ "RET", ] -extend-ignore = [ +lint.extend-ignore = [ # zip() without an explicit strict= parameter "B905", # df is a bad variable name. Be kinder to your future self. @@ -261,7 +261,7 @@ extend-exclude = [ "workbench.py", ] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/*" = ["S101"] # Allow use of `assert`, and `print`. "examples/*" = ["T201"] # Allow `print` "cratedb_toolkit/retention/cli.py" = ["T201"] # Allow `print` @@ -286,12 +286,13 @@ format = [ { cmd = "black ." }, # Configure Ruff not to auto-fix (remove!): # unused imports (F401), unused variables (F841), `print` statements (T201), and commented-out code (ERA001). - { cmd = "ruff --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." }, + { cmd = "ruff format" }, + { cmd = "ruff check --fix --ignore=ERA --ignore=F401 --ignore=F841 --ignore=T20 --ignore=ERA001 ." }, { cmd = "pyproject-fmt --keep-full-version pyproject.toml" }, ] lint = [ - { cmd = "ruff ." }, + { cmd = "ruff check ." }, { cmd = "black --check ." }, { cmd = "validate-pyproject pyproject.toml" }, { cmd = "mypy" },