Remove sanitizeKdoc — redundant with KotlinPoet 2.3.0#66
Open
halotukozak wants to merge 1 commit into
Open
Conversation
CodeWriter in 2.3.0 (#2258) replaces /* and */ with * in kdoc mode, making the local sanitizeKdoc() helper redundant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coverage Report
|
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the local sanitizeKdoc() helper and switches generated KDoc to rely on KotlinPoet 2.3.0’s built-in escaping of comment terminators during KDoc emission.
Changes:
- Removed the
String.sanitizeKdoc()extension fromNameUtils.kt. - Updated client and model generators to pass endpoint/schema/property descriptions directly into
addKdoc(...)(removed 9 call sites).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/src/main/kotlin/com/avsystem/justworks/core/gen/NameUtils.kt | Removes the sanitizeKdoc() extension helper. |
| core/src/main/kotlin/com/avsystem/justworks/core/gen/model/ModelGenerator.kt | Stops sanitizing schema/property/enum descriptions before adding them as KDoc. |
| core/src/main/kotlin/com/avsystem/justworks/core/gen/client/ClientGenerator.kt | Stops sanitizing endpoint summary/description/param docs before adding them as KDoc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| kdocParts.add("@param ${param.name.toCamelCase()} ${param.description}") | ||
| } | ||
| if (kdocParts.isNotEmpty()) { | ||
| funBuilder.addKdoc("%L", kdocParts.joinToString("\n")) |
|
|
||
| if (schema.description != null) { | ||
| parentBuilder.addKdoc("%L", schema.description.sanitizeKdoc()) | ||
| parentBuilder.addKdoc("%L", schema.description) |
| fun String.sanitizeKdoc(): String = replace("*/", "*/") | ||
| .replace("/*", "/*") | ||
|
|
||
| /** |
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
/*and*/inCodeWriter.emitKdoc(replaces with*), identical to localsanitizeKdoc()helper.sanitizeKdoc()extension fromNameUtils.ktand all 9 call sites inClientGenerator.kt/ModelGenerator.kt.Test plan
./gradlew ktlintCheck testpasses*/in description🤖 Generated with Claude Code