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 report is generating for sun_checks instead of google_checks #70

Closed
ABHAY0O7 opened this issue Apr 4, 2021 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ABHAY0O7
Copy link
Contributor

ABHAY0O7 commented Apr 4, 2021

The problem about the checkstyle that I mention in this issue #42 still exists.

See report generated:
image

In code too:
Screenshot 2021-04-05 024904

But this time I also got the cause for it.
In the project's pom file it is clearly mentioned that Google_checks are adopted.

See this
Screenshot 2021-04-05 024255

It is true that in the parent checkstyle module, the configuration is of google checks.
See
Screenshot 2021-04-05 030632

But the module that is configured in both depclean core and maven plugin is of sun_checks.
See this
image

So it can be fixed either by mentioning that sun_checks are adopted in parent pom file or replace the checkstyle with this one in both depclean core as well as in maven plugin.
I can fix this issue but please suggest to me the correct way (mentioned above) of fixing this issue.

@ABHAY0O7 ABHAY0O7 added the bug Something isn't working label Apr 4, 2021
@cesarsotovalero
Copy link
Collaborator

cesarsotovalero commented Apr 5, 2021

Hi @ABHAY0O7, thanks for reporting this issue.

Checkstyle is part of the DepClean CI pipeline. If you look at the pom.xml of the DepClean modules (eg. https://github.com/castor-software/depclean/blob/master/depclean-core/pom.xml#L48), you will notice that the configuration file used is the checkstyle.xml located at the root of the repo, which is actually a less strict version of the Google conventions, see https://github.com/castor-software/depclean/blob/master/checkstyle.xml.

If you run mvn checkstyle:checkstyle then the default maven-checkstyle-plugin is executed, which is configured to use the sun_checks. To run the Checkstyle configured for this project (which should trigger no errors), you should run mvn validate for if you want to run check Checkstyle goal (see https://github.com/castor-software/depclean/blob/master/depclean-core/pom.xml#L52) or mvn verify for the checkstyle goal that generates the report (see https://github.com/castor-software/depclean/blob/master/depclean-core/pom.xml#L52).

To fix the issue and get the correct report when running mvn checkstyle:checkstyle, the property <checkstyle.config.location>../checkstyle.xml</checkstyle.config.location> needs to be added in the pom.xml (see https://stackoverflow.com/a/14010915/10480869).

I've just created a PR to solve the issue, see #71.

@cesarsotovalero
Copy link
Collaborator

@ABHAY0O7 Please close this issue IF #71 fixed this issue. Thanks.

@ABHAY0O7
Copy link
Contributor Author

ABHAY0O7 commented Apr 5, 2021

Thanks, @cesarsotovalero,
I checked it and the issue is solved.

@ABHAY0O7 ABHAY0O7 closed this as completed Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants