-
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.
Merge pull request #1099 from Tapchicoma/tapchicoma/serializable
ReporterProvider, LintError and RuleSetProvider now implement Serializable interface
- Loading branch information
Showing
11 changed files
with
25 additions
and
15 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
7 changes: 4 additions & 3 deletions
7
ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/ReporterProvider.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,15 @@ | ||
package com.pinterest.ktlint.core | ||
|
||
import java.io.PrintStream | ||
import java.io.Serializable | ||
|
||
/** | ||
* `ktlint` uses [ServiceLoader](http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html) to | ||
* discover all available [ReporterProvider]s on the classpath and so each [ReporterProvider] must be registered using | ||
* `META-INF/services/com.pinterest.ktlint.core.ReporterProvider` | ||
* (see `ktlint-reporter-plain/src/main/resources` for an example). | ||
*/ | ||
interface ReporterProvider { | ||
val id: String | ||
fun get(out: PrintStream, opt: Map<String, String>): Reporter | ||
public interface ReporterProvider : Serializable { | ||
public val id: String | ||
public fun get(out: PrintStream, opt: Map<String, String>): Reporter | ||
} |
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
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
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
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