feat: add excludeFromCommitMsg option for additionalQuestions #250
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.
feat: add
excludeFromCommitMsgoption for additionalQuestionsDescription
This PR introduces a new
excludeFromCommitMsgpredicate on each entry inadditionalQuestions. When defined, it allows users to conditionally omit certain answers from the generated commit message body based on the full set of answers provided.Motivation and Context
By default, all answers to
additionalQuestionsare appended to the commit body. However, in cases where an answer is used solely to trigger the display of another question—without itself being meaningful in the final commit—you may want to collect it during the prompt phase but omit it from the resulting commit message. TheexcludeFromCommitMsgcallback lets you conditionally exclude those fields at commit-generation time:Changes
API
Added optional excludeFromCommitMsg?: (answers) => boolean to each additionalQuestions entry.
Behavior
Tests
Added two new unit tests covering both inclusion and exclusion paths.
Docs
Updated README to document the excludeFromCommitMsg option and include a usage example.