JLLeitschuh / ktlint-gradle

A ktlint gradle plugin
MIT License
1.48k stars 163 forks source link

How to use baseline when the project has multiple modules? #765

Open Tgo1014 opened 5 months ago

Tgo1014 commented 5 months ago

I've generated the baseline.xmls files using ktlintGenerateBaseline. Then I've added:

subprojects {
  ktlint {
   [...]
   baseline = file("baseline.xml")
   [...]
  }
}

but it gets ignored when I run ktlintFormat.

Is there a way to have a baseline.xml per module and have the ktlintFormat to ignore the issues on the baseline?

saran-epifi commented 1 month ago

The issue pointed to Readme https://github.com/JLLeitschuh/ktlint-gradle/blob/7fc6fe24b68c673f152a38b3dbffca768f98f847/README.md?plain=1#L202

has been resolved. However, using the latest ktlint version with this gradle plugin still formats the errors in the baseline file.

How do we make the format task ignore the errors included in the baseline?