Search code examples
androidgradleandroid-gradle-plugineditorconfig

How to disable filename in ktlint?


How and where i can to disable filename in ktlint?

I don t want to rename this class, but get next error:

interface MainActivityContract should be declared in a file named MainActivityContract.kt (cannot be auto-corrected)


Solution

  • Just added at the top of the file:

    // ktlint-disable filename
    

    Note: This works for ktlint version 0.24.0 and above.