问题
Can checkstyle be configured to check xml, text, properties file formats. I have a requirment wherein I need to check for certain keywords in java, xml, text etc. file formats. For e.g. if in a text file the text "danger" appears, then I need to inform the user that the text danger appears in this line, please remove it.
回答1:
Checkstyle has a regular expression check that can check for any keyword for you. But I don't know how to get it to check non-java files. I think a better tool for this job is grep.
回答2:
PMD can at least check XML. For anything else you may want to consider writing a plug-in for Sonar.
来源:https://stackoverflow.com/questions/750585/checkstyle-for-xml-text-properties-file-formats