Skip to content

Commit 6591d02

Browse files
committed
Make ruff complain less
1 parent b041e7c commit 6591d02

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

debug_toolbar/panels/profiling.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ def func_std_string(self): # match what old profile produced
8686
)
8787

8888
def subfuncs(self):
89-
i = 0
9089
h, s, v = self.hsv
9190
count = len(self.statobj.all_callees[self.func])
92-
for func, stats in self.statobj.all_callees[self.func].items():
93-
i += 1
94-
h1 = h + (i / count) / (self.depth + 1)
91+
for i, (func, stats) in enumerate(self.statobj.all_callees[self.func].items()):
92+
h1 = h + ((i + 1) / count) / (self.depth + 1)
9593
s1 = 0 if stats[3] == 0 else s * (stats[3] / self.stats[3])
9694
yield FunctionCall(
9795
self.statobj,

pyproject.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ packages = ["debug_toolbar"]
5151
path = "debug_toolbar/__init__.py"
5252

5353
[tool.ruff]
54+
fix = true
55+
show-fixes = true
56+
target-version = "py38"
57+
58+
[tool.ruff.lint]
5459
extend-select = [
5560
"ASYNC", # flake8-async
5661
"B", # flake8-bugbear
@@ -75,17 +80,14 @@ extend-ignore = [
7580
"E501", # Ignore line length violations
7681
"SIM108", # Use ternary operator instead of if-else-block
7782
]
78-
fix = true
79-
show-fixes = true
80-
target-version = "py38"
8183

82-
[tool.ruff.isort]
84+
[tool.ruff.lint.isort]
8385
combine-as-imports = true
8486

85-
[tool.ruff.mccabe]
87+
[tool.ruff.lint.mccabe]
8688
max-complexity = 16
8789

88-
[tool.ruff.per-file-ignores]
90+
[tool.ruff.lint.per-file-ignores]
8991
"*/migrat*/*" = [
9092
"N806", # Allow using PascalCase model names in migrations
9193
"N999", # Ignore the fact that migration files are invalid module names

0 commit comments

Comments
 (0)