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

Update AbstractChecks to log DetailAST - Indentation #7734

Closed
rnveach opened this issue Mar 1, 2020 · 19 comments
Closed

Update AbstractChecks to log DetailAST - Indentation #7734

rnveach opened this issue Mar 1, 2020 · 19 comments

Comments

@rnveach
Copy link
Member

rnveach commented Mar 1, 2020

Child of #5777

This issue specifically focuses on Indentation.

@Abhishek-kumar09
Copy link
Contributor

I am on it.

Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Mar 21, 2020
@Abhishek-kumar09
Copy link
Contributor

Please have a look on the commit:
the regression test for indentation is giving the unexpected error
For instance:
this is the regression test

 @Test
    public void testThree() throws Exception {
        final File fileToProcess = new File(
                getPath("SuppressionXpathRegressionIndentation3.java")
        );

        final DefaultConfiguration moduleConfig =
                createModuleConfig(IndentationCheck.class);
       
        final String[] expectedViolation = {
                "1:16: " + getCheckMessage(IndentationCheck.class,
                        IndentationCheck.MSG_ERROR, "package def", 15, 0),
        };

        final List<String> expectedXpathQueries = Collections.singletonList(
                "/PACKAGE_DEF"
        );

        runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries);
    }

The expectedXpathQueries and expectedViolation are all good and correct.
Following is the content of suppressionxpathregressionIndentation3.java file, for checking wrong indentation in package declaration.

               package org.checkstyle.suppressionxpathfilter.indentation; //warn

The error log is :

