Wrong new line check

See original GitHub issue

The bug you’re experiencing might have already be reported! Please search in the issues before creating one.

Expected Behavior

Method after multiline text

Observed Behavior

      """
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            """.trimMargin("|")

Ktlint gives 2 error.

Argument should be on a separate line (unless all arguments can fit a single line)ktlintTestSourceSetCheck Missing newline before ")"

Steps to Reproduce

  • Version of ktlint used: 0.38.0-alpha01
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task): ktlintCheck from https://github.com/JLLeitschuh/ktlint-gradle
  • Version of Gradle used (if applicable): 6.6
  • Operating System and version: MacOs - 10.15.6
  • Link to your project (if it’s a public repository):

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Tapchicomacommented, Sep 18, 2020

@kozaxinan with 0.39.0 release you could disable experimental ‘argument-list-wrapping’ rule to suppress this issue.

1reaction
Tapchicomacommented, Aug 21, 2020

@kozaxinan I could not reproduce it with following Kotlin file:

val test =
"""
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            |longtext longtext longtext longtext longtext longtext
            """.trimMargin("|")

Maybe you could provide full Kotlin file or link to it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

wrong new line character: expected \n (new-lines) #24 - GitHub
Problem: sonar reports that file has wrong new line character in only one of two yaml files. And in only one place. Line...
Read more >
new line "\n" in yaml file - Stack Overflow
But it prints out the "\n" instead of making new lines. I know it's possible to do test: "This is a long string...
Read more >
YAML error checking - explorerob's Blog
YAML error checking ... Add site-package yamllint to inspect YAML/YML files for errors. ... Yamllint has two default configuration files: default.
Read more >
How to check that a variable has new lines characters only
Ideally done via substitution, as this is part of a prompt script, so needs to be really fast. The following gives me a...
Read more >
SonarQube new lines are not correct - Sonar Community
First, I use Sonarqube 8.0 version and run it on a server while the analysis is triggered from sonarqube maven plugin. It is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found