feat(cli): add --report flag for structured JSON export reports - #66
Conversation
Single export commands (colors, icons, images, typography) now support `--report <path>` to write a structured JSON report with timing, stats, warnings, and asset manifest — replacing fragile regex parsing in exfig-action. - ExportReport struct with version, timing, stats, warnings, manifest - WarningCollector actor to capture warnings during export - ManifestTracker with file action detection (created/modified/unchanged/deleted) - FNV-1a content checksums via existing FNV1aHasher - Report written even on export failure (success: false) - Report write failure is non-fatal (logs warning, doesn't fail export) - 32 unit + integration tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @alexey1312, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the command-line interface (CLI) by introducing a robust reporting mechanism for single asset export commands. It provides users with structured JSON reports containing comprehensive details about each export, including execution metrics, warnings, and a detailed manifest of all affected files. This new capability streamlines integration with automated workflows and external tools by offering a reliable, machine-readable output of export results and file changes. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request introduces a new --report flag to single export commands, enabling structured JSON reports for better integration with CI/CD pipelines and tools like exfig-action. The changes include new structs for ExportReport, AssetManifest, ManifestEntry, and FileAction, along with WarningCollector and ManifestTracker to gather warnings and track file operations. The implementation correctly integrates these components into the export workflow, ensuring reports are generated even on failure and that file actions (created, modified, unchanged, deleted) and checksums are accurately recorded. Unit and integration tests cover the new functionality thoroughly. The changes align well with the project's existing patterns for batch reporting and error handling.
Fix TOCTOU race in capturePreState, extract duplicated determineAction logic, add diagnostics for nil checksums and decode failures, create parent directories before report write, improve error descriptions for non-LocalizedError types, and add ReportStats factory methods. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
--report <path>option to all single export commands (colors,icons,images,typography) for structured JSON reportsExportReportstruct with version, timing, stats, warnings, and asset manifest — replaces fragile regex parsing inexfig-actionWarningCollectoractor captures warnings during export;ManifestTrackertracks file writes with FNV-1a checksums and action detection (created/modified/unchanged/deleted)success: false); report write failure is non-fatalTest plan
swift build)swiftlint --strict)swiftformat --lint)exfig colors -i exfig.pkl --report results.jsonproduces valid JSON🤖 Generated with Claude Code