Hello! Does anybody know how can I apply `ktlint`...
# ktlint
n
Hello! Does anybody know how can I apply
ktlint
to a composite builds? ideally
build-logic
n
Hey @Chrimaeon thanks so much. Just clarifying again to make sure I explained myself correctly. I want
ktlint
to format files in
build-logic
as well. Right now, it is only applied to the root project but I want
ktlint
to run for
build-logic
as well. So should I check custom configuration again?
c
No, this will not work through Gradle. You need to use the CLI. https://pinterest.github.io/ktlint/0.49.1/install/cli/
n
I see, thanks! I would still like to keep our
ktlint
setup in the project tho. Can I tell
CLI
to run only for
build-logic
using my existing configuration such as exclusions,
.editorconfig
, etc without doing further ado?
c
You can add a parameter to the comment to the editorconfig
ktlint --editorconfig=/path/to/.editorconfig
The rest is also described in the like above.
h
we use kotlinter gradle plugin to simplify the work, which wraps klint