-
Notifications
You must be signed in to change notification settings - Fork 0
Fix import path and add Zod validation for FederalTaxInput #239
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
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Codacy's Analysis Summary0 new issue (≤ 0 issue) Review Pull Request in Codacy →
|
- Fix incorrect import path in apps/forecaster/backend/src/tax/federal.ts (4→5 levels up) - Remove extra closing braces in city-tax.ts and pdf-filler.ts causing build errors - Update tsconfig to allow cross-project imports from Cyrano - Install missing @types/node dependency Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
- Add FederalTaxInputSchema in tax-formulas.ts for runtime validation - Update http-bridge.ts to validate forecast_input with the new schema - Add validation for both /api/forecast/tax and /api/forecast/tax/pdf endpoints - Fix remaining syntax errors (extra closing braces) in Cyrano source files - Install Cyrano dependencies to support zod import Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
- Simplify year validation using z.number().int().min(2018).max(2025) for better maintainability - Improve ForecastHttpRequestSchema documentation to explain validation approach - Maintain two-stage validation to allow flexible input while ensuring type safety Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
|
@copilot codacy identified the following new issue: HIGH The numeric literal '0.10' will have at different value at runtime. Cyrano/src/modules/forecast/formulas/ |
The file Cyrano/src/modules/forecast/formulas/tax-formulas.js was a compiled JavaScript file that was accidentally committed in the previous changes. This build artifact should not be in version control as it's generated from the TypeScript source file. This resolves the Codacy error about numeric literal '0.10' by removing the generated file that triggered the warning. Co-authored-by: MightyPrytanis <219587333+MightyPrytanis@users.noreply.github.com>
... Fixed in commit 79477b2. The file |
|
Changes approved! |
## Fix 170+ Syntax Errors from BraceCase Issue The issue is that random closing braces `}`, brackets `]`, and parentheses `)` were added at the end of many files, causing TypeScript compilation to fail with 1400+ errors across 170+ files. **Plan:** - [x] Explore repository and identify the scope of the problem - [x] Confirm that the issue is extra closing delimiters at the end of files - [ ] Create automated fix script to remove trailing garbage delimiters - [ ] Run the fix script on all affected files in Cyrano - [ ] Verify the build succeeds after fixes - [ ] Check and fix any remaining files in other parts of the codebase - [ ] Run tests to ensure no functionality was broken - [ ] Final code review and security check <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Fix 170+ Syntax Errors</issue_title> > <issue_description>“BraceCase” was intended to fix the unfortunately commonplace problem of missing closing brackets. However, it appears that @cursoragent’s “solution” was to create an agent that randomly added a bunch of “}” and “)” at the end of files–garbage that addressed the underlying problem accidentally, if at all. This issue has been run into in PR #239 and elsewhere. > > @copilot, this issue is to address the remaining “BraceCase” and other unbalanced and unnecessary (or missing) brackets, etc. throughout the codebase.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #241 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/MightyPrytanis/codebase/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
Summary
Successfully addressed all critical and major issues identified by CodeRabbit and Codacy code review tools.
Issues Resolved
✅ Critical Issues
Import Path Error - Fixed incorrect relative import in
apps/forecaster/backend/src/tax/federal.ts../../../../) to 5 levels up (../../../../../)/Cyrano/Syntax Errors - Removed extra closing braces causing build failures
apps/forecaster/backend/src/city/city-tax.tsapps/forecaster/backend/src/pdf/pdf-filler.tsTypeScript Configuration - Updated tsconfig to support cross-project imports
rootDirsetting in forecaster backend✅ Major Issues
FederalTaxInputSchemawith proper type constraintsyear(2018-2025),filingStatus,wages(non-negative)/api/forecast/taxand/api/forecast/tax/pdfendpoints✅ Code Quality Improvements
Verification
Build Status
Security
Commits
92011d3- Fix critical import path and syntax errors4234e46- Add Zod validation schema for FederalTaxInput628b2a5- Address code review suggestions💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.