question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

additionalEditorconfigFile doesn't seem to work

See original GitHub issue

Possible duplicate of #322 but I couldn’t find a solution yet.

Versions:

  • Pluging: 10.0.0
  • ktlint: 0.40.0

Current Behavior

Ktlint doesn’t seem to stick by .editorconfig properties. I am getting max line length error for test classes.

Expected Behavior

Ktlint should stick by .editorconfig properties. I shouldn’t get max line length error for test classes.

I have below setup of ktlint.

ktlint {
    android = true
    ignoreFailures = false
    additionalEditorconfigFile = rootProject.file(".editorconfig")
    version = "0.40.0"
    disabledRules = [
        'import-ordering',
        'chain-wrapping',
        'no-blank-line-before-rbrace'
    ]
}

.editorconfig file(located under rootProject)

[*]
insert_final_newline = true

[*.{kt,kts}]
max_line_length=120

[**/test/**.kt]
max_line_length=1000

However still getting;

/path/to/test/class.kt:321:1 Exceeded max line length (120) (cannot be auto-corrected)`

Am I missing something here?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Tapchicomacommented, Mar 13, 2021

.editorconfig file(located under rootProject)

Note that you don’t need to use additionalEditorconfigFile for .editorconfig files located inside source file parents directories.

Regarding your problem - could you try to reproduce it with KtLint 0.39.0 version?

0reactions
nuhkocacommented, Mar 13, 2021

Thanks a lot @Tapchicoma! I’ll wait for it then. Hope to have it fixing this issue. Otherwise, I’ll ping them and update this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

editorconfig not working correctly - Visual Studio Feedback
When I'm using Folder View and edit on *.js, *.ts or *.cs file. The 'indent_size' property is not applied on Format Document in...
Read more >
visual studio 2017 - .editorconfig not doing anything in VS2017?
For a reason or another editorconfig file does not do anything when the solution folder has a parent folder named between square brackets....
Read more >
Settings do not apply if .editorconfig file is not in curently ...
I tried npm install editorconfig -g and ran editorconfig [file-in-question] and the configuration was what I expected. If not, please file on ...
Read more >
EditorConfig settings - Visual Studio (Windows) - Microsoft Learn
Settings in EditorConfig files let you maintain consistent coding styles and settings in a codebase, such as indent style, tab width, end of ......
Read more >
457046 – Support .editorconfig (editorconfig.org) - Bugs
It seems that the code to support most of the other IDE's is actually hosted on editorconfig.org (or various github projects). I don't...
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