Skip to content

Commit

Permalink
Issue sevntu-checkstyle#610: added CheckstyleTestMakeupCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
rnveach authored and kariem committed Jul 26, 2018
1 parent 1e5c804 commit 6219538
Show file tree
Hide file tree
Showing 10 changed files with 838 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ HideUtilityClassConstructorCheck.desc = Make sure that utility classes (classes

InnerClassCheck.name = Inner Class
InnerClassCheck.desc = Check nested (internal) classes to be declared at the bottom of the class after all methods (fields) declaration.

CheckstyleTestMakeupCheck.name = Checkstyle Test Makeup
CheckstyleTestMakeupCheck.desc = Custom check to ensure Checkstyle tests are designed correctly.
CheckstyleTestMakeupCheck.createMethodRegexp = Regular expression for matching a create configuration method by name.
CheckstyleTestMakeupCheck.verifyMethodRegexp = Regular expression for matching a verify method by name.
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,24 @@
<message-key key="arrangement.members.before.inner"/>
</rule-metadata>

<rule-metadata name="%CheckstyleTestMakeupCheck.name" internal-name="CheckstyleTestMakeupCheck" parent="TreeWalker">
<alternative-name internal-name="com.github.sevntu.checkstyle.checks.design.CheckstyleTestMakeupCheck"/>
<description>%CheckstyleTestMakeupCheck.desc</description>

<property-metadata name="createMethodRegexp" datatype="Regex" default-value="create(Root|Module)Config|getModuleConfig">
<description>%CheckstyleTestMakeupCheck.createMethodRegexp</description>
</property-metadata>

<property-metadata name="verifyMethodRegexp" datatype="Regex" default-value="verify(Warns|Suppressed)?">
<description>%CheckstyleTestMakeupCheck.verifyMethodRegexp</description>
</property-metadata>

<message-key key="tester.config.not.assigned"/>
<message-key key="tester.config.not.assigned.with"/>
<message-key key="tester.config.not.assigned.properly"/>
<message-key key="tester.unknown.property"/>
<message-key key="tester.config.not.found"/>
</rule-metadata>

</rule-group-metadata>
</checkstyle-metadata>
1 change: 1 addition & 0 deletions sevntu-checks/sevntu-checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
<module name="com.github.sevntu.checkstyle.checks.design.NestedSwitchCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.AvoidConditionInversionCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.CauseParameterInExceptionCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.CheckstyleTestMakeupCheck"/>

<!-- Naming -->
<module name="com.github.sevntu.checkstyle.checks.naming.InterfaceTypeParameterNameCheck">
Expand Down
Loading

0 comments on commit 6219538

Please sign in to comment.