Conversation
Enhanced the CLI with comprehensive new features: **File Input Support:** - All commands now accept both file paths and string literals - Smart detection with proper UTF-8 encoding handling - Graceful error handling for encoding issues and permissions **New Output Formats:** - `json` command: Output comparison results as JSON with --pretty flag - `stats` command: Display comprehensive statistics with --quiet flag **Enhanced Existing Commands:** - `text`: Added stats panel at bottom and --quiet flag support - `markdown`: Added --quiet flag for raw markdown output - `simple_text`: Added file input support and exit codes **Exit Code Strategy (ALL commands):** - 0: Success with changes detected - 1: Success with no changes (source == test) - 2: Error (file not found, encoding issues, etc.) **Helper Functions:** - `_read_input()`: Smart file/string reader with error handling - `_format_stats_panel()`: Format statistics as Rich panel - `_set_exit_code()`: Consistent exit code handling **Testing:** - Added 35 comprehensive tests in tests/test_cli.py - Tests cover all commands, file handling, exit codes, and edge cases - All 93 tests pass successfully **Documentation:** - Updated CLI docstring with all new features and examples - Added file input examples, exit code documentation - Documented all flags and options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Added proper type annotations to all test functions and fixtures in test_cli.py to satisfy mypy type checking: - Added return type annotations (-> None) to all test methods - Added parameter type annotations (CliRunner, Path, dict[str, Path]) - Added typing.Any import for future extensibility All 35 CLI tests still pass with full type safety. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Fixes #61