Skip to content

E10 when using custom checkstyle.xml #19

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

Closed
efueger opened this issue Oct 17, 2017 · 4 comments
Closed

E10 when using custom checkstyle.xml #19

efueger opened this issue Oct 17, 2017 · 4 comments
Assignees

Comments

@efueger
Copy link
Member

efueger commented Oct 17, 2017

Bug

Actual Behavior

User is experiencing an E10 error when trying to analyze this repo: https://github.com/dropwizard/dropwizard

  • Code Climate Support has tested against "beta" and stable channels. (both errored)

  • Support has also increased the max memory threshold to 3.73 gigs (still errored)

  • customer's repo has a different checkstyle.xml (compared to the one the engine is shipped with)

  • replacing customer's checkstyle.xml with CC's allows the build to complete.


BTW: analysis does work with the CLI, but I think it might be related to CLI silently failing?


Expected Behavior

  • completed analysis
  • error indicating what might be wrong

Relevant links

@arteam
Copy link

arteam commented Oct 17, 2017

Hi! I am the reporter of the issue, happy to help with debugging.

I tried to check different configurations in our .codeclimate.yml file, but without success. If add the checkstyle plugin to our Maven build, it seems to be working fine and picking up the config. At least I see some violations in the console.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <version>2.17</version>
    <configuration>
        <configLocation>checkstyle.xml</configLocation>
        <encoding>UTF-8</encoding>
        <consoleOutput>true</consoleOutput>
        <failOnViolation>false</failOnViolation>
    </configuration>
</plugin>

From the user's perspective it would be nice to see an error log from the engine in the web interface instead of a generic error.

@arteam
Copy link

arteam commented Oct 17, 2017

Without the Maven plugin and a downloaded checkstyle jar file, analysys seems to be working too:

java -jar checkstyle-8.2-all.jar -c checkstyle.xml $(find -name *.java | grep -v "dropwizard-archetypes" | paste -sd " ")

@filipesperandio
Copy link
Contributor

@arteam @efueger Checkstyle has a tricky way to handle the output of some violations, so it is indeed not helpful.

What is happening here is that the default Severity for UnnecessaryParentheses is defined as ERROR and checkstyle itself abort the execution on those. To overcome this behavior we change the default Severity of all violations to be WARNING within the builtin checkstyle.xml the engine provides, that can be done in the custom file as well and might solve this problem:

...
<module name="Checker">
    <property name="severity" value="warning"/>
    ...

I will make sure that we add this to our documentation as well.

@efueger efueger closed this as completed Oct 24, 2017
Botffy added a commit to Botffy/XPLanG that referenced this issue Jul 29, 2019
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

3 participants