-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test custom rule loading in ktlin 0.50.0 (#699)
Edit Main.kt in the kotlin-rulesets-using projects according to inline comment, then run ./gradlew samples:kotlin-rulesets-using:build
- Loading branch information
1 parent
a145c65
commit f75b169
Showing
8 changed files
with
20 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
kotlin.js.compiler=ir |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
kotlin.js.compiler=ir |
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
11 changes: 7 additions & 4 deletions
11
...ting/src/main/kotlin/org/jlleitschuh/gradle/ktlint/sample/kotlin/CustomRuleSetProvider.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,9 +1,12 @@ | ||
package org.jlleitschuh.gradle.ktlint.sample.kotlin | ||
|
||
import com.pinterest.ktlint.core.RuleSet | ||
import com.pinterest.ktlint.core.RuleSetProvider | ||
import com.pinterest.ktlint.cli.ruleset.core.api.RuleSetProviderV3 | ||
import com.pinterest.ktlint.rule.engine.core.api.RuleProvider | ||
import com.pinterest.ktlint.rule.engine.core.api.RuleSetId | ||
|
||
class CustomRuleSetProvider : RuleSetProvider { | ||
class CustomRuleSetProvider : RuleSetProviderV3(RuleSetId("custom")) { | ||
|
||
override fun get(): RuleSet = RuleSet("custom", NoVarRule()) | ||
override fun getRuleProviders(): Set<RuleProvider> { | ||
return setOf(RuleProvider { NoVarRule() }) | ||
} | ||
} |
10 changes: 7 additions & 3 deletions
10
...ulesets-creating/src/main/kotlin/org/jlleitschuh/gradle/ktlint/sample/kotlin/NoVarRule.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
File renamed without changes.
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