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

Add KtLint baseline support #475

Merged
merged 4 commits into from
Jun 1, 2021

Conversation

Tapchicoma
Copy link
Collaborator

@Tapchicoma Tapchicoma commented Apr 29, 2021

This PR adds initial KtLint baseline support with following limitations:

  • Format tasks ignore baseline, see KtLint 1072 issue for more details
  • One baseline file is generated per one Gradle project (module). Merging baseline is not possible as KtLint actually uses Reporter interface to generate baseline file. Theoretically it will be possible to introduce special generate task in the root project that will trigger all subprojects, collects all errors and then write one baseline file, but let us see how big demand for it will be.

Fixes #414

@Tapchicoma Tapchicoma changed the title Adds KtLint baseline support Add KtLint baseline support Apr 29, 2021
@Tapchicoma Tapchicoma force-pushed the 414/add-baseline-support branch 2 times, most recently from 5087f80 to c06996c Compare May 9, 2021 20:41
@Tapchicoma Tapchicoma marked this pull request as ready for review May 9, 2021 20:45
@Tapchicoma Tapchicoma requested a review from JLLeitschuh May 9, 2021 20:45
@Tapchicoma Tapchicoma force-pushed the 414/add-baseline-support branch from eb73d0b to 7460a90 Compare May 9, 2021 21:17
@Tapchicoma Tapchicoma force-pushed the 414/add-baseline-support branch 2 times, most recently from 4286245 to ed71f90 Compare May 18, 2021 08:26
*/
val baseline: RegularFileProperty = objectFactory.fileProperty()
.convention(
projectLayout.projectDirectory.file("ktlintBaseline.xml")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to make the convention having this inside of a directory instead of in the project directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which directory do you have in mind? Something like $projectDir/ktlint/ktlintBaseline.xml?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have changed it to $projectDir/config/ktlint/baseline.xml

@Tapchicoma Tapchicoma force-pushed the 414/add-baseline-support branch from ed71f90 to d206cf0 Compare May 28, 2021 15:32
@Tapchicoma Tapchicoma added the skip news This PR does not require new changelog entry label May 28, 2021
It is constantly failing on Github Windows Agent, while working locally on another windows installation. It is ok just to check it on Linux OS.
@Tapchicoma Tapchicoma force-pushed the 414/add-baseline-support branch from aa03c10 to edc6f92 Compare May 31, 2021 19:36
Copy link
Owner

@JLLeitschuh JLLeitschuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -14,6 +16,7 @@ class UnsupportedGradleTest : AbstractPluginTest() {
.withGradleVersion("5.6.4")

@Test
@DisabledOnOs(OS.WINDOWS)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's up here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle test daemon disappearing on Github Windows runner. I've tried to reproduce it on another windows installation, but test there is passing successfully.

And actually it is ok to run this test only on Linux runner.

@Tapchicoma Tapchicoma merged commit 35b6005 into JLLeitschuh:master Jun 1, 2021
@Tapchicoma Tapchicoma deleted the 414/add-baseline-support branch June 1, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news This PR does not require new changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for ktlint baseline
2 participants