-
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.
RuleSetProvider now implements Serializable interface.
This is needed for better Gradle plugin support.
- Loading branch information
1 parent
da8c3f6
commit 8954d4c
Showing
4 changed files
with
7 additions
and
5 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
6 changes: 4 additions & 2 deletions
6
ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/RuleSetProvider.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,16 +1,18 @@ | ||
package com.pinterest.ktlint.core | ||
|
||
import java.io.Serializable | ||
|
||
/** | ||
* `ktlint` uses [ServiceLoader](http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) to | ||
* discover all available `RuleSetProvider`s on the classpath and so each `RuleSetProvider` must be registered using | ||
* `META-INF/services/com.pinterest.ktlint.core.RuleSetProvider` | ||
* (see `ktlint-ruleset-standard/src/main/resources` for an example). | ||
*/ | ||
interface RuleSetProvider { | ||
public interface RuleSetProvider : Serializable { | ||
|
||
/** | ||
* This method is going to be called once for each file (which means if any of the rules have state or | ||
* are not thread-safe - a new RuleSet must be created). | ||
*/ | ||
fun get(): RuleSet | ||
public fun get(): RuleSet | ||
} |
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