Skip to content

Commit

Permalink
supplemental: Convert from Todo check to better MatchXpath check(#10107)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkMo3 authored and romani committed Aug 4, 2021
1 parent 8ba689e commit 1ecc59d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions config/checkstyle_checks.xml
Expand Up @@ -429,14 +429,18 @@
<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')) ]]"/>
and not(@text = '\n') and not(ends-with(@text, '//\n'))
and not(@text = '\r') and not(ends-with(@text, '//\r'))
and not(@text = '\r\n') and not(ends-with(@text, '//\r\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, '*'))]]"/>
or matches(@text, '^[^\* \\n]') or matches(@text, '\\r+ *\*[^\\r ]\S')
or matches(@text, '^[^\* \\r]') or matches(@text, '\\r\\n+ *\*[^\\r\\n ]\S')
or matches(@text, '^[^\* \\r\\n]') and not(starts-with(@text, '*'))]]"/>
<message key="matchxpath.match"
value="Block comment text should start with space after asterisk."/>
</module>
Expand Down

0 comments on commit 1ecc59d

Please sign in to comment.