Skip to content

Commit

Permalink
Don't use Triple
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Jul 23, 2022
1 parent 59b6e53 commit ab9ab07
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -91,10 +91,12 @@ class MultilineRawStringIndentation(config: Config) : Rule(config) {
desiredIndent: Int,
lineNumberRange: IntRange,
) {
data class LineInformation(val lineNumber: Int, val line: String, val currentIndent: Int)

val indentation = lineNumberRange
.map { lineNumber ->
val line = containingFile.getLine(lineNumber)
Triple(lineNumber, line, line.countIndent())
LineInformation(lineNumber, line, line.countIndent())
}

if (indentation.isNotEmpty()) {
Expand All @@ -112,7 +114,7 @@ class MultilineRawStringIndentation(config: Config) : Rule(config) {
if (indentation.none { (_, _, currentIndent) -> currentIndent == desiredIndent }) {
val location = containingFile.getLocation(
SourceLocation(lineNumberRange.first, desiredIndent + 1),
SourceLocation(lineNumberRange.last, indentation.last().second.length + 1),
SourceLocation(lineNumberRange.last, indentation.last().line.length + 1),
)

report(
Expand Down

0 comments on commit ab9ab07

Please sign in to comment.