Skip to content

Commit 1099a06

Browse files
committed
Several fixes to get the pytest working, and updates to ruff and shellcheck.
1 parent 786e081 commit 1099a06

4 files changed

Lines changed: 22 additions & 13 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
files: \.(yaml|yml)$
1818
- repo: https://github.com/astral-sh/ruff-pre-commit
1919
# Ruff version.
20-
rev: v0.11.10
20+
rev: v0.15.12
2121
hooks:
2222
# Run the linter.
2323
- id: ruff-check
@@ -44,14 +44,14 @@ repos:
4444
entry: mypy
4545
args: [--strict, --show-error-codes, --no-warn-unused-ignores]
4646
- repo: https://github.com/koalaman/shellcheck-precommit.git
47-
rev: v0.10.0
47+
rev: v0.11.0
4848
hooks:
4949
- id: shellcheck
5050
#args: [--format,json]
5151
stages: [manual]
5252
- repo: https://github.com/astral-sh/ruff-pre-commit
5353
# Ruff version.
54-
rev: v0.11.10
54+
rev: v0.15.12
5555
hooks:
5656
# Run the formatter.
5757
- id: ruff-format

treecript/aggregator.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,11 @@ def draw_tree(
100100
if group_by_process_name is not None:
101101
node_color = list(
102102
map(
103-
lambda command: GROUPED_BY_COLOR
104-
if command.startswith(group_by_process_name)
105-
else OTHER_COLOR,
103+
lambda command: (
104+
GROUPED_BY_COLOR
105+
if command.startswith(group_by_process_name)
106+
else OTHER_COLOR
107+
),
106108
pids["command"],
107109
)
108110
)
@@ -169,9 +171,11 @@ def draw_spiral(
169171
if group_by_process_name is not None:
170172
node_color = list(
171173
map(
172-
lambda command: GROUPED_BY_COLOR
173-
if command.startswith(group_by_process_name)
174-
else OTHER_COLOR,
174+
lambda command: (
175+
GROUPED_BY_COLOR
176+
if command.startswith(group_by_process_name)
177+
else OTHER_COLOR
178+
),
175179
pids["command"],
176180
)
177181
)

treecript/parser.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ def metrics_parser(
169169
lambda row: str(row.create_time) + "_" + str(row.PID), axis=1
170170
)
171171
pids["parent"] = pids.apply(
172-
lambda row: str(row.ppid_create_time) + "_" + str(row.PPID)
173-
if not pd.isna(row.PPID)
174-
else pd.NA,
172+
lambda row: (
173+
str(row.ppid_create_time) + "_" + str(row.PPID)
174+
if not pd.isna(row.PPID)
175+
else pd.NA
176+
),
175177
axis=1,
176178
)
177179

treecript/tdp_finder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@
3636
Union,
3737
)
3838

39+
from .common import (
40+
CPUInfo,
41+
)
42+
3943
from .common import (
4044
CPU_DETAILS_FILENAME,
41-
CPUInfo,
4245
parse_cpuinfo,
4346
)
4447

0 commit comments

Comments
 (0)