Skip to content

Commit 893d6ed

Browse files
committed
cli/fmt(fix[path-privacy]): collapse config paths in logs
why: fmt still leaked full config paths when reporting results, unlike other CLI commands. what: - cache a PrivatePath display string inside format_single_config - use the redacted form for not-found, already formatted, issue summary, and success logs - emit PrivatePath entries for fmt --all config listings
1 parent 6bea3c4 commit 893d6ed

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/vcspull/cli/fmt.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,17 @@ def format_single_config(
159159
bool
160160
True if formatting was successful, False otherwise
161161
"""
162+
# Precompute redacted path for CLI output.
163+
display_config_path = str(PrivatePath(config_file_path))
164+
162165
# Check if file exists
163166
if not config_file_path.exists():
164167
log.error(
165168
"%s✗%s Config file %s%s%s not found.",
166169
Fore.RED,
167170
Style.RESET_ALL,
168171
Fore.BLUE,
169-
config_file_path,
172+
display_config_path,
170173
Style.RESET_ALL,
171174
)
172175
return False
@@ -258,7 +261,7 @@ def format_single_config(
258261
Fore.GREEN,
259262
Style.RESET_ALL,
260263
Fore.BLUE,
261-
config_file_path,
264+
display_config_path,
262265
Style.RESET_ALL,
263266
)
264267
return True
@@ -273,7 +276,7 @@ def format_single_config(
273276
Style.RESET_ALL,
274277
"issue" if change_count == 1 else "issues",
275278
Fore.BLUE,
276-
config_file_path,
279+
display_config_path,
277280
Style.RESET_ALL,
278281
)
279282

@@ -362,7 +365,7 @@ def format_single_config(
362365
Fore.GREEN,
363366
Style.RESET_ALL,
364367
Fore.BLUE,
365-
config_file_path,
368+
display_config_path,
366369
Style.RESET_ALL,
367370
)
368371
except Exception:
@@ -438,12 +441,13 @@ def format_config_file(
438441
)
439442

440443
for config_file in config_files:
444+
display_config_file = str(PrivatePath(config_file))
441445
log.info(
442446
" %s•%s %s%s%s",
443447
Fore.BLUE,
444448
Style.RESET_ALL,
445449
Fore.CYAN,
446-
config_file,
450+
display_config_file,
447451
Style.RESET_ALL,
448452
)
449453

0 commit comments

Comments
 (0)