xvik / gradle-quality-plugin

Gradle quality plugin for Java and Groovy
http://xvik.github.io/gradle-quality-plugin
MIT License
134 stars 11 forks source link

Disable output on the console #11

Closed dovogt closed 6 years ago

dovogt commented 6 years ago

When you run Checkstyle, PMD, and Spotbugs, the messages are output to the console. Is it possible to suppress the messages? The logfiles become very big. That's why I would like to activate it.

Console output: checkstyle

[Coding | MultipleStringLiterals] de.alpha.util.(ExportToolsTest.java:32)
  Der String "c:/temp/test.zip" wird in dieser Datei 3-mal verwendet.
  http://checkstyle.sourceforge.net/config_coding.html#MultipleStringLiterals

pmd

[Best Practices | AvoidReassigningParameters] de.alpha.kit.web.fe.servlets.(CSSStyleServlet.java:654)
  Avoid reassigning parameters such as 'col2'
  https://pmd.github.io/pmd-6.7.0/pmd_rules_java_bestpractices.html#avoidreassigningparameters

spotbugs

[Dodgy code | ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD] de.alpha.webservice.webserver.(JavaWebservice.java:112)  [priority 1]
    >> Write to static field de.alpha.webservice.webserver.JavaWebservice.serverConfig from instance method de.alpha.webservice.webserver.JavaWebservice.configure(String, String, String, String)
  This instance method writes to a static field. This is tricky to get
  correct if multiple instances are being manipulated,
  and generally bad practice.
xvik commented 6 years ago

Yes, of course:

quality.consoleReporting = false

Docs

dovogt commented 6 years ago

Hello, I have it active. The logs will still be displayed

image

xvik commented 6 years ago

What are your gradle and quality plugin versions? Is it multi-module project (maybe quality.consoleReporting = false applied not to all modules)?

And the picture above slightly confuses me: do you disable it in build.gradle (with quality.consoleReporting = false) or somewhere in code? (just to be sure)

I tried on gradle 4.8 and quality plugin 3.1.1 and its working.

dovogt commented 6 years ago

I have only one project. It may be that the high-priority warnings are still output to the console? The problem I have since Gradle 3. * Currently I use gradle 4.10.2 and quality plugin 3.2.0

`quality { /**

xvik commented 6 years ago

Mmm, I think I got your situation. If this is exact extract from your build file then its incorrect (and it's my bad).

Before, I put part of source code (extension class) into the documentation (and seems you copy pasted it from old doc). New doc is correct.

Look, for example,

quality {
   boolean autoRegistration = true
}

For gradle is local variable declaration, which doesn't actually do anything, and

quality {
   autoRegistration = true
}

is quality extension configuration (changing it's value).

So please remove all boolean in your config so only property names remain (like in docs) and consoleReporting = false will work correctly.

Sorry for misguiding.

dovogt commented 6 years ago

Oh sorry, I did not see that. Now it works :-) Thank you