Skip to content

Commit fc8ec8f

Browse files
committed
chore: Enable the C408 lint in ruff
1 parent b34498c commit fc8ec8f

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎cuda_core/tests/test_program_cache.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _make_key(**overrides):
124124
unspecified defaults to a valid cubin-from-c++ compile over "a"."""
125125
from cuda.core.utils import make_program_cache_key
126126

127-
base = dict(code="a", code_type="c++", options=_opts(), target_type="cubin")
127+
base = {"code": "a", "code_type": "c++", "options": _opts(), "target_type": "cubin"}
128128
return make_program_cache_key(**{**base, **overrides})
129129

130130

‎cuda_core/tests/test_tensor_map.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,10 @@ class TestTensorMapHelpers:
810810
@pytest.mark.parametrize(
811811
("kwargs", "match"),
812812
[
813-
(dict(box_dim=5), "box_dim must be a tuple of ints"),
814-
(dict(box_dim=(1, "x", 3)), r"box_dim\[1\] must be an int"),
815-
(dict(box_dim=(32,), swizzle=2), "swizzle must be a TensorMapSwizzle"),
816-
(dict(box_dim=(32,), interleave=0), "interleave must be a TensorMapInterleave"),
813+
({"box_dim": 5}, "box_dim must be a tuple of ints"),
814+
({"box_dim": (1, "x", 3)}, r"box_dim\[1\] must be an int"),
815+
({"box_dim": (32,), "swizzle": 2}, "swizzle must be a TensorMapSwizzle"),
816+
({"box_dim": (32,), "interleave": 0}, "interleave must be a TensorMapInterleave"),
817817
],
818818
ids=["box_dim_non_iterable", "box_dim_non_int_element", "swizzle_wrong_type", "interleave_wrong_type"],
819819
)

‎cuda_python_test_helpers/cuda_python_test_helpers/cython_cache.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def test_identical_settings_produce_same_path(self, monkeypatch, tmp_path):
349349
def test_changed_directives_change_namespace(self, monkeypatch, tmp_path):
350350
"""Different ``compiler_directives`` map to different namespaces (#7532 workaround)."""
351351
self._set_env(monkeypatch, str(tmp_path))
352-
base = dict(embedsignature=True, freethreading_compatible=True)
352+
base = {"embedsignature": True, "freethreading_compatible": True}
353353
with_linetrace = dict(base, linetrace=True)
354354
p1 = self.build_hooks._cython_cache_path(self.package, compiler_directives=base)
355355
p2 = self.build_hooks._cython_cache_path(self.package, compiler_directives=with_linetrace)

‎ruff.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ ignore = [
6262
"S404", # allow subprocess imports
6363

6464
# style preferences
65-
"C408", # unnecessary dict/list/tuple call (dict() is fine)
6665
"E501", # line too long (formatter handles what it can; the rest is intentional)
6766
"E741", # ambiguous variable name (I, l, O)
6867
"B007", # unused loop control variable

0 commit comments

Comments
 (0)