Skip to content

Commit 5854cd3

Browse files
kwschulzclaude
andauthored
feat: pretty-print HAR files by default (#7)
HAR files are now written with indent=2 for better readability in text editors. Since output is typically compressed, the file size impact is negligible. Co-authored-by: Ken Schulz <kwschulz@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent afedc87 commit 5854cd3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "har-capture"
7-
version = "0.2.2"
7+
version = "0.2.3"
88
description = "HAR capture and PII sanitization library for network traffic analysis"
99
readme = "README.md"
1010
license = "MIT"

src/har_capture/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
from __future__ import annotations
2626

27-
__version__ = "0.2.2"
27+
__version__ = "0.2.3"
2828

2929
# Re-export public API for convenience
3030
from har_capture.sanitization import (

src/har_capture/capture/browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def filter_and_compress_har(
167167
har["log"]["entries"] = filtered_entries
168168
filtered_count = len(filtered_entries)
169169

170-
# Write filtered HAR
170+
# Write filtered HAR (pretty-printed for readability)
171171
with open(har_path, "w", encoding="utf-8") as f:
172-
json.dump(har, f, separators=(",", ":")) # Compact JSON
172+
json.dump(har, f, indent=2)
173173

174174
filtered_size = har_path.stat().st_size
175175

0 commit comments

Comments
 (0)