-
Notifications
You must be signed in to change notification settings - Fork 0
Improve and simplify insertSpaceAroundParameterAssignment & specificKeywordCaseOverride specificTypeCaseOverride #2
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds two new formatting options (specificKeywordCaseOverride and specificTypeCaseOverride) that allow users to specify exact casing for individual keywords and types, and refactors the insertSpaceAroundParameterAssignment logic to use AST walking instead of token-based iteration.
Key Changes
- Added
specificKeywordCaseOverrideandspecificTypeCaseOverrideoptions to allow granular control over keyword/type casing with custom strings - Refactored
insertSpaceAroundParameterAssignmentformatting from a token-based approach to an AST-based approach usingFunctionParameterExpression - Reorganized test suite structure for better organization and maintainability
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/formatters/KeywordCaseFormatter.ts | Adds logic to check for and apply specific keyword/type case overrides before applying general case rules |
| src/formatters/KeywordCaseFormatter.spec.ts | Adds comprehensive tests for the new specific case override features including edge cases |
| src/formatters/InteriorWhitespaceFormatter.ts | Refactors parameter assignment spacing logic into a dedicated AST-based method and adds FunctionParameterExpression import |
| src/formatters/InteriorWhitespaceFormatter.spec.ts | Reorganizes tests into nested describe blocks and moves parameter assignment tests into a dedicated section |
| src/FormattingOptions.ts | Adds TypeScript interface definitions for the two new formatting options with JSDoc comments |
| bsfmt.schema.json | Adds JSON schema definitions for the new formatting options with examples |
| README.md | Updates documentation to include the new options in the table and adds detailed sections explaining their usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No more brittle logic by tying into FunctionParameterExpression which also handles anonymous functions properly.
2cfa7cb to
7a18082
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
33d5df2 to
5245606
Compare
No description provided.