Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ktlint-gradle with ktlint-intellij-plugin and baseline file #753

Open
Rshalika opened this issue Mar 12, 2024 · 0 comments
Open

Using ktlint-gradle with ktlint-intellij-plugin and baseline file #753

Rshalika opened this issue Mar 12, 2024 · 0 comments

Comments

@Rshalika
Copy link

Hello,

I want to be able to use ktlint-gradle integration together with the official Ktlint plugin for intelliJ IDEA.
Problems start when I try to also keep the baseline file for both ktlint-gradle and IntelliJ plugin. When I run ktlintGenerateBaseline it generates baseline for submodule (app module in my case for Android). But, IntelliJ plugin expects the baseline generated from the root directory of the project.

I have opened an [issue] (nbadal/ktlint-intellij-plugin#472) in intelliJ plugin repo which describes what is an exact problem in my case.
TLDR: it is about <file name="app/src/ vs <file name="src/

In the documentation I can read that "One baseline file is generated per one Gradle project (module)." My question is, is there a way to generate the baseline file from the root project directory?

I tried to generate a baseline with just ktlint command line from the root project directory and pass that file as baseline configuration but that did not work. ktlintCheck still shows all the errors that are in baseline.

I also tried to only apply ktlint-gradle in the root gradle file and then run ktlintGenerateBaseline. And it generated an empty baseline file. (Even if I have some kotlin files in the root directory with some errors it still generates an empty baseline file).

to go back to this "One baseline file is generated per one Gradle project (module)." what does project and model refer to in this statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant