-
Notifications
You must be signed in to change notification settings - Fork 1
🍔 Small overall refactor #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…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.
There was a problem hiding this 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
getPluginVersionfailure 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.
...-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/PropertiesExtensions.kt
Show resolved
Hide resolved
...dle-plugin/src/test/kotlin/com/escodro/techdebt/gradle/extension/PropertiesExtensionsTest.kt
Outdated
Show resolved
Hide resolved
...ebt-gradle-plugin/src/main/kotlin/com/escodro/techdebt/gradle/extension/ProjectExtensions.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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
TechDebtExtensionfromcom.escodro.techdebt.gradletocom.escodro.techdebt.gradle.extensionis 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.
Small improvements for code readability