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

Message validation in our Inputs should not have trailing and leading '.*' #10943

Closed
romani opened this issue Nov 11, 2021 · 1 comment · Fixed by #10980
Closed

Message validation in our Inputs should not have trailing and leading '.*' #10943

romani opened this issue Nov 11, 2021 · 1 comment · Fixed by #10980

Comments

@romani
Copy link
Member

romani commented Nov 11, 2021

detected during code review #10839 (comment)

Message validation in our Inputs should not have trailinng and leading .*.

following modification of test should be acceptable

✔ ~/java/github/romani/checkstyle [strkkk/10144_multicatch L|✚ 1] 
$ git diff
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity/InputClassFanOutComplexityImplementsAndNestedCount.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity/InputClassFanOutComplexityImplementsAndNestedCount.java
index 25daa35..82b09e1 100644
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity/InputClassFanOutComplexityImplementsAndNestedCount.java
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity/InputClassFanOutComplexityImplementsAndNestedCount.java
@@ -24,7 +24,7 @@ import java.io.Serializable;
 import java.util.RandomAccess;
 
 // count is 3 - two interfaces and parent class
-public class InputClassFanOutComplexityImplementsAndNestedCount // violation '.* Complexity is 3 .*'
+public class InputClassFanOutComplexityImplementsAndNestedCount // violation 'Complexity is 3'
     extends Outer.Nested implements Serializable, RandomAccess {
 
 }

image

But UT failing.

Actual and expected violations differ.
expected to match: 27:(?:\d+:)?\s.*Complexity is 3
but was          : 27:1: Class Fan-Out Complexity is 3 (max allowed is 0).

	at com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport.verifyViolations(AbstractModuleTestSupport.java:431)
	at com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport.verifyWithInlineConfigParser(AbstractModuleTestSupport.java:270)
	at com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheckTest.testImplementsAndNestedCount(ClassFanOutComplexityCheckTest.java:239)
@strkkk strkkk changed the title Message validation in our Inputs should not have trailinng and leading '.*' Message validation in our Inputs should not have trailing and leading '.*' Nov 12, 2021
@Vyom-Yadav
Copy link
Member

I am on it.

Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 26, 2021
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 26, 2021
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 26, 2021
github-actions bot pushed a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 27, 2021
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 27, 2021
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Nov 27, 2021
romani pushed a commit that referenced this issue Nov 27, 2021
@romani romani added this to the 9.2 milestone Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2 participants