gradle / gradle-native

The home of Gradle's support for natively compiled languages
https://blog.gradle.org/introducing-the-new-cpp-plugins
Apache License 2.0
93 stars 8 forks source link

How to Disable/bypass checkstyle in gradle via ./gradlew sonarqube #1092

Open Sadashiv opened 3 years ago

Sadashiv commented 3 years ago

Expected Behavior

sonarqube version: 8.7 checkstyle plugin in sonarqube: 4.29

./gradlew sonarqube to be passed

Current Behavior

sonarqube version: 8.7 checkstyle plugin in sonarqube: 4.29

How to skip/bypass checkstyle during ./gradlew sonarqube. Time being not interested to go with checkstyle which is failing code anyalysis part.

./gradlew sonarqube

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Exception was thrown while processing src/main/java/org/resultsbridge/export/CsvDataExporter.java at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:304) at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:216) at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader(CheckstyleExecutor.java:103) ... 152 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: IllegalStateException occurred while parsing file src/main/java/org/resultsbridge/export/CsvDataExporter.java. at com.puppycrawl.tools.checkstyle.JavaParser.parse(JavaParser.java:105) at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:159) at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:85) at com.puppycrawl.tools.checkstyle.Checker.processFile(Checker.java:329) at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:291) ... 154 more Caused by: java.lang.IllegalStateException: src/main/java/org/resultsbridge/export/CsvDataExporter.java:589:54: expecting COLON, found ';' at com.puppycrawl.tools.checkstyle.JavaParser$1.reportError(JavaParser.java:93) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinition(GeneratedJavaRecognizer.java:411) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compilationUnit(GeneratedJavaRecognizer.java:202) at com.puppycrawl.tools.checkstyle.JavaParser.parse(JavaParser.java:99) ... 158 more src/main/java/org/resultsbridge/export/CsvDataExporter.java:589:54: expecting COLON, found ';' at antlr.Parser.match(Parser.java:211) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.aCase(GeneratedJavaRecognizer.java:6226) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.casesGroup(GeneratedJavaRecognizer.java:5760) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5463) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compoundStatement(GeneratedJavaRecognizer.java:4063) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5215) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5276) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compoundStatement(GeneratedJavaRecognizer.java:4063) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.field(GeneratedJavaRecognizer.java:3453) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.classBlock(GeneratedJavaRecognizer.java:2643) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.classDefinition(GeneratedJavaRecognizer.java:634) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinitionInternal(GeneratedJavaRecognizer.java:556) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinition(GeneratedJavaRecognizer.java:389) ... 160 more

Context

Steps to Reproduce (for bugs)

Your Environment

sonarqube version: 8.7 checkstyle plugin in sonarqube: 4.29

How to skip/bypass checkstyle during ./gradlew sonarqube. As of now i am not interested to go with checkstyle which is failing code anyalysis part.

./gradlew sonarqube

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Exception was thrown while processing src/main/java/org/resultsbridge/export/CsvDataExporter.java at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:304) at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:216) at org.sonar.plugins.checkstyle.CheckstyleExecutor.executeWithClassLoader(CheckstyleExecutor.java:103) ... 152 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: IllegalStateException occurred while parsing file src/main/java/org/resultsbridge/export/CsvDataExporter.java. at com.puppycrawl.tools.checkstyle.JavaParser.parse(JavaParser.java:105) at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:159) at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:85) at com.puppycrawl.tools.checkstyle.Checker.processFile(Checker.java:329) at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:291) ... 154 more Caused by: java.lang.IllegalStateException: src/main/java/org/resultsbridge/export/CsvDataExporter.java:589:54: expecting COLON, found ';' at com.puppycrawl.tools.checkstyle.JavaParser$1.reportError(JavaParser.java:93) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinition(GeneratedJavaRecognizer.java:411) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compilationUnit(GeneratedJavaRecognizer.java:202) at com.puppycrawl.tools.checkstyle.JavaParser.parse(JavaParser.java:99) ... 158 more src/main/java/org/resultsbridge/export/CsvDataExporter.java:589:54: expecting COLON, found ';' at antlr.Parser.match(Parser.java:211) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.aCase(GeneratedJavaRecognizer.java:6226) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.casesGroup(GeneratedJavaRecognizer.java:5760) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5463) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compoundStatement(GeneratedJavaRecognizer.java:4063) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5215) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.traditionalStatement(GeneratedJavaRecognizer.java:5276) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.statement(GeneratedJavaRecognizer.java:4397) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.compoundStatement(GeneratedJavaRecognizer.java:4063) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.field(GeneratedJavaRecognizer.java:3453) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.classBlock(GeneratedJavaRecognizer.java:2643) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.classDefinition(GeneratedJavaRecognizer.java:634) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinitionInternal(GeneratedJavaRecognizer.java:556) at com.puppycrawl.tools.checkstyle.grammar.GeneratedJavaRecognizer.typeDefinition(GeneratedJavaRecognizer.java:389) ... 160 more