fix: parse commands with CRLF line endings - #108
Draft
thc1006 wants to merge 1 commit into
Draft
Conversation
getCommandArgs and getLineArgs split the body on \n without stripping the \r, so a CRLF comment left a trailing carriage return on every line but the last. Commands other than the last then failed their label or milestone lookup. Normalize \r\n and a lone \r to \n before splitting. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
thc1006
marked this pull request as draft
August 27, 2026 10:00
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.
Description
getCommandArgsandgetLineArgssplit the comment body on\nbut never strip the\r, so with a CRLF comment every line except the last keeps a trailing carriage return./kind enhancement\ris then filtered out becauseenhancement\ris not an allowed label,/milestone ...\rmisses the milestone by name, and only the final line, which has no\r, works.That is exactly #81:
/kind,/milestone, and/areaonly took effect on whichever command was on the last line, and reordering changed which one worked. GitHub delivers comment bodies with CRLF, so this hits any comment with more than one command.This normalizes
\r\nand a lone\rto\nbefore splitting, through a smallsplitLineshelper used by both functions.Fixes #81
Testing
npm run allpasses (build, lint, pack, test)/kindand/areareturns each command's args without a trailing carriage returngetLineArgsreturns a milestone title with no trailing carriage returnChecklist:
npm run allto lint and build my code