Skip to content

Commit

Permalink
supplemental: Convert from Todo check to better MatchXpath check(chec…
Browse files Browse the repository at this point in the history
  • Loading branch information
AkMo3 committed Jul 20, 2021
1 parent b557d01 commit a5f54a6
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions config/checkstyle_checks.xml
Expand Up @@ -425,6 +425,21 @@
<message key="matchxpath.match"
value="Avoid using deprecated method 'DetailAst.branchContains()'."/>
</module>
<module name="MatchXpath">
<property name="id" value="singleLineCommentStartWithSpace"/>
<property name="query"
value="//SINGLE_LINE_COMMENT[./COMMENT_CONTENT[not(starts-with(@text, ' '))
and not(@text = '\n') and not(ends-with(@text, '//\n')) ]]"/>
<message key="matchxpath.match" value="Single line comment text should start with space."/>
</module>
<module name="MatchXpath">
<property name="id" value="blockCommentStartWithSpace"/>
<property name="query"
value="//BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT[matches(@text, '\\n+ *\*[^\\n ]\S')
or matches(@text, '^[^\* \\n]') and not(starts-with(@text, '*'))]]"/>
<message key="matchxpath.match"
value="Block comment text should start with space after asterisk."/>
</module>
<module name="MissingCtor">
<!--
we will not use that fanatic validation, extra code is not good
Expand Down Expand Up @@ -677,12 +692,6 @@
<module name="TodoComment">
<property name="format" value="(TODO)|(FIXME)" />
</module>
<!-- till https://github.com/checkstyle/checkstyle/issues/8137 -->
<module name="TodoComment">
<property name="id" value="commentStartWithSpace"/>
<property name="format" value="^([^\s\/*])"/>
<message key="todo.match" value="Comment text should start with space."/>
</module>
<module name="TrailingComment"/>
<module name="UncommentedMain">
<property name="excludedClasses" value="\.(Main|JavadocPropertiesGenerator)$"/>
Expand Down

0 comments on commit a5f54a6

Please sign in to comment.