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

Checkstyle in local setup - intelliJ #17450

Closed
Shekharrajak opened this issue Nov 5, 2024 · 7 comments
Closed

Checkstyle in local setup - intelliJ #17450

Shekharrajak opened this issue Nov 5, 2024 · 7 comments

Comments

@Shekharrajak
Copy link

I have setup intellij as per the doc: https://github.com/apache/druid/blob/master/CONTRIBUTING.md#how-to-contribute

Imported code style settings xml: druid_intellij_formatting.xml.

But I do not see the actual style error which is aligned with github action script output error in my PR: #17392

Can anyone know what I am missing ?

image
@abhishekrb19
Copy link
Contributor

Make sure you've imported the project as a "Maven project" in your Intellij, so the mvn steps use the correct project configurations; the checkstyle config file should be codestyle/checkstyle.xml. Fwiw, I’m seeing the same checkstyle errors as in your PR:

CleanShot 2024-11-05 at 08 55 21@2x

If that doesn't still work, you can also run the mvn checkstyle:checkstyle command locally in your terminal.

@Shekharrajak
Copy link
Author

the checkstyle config file should be codestyle/checkstyle.xml

I just have to import the codestyle xml : druid_intellij_formatting.xml right ?

@Shekharrajak
Copy link
Author

With the mvn checkstyle command I do not get the error details
image
Can you please let me know what I am missing ?

@abhishekrb19
Copy link
Contributor

What do you see above the "BUILD FAILURE" in red? It should list out the individual checkstyle errors.

I just have to import the codestyle xml : druid_intellij_formatting.xml right ?

In addition to importing the code style settings, druid_intellij_formatting.xml, you'll need to open the druid repo as a new project by selecting the root level pom.xml. This is so your IDE recognizes that it's a maven project and you can run maven commands directly from it.

@Shekharrajak
Copy link
Author

Somehow I only see this
image

@abhishekrb19
Copy link
Contributor

ah yes, you will see the errors if you scroll a bit above to the druid-iceberg-extensions project. We run checkstyle with the --fail-at-end mode, so the individual errors will be listed after each sub-project's checks, not in the end. Hope that helps!
CleanShot 2024-11-05 at 10 41 56@2x

@Shekharrajak
Copy link
Author

Thanks! Locally I am able to check in intelliJ. Although in CLI I am not sure, why the error details are missing for me.

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

2 participants