Hey guys! I've been scouring through the docs and ...
# ktlint
l
Hey guys! I've been scouring through the docs and forums, and couldn't found a straightforward way to make ktlint ignore specfic files. Can anyone help me shed a light on this? I'm using 0.36 and prefer not to update due to massive code debt that is introduced in newer versions.
j
You can specify files to format specifically and simply not include the ones you don't want it to format IIRC
Instead of specifying entire directories
l
Right
But I want to format the entire project, except for two files
They're in a specific package, so... if theres any way to put it as an "exception" it would work, too
j
¯\_(ツ)_/¯
I know Ktlint-Gradle supports it using Gradle's exclusion patterns. Other than that, I honestly don't know
l
oh okay 😞
I appreciate it a lot, anyway. Didn't think I'd get a reply before monday haha
s
If it's just two files, you can add
/* ktlint-disable */
at the top of the files
there's ways to disable specific rules via
.editorconfig
that can use file globs but I can't recall a way to disable every rule. see https://pinterest.github.io/ktlint/rules/configuration-ktlint/#disabled-rules