Skip to content

Commit c6952bc

Browse files
antiguruclaude
andcommitted
Select RUF100 and drop the suppressions that suppress nothing
Of 38 `noqa` directives, 29 had no effect. They were invisible because the rule that reports them was not selected, and they predate the ruff upgrade: version 0.0.292 reports the same 29. Most are star imports annotated `F401 F403`. A star import triggers F403 and never F401, so only the F403 half ever did anything, and those directives are narrowed to it. Three name rules from families this repository does not select, `SLF001`, `E731` and `BLE001`, are removed along with one blanket directive on an import that is used. The eight that remain sit on genuine re-exports in `mzexplore/__init__.py`, where F401 does fire. Selecting RUF100 keeps the set honest, since a directive that stops applying now fails the lint rather than accumulating. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c14bac6 commit c6952bc

13 files changed

Lines changed: 30 additions & 29 deletions

File tree

misc/python/materialize/cli/mz_workload_anonymize_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def cross_schema_cdc_workload() -> dict[str, Any]:
465465
schema. The child key is built in pass 1 while processing the source's
466466
schema (`aaa_src`), before the child's schema (`zzz_upstream`) is mapped, so
467467
a stale key leaks the original schema name unless rebuilt in pass 2."""
468-
empty = lambda: { # noqa: E731
468+
empty = lambda: {
469469
"tables": {},
470470
"views": {},
471471
"materialized_views": {},

misc/python/materialize/cli/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def main(argv: list[str]) -> None:
167167
# Convert to a list of the members: shtab renders them via str(), and
168168
# argparse still accepts the type-converted member, which converting to
169169
# name strings would not (the member never compares equal to its name).
170-
for action in parser._actions: # noqa: SLF001
170+
for action in parser._actions:
171171
if isinstance(action.choices, type) and issubclass(action.choices, enum.Enum):
172172
action.choices = list(action.choices)
173173

misc/python/materialize/scalability/executor/benchmark_executor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
from materialize.scalability.schema.schema import Schema
3131
from materialize.scalability.workload.workload import Workload, WorkloadWithContext
3232
from materialize.scalability.workload.workload_markers import ConnectionWorkload
33-
from materialize.scalability.workload.workloads.connection_workloads import * # noqa: F401 F403
34-
from materialize.scalability.workload.workloads.ddl_workloads import * # noqa: F401 F403
35-
from materialize.scalability.workload.workloads.dml_dql_workloads import * # noqa: F401 F403
36-
from materialize.scalability.workload.workloads.self_test_workloads import * # noqa: F401 F403
33+
from materialize.scalability.workload.workloads.connection_workloads import * # noqa: F403
34+
from materialize.scalability.workload.workloads.ddl_workloads import * # noqa: F403
35+
from materialize.scalability.workload.workloads.dml_dql_workloads import * # noqa: F403
36+
from materialize.scalability.workload.workloads.self_test_workloads import * # noqa: F403
3737

3838
# number of retries in addition to the first run
3939
MAX_RETRIES_ON_REGRESSION = 2

misc/python/materialize/zippy/scenarios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from materialize.zippy.blob_store_actions import BlobStoreRestart, BlobStoreStart
1919
from materialize.zippy.crdb_actions import CockroachRestart, CockroachStart
2020
from materialize.zippy.debezium_actions import CreateDebeziumSource, DebeziumStart
21-
from materialize.zippy.framework import ActionOrFactory # noqa
21+
from materialize.zippy.framework import ActionOrFactory
2222
from materialize.zippy.kafka_actions import (
2323
CreateTopicParameterized,
2424
Ingest,

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ select = [
2727
"I",
2828
"UP", # e.g. PEP585 built-in generic type annotations
2929
"E711", # comparisons to none
30+
"RUF100", # `noqa` that suppresses nothing, including for unselected rules
3031
]
3132

3233
[tool.ruff.lint.isort]

test/cloudtest/test_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
from materialize import buildkite
1616
from materialize.checks.actions import Action, Initialize, Manipulate, Validate
17-
from materialize.checks.all_checks import * # noqa: F401 F403
17+
from materialize.checks.all_checks import * # noqa: F403
1818
from materialize.checks.all_checks.alter_connection import (
1919
AlterConnectionHost,
2020
AlterConnectionToNonSsh,

test/data-ingest/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
KafkaExecutor,
2222
MySqlExecutor,
2323
)
24-
from materialize.data_ingest.workload import * # noqa: F401 F403
24+
from materialize.data_ingest.workload import * # noqa: F403
2525
from materialize.data_ingest.workload import WORKLOADS, execute_workload
2626
from materialize.mzcompose import get_default_system_parameters
2727
from materialize.mzcompose.composition import Composition, WorkflowArgumentParser

test/feature-benchmark/mzcompose.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@
7272
from materialize.feature_benchmark.executor import Docker
7373
from materialize.feature_benchmark.filter import Filter, FilterFirst, NoFilter
7474
from materialize.feature_benchmark.measurement import MeasurementType
75-
from materialize.feature_benchmark.scenarios.benchmark_main import * # noqa: F401 F403
75+
from materialize.feature_benchmark.scenarios.benchmark_main import * # noqa: F403
7676
from materialize.feature_benchmark.scenarios.benchmark_main import (
7777
Scenario,
7878
)
79-
from materialize.feature_benchmark.scenarios.concurrency import * # noqa: F401 F403
80-
from materialize.feature_benchmark.scenarios.customer import * # noqa: F401 F403
81-
from materialize.feature_benchmark.scenarios.optbench import * # noqa: F401 F403
82-
from materialize.feature_benchmark.scenarios.scale import * # noqa: F401 F403
83-
from materialize.feature_benchmark.scenarios.skew import * # noqa: F401 F403
84-
from materialize.feature_benchmark.scenarios.subscribe import * # noqa: F401 F403
85-
from materialize.feature_benchmark.scenarios.temporal import * # noqa: F401 F403
79+
from materialize.feature_benchmark.scenarios.concurrency import * # noqa: F403
80+
from materialize.feature_benchmark.scenarios.customer import * # noqa: F403
81+
from materialize.feature_benchmark.scenarios.optbench import * # noqa: F403
82+
from materialize.feature_benchmark.scenarios.scale import * # noqa: F403
83+
from materialize.feature_benchmark.scenarios.skew import * # noqa: F403
84+
from materialize.feature_benchmark.scenarios.subscribe import * # noqa: F403
85+
from materialize.feature_benchmark.scenarios.temporal import * # noqa: F403
8686
from materialize.feature_benchmark.termination import (
8787
NormalDistributionOverlap,
8888
ProbForMin,

test/mcp/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ def run(cur: Cursor, sql: str) -> str:
10231023
"""Run `sql`; return ``"ok:<nrows>"`` or the error message string."""
10241024
try:
10251025
cur.execute(sql.encode())
1026-
except Exception as e: # noqa: BLE001 — the message is the assertion
1026+
except Exception as e:
10271027
return str(e)
10281028
if cur.description is None:
10291029
return "ok:0"

test/parallel-benchmark/mzcompose.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
SQLiteStore,
6161
State,
6262
)
63-
from materialize.parallel_benchmark.scenarios import * # noqa: F401 F403
63+
from materialize.parallel_benchmark.scenarios import * # noqa: F403
6464
from materialize.test_analytics.config.test_analytics_db_config import (
6565
create_test_analytics_config,
6666
)

0 commit comments

Comments
 (0)