/usr/lib/jvm/java-11-amazon-corretto/bin/java -ea -Djacoco-agent.destfile=/home/abhishek99/Documents/checkStyle/checkstyle/target/jacoco.exec -Didea.test.cyclic.buffer.size=1048576 -javaagent:/home/abhishek99/Applications/ideaIC-2019.3.3/idea-IC-193.6494.35/lib/idea_rt.jar=37815:/home/abhishek99/Applications/ideaIC-2019.3.3/idea-IC-193.6494.35/bin -Dfile.encoding=UTF-8 -classpath /home/abhishek99/Applications/ideaIC-2019.3.3/idea-IC-193.6494.35/lib/idea_rt.jar:/home/abhishek99/Applications/ideaIC-2019.3.3/idea-IC-193.6494.35/plugins/junit/lib/junit5-rt.jar:/home/abhishek99/Applications/ideaIC-2019.3.3/idea-IC-193.6494.35/plugins/junit/lib/junit-rt.jar:/home/abhishek99/Documents/checkStyle/checkstyle/target/test-classes:/home/abhishek99/Documents/checkStyle/checkstyle/target/classes:/home/abhishek99/.m2/repository/info/picocli/picocli/4.2.0/picocli-4.2.0.jar:/home/abhishek99/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/abhishek99/.m2/repository/org/antlr/antlr4-runtime/4.8-1/antlr4-runtime-4.8-1.jar:/home/abhishek99/.m2/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar:/home/abhishek99/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/home/abhishek99/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/home/abhishek99/.m2/repository/com/google/guava/guava/28.2-jre/guava-28.2-jre.jar:/home/abhishek99/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/home/abhishek99/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/home/abhishek99/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/home/abhishek99/.m2/repository/org/checkerframework/checker-qual/2.10.0/checker-qual-2.10.0.jar:/home/abhishek99/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar:/home/abhishek99/.m2/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar:/home/abhishek99/.m2/repository/org/apache/ant/ant/1.10.7/ant-1.10.7.jar:/home/abhishek99/.m2/repository/org/apache/ant/ant-launcher/1.10.7/ant-launcher-1.10.7.jar:/home/abhishek99/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.6.0/junit-jupiter-api-5.6.0.jar:/home/abhishek99/.m2/repository/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar:/home/abhishek99/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar:/home/abhishek99/.m2/repository/org/junit/platform/junit-platform-commons/1.6.0/junit-platform-commons-1.6.0.jar:/home/abhishek99/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.6.0/junit-jupiter-engine-5.6.0.jar:/home/abhishek99/.m2/repository/org/junit/platform/junit-platform-engine/1.6.0/junit-platform-engine-1.6.0.jar:/home/abhishek99/.m2/repository/org/itsallcode/junit5-system-extensions/1.1.0/junit5-system-extensions-1.1.0.jar:/home/abhishek99/.m2/repository/org/junit-pioneer/junit-pioneer/0.5.4/junit-pioneer-0.5.4.jar:/home/abhishek99/.m2/repository/org/junit/jupiter/junit-jupiter-params/5.3.2/junit-jupiter-params-5.3.2.jar:/home/abhishek99/.m2/repository/org/junit/vintage/junit-vintage-engine/5.6.0/junit-vintage-engine-5.6.0.jar:/home/abhishek99/.m2/repository/junit/junit/4.13/junit-4.13.jar:/home/abhishek99/.m2/repository/com/google/truth/truth/1.0.1/truth-1.0.1.jar:/home/abhishek99/.m2/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar:/home/abhishek99/.m2/repository/com/googlecode/java-diff-utils/diffutils/1.3.0/diffutils-1.3.0.jar:/home/abhishek99/.m2/repository/com/google/auto/value/auto-value-annotations/1.6.3/auto-value-annotations-1.6.3.jar:/home/abhishek99/.m2/repository/com/github/stefanbirkner/system-rules/1.19.0/system-rules-1.19.0.jar:/home/abhishek99/.m2/repository/nl/jqno/equalsverifier/equalsverifier/3.1.13/equalsverifier-3.1.13.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-api-mockito2/2.0.5/powermock-api-mockito2-2.0.5.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-api-support/2.0.5/powermock-api-support-2.0.5.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-reflect/2.0.5/powermock-reflect-2.0.5.jar:/home/abhishek99/.m2/repository/net/bytebuddy/byte-buddy/1.9.10/byte-buddy-1.9.10.jar:/home/abhishek99/.m2/repository/net/bytebuddy/byte-buddy-agent/1.9.10/byte-buddy-agent-1.9.10.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-core/2.0.5/powermock-core-2.0.5.jar:/home/abhishek99/.m2/repository/org/javassist/javassist/3.25.0-GA/javassist-3.25.0-GA.jar:/home/abhishek99/.m2/repository/org/mockito/mockito-core/2.28.2/mockito-core-2.28.2.jar:/home/abhishek99/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-module-junit4/2.0.5/powermock-module-junit4-2.0.5.jar:/home/abhishek99/.m2/repository/org/powermock/powermock-module-junit4-common/2.0.5/powermock-module-junit4-common-2.0.5.jar:/home/abhishek99/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/abhishek99/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/home/abhishek99/.m2/repository/org/eclipse/jgit/org.eclipse.jgit/5.7.0.202003110725-r/org.eclipse.jgit-5.7.0.202003110725-r.jar:/home/abhishek99/.m2/repository/com/jcraft/jsch/0.1.55/jsch-0.1.55.jar:/home/abhishek99/.m2/repository/com/jcraft/jzlib/1.1.1/jzlib-1.1.1.jar:/home/abhishek99/.m2/repository/com/googlecode/javaewah/JavaEWAH/1.1.7/JavaEWAH-1.1.7.jar:/home/abhishek99/.m2/repository/org/slf4j/slf4j-api/1.7.2/slf4j-api-1.7.2.jar:/home/abhishek99/.m2/repository/org/bouncycastle/bcpg-jdk15on/1.64/bcpg-jdk15on-1.64.jar:/home/abhishek99/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar:/home/abhishek99/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar:/home/abhishek99/.m2/repository/org/slf4j/slf4j-simple/1.7.30/slf4j-simple-1.7.30.jar:/home/abhishek99/.m2/repository/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar:/home/abhishek99/.m2/repository/net/sf/saxon/Saxon-HE/9.9.1-7/Saxon-HE-9.9.1-7.jar:/home/abhishek99/.m2/repository/org/junit/platform/junit-platform-launcher/1.6.0/junit-platform-launcher-1.6.0.jar:src/test/resources-noncompilable com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit5 org.checkstyle.suppressionxpathfilter.XpathRegressionIndentationTest,testThree



org.opentest4j.AssertionFailedError: unexpected output: /home/abhishek99/Documents/checkStyle/checkstyle/src/it/resources/org/checkstyle/suppressionxpathfilter/indentation/SuppressionXpathRegressionIndentation3.java:1:16: 'package def' has incorrect indentation level 15, expected level should be 0. ==> 
Expected :0
Actual   :1
<Click to see difference>


	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertionUtils.failNotEqual(AssertionUtils.java:62)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:542)
	at org.checkstyle.base.AbstractItModuleTestSupport.verify(AbstractItModuleTestSupport.java:257)
	at org.checkstyle.base.AbstractItModuleTestSupport.verify(AbstractItModuleTestSupport.java:207)
	at org.checkstyle.suppressionxpathfilter.AbstractXpathTestSupport.runVerifications(AbstractXpathTestSupport.java:210)
	at org.checkstyle.suppressionxpathfilter.XpathRegressionIndentationTest.testThree(XpathRegressionIndentationTest.java:128)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:205)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:201)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
	at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)



Process finished with exit code 255

The error is comming due to this line in (AbstractItModuleTestSupport.java at lineNo. 257)

assertEquals(expected.length,
                    errs, "unexpected output: " + lnr.readLine());

Removing this line passes the test cases, and not only this I have tried many other cases for indentation check with different examples (three of them are in my commit), but all have the same result (failing with the same error log).

Please help if I am missing something.

@rnveach
Copy link
Member Author

rnveach commented Mar 21, 2020

AbstractXpathTestSupport.runVerifications(AbstractXpathTestSupport.java:210)

Xpath is failing to suppress the violation this is why no violations are expected.

Can you confirm the issue with the CLI? Generate xpath suppression and then use xpath suppression filter to show violation remains.

@Abhishek-kumar09
Copy link
Contributor

Ok, I will do it. Thank you @rnveach

@Abhishek-kumar09
Copy link
Contributor

Abhishek-kumar09 commented Mar 21, 2020

Should I check it with checkstyle-8.30-all.jar (It is giving error: Exception in thread "main" java.lang.IllegalStateException: Unknown name:suppressions. )

<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
  "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
  "https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
  <suppress checks="Indentation"
    files="Test.java"
    lines="1"/>
</suppressions>
          

or am I doing the wrong checks.

@rnveach
Copy link
Member Author

rnveach commented Mar 21, 2020

https://checkstyle.org/cmdline.html#Command_line_usage
Option -g will print the xpath suppression for the configuration and file. Use the file that is causing the issue and recreate the configuration from your UT.

After you show us that run, use the suppression it generates as part of the xpath single filter and see if you can suppress the violation.
https://checkstyle.org/config_filters.html#SuppressionXpathSingleFilter_Examples

Should I check it with checkstyle-8.30-all.jar

Yes, the released version of checkstyle.

@Abhishek-kumar09
Copy link
Contributor

generate-xpath-suppression is not working for Indentation.

$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">

<module name = "Checker">
    <module name="TreeWalker">
        <module name="Indentation">               
        </module>
    </module>
</module>

$ cat Test.java
class Test {
    void indentationTest() {
    int indent = 0;

    }
}

$ java -jar checkstyle-8.30-all.jar -g -c config.xml Test.java
Checkstyle ends with 1 errors.

Thinking that I am doing something wrong, I tried on other module and that worked without an issue and xpathsupression is generated successfully. for instance,

$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
          "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
          "http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">

<module name = "Checker">
    <module name="TreeWalker">
        <module name="NoWhitespaceBefore">               
        </module>
    </module>
</module>

$ Test.java
class Test {
  void otherTestIsWorking() {
    int whitespace = 0  ;
  }
}

$ java -jar checkstyle-8.30-all.jar -g -c config.xml Test.java
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
    "-//Checkstyle//DTD SuppressionXpathFilter Experimental Configuration 1.2//EN"
    "https://checkstyle.org/dtds/suppressions_1_2_xpath_experimental.dtd">
<suppressions>
<suppress-xpath
       files="Test.java"
       checks="NoWhitespaceBeforeCheck"
       query="/CLASS_DEF[./IDENT[@text='Test']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='otherTestIsWorking']]/SLIST/SEMI"/>
</suppressions>
Checkstyle ends with 1 errors.

Am I doing something wrong with indentation test or is it a new checkstyle issue.

Thanks @rnveach

@rnveach
Copy link
Member Author

rnveach commented Mar 22, 2020

You are right, it is my fault. You will need to work with the all jar created from your PR branch. log(DetailAST) is required for xpath suppression to work and it is only in your PR branch as this work shows. Sorry.
Command to create all jar is mvn --batch-mode -Pno-validations clean package -Passembly. It will be stored in target folder.

@Abhishek-kumar09
Copy link
Contributor

$ java -jar checkstyle-8.31-SNAPSHOT-all.jar  -c config.xml Test.java 
Starting audit...
[ERROR] /home/abhishek99/GSoC/NoWhitespaceBefore/Test.java:3:5: 'method def' child has incorrect indentation level 4, expected level should be 8. [Indentation]
Audit done.
Checkstyle ends with 1 errors.

Suppression xpath is not generated with the new checkstyle jar, and the detailLogAST changes are applied.

$ java -jar checkstyle-8.31-SNAPSHOT-all.jar -g -c config.xml Test.java 
Checkstyle ends with 1 errors.

@rnveach
Copy link
Member Author

rnveach commented Mar 22, 2020

@romani ping

@Abhishek-kumar09 Can you examine why CLI reports no suppression while IT tests generates a suppression?
If you feel this is too complex, I would move on to another issue.

@romani
Copy link
Member

romani commented Mar 22, 2020

please move this to another issue, we should merge this PR sooner, in new issue lets mention that IT should be fixed.

@Abhishek-kumar09
Copy link
Contributor

@Abhishek-kumar09 Can you examine why CLI reports no suppression while IT tests generates a suppression?

I can try.

@rnveach
Copy link
Member Author

rnveach commented Mar 22, 2020

@Abhishek-kumar09 I am sorry for conflicting messages. @romani thinks its better to just move on. Please save this PR and start a new PR to update documentation that Indentation will not be supported to the issue is resolved. Please put all details of issue into this main issue for us to come back to later.

@Abhishek-kumar09
Copy link
Contributor

Abhishek-kumar09 commented Mar 22, 2020

Should a new Issue be created to address this problem about Suppression xpath is not generated for indentation?

@Abhishek-kumar09
Copy link
Contributor

wrong indentaion log is caught at some points, please see Abhishek-kumar09@86a45dc#r38003427

@romani
Copy link
Member

romani commented Apr 5, 2020

Should a new Issue be created to address this problem about Suppression xpath is not generated for indentation?

yes, just copy your example that -g does not work for Indentation but works for another Check.


In this issue please update Check to report violation on AST node, you already updated doc to keep it in list of unsupported Checks in documentation, .... good but please make reference "untill ...." to issue that you need to create.
Check should migrate to logging by AST, no matter what problems in Xpath we have now.

@Abhishek-kumar09
Copy link
Contributor

Ok, I will do it. Thanks.

Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Apr 19, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Apr 26, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Apr 26, 2020
@rdiachenko rdiachenko added this to To do in Patch Suppression May 17, 2020
HuGanghui added a commit to HuGanghui/checkstyle that referenced this issue Jun 4, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 4, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 4, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 4, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 5, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 5, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 14, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 14, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 15, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 15, 2020
Abhishek-kumar09 added a commit to Abhishek-kumar09/checkstyle that referenced this issue Jun 16, 2020
@romani romani added this to the 8.34 milestone Jun 23, 2020
@romani
Copy link
Member

romani commented Jun 23, 2020

fix is merged.

@Abhishek-kumar09 , thanks a lot for your hard work. It is the most complicated module in checkstyle, but you managed to make change with proper testing.
I am looking forward for new contributions.

@romani romani closed this as completed Jun 23, 2020
Patch Suppression automation moved this from To do to Done Jun 23, 2020
@Abhishek-kumar09
Copy link
Contributor

Thanks for your kind comment @romani :)

@romani romani added the bug label Jun 24, 2020
jo2 pushed a commit to jo2/checkstyle that referenced this issue Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

3 participants