diff --git a/src/main/kotlin/com/ypwang/plugin/GolangCiOutputParser.kt b/src/main/kotlin/com/ypwang/plugin/GolangCiOutputParser.kt index c5c8c24..eb48807 100644 --- a/src/main/kotlin/com/ypwang/plugin/GolangCiOutputParser.kt +++ b/src/main/kotlin/com/ypwang/plugin/GolangCiOutputParser.kt @@ -35,8 +35,8 @@ object GolangCiOutputParser { val linters = mutableListOf() val linterRaw = result.stdout.lines() - // format: name[ (aka)]: description [fast: bool, auto-fix: bool] - val regex = Regex("""(?\w+)( \((?[\w, ]+)\))?: (?.+) \[fast: (?true|false), auto-fix: (?true|false)]""") + // format: name[ (aka)][ deprecated]: description [fast: bool, auto-fix: bool] + val regex = Regex("""(?\w+)( \((?[\w, ]+)\))?( \[(?deprecated)])?: (?.+) \[fast: (?true|false), auto-fix: (?true|false)]""") // parse output var enabled = true for (line in linterRaw) { @@ -57,9 +57,11 @@ object GolangCiOutputParser { enabled, it.groups["name"]!!.value, it.groups["aka"]?.value ?: "", + it.groups["deprecated"]?.value == "deprecated", it.groups["description"]!!.value, it.groups["fast"]!!.value.toBoolean(), - it.groups["autofix"]!!.value.toBoolean()) + it.groups["autofix"]!!.value.toBoolean(), + ) ) } } diff --git a/src/main/kotlin/com/ypwang/plugin/model/GoLinter.kt b/src/main/kotlin/com/ypwang/plugin/model/GoLinter.kt index 2834109..50dfec3 100644 --- a/src/main/kotlin/com/ypwang/plugin/model/GoLinter.kt +++ b/src/main/kotlin/com/ypwang/plugin/model/GoLinter.kt @@ -4,6 +4,7 @@ data class GoLinter ( val defaultEnabled: Boolean, val name: String, val aka: String, + val isDeprecated: Boolean, val description: String, val fast: Boolean, val autoFix: Boolean