Conversation
…e; docs need to be checked, they were made by LLM;
There was a problem hiding this comment.
Pull Request Overview
This PR completely refactors the menu functionality by extracting it into a standalone Menu class, introducing type-safe enums for meal and order types, and adding comprehensive error handling. The refactoring improves code organization, extensibility, and user experience with better filtering options and automatic validations.
Key changes:
- Extracted menu functionality into a new
Menuclass that maintains a reference to the parentStravaCZclient - Added
MealTypeandOrderTypeenums for type-safe meal categorization and order status tracking - Introduced specialized exceptions (
InvalidMealTypeError,DuplicateMealError,InsufficientBalanceError) with automatic duplicate detection, meal type validation, and balance checking
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_strava_cz.py | Comprehensive test suite added/updated for new Menu class features including filtering, ordering, error handling, and iteration support |
| src/strava_cz/main.py | Complete refactoring with new Menu class, enums (MealType, OrderType), exception classes, and advanced error handling with rollback support |
| src/strava_cz/init.py | Updated exports to include new Menu class, enums, and exception classes; version bumped to 0.2.0 |
| pyproject.toml | Version updated to 0.2.0 and repository URLs corrected to new GitHub location |
| notes/repo_rules.md | Added guidelines for LLM usage in the project with emphasis on manual review |
| examples/example.py | Comprehensive examples demonstrating new Menu API with filtering, error handling, and balance tracking |
| README.md | Extensive documentation updates covering new Menu class API, enums, exceptions, filtering system, and migration notes |
| MIGRATION_GUIDE.md | New detailed migration guide for users upgrading from 0.1.x to 0.2.0 with examples and architecture explanation |
| CHANGELOG.md | Detailed changelog documenting all additions, changes, removals, and fixes in version 0.2.0 |
| .flake8 | Added flake8 configuration for code style enforcement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # These tests were made mostly by an LLM, | ||
| # but they have been reviewed by me. | ||
| # - - - - - - - - - - - - - | ||
| # Tyto testy byly vytvořeny převážně pomociLLM, |
There was a problem hiding this comment.
Corrected spacing: 'pomociLLM' should be 'pomoci LLM' (missing space between 'pomoci' and 'LLM').
| # Tyto testy byly vytvořeny převážně pomociLLM, | |
| # Tyto testy byly vytvořeny převážně pomoci LLM, |
| if "konto" in response_data: | ||
| try: | ||
| self.strava.user.balance = float(response_data["konto"]) | ||
| except (ValueError, TypeError): |
There was a problem hiding this comment.
'except' clause does nothing but pass and there is no explanatory comment.
kompletne prekopane fungovani menu. nyni samostatny objekt. nove jednodussi pouzivani a filtrace.