chore: improve code quality with Gourmand AI standards#66
Open
jfenal wants to merge 6 commits into
Open
Conversation
Ignore Gourmand AI cache directory to keep repository clean. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add linting configuration (pyproject.toml, .pre-commit-config.yaml) - Fix 17 generic variable names to be descriptive - Extract magic numbers to constants (DEFAULT_PORT, ALPHABET_SIZE) - Remove 3 verbose/redundant comments - Fix redundant error handling (empty exception handlers) - Remove silent fallbacks (generic except Exception patterns) - Inline single-use helper function (_parse_enabled_tools) - Extract duplicate range construction to _build_range() helper - Remove .gourmand-cache from .gitignore Reduced violations from 31 to 4 (87% improvement). Remaining violations are copy_paste_detection in tool setup code. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Document why remaining copy_paste_detection violations are acceptable: - MCP tool functions necessarily share common structure - Batch operation error handling follows standard pattern - Further extraction would create over-abstraction These patterns are intentional and follow MCP best practices. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Summary of code quality improvements: - 87% violation reduction (31 → 4) - Fixed 27 violations across 7 categories - 4 remaining violations documented as justified exceptions - All critical issues resolved Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Created _setup_sheets_api_call() helper to DRY up service + range setup - Used in get_sheet_data(), get_sheet_formulas(), update_cells() - Inlined _build_range() into _setup_sheets_api_call() (single use) - Removed GOURMAND_REVIEW.md (summary litter - info in commits) - Updated exceptions to document only batch operation pattern Reduced violations: 4 → 1 (75% improvement) Remaining: batch operation error handling pattern (justified) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Prevent worktree contents from being tracked in git. Co-Authored-By: Claude Sonnet 4.5 <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.
Summary
Improves code quality and maintainability by applying Gourmand AI code quality standards and refactoring common patterns.
Changes
.gourmand-cache/and configurationgourmand-exceptions.tomlexplaining justified exceptions.worktrees/to gitignore for better development workflowBenefits
Test Plan
🤖 Created with assistance from Claude Code