style: apply ruff formatting to all backend files
Some checks failed
CI / lint-and-test (push) Failing after 38s

This commit is contained in:
2026-04-16 18:58:41 +02:00
parent b86539399b
commit 4713b43afe
14 changed files with 254 additions and 187 deletions

View File

@@ -75,10 +75,7 @@ def _target_types(targets: list) -> list:
types = []
for t in targets or []:
resolved = t.get("_resolved") or {}
t_type = (
resolved.get("type")
or t.get("type")
)
t_type = resolved.get("type") or t.get("type")
if t_type:
types.append(t_type)
return types
@@ -101,7 +98,9 @@ def _display_summary(operation: str, target_labels: list, actor_label: str, targ
return " | ".join(pieces)
def _render_summary(template: str, operation: str, actor: str, target: str, category: str, result: str, service: str) -> str:
def _render_summary(
template: str, operation: str, actor: str, target: str, category: str, result: str, service: str
) -> str:
try:
return template.format(
operation=operation or category or "Event",
@@ -177,13 +176,16 @@ def normalize_event(e):
else:
display_actor_value = actor_label
dedupe_key = _make_dedupe_key(e, {
"id": e.get("id"),
"timestamp": e.get("activityDateTime"),
"service": e.get("category"),
"operation": e.get("activityDisplayName"),
"target_displays": target_labels,
})
dedupe_key = _make_dedupe_key(
e,
{
"id": e.get("id"),
"timestamp": e.get("activityDateTime"),
"service": e.get("category"),
"operation": e.get("activityDisplayName"),
"target_displays": target_labels,
},
)
return {
"id": e.get("id"),