Skip to content

Resolve initProperties KDoc link and remove redundant self-imports - #121

Merged
pambrose merged 1 commit into
masterfrom
kdoc-and-import-cleanups
Jul 26, 2026
Merged

Resolve initProperties KDoc link and remove redundant self-imports#121
pambrose merged 1 commit into
masterfrom
kdoc-and-import-cleanups

Conversation

@pambrose

Copy link
Copy Markdown
Contributor

Summary

Fixes a broken KDoc link and cleans up redundant imports across a handful of files.

ContentDsl.kt — resolve the [initProperties] KDoc link

initProperties() is a companion-object member of Property, which is not in scope in ContentDsl.kt (the file only imports individual Property.X members). So the bare [initProperties] link had nothing to bind to and rendered as plain text — Dokka reported Couldn't resolve link: [initProperties].

Fixed with KDoc's custom-link-text form, which reads cleanly in prose while binding to the fully-qualified target, so no extra import is needed:

[Property.initProperties][com.readingbat.common.Property.initProperties]

Dokka (dokkaGenerateModuleHtml) now generates with zero warnings.

Redundant self-import removals

Property.kt, ConfigureOAuth.kt, GeoInfo.kt, ReadingBatServer.kt, AdminRoutes.kt — each was importing symbols already defined in its own object/companion. Removed.

Intercepts.kt — minor simplification (behavior-preserving)

- if (suffix.isEmpty()) return true
- return suffix.split('/').size <= 2
+ return suffix.isEmpty() || suffix.split('/').size <= 2

Verification

./gradlew check: 364 tests, 0 failures. Dokka module generation clean.

🤖 Generated with Claude Code

- ContentDsl.kt: fix the unresolved `[initProperties]` KDoc link. initProperties
  is a companion member of Property, which isn't in scope here, so the bare link
  rendered as plain text (Dokka: "Couldn't resolve link"). Use the custom-link-
  text form pointing at the fully-qualified target so no import is needed:
  [Property.initProperties][com.readingbat.common.Property.initProperties].
  Dokka now generates with zero warnings.

- Property.kt, ConfigureOAuth.kt, GeoInfo.kt, ReadingBatServer.kt,
  AdminRoutes.kt: drop redundant imports of symbols defined in each file's own
  object/companion.

- Intercepts.kt: collapse `if (suffix.isEmpty()) return true; return ...` into
  `return suffix.isEmpty() || ...` (behavior-preserving).

Verified: ./gradlew check green (364 tests, 0 failures).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rc/main/kotlin/com/readingbat/server/Intercepts.kt 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pambrose
pambrose merged commit c4aca27 into master Jul 26, 2026
4 checks passed
@pambrose
pambrose deleted the kdoc-and-import-cleanups branch July 26, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant