Skip to content

Commit

Permalink
Fix bugs caused by not reinstantiating stateful ruleset for each file (
Browse files Browse the repository at this point in the history
…#20)

Fixes #19

Also upgrade kotlin and gradle
  • Loading branch information
jeremymailen authored Sep 29, 2017
1 parent 9c9402f commit 4de66f6
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
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

0 comments on commit 4de66f6

Please sign in to comment.