Skip to content

Commit 5be2a1f

Browse files
committed
ci: Add B023 to .flake8 ignores
1 parent f512b4d commit 5be2a1f

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

.flake8

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ extend-ignore =
66
# Formatting style for `black`
77
E203 # Whitespace before ':'
88
W503 # Line break occurred before a binary operator
9+
B023 # Function definition does not bind loop variable

genetic_algorithm/basic_string.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ def select(parent_1: tuple[str, float]) -> list[str]:
129129
child_n = int(parent_1[1] * 100) + 1
130130
child_n = 10 if child_n >= 10 else child_n
131131
for _ in range(child_n):
132-
parent_2 = population_score[ # noqa: B023
133-
random.randint(0, N_SELECTED)
134-
][0]
132+
parent_2 = population_score[random.randint(0, N_SELECTED)][0]
135133

136134
child_1, child_2 = crossover(parent_1[0], parent_2)
137135
# Append new string to the population list.

0 commit comments

Comments
 (0)