Repository navigation
Start a new word at "Is" or "As" after an acronym [patch] - #157
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
The plural-acronym rule from #99 read the "s" of "Is" or "As" as a plural suffix whenever a capital followed it, so "UserIDIsValid" fused into "user_idis_valid". An "I" or "A" plus "s" followed by a capital now starts its own word; an "s" that ends the word ("APIs", "getIDs") is still a plural. PascalCase output no longer lowers "Is"/"As" after a one-letter word when a capitalised word follows, so "IfXIsNull" stays unchanged. Fixes #104 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW6ap2X1hPcsPueGLQX
|
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.



Fixes #104
What changed
The plural-acronym rule from #99 (#102) treated the
sofIs/Asas a plural suffix whenever a capital followed it, soUserIDIsValidread as the plural ofIDIand fused intouser_idis_valid.IsWordBoundary: anIorAthat ends an acronym run, followed directly bysand then a capital, now starts its own word (IsIsOrAsBeforeNextWord). Ansthat ends the word (APIs,getIDs,GUIDs_2) or precedes a non-letter is still a plural, and other plurals before a capital (PDFsAndDOCs,URLsList) are unchanged.LowercaseOneLetterWordsAfterOneLetterWords: PascalCase/camelCase output used to lowerIs/Asafter a capital one-letter word soXIswouldn't read back as a plural. That's still done at the end of the identifier (check_x_is→CheckXis, unchanged), but not when a capitalised word follows, since that now reads back correctly. SoIfXIsNullstays unchanged, andcheck_x_is_null→CheckXIsNull→check_x_is_null.Trade-off to confirm
The triage asked for the
APIsListcase to be settled before merging. With this rule, a plural acronym ending inI/Afollowed by another word can't be told apart fromIs, soAPIsListnow givesap_is_list(it gaveapis_listbefore). The new testAPluralAcronymEndingInIOrAFollowedByAWordShouldSplitAsIspins this so it's a deliberate, reviewable choice. If you'd rather keepAPIsListwhole, the alternative is to revert #102's capital-follows case, which brings back the #99 behaviour forPDFsAndDOCs.Tests
IsOrAsAfterAnAcronymShouldStartItsOwnWordcovers every converter for the rows in the issue table (UserIDIsValid,URLIsSet,ConvertIDAsString,getAPIAsJson,DOMIsReady,PlayerAIsDead). Also new:IsAfterASingleCapitalShouldKeepAPascalCaseIdentifierUnchangedand theAPIsListpin.Generated by Claude Code