From a4fdfc241472987d6256173b1b18d4cc36cbcde4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 6 Jan 2026 00:42:23 +0100 Subject: [PATCH] chore: fix redaction lint --- src/config/zod-schema.ts | 4 +++- src/logging/redact.ts | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/config/zod-schema.ts b/src/config/zod-schema.ts index f7b671c79..bc347f8d0 100644 --- a/src/config/zod-schema.ts +++ b/src/config/zod-schema.ts @@ -330,7 +330,9 @@ export const ClawdbotSchema = z.object({ consoleStyle: z .union([z.literal("pretty"), z.literal("compact"), z.literal("json")]) .optional(), - redactSensitive: z.union([z.literal("off"), z.literal("tools")]).optional(), + redactSensitive: z + .union([z.literal("off"), z.literal("tools")]) + .optional(), redactPatterns: z.array(z.string()).optional(), }) .optional(), diff --git a/src/logging/redact.ts b/src/logging/redact.ts index be43177e4..065b4e334 100644 --- a/src/logging/redact.ts +++ b/src/logging/redact.ts @@ -1,5 +1,4 @@ import { loadConfig } from "../config/config.js"; -import type { LoggingConfig } from "../config/types.js"; export type RedactSensitiveMode = "off" | "tools"; @@ -88,10 +87,8 @@ function redactMatch(match: string, groups: string[]): string { function redactText(text: string, patterns: RegExp[]): string { let next = text; for (const pattern of patterns) { - next = next.replace( - pattern, - (...args: string[]) => - redactMatch(args[0], args.slice(1, args.length - 2)), + next = next.replace(pattern, (...args: string[]) => + redactMatch(args[0], args.slice(1, args.length - 2)), ); } return next;