checkstyle-simple.xml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!DOCTYPE module PUBLIC
  17. "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
  18. "https://checkstyle.org/dtds/configuration_1_3.dtd">
  19. <!-- This is a checkstyle configuration file. For descriptions of
  20. what the following rules do, please see the checkstyle configuration
  21. page at http://checkstyle.sourceforge.net/config.html -->
  22. <module name="Checker">
  23. <!-- Prevent *Tests.java as tools may not pick them up -->
  24. <module name="RegexpOnFilename">
  25. <property name="fileNamePattern" value=".*Tests\.java$" />
  26. </module>
  27. <module name="SuppressionFilter">
  28. <property name="file" value="${checkstyle.suppressions.file}" default="suppressions.xml" />
  29. </module>
  30. <!-- All Java AST specific tests live under TreeWalker module. -->
  31. <module name="TreeWalker">
  32. <!-- Allow use of comment to suppress javadocstyle -->
  33. <module name="SuppressionCommentFilter">
  34. <property name="offCommentFormat" value="CHECKSTYLE.OFF\: ([\w\|]+)"/>
  35. <property name="onCommentFormat" value="CHECKSTYLE.ON\: ([\w\|]+)"/>
  36. <property name="checkFormat" value="$1"/>
  37. </module>
  38. <module name="TodoComment">
  39. <!-- Checks that disallowed strings are not used in comments. -->
  40. <property name="format" value="(@author)" />
  41. </module>
  42. <module name="PackageName">
  43. <!-- Validates identifiers for package names against the
  44. supplied expression. -->
  45. <!-- Here the default checkstyle rule restricts package name parts to
  46. seven characters, this is not in line with common practice at Google.
  47. -->
  48. <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,})*$"/>
  49. <property name="severity" value="error"/>
  50. </module>
  51. </module>
  52. </module>