com.puppycrawl.tools.checkstyle.meta.checks.OrderedPropertiesCheck.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkstyle Show documentation
Show all versions of checkstyle Show documentation
Checkstyle is a development tool to help programmers write Java code
that adheres to a coding standard
<?xml version="1.0" encoding="UTF-8"?> <checkstyle-metadata> <module> <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck" name="OrderedProperties" parent="com.puppycrawl.tools.checkstyle.Checker"> <description><p>Detects if keys in properties files are in correct order.</p> <p> Rationale: Sorted properties make it easy for people to find required properties by name in file. It makes merges more easy. While there are no problems at runtime. This check is valuable only on files with string resources where order of lines does not matter at all, but this can be improved. E.g.: checkstyle/src/main/resources/com/puppycrawl/tools/checkstyle/messages.properties You may suppress warnings of this check for files that have an logical structure like build files or log4j configuration files. See SuppressionFilter. {@code &lt;suppress checks="OrderedProperties" files="log4j.properties|ResourceBundle/Bug.*.properties|logging.properties"/&gt; } </p> <p>Known limitation: The key should not contain a newline. The string compare will work, but not the line number reporting.</p></description> <properties> <property default-value=".properties" name="fileExtensions" type="java.lang.String[]"> <description>Specify file type extension of the files to check.</description> </property> </properties> <message-keys> <message-key key="properties.notSorted.property"/> <message-key key="unable.open.cause"/> </message-keys> </check> </module> </checkstyle-metadata>