Skip to content

Drop the dead unused suppressions from Spine and DokkaTools - #806

Merged
alexander-yevsyukov merged 2 commits into
masterfrom
drop-dead-unused-suppressions
Oct 19, 2026
Merged

alexander-yevsyukov merged 2 commits into
masterfrom
drop-dead-unused-suppressions

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

Follow-up to #803. That PR documented every object-level @Suppress entry
under buildSrc/src/main/kotlin/io/spine/dependency/local/ with a
/* rationale */ comment, without adding, removing or reordering a single
suppression name. Writing those rationales is what exposed that two unused
entries had nothing left to suppress. This PR removes exactly those two.

Why these two, and only these two

The catalogues in this package are copied into every downstream repo by
./config/pull, so a constant with no reference inside config is the
expected state, not evidence of staleness. A class-level unused
suppression is dead only when every declared member is referenced — which
is what makes these two objects special. Nine other catalogues in the package
keep their unused entry for exactly this reason, and this PR leaves them
untouched.

Spine declares two members, both referenced:

Member References outside Spine.kt
group 11
toolsGroup 17

All 28 live inside buildSrc, which migrate copies wholesale — so the
referencing files always travel with Spine.kt. The old rationale, "Some
subprojects do not use all the declared groups", could never apply: no
consumer can receive Spine.kt without also receiving its referencers.

DokkaTools declares three members, all referenced:

Member Referenced by
extensions DokkaExts.kt:48, inside useDokkaWithSpineExtensions()
group the extensions template, same file
version the extensions template, same file

The chain terminates at an entry point rather than trailing off into dead
code: dokka-setup.gradle.kts:23 calls useDokkaWithSpineExtensions(), and
that precompiled script plugin is applied by id from jvm-module.gradle.kts:43
and kmp-publish.gradle.kts:50. Reflect already has this exact shape — only
its lib referenced across files, the rest consumed by lib's own template —
and carries no unused entry.

What is deliberately unchanged

  • ConstPropertyName stays in both files. The names are lowerCamelCase
    const vals by this catalogue's own convention, so that entry is live.
  • No version literal, Maven coordinate, other suppression name, or entry
    order was touched. The diff is two deleted lines.
  • The remaining single-entry @Suppress(...) keeps its multi-line form and
    trailing comma, matching BaseTypes.kt, Change.kt, TestLib.kt and
    Reflect.kt. Collapsing it to one line would exceed detekt's
    MaxLineLength: 100 once the inline rationale is included.

Severity

unused is an IDE inspection. Neither detekt nor the Kotlin compiler enforces
it, so a stale entry costs nothing at build time and this change has no effect
on compilation. It is IDE-noise cleanup.

Verification

./gradlew detekt passes (:buildSrc:compileKotlin executed, not cached).
config has no root version.gradle.kts, so the version gate does not apply;
build is ambiguous here and dokkaGenerate is not registered, so detekt is
the gate. Reviewed by spine-code-review, kotlin-engineer, review-docs and
dependency-audit.

Still open, not addressed here

  • Entry ordering across the package is inconsistent: 9 files lead with
    ConstPropertyName, 5 with unused, and CoreJvmCompiler with
    MemberVisibilityCanBePrivate. Cosmetic, and mixing it into a PR that
    changes which inspections are suppressed is the kind of churn that got
    this work split out of Bump CoreJvm -> 2.0.0-SNAPSHOT.571 #801.
  • The inverse gap. BaseTypes and Change have no reference anywhere in
    this repo, yet carry no unused entry at all — the mirror image of what
    this PR fixes. Pre-existing, and presumably fine in practice because
    consumers use the distributed buildSrc.

🤖 Generated with Claude Code

These two are the only catalogues in `io.spine.dependency.local` whose
every declared member is referenced, so their object-level `unused` entry
has nothing left to suppress.

`Spine` declares `group` and `toolsGroup` alone, with 11 and 17 references
from outside the file. All of them live in `buildSrc`, which `migrate`
copies wholesale, so the referencing files always travel with `Spine.kt`.

`DokkaTools` declares `group`, `version` and `extensions`. `extensions` is
used by `useDokkaWithSpineExtensions()` in `DokkaExts.kt`, and `group` and
`version` are used by the `extensions` template. That chain ends at
`dokka-setup.gradle.kts`, applied by id from `jvm-module.gradle.kts` and
`kmp-publish.gradle.kts`. `Reflect` already has this exact shape without
an `unused` entry.

The other nine catalogues in the package keep theirs: their constants are
genuinely unreferenced here, because downstream repos consume them.

The `ConstPropertyName` entry stays in both files: the constant names are
lowerCamelCase by the catalogue's own convention.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T14:47:13.911353Z 1ac617d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alexander-yevsyukov alexander-yevsyukov self-assigned this Oct 19, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to In Review in v2.0 Oct 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

Both removals are supported by existing member references and leave executable code and dependency coordinates unchanged.

No open issues 🎉

What changed in this PR

Removes two obsolete unused suppressions from dependency catalogues distributed to downstream repositories, following #803.

Changes:

  • Removes unused from Spine and DokkaTools.
  • Preserves ConstPropertyName, annotation formatting, and all dependency coordinates.
File Description
buildSrc/​src/​main/​kotlin/​io/​spine/​dependency/​local/​Spine.kt Removes the obsolete group-constant suppression.
buildSrc/​src/​main/​kotlin/​io/​spine/​dependency/​local/​DokkaTools.kt Removes the obsolete Dokka catalogue suppression.

Review effort: Balanced

@alexander-yevsyukov
alexander-yevsyukov merged commit 30e2383 into master Oct 19, 2026
3 checks passed
@alexander-yevsyukov
alexander-yevsyukov deleted the drop-dead-unused-suppressions branch October 19, 2026 14:47
@github-project-automation github-project-automation Bot moved this from In Review to ✅ Done in v2.0 Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants