Skip to content

Commit 8967c52

Browse files
[ruff] Activate use next(iter(x)) instead of list(x)[0] and fix issue
1 parent 180a16a commit 8967c52

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ ignore = [
160160
# ruff ignore
161161
"RUF005", # Consider `(x, *y)` instead of concatenation
162162
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
163-
"RUF015", # Prefer `next(iter(x))` over single element slice
164163
]
165164

166165
[tool.ruff.format]

testing/python/collect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ def test_bar(self):
12091209
classcol = pytester.collect_by_name(modcol, "TestClass")
12101210
assert isinstance(classcol, Class)
12111211
path, lineno, msg = classcol.reportinfo()
1212-
func = list(classcol.collect())[0]
1212+
func = next(iter(classcol.collect()))
12131213
assert isinstance(func, Function)
12141214
path, lineno, msg = func.reportinfo()
12151215

0 commit comments

Comments
 (0)