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

Multiline string indent #1052

Merged
merged 10 commits into from
Oct 24, 2021
Prev Previous commit
Next Next commit
Change message when closing quotes of multiline raw string literal ar…
…e incorrectly indented
Paul Dingemans committed Oct 16, 2021
commit 0ae1b1f073bfac0631956ddd2b31a42a929cbae8
Original file line number Diff line number Diff line change
@@ -816,7 +816,7 @@ class IndentationRule : Rule("indent"), Rule.Modifier.RestrictToRootLast {
// the closing quotes.
emit(
it.startOffset,
"Unexpected indent of multiline string", // TODO: Change to "Unexpected indent of multiline string closing quotes"???
"Unexpected indent of multiline string closing quotes",
true
)
if (autoCorrect) {
Original file line number Diff line number Diff line change
@@ -683,7 +683,7 @@ internal class IndentationRuleTest {
IndentationRule().lint(code)
).isEqualTo(
listOf(
LintError(5, 1, "indent", "Unexpected indent of multiline string"),
LintError(5, 1, "indent", "Unexpected indent of multiline string closing quotes"),
)
)
assertThat(IndentationRule().format(code)).isEqualTo(expectedCode)
@@ -720,7 +720,7 @@ internal class IndentationRuleTest {
).isEqualTo(
listOf(
LintError(line = 2, col = 13, ruleId = "indent", detail = "Missing newline after \"(\""),
LintError(line = 7, col = 1, ruleId = "indent", detail = "Unexpected indent of multiline string"),
LintError(line = 7, col = 1, ruleId = "indent", detail = "Unexpected indent of multiline string closing quotes"),
LintError(line = 7, col = 20, ruleId = "indent", detail = "Missing newline before \")\""),
)
)
@@ -757,7 +757,7 @@ internal class IndentationRuleTest {
).isEqualTo(
listOf(
LintError(line = 2, col = 13, ruleId = "indent", detail = "Missing newline after \"(\""),
LintError(line = 6, col = 1, ruleId = "indent", detail = "Unexpected indent of multiline string"),
LintError(line = 6, col = 1, ruleId = "indent", detail = "Unexpected indent of multiline string closing quotes"),
LintError(line = 6, col = 20, ruleId = "indent", detail = "Missing newline before \")\""),
)
)