fix(tools/render_jsonl): apply ruff format
Earlier commit fixed ruff lint but missed the formatter check. This applies `ruff format` — adds standard PEP8 blank lines between functions, splits one inline list. No behavior change. Verified: both `ruff format --check` and `ruff check` pass cleanly. Tool still renders correctly.
This commit is contained in:
@@ -11,10 +11,12 @@ Usage:
|
|||||||
|
|
||||||
Stdlib only. Python 3.9+. Read-only on the input.
|
Stdlib only. Python 3.9+. Read-only on the input.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def extract_text(content):
|
def extract_text(content):
|
||||||
if isinstance(content, str):
|
if isinstance(content, str):
|
||||||
return content.strip()
|
return content.strip()
|
||||||
@@ -28,6 +30,7 @@ def extract_text(content):
|
|||||||
return "\n".join(parts)
|
return "\n".join(parts)
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print(__doc__)
|
print(__doc__)
|
||||||
@@ -62,7 +65,8 @@ def main():
|
|||||||
f"# Claude Code transcript: {src}",
|
f"# Claude Code transcript: {src}",
|
||||||
f"# Total turns: {len(turns)}",
|
f"# Total turns: {len(turns)}",
|
||||||
f"# Date range : {min(stamps) if stamps else 'n/a'} -> {max(stamps) if stamps else 'n/a'}",
|
f"# Date range : {min(stamps) if stamps else 'n/a'} -> {max(stamps) if stamps else 'n/a'}",
|
||||||
"#" + "-" * 70, "",
|
"#" + "-" * 70,
|
||||||
|
"",
|
||||||
]
|
]
|
||||||
out.write("\n".join(header))
|
out.write("\n".join(header))
|
||||||
for ts, role, text in turns:
|
for ts, role, text in turns:
|
||||||
@@ -71,5 +75,6 @@ def main():
|
|||||||
out.close()
|
out.close()
|
||||||
print(f"Wrote {len(turns)} turns to {sys.argv[2]}")
|
print(f"Wrote {len(turns)} turns to {sys.argv[2]}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user