-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename file "KtlintVersionProvider.kt" containing method "getKtlintVe…
…rsion" to "KtlintVersion.kt" with method "ktlintVersion" so that file adheres to PascalNaming convention in the modified FilenameRule.
- Loading branch information
1 parent
4c24a76
commit ffe22c6
Showing
3 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
ktlint/src/main/kotlin/com/pinterest/ktlint/internal/KtlintVersionProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package com.pinterest.ktlint.internal | ||
|
||
import com.pinterest.ktlint.core.getKtlintVersion | ||
import com.pinterest.ktlint.core.ktlintVersion | ||
import picocli.CommandLine | ||
|
||
/** | ||
* Dynamically provides current ktlint version as [CommandLine.IVersionProvider] | ||
*/ | ||
internal class KtlintVersionProvider : CommandLine.IVersionProvider { | ||
override fun getVersion(): Array<String> { | ||
val version = getKtlintVersion(KtlintVersionProvider::class.java) | ||
return version?.let { arrayOf(version) } ?: error("Failed to determine ktlint version") | ||
} | ||
override fun getVersion(): Array<String> = | ||
ktlintVersion(KtlintVersionProvider::class.java) | ||
?.let { version -> arrayOf(version) } | ||
?: error("Failed to determine ktlint version") | ||
} |