Review all AI-authored code comments critically, with intent to remove them - #194
Merged
Conversation
Sweep the repository's comments against the standard that a comment survives only when it states a constraint or non-obvious fact the code cannot express. Removed are comments that narrate what the next line does, justify why a past change was correct, describe what the code used to be, or restate adjacent KDoc. The facts worth keeping already live where a reader looks for them: the midnight-UTC encoding of lastUpdateDate is in its KDoc, the String-versus-CharSequence asymmetry is on String.toIban, the PUBLICATION lazy mode is on Iban.pretty, the ISO 13616 maximum is on the test constant that carries it, and the two-arg Modulo97.calculateCheckDigits constraint is at the call site in Iban.compose. Kept: the private-constructor-versus-invoke resolution trap in IbanTest, the case-bit rationale behind the punctuation boundary cases, the sealed-hierarchy exhaustiveness `when` in RejectionTest, the typealias class-identity note in IbanAliasTest, and the build and workflow comments that state operational constraints. Three workflow comments were trimmed to their constraint, dropping the history clause. Comment-only change: no production behaviour, no public API and no test assertions were touched. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Sweeps every non-KDoc comment in the repository against the standard from #169: a comment survives only if it states a constraint or non-obvious fact the code itself cannot express. Everything that narrates the next line, justifies why a past change was correct, records what the code used to be, or restates adjacent KDoc is gone.
What was removed
CountryCodesTest.kt(the #168 traces the issue names) — the "unlike the array view it replaced" and "what anArray.asList()would have allowed" history narration, theindexOfcontract restatement, the ISO 13616 cap rationale (already the KDoc onLONGEST_IBAN_LENGTH_ISO_13616), the cross-check explanation, thelastUpdateDatemidnight-UTC block (already the KDoc onCountryCodes.lastUpdateDate, contract wording included) and the "getter re-parses on every call" note.IbanTest.kt(the #167 trace) — theparse-versus-invokeblock duplicated from the KDoc onIban.parse, theString-versus-CharSequenceasymmetry block duplicated from the KDoc onString.toIban, thePUBLICATIONlazy-mode block duplicated from the KDoc onIban.pretty, the "#137 used to parse" and "used to slip past the one-argcalculateCheckDigits" history, and seven comments restating the test name or the assertion below them.Modulo97Test.kt,RejectionTest.kt,IbanAliasTest.kt— data-table labels and rationale restating the test names, plus the "these used to be accepted" note whose fact is already onModulo97.transform.Modulo97.kt,Iban.kt— "Process the string of 9 digits at a time as integers" (thechunked(9)says it), the boundary-order narration invalidate, and "The elvis is what keeps this total.".github/workflows/gradle.yml— three comments trimmed to their constraint, dropping the "which is what renamed every check whenidwas introduced", "Nothing on push or pull request did either before" and "a green run used to report nothing but BUILD SUCCESSFUL" clauses.What was kept, and why
IbanTest.kt: the private-constructor-wins-over-invokeresolution trap, and the case-bit rationale that explains why@,[,`,{,/,:are the punctuation tested.RejectionTest.kt: the sealed-hierarchywhennote — without it the exhaustiveness guard reads as amapwaiting to be simplified away.IbanAliasTest.kt: the typealias generates no separate class, which is why identity and not value equality is asserted.Iban.kt: the ordering constraint on the invalid-character scan, the two-argModulo97.calculateCheckDigitsnote at thecomposecall site, the all-upper-case early return, and theofValidated-not-Iban(...)traps.scripts/: operational constraints (whyconsumption-probeis a build of its own, whymavenLocal()is exclusive, whyannotate_only, why the emulator lookup is lazy) rather than change narration.No load-bearing fact was dropped without a home: each removal above either duplicated KDoc that already states the fact, or restated the test name directly above it.
Verification
./gradlew ktfmtCheck jvmTest apiCheck— BUILD SUCCESSFUL (:library:jvmTest,:library:jvmApiCheck,:library:klibApiCheckall ran). No API dump churn, as expected for a comment-only change. Apple-target and Android-specific tasks were not run here (no Xcode or Android SDK in this sandbox, perCLAUDE.md); nothing in this diff is compiled code, so the full matrix on CI is the remaining check.Closes #169
Generated by Claude Code