Repository navigation
fix(generator): normalize error message consistency across generator surfaces - #273
Merged
dDevAhmed merged 1 commit intoOct 18, 2026
Conversation
…surfaces Align path, collision, and substitution failure messages to use consistent actionable wording: sentence case, ending with a period, no raw user input reflected verbatim. Changes: - validation.ts: add missing trailing period to 'not a directory' message so all destination error messages end consistently with '.' - template-registry.ts: remove raw templateId from the rejection message; wording is now 'The requested template is not supported. Supported templates: ...' — safer and still satisfies all test assertions that check for the 'Supported templates' substring - template-sources.ts: remove templateId from the unavailable-bundle message; wording is now 'The selected template is not available in this CLI version.' — clear, actionable, and free of reflected input Exit codes and error categories are unchanged. All test substring assertions continue to match.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
Aligns generator validation and generation error messages to use consistent, actionable wording: sentence case, ending with a period, and no raw user input reflected verbatim when sensitive.
What was implemented
Three targeted changes across the generator surface:
src/generator/validation.ts.Destination already exists and is not a directory: ${destination}Destination already exists and is not a directory: ${destination}.src/generator/template-registry.tstemplateIdfrom the rejection message to avoid reflecting unsafe input verbatimUnknown template '${templateId}'. Supported templates: ...The requested template is not supported. Supported templates: ...Supported templatessubstring continue to passsrc/generator/template-sources.tsTemplate '${templateId}' is registered but is not bundled in this CLI version yet.The selected template is not available in this CLI version.Acceptance criteria verified
Closes #140