Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds JSON output support to the for-file command by introducing a --json flag that formats ownership information as structured JSON instead of plain text.
- Added
--jsonflag to thefor-filecommand in CLI - Implemented JSON serialization for file ownership results
- Updated existing methods to handle both text and JSON output formats
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/cli.rs | Added --json flag parameter to ForFile command |
| src/runner/api.rs | Updated for_file function signature to accept json parameter |
| src/runner.rs | Added JSON serialization logic and ForFileResult struct |
| src/ownership.rs | Modified Display formatting for FileOwner to handle empty sources |
| src/runner/types.rs | Added Serialize derive to Error enum and moved has_errors method |
| tests/valid_project_test.rs | Added test cases for JSON output with valid projects |
| tests/invalid_project_test.rs | Added test cases for JSON output with invalid projects |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
53e5001 to
0c7aa5b
Compare
0c7aa5b to
1c71490
Compare
a5cd50d to
b90ed08
Compare
perryqh
commented
Aug 24, 2025
| }) | ||
| .collect::<Result<_, IoError>>() | ||
| .map_err(|e| Box::new(e) as Box<dyn Error>)?; | ||
| let codeowners_entries = parse_codeowners_entries(self.codeowners_file_path.to_string_lossy().into_owned()); |
Contributor
Author
There was a problem hiding this comment.
A little refactoring for clarity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
--jsonfor thefor-filecommand