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
Issue #13345: enable example test for SeverityMatchFilterExamplesTest #14784
base: master
Are you sure you want to change the base?
Issue #13345: enable example test for SeverityMatchFilterExamplesTest #14784
Conversation
The work on this PR is not yet complete. To avoid unnecessary work, I want to first confirm a suitable solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
items:
@@ -0,0 +1 @@ | |||
name.invalidPattern=Name ''{0}'' must match pattern ''{1}''. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what forcing you to add this file and such property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see guidance at #14784 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
yes, it is defect of our tes suite as it expects modules to be in same package and target module - Filter in this case.
not good, can we update internal suite code to take messages from file we will provide as hardcoded values, same as we did for fully qualified names ( item above) |
e14b1a8
to
f9f877a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Items
|
||
public void method1(int V1){} // ok, ParameterNameCheck's severity is info | ||
|
||
public void Method2(){} // violation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// violation, as default severity is error
<source> | ||
public class Example1 { | ||
|
||
public void method1(int V1){} // ok, ParameterNameCheck's severity is info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ok, ParameterName's severity is info
if (endIndex < 0) { | ||
messageBundle = messages; | ||
} | ||
else { | ||
final String packageName = className.substring(0, endIndex); | ||
messageBundle = packageName + "." + messages; | ||
if ("com.puppycrawl.tools.checkstyle.filters".equals(packageName)) { | ||
messageBundle = messageBundleMappings.get(className.substring(endIndex + 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change logic to use value from manual mapping if mapping is present.
If present in special map then use it , else use packageName
@Kexin2000 ,please find time to finish PR |
part of issue: #13345
this is the first example test for filter, I've encountered some issues and need to discuss potential solutions. @romani @nrmancuso
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/bdd/InlineConfigParser.java
Lines 372 to 390 in 571e547
checkstyle/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java
Lines 600 to 610 in 571e547