0

Does someone know of a checkstyle plugin that can be configured with a set of words, and will mark all occurences of those words as warnings (in identifiers or in string values) ?

The project we're working on requires that all code is in english. But most people are not native speakers and they sometimes accidentally include non-english words in their code. We'd like to detect at least some of those mistakes and signal them.

ARRG
  • 2,476
  • 17
  • 28

1 Answers1

1

Try this rule which checks for several non-English variants of "Cheers!", ignoring case:

<module name="Regexp">
    <property name="format" value="(?i)(na zdrowie|kippis|a votre sante|prost)"/>
    <property name="message" value="Use only English language"/>
    <property name="illegalPattern" value="true"/>
</module>
barfuin
  • 16,865
  • 10
  • 85
  • 132
  • Thanks for the answer. I won't be able to test it for a while, but I'll make sure to mark it as accepted in the future when I get the time to test it, if it works. Na zdrowie ! – ARRG Jan 31 '13 at 12:48