-
Notifications
You must be signed in to change notification settings - Fork 3
for-file --json #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for-file --json #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| }) | ||
| .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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little refactoring for clarity
jackboberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected 👍
Added
--jsonfor thefor-filecommand