feat: cheap KDoc lint in check; move dokka link-resolution off the critical path#15
Merged
Conversation
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.
What changed
checkKdocverification task (lexical scan, likecheckNativeSafeTestNames), wired intocheck. It flags:@tags not in the valid set (@param @return @throws …). PascalCase annotations (@Serializable,@Test) are ignored.[links]to a non-existent package — e.g. a typo'd[com.eignex.klause.nope.Thing]. Scoped to the project's own package root (longest common prefix), so sibling deps (com.eignex.skema) and stdlib ([kotlin.*]) are left alone. Handles top-level-function links; skips fenced code and markdown URLs.checkno longer depends onlintDocs; it depends on the detekt tasks +checkNativeSafeTestNames+checkKdoc. Dokka's full link resolution moves to the dedicatedlintDocsjob (consumers already run it in parallel).Why
lintDocsruns a full dokka generation (the slowest thing in CI) purely to validate KDoc. Detekt already enforces 'public symbols documented';checkKdocnow covers tag validity + package-existence cheaply in check, so common KDoc mistakes are still caught on a local build. That removes the reasoncheckhad to drag dokka onto the critical path — dokka stays as the thorough resolution backstop in its own job.Testing
./gradlew compileKotlinpasses. The scan was validated against klause's full source: 0 false positives, and it correctly catches injected errors (bad@returnstag;[…nope.Thing]and[…propagatio.someFun]bad packages).