Skip to content
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

fix(deps): update kotlin monorepo to v2.1.0 #2880

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
java-compilation = "21"
# The java-target version is the lowest supported LTS version of Java. Jar's produced are bytecode compatible with this version.
java-target = "8"
kotlin = "2.0.21"
kotlinDev = "2.1.0-RC2"
kotlin = "2.1.0"
kotlinDev = "2.1.0"

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.pinterest.ktlint.ruleset.standard.rules

import com.pinterest.ktlint.test.KtLintAssertThat
import org.jetbrains.kotlin.lexer.KtTokens
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.params.provider.ValueSource

class ClassNamingRuleTest {
Expand Down Expand Up @@ -141,23 +143,22 @@ class ClassNamingRuleTest {
}

@ParameterizedTest(name = "Keyword: {0}")
@Suppress("ktlint:standard:argument-list-wrapping")
@ValueSource(
strings = [
"abstract", "actual", "annotation", "as", "break", "by", "catch", "class", "companion", "const", "constructor", "context",
"continue", "contract", "crossinline", "data", "delegate", "do", "dynamic", "else", "enum", "expect", "external", "false",
"field", "file", "final", "finally", "for", "fun", "get", "header", "if", "impl", "import", "in", "infix", "init", "inline",
"inner", "interface", "internal", "is", "lateinit", "noinline", "null", "object", "open", "operator", "out", "override",
"package", "param", "private", "property", "protected", "public", "receiver", "reified", "return", "sealed", "set", "setparam",
"super", "suspend", "tailrec", "this", "throw", "true", "try", "typealias", "typeof", "val", "value", "var", "vararg", "when",
"where", "while",
],
)
@MethodSource("ktTokens")
fun `Issue 2352 - Given a keyword then allow it to be wrapped between backticks`(keyword: String) {
val code =
"""
class `$keyword`
""".trimIndent()
classNamingRuleAssertThat(code).hasNoLintViolations()
}

companion object {
@Suppress("UnstableApiUsage")
@JvmStatic
private fun ktTokens() =
KtTokens.KEYWORDS.types
.plus(KtTokens.SOFT_KEYWORDS.types)
.filterNot { it == KtTokens.AS_SAFE || it == KtTokens.NOT_IN || it == KtTokens.NOT_IS }
.map { it.debugName }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package com.pinterest.ktlint.ruleset.standard.rules

import com.pinterest.ktlint.ruleset.standard.rules.FunctionNamingRule.Companion.IGNORE_WHEN_ANNOTATED_WITH_PROPERTY
import com.pinterest.ktlint.test.KtLintAssertThat
import org.jetbrains.kotlin.lexer.KtTokens
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.params.provider.ValueSource

class FunctionNamingRuleTest {
Expand Down Expand Up @@ -273,23 +275,22 @@ class FunctionNamingRuleTest {
}

@ParameterizedTest(name = "Keyword: {0}")
@Suppress("ktlint:standard:argument-list-wrapping")
@ValueSource(
strings = [
"abstract", "actual", "annotation", "as", "break", "by", "catch", "class", "companion", "const", "constructor", "context",
"continue", "contract", "crossinline", "data", "delegate", "do", "dynamic", "else", "enum", "expect", "external", "false",
"field", "file", "final", "finally", "for", "fun", "get", "header", "if", "impl", "import", "in", "infix", "init", "inline",
"inner", "interface", "internal", "is", "lateinit", "noinline", "null", "object", "open", "operator", "out", "override",
"package", "param", "private", "property", "protected", "public", "receiver", "reified", "return", "sealed", "set", "setparam",
"super", "suspend", "tailrec", "this", "throw", "true", "try", "typealias", "typeof", "val", "value", "var", "vararg", "when",
"where", "while",
],
)
@MethodSource("ktTokens")
fun `Issue 2352 - Given a keyword then allow it to be wrapped between backticks`(keyword: String) {
val code =
"""
fun `$keyword`() = "foo"
""".trimIndent()
functionNamingRuleAssertThat(code).hasNoLintViolations()
}

companion object {
@Suppress("UnstableApiUsage")
@JvmStatic
private fun ktTokens() =
KtTokens.KEYWORDS.types
.plus(KtTokens.SOFT_KEYWORDS.types)
.filterNot { it == KtTokens.AS_SAFE || it == KtTokens.NOT_IN || it == KtTokens.NOT_IS }
.map { it.debugName }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package com.pinterest.ktlint.ruleset.standard.rules
import com.pinterest.ktlint.test.KtLintAssertThat.Companion.assertThatRule
import com.pinterest.ktlint.test.KtlintDocumentationTest
import com.pinterest.ktlint.test.LintViolation
import org.jetbrains.kotlin.lexer.KtTokens
import org.junit.jupiter.api.Nested
import org.junit.jupiter.api.Test
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import org.junit.jupiter.params.provider.ValueSource

class PropertyNamingRuleTest {
Expand Down Expand Up @@ -189,18 +191,7 @@ class PropertyNamingRuleTest {
}

@ParameterizedTest(name = "Keyword: {0}")
@Suppress("ktlint:standard:argument-list-wrapping")
@ValueSource(
strings = [
"abstract", "actual", "annotation", "as", "break", "by", "catch", "class", "companion", "const", "constructor", "context",
"continue", "contract", "crossinline", "data", "delegate", "do", "dynamic", "else", "enum", "expect", "external", "false",
"field", "file", "final", "finally", "for", "fun", "get", "header", "if", "impl", "import", "in", "infix", "init", "inline",
"inner", "interface", "internal", "is", "lateinit", "noinline", "null", "object", "open", "operator", "out", "override",
"package", "param", "private", "property", "protected", "public", "receiver", "reified", "return", "sealed", "set", "setparam",
"super", "suspend", "tailrec", "this", "throw", "true", "try", "typealias", "typeof", "val", "value", "var", "vararg", "when",
"where", "while",
],
)
@MethodSource("ktTokens")
fun `Issue 2352 - Given a keyword then allow it to be wrapped between backticks`(keyword: String) {
val code =
"""
Expand Down Expand Up @@ -308,4 +299,14 @@ class PropertyNamingRuleTest {
""".trimIndent()
propertyNamingRuleAssertThat(code).hasNoLintViolations()
}

companion object {
@Suppress("UnstableApiUsage")
@JvmStatic
private fun ktTokens() =
KtTokens.KEYWORDS.types
.plus(KtTokens.SOFT_KEYWORDS.types)
.filterNot { it == KtTokens.AS_SAFE || it == KtTokens.NOT_IN || it == KtTokens.NOT_IS }
.map { it.debugName }
}
}