Skip to content

Conversation

jeremymailen
Copy link
Owner

Before we weren't waiting until the kotlinter extension was resolved. Along with ignoring ktlint version customization, tasks may not have gotten customized correctly.

Before we weren't waiting until the kotlinter extension was resolved.
Along with ignoring ktlint version customization, tasks may not have gotten customized correctly.
@jeremymailen jeremymailen requested review from Karn and Copilot July 22, 2025 06:17
Copy link

@Copilot 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 fixes issue #464 by ensuring ktlint dependencies and tasks are configured after the kotlinter extension has been evaluated. Previously, the plugin wasn't waiting for the extension to be resolved, which caused ktlint version customization to be ignored and tasks to potentially be misconfigured.

  • Move ktlint configuration logic into an afterEvaluate block to ensure extension settings are resolved
  • Refactor configuration creation to separate initial setup from dependency population
  • Update test projects to use newer Kotlin version (2.2.0) and demonstrate ktlint version customization

Reviewed Changes

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

File Description
src/main/kotlin/org/jmailen/gradle/kotlinter/KotlinterPlugin.kt Restructures plugin to defer ktlint configuration until after extension evaluation
test-project/service/build.gradle.kts Adds ktlint version configuration to test the fix
test-project/build.gradle.kts Updates Kotlin version from 2.1.0 to 2.2.0
test-project-android/build.gradle.kts Updates Kotlin version from 2.1.0 to 2.2.0
Comments suppressed due to low confidence (1)

src/main/kotlin/org/jmailen/gradle/kotlinter/KotlinterPlugin.kt:40

  • [nitpick] The parameter 'it' in the afterEvaluate block is ambiguous. Consider using a more descriptive name like 'project' or explicitly use 'this' since it refers to the same project instance.
            it.configureKtLintConfiguration(ktlintConfiguration, kotlinterExtension.ktlintVersion)

@jeremymailen jeremymailen merged commit 52070d9 into master Jul 27, 2025
19 checks passed
@jeremymailen jeremymailen deleted the fix-464 branch July 27, 2025 02:17
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