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.

ktlintFormat creates directories under src

See original GitHub issue

When I run ktlintFormat there are the following directories, which are created under src directory:

  • src/main/java
  • src/main/kotlin
  • src/test/java
  • src/test/kotlin

It is pretty annoying seeing java directory all the time and have no chance to get rid of it when you write a 100% Kotlin project. Is there a way to ask ktlint not to create these directories?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Tapchicomacommented, Jan 5, 2021

Could reproduce this issue with sample project 👍

Relates to #306

1reaction
ed0906commented, Feb 22, 2021

We also have this issue Temporary workaround is to just delete the extra folders immediately after

tasks {
    ktlintFormat {
        doLast {
            delete("src/main/java")
            delete("src/test/java")
            // etc
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - ktlintFormat creates directories under src -
ktlintFormat creates directories under src ... When I run ktlintFormat there are the following directories, which are created under src directory: src/main/java ...
Read more >
Code Formatting in Kotlin using ktlint - GeeksforGeeks
When everything is correctly formatted, you should see something like the following image when you run ktlintCheck. ktlint is an open-source ...
Read more >
build.gradle.kts - platform/tools/metalava - Git at Google
val testPrebuiltsSdkExt1 = registerTestPrebuiltsSdkTasks("src/testdata/ ... The build server will copy the contents of the distribution directory and make ...
Read more >
1 - Stack Overflow
Configure your ktlintFormat task to include jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED") , works for me with with JDK 17.0.1.
Read more >
Android, ktlint, and pre-commit Git Hook | by Chip Cerio
args "-F", "src/**/*.kt" }. Here, we're creating 2 new gradle tasks ktlint and ktlintFormat. Then we add these tasks on top of the...
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