summaryrefslogtreecommitdiff
path: root/cmd/perc
AgeCommit message (Collapse)Author
2026-03-23Update to gt binary name and refactor code quality improvementsPaul Buetow
- Renamed binary from perc to gt throughout the project - Refactored calculator.Parse to use registration pattern for parsing strategies - Refactored rpn.handleOperator to use operator registry instead of switch statements - Added panic recovery to REPL executor for better resilience - Improved code organization with OperatorRegistry and strategy registration All changes maintain full test compatibility and pass race detection tests.
2026-03-23Code quality audit fixes from comprehensive auditPaul Buetow
- Error wrapping improvements across multiple files - Thread-safe singleton initialization using sync.Once - Proper error handling for file close operations - Removed speculative complexity in history management - Fixed operator interface design Audit report: COMPLETE_AUDIT_REPORT.md
2026-03-23Fix error handling in cmd/perc/main.goPaul Buetow
2026-03-20refactor: update Operations to use VariableStore interfacePaul Buetow
- Changed Operations.vars from *Variables to VariableStore interface - Changed NewOperations to accept VariableStore interface - Changed RPN.vars from *Variables to VariableStore interface - Changed NewRPN to accept VariableStore interface - Removed type assertions in main.go and repl.go - Added FormatVariables to VariableStore interface - All tests pass, build successful
2026-03-20cmd/perc/main.go: try RPN parsing before percentage calculation in command modePaul Buetow
- Bare expressions like '1 2 +' now work without 'calc' prefix - Assignment format 'name value =' requires 'calc' subcommand prefix
2026-03-20cmd/perc: add unit tests with 86% coveragePaul Buetow
- 21 test functions covering version, calc, rpn subcommands - Tests for assignment, percentage calculations, error handling, repl mode - Coverage: runCommand 91.7%, runRPN 100%, printUsage 100%
2026-03-20cmd/perc: add unit tests with 76% coveragePaul Buetow
- Test version, calc, rpn subcommands - Test percentage calculations - Test error handling (missing expressions, division by zero, unknown tokens) - Test assignment with variables - Test printUsage function - Achieve 76% coverage of cmd/perc package
2026-03-20internal/rpn/cmd/perc: add calc/rpn subcommands and fix assignment handlingPaul Buetow
- Add calc and rpn subcommands to main.go - Support RPN expression evaluation via perc calc/rpn <expr> - Support variable assignment format: 'name value = expr...' - Fix assignment parsing to handle 'name value = expression' format - All tests pass, go vet passes
2026-03-16bump version to v0.2.0v0.2.0Paul Buetow
- Add REPL mode with vi keybindings - Add built-in commands (help, clear, quit/exit) - Add mage repl target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2025-11-25Initial commit: perc v0.0.0 - percentage calculatorv0.0.0Paul Buetow
Amp-Thread-ID: https://ampcode.com/threads/T-e4f4a959-8cc6-4ac0-b6fb-2779867e8b2a Co-authored-by: Amp <amp@ampcode.com>