fix android lint bug with no file column errors

This commit is contained in:
Maxim Bachinsky 2020-08-20 17:55:14 +03:00
parent 3d73b2473f
commit 21e21aca1d
2 changed files with 3 additions and 3 deletions

View File

@ -2,11 +2,11 @@ package static_analysis.errors
class AndroidLintError(
private val filePath: String,
private val fileLine: String,
private val fileLine: String?,
private val errorId: String,
private val description: String
) : StaticAnalysisError {
override fun print(count: Int): String = "\n$count. Android Lint. $description ($errorId)\n\tat [$filePath:$fileLine]"
override fun print(count: Int): String = "\n$count. Android Lint. $description ($errorId)\n\tat [$filePath${fileLine?.let { ":$it" }.orEmpty()}]"
}

View File

@ -24,7 +24,7 @@ class AndroidLinter : Linter {
.map { locationNode ->
AndroidLintError(
filePath = locationNode.attribute("file") as String,
fileLine = locationNode.attribute("line") as String,
fileLine = locationNode.attribute("line") as String?,
errorId = errorNode.attribute("id") as String,
description = errorNode.attribute("message") as String
)