Skip to content

Conversation

@igorescodro
Copy link
Owner

Small improvements for code readability

…r readability

Simplified target name capitalization logic and replaced raw string
construction with constants to improve maintainability.
Refactored `getPluginVersion` to include detailed validation for missing
or blank versions, added unit tests for edge cases, and removed
unnecessary `Logger` usage for cleaner code.
Removed redundant variable assignment in `getSourceSetName` method to
streamline code and improve readability.
Relocated `SourceFileResolver` from `parser` to `extension` package for
improved module organization and updated affected imports and tests
accordingly.
…ation

Relocated the `TechDebtExtension` class to the `extension` package to
align with the module's logical structure.
Refactored `getAnnotationLocation` to streamline logic by inlining the
`location` variable and removed the unused `getLocation` method to clean
 up the code.
Replaced duplicate occurrences of `Suppress::class.qualifiedName` with a
companion object constant `SuppressName` for improved readability and
maintainability.
Replaced inline `TechDebt::class.qualifiedName` with a companion object
constant `TechDebtAnnotationName` for improved readability and
maintainability.
@igorescodro igorescodro requested a review from Copilot February 8, 2026 23:38
@igorescodro igorescodro marked this pull request as ready for review February 8, 2026 23:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR focuses on small refactors to improve readability and consistency across the KSP processor module and the Gradle plugin, including package cleanup, minor simplifications, and improved test coverage around plugin version resolution.

Changes:

  • Extracted repeated annotation qualified-name lookups into companion object properties in KSP processors.
  • Refactored Gradle plugin internals (package alignment for extensions, simplified logic, and improved version-loading behavior with tests).
  • Added test resources and new unit tests for getPluginVersion failure modes.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
techdebt-processor/src/main/kotlin/com/escodro/techdebt/processor/TechDebtSymbolProcessor.kt Reuses a single annotation name constant when querying/filtering KSP annotations.
techdebt-processor/src/main/kotlin/com/escodro/techdebt/processor/SuppressSymbolProcessor.kt Same annotation-name reuse refactor for @Suppress processing.
techdebt-processor/src/main/kotlin/com/escodro/techdebt/extension/KSAnnotationExtensions.kt Simplifies annotation location resolution by inlining helper logic.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/parser/GitParser.kt Updates import to new SourceFileResolver package.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/parser/GeneratedTechDebtParser.kt Minor simplification in source set resolution.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/TechDebtExtension.kt Fixes/aligns package to ...gradle.extension.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/SourceFileResolver.kt Fixes/aligns package to ...gradle.extension.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/PropertiesExtensions.kt Makes plugin version loading configurable (resource name) and fail-fast when missing/invalid.
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/ProjectExtensions.kt Refactors KMP KSP configuration name construction (currently introduces a compile error).
techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/TechDebtPlugin.kt Updates import for moved TechDebtExtension.
techdebt-gradle-plugin/src/test/kotlin/com/escodro/techdebt/gradle/extension/SourceFileResolverTest.kt Fixes package to match new location.
techdebt-gradle-plugin/src/test/kotlin/com/escodro/techdebt/gradle/extension/PropertiesExtensionsTest.kt Adds unit tests for version loading success and failure cases.
techdebt-gradle-plugin/src/test/resources/techdebt.properties Adds a test properties file with a version value.
techdebt-gradle-plugin/src/test/resources/no_version.properties Adds a test resource with missing version key.
techdebt-gradle-plugin/src/test/resources/blank_version.properties Adds a test resource with blank version value.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

techdebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/TechDebtExtension.kt:2

  • Moving TechDebtExtension from com.escodro.techdebt.gradle to com.escodro.techdebt.gradle.extension is a breaking change for any consumers that reference the type by its FQCN (including Kotlin DSL code that might import it). If this plugin has external users, consider keeping a deprecated shim in the old package (e.g., a deprecated wrapper class) to preserve binary/source compatibility, or document this as an intentional breaking change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@igorescodro igorescodro enabled auto-merge (rebase) February 8, 2026 23:51
@igorescodro igorescodro merged commit 905719e into main Feb 8, 2026
10 checks passed
@igorescodro igorescodro deleted the refactor/small branch February 8, 2026 23:51
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