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 bugs caused by not reinstantiating stateful ruleset for each file #20

Merged
merged 1 commit into from
Sep 29, 2017
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Available on the Gradle Plugins Portal: https://plugins.gradle.org/plugin/org.jm

```groovy
plugins {
id 'org.jmailen.kotlinter' version '1.3.1'
id 'org.jmailen.kotlinter' version '1.3.2'
}
```

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.1.4-3'
id 'com.gradle.plugin-publish' version '0.9.7'
id 'org.jetbrains.kotlin.jvm' version '1.1.51'
id 'com.gradle.plugin-publish' version '0.9.8'
id 'java-gradle-plugin'
id 'maven-publish'
id 'idea'
Expand All @@ -20,7 +20,7 @@ dependencies {
testRuntime 'com.android.tools.build:gradle:2.3.3'
}

version = '1.3.1'
version = '1.3.2'
group = 'org.jmailen.gradle'
def pluginId = 'org.jmailen.kotlinter'

Expand Down Expand Up @@ -56,5 +56,5 @@ publishing {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.1'
gradleVersion = '4.2'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2-bin.zip
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ open class FormatTask : SourceTask() {
@TaskAction
fun run() {
var fixes = ""
val ruleSets = resolveRuleSets()

getSource().forEach { file ->
val relativePath = file.toRelativeString(project.projectDir)
Expand All @@ -40,7 +39,7 @@ open class FormatTask : SourceTask() {
}

var wasFormatted = false
val formattedText = formatFunc?.invoke(file, ruleSets) { line, col, detail, corrected ->
val formattedText = formatFunc?.invoke(file, resolveRuleSets()) { line, col, detail, corrected ->
val errorStr = "$relativePath:$line:$col: $detail"
val msg = when (corrected) {
true -> "Format fixed > $errorStr"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ open class LintTask : SourceTask() {
fun run() {
var hasErrors = false
var fileReporter = reporterFor(reporter, report)
val ruleSets = resolveRuleSets()

fileReporter.beforeAll()

Expand All @@ -57,7 +56,7 @@ open class LintTask : SourceTask() {
}
}

lintFunc?.invoke(file, ruleSets) { error ->
lintFunc?.invoke(file, resolveRuleSets()) { error ->
fileReporter.onLintError(relativePath, error, false)

val errorStr = "$relativePath:${error.line}:${error.col}: ${error.detail}"
Expand Down