| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> |
| |
| <!-- |
| See installation instructions: https://sites.google.com/a/chromium.org/dev/developers/checkstyle |
| --> |
| <module name="Checker"> |
| <property name="severity" value="warning"/> |
| <property name="charset" value="UTF-8"/> |
| <module name="SuppressionFilter"> |
| <property name="file" value="tools/android/checkstyle/suppressions.xml"/> |
| </module> |
| <module name="TreeWalker"> |
| <module name="AvoidStarImport"> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="IllegalCatch"> |
| <property name="severity" value="info"/> |
| </module> |
| <module name="RedundantImport"> |
| <message key="import.redundant" value="Redundant import: {0}. Use :JavaImportOrganize (ECLIM) or Ctrl+Shift+O (Eclipse) to sort imports"/> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="UnusedImports"> |
| <message key="import.unused" value="Unused import: {0}. Use :JavaImportOrganize (ECLIM) or Ctrl+Shift+O (Eclipse) to sort imports"/> |
| <property name="severity" value="error"/> |
| <property name="processJavadoc" value="true"/> |
| </module> |
| <module name="JavadocType"> |
| <property name="severity" value="warning"/> |
| <property name="tokens" value="INTERFACE_DEF, CLASS_DEF"/> |
| <property name="scope" value="public"/> |
| <message key="javadoc.missing" value="Public classes and interfaces require JavaDoc comments."/> |
| </module> |
| <module name="JavadocMethod"> |
| <property name="severity" value="info"/> |
| <property name="scope" value="public"/> |
| <property name="allowMissingParamTags" value="true"/> |
| <property name="allowMissingPropertyJavadoc" value="true"/> |
| <property name="allowMissingReturnTag" value="true"/> |
| <property name="allowMissingThrowsTags" value="true"/> |
| </module> |
| <module name="PackageName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^[a-z]+(\.[a-z][a-z0-9_]{1,})*$"/> |
| </module> |
| <module name="SimplifyBooleanExpression"> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="SimplifyBooleanReturn"> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="TypeName"> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="ConstantName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*)|(s[A-Z][a-zA-Z0-9]*)$"/> |
| <message key="name.invalidPattern" value="Static final field names must either be all caps (e.g. int HEIGHT_PX) for 'true' constants, or start with s (e.g. AtomicInteger sNextId or Runnable sSuspendTask) for fields with mutable state or that don't 'feel' like constants."/> |
| </module> |
| <!-- Non-public, non-static field names start with m. --> |
| <module name="MemberName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^m[A-Z][a-zA-Z0-9]*$"/> |
| <property name="applyToPublic" value="false"/> |
| <message key="name.invalidPattern" value="Non-public, non-static field names start with m."/> |
| </module> |
| <!-- Static field names start with s. --> |
| <module name="StaticVariableName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^s[A-Z][a-zA-Z0-9]*$"/> |
| <property name="applyToPublic" value="false"/> |
| <message key="name.invalidPattern" value="Static field names start with s."/> |
| </module> |
| <module name="MethodName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/> |
| <message key="name.invalidPattern" value="Method names should start with a lower case letter (e.g. getWidth())"/> |
| </module> |
| <module name="ParameterName"> |
| <property name="severity" value="error"/> |
| </module> |
| <module name="LocalFinalVariableName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^m|s|((([ms][a-z0-9])|([a-ln-rt-z]))[a-zA-Z0-9]*)$"/> |
| <message key="name.invalidPattern" value="Local variables should be camel-cased (e.g. int minWidth = 4)."/> |
| </module> |
| <module name="LocalVariableName"> |
| <property name="severity" value="error"/> |
| <property name="format" value="^m|s|((([ms][a-z0-9])|([a-ln-rt-z]))[a-zA-Z0-9]*)$"/> |
| <message key="name.invalidPattern" value="Local variables should be camel-cased (e.g. int minWidth = 4)."/> |
| </module> |
| <module name="FallThrough"> |
| <property name="severity" value="error"/> |
| <property name="reliefPattern" value=".*"/> |
| </module> |
| <module name="NoFinalizer"> |
| <property name="severity" value="info"/> |
| </module> |
| <module name="ImportOrder"> |
| <property name="severity" value="error"/> |
| <message key="import.ordering" value="Wrong order for {0} import. Follow the AOSP Java Code Style: https://source.android.com/setup/code-style#order-import-statements. When using Android Studio, use Ctrl+Alt+O to sort imports. A style configuration file can be found at //tools/android/android_studio/ChromiumStyle.xml."/> |
| <property name="groups" value="android, com, dalvik, junit, org, com.google.android.apps.chrome, org.chromium, java, javax"/> |
| <property name="ordered" value="true"/> |
| <property name="option" value="top"/> |
| <property name="separated" value="true"/> |
| </module> |
| <module name="RegexpSinglelineJava"> |
| <property name="id" value="StringBufferCheck"/> |
| <property name="severity" value="error"/> |
| <property name="format" value="StringBuffer"/> |
| <property name="ignoreComments" value="true"/> |
| <property name="message" value="Avoid StringBuffer; use StringBuilder instead, which is faster (it's not thread-safe, but this is almost never needed)"/> |
| </module> |
| <module name="RegexpSinglelineJava"> |
| <property name="id" value="AlertDialogCheck"/> |
| <property name="severity" value="warning"/> |
| <property name="format" value="android\.app\.AlertDialog"/> |
| <property name="ignoreComments" value="true"/> |
| <property name="message" value="Avoid android.app.AlertDialog; if possible, use android.support.v7.app.AlertDialog instead, which has a Material look on all devices. (Some parts of the codebase can’t depend on the support library, in which case android.app.AlertDialog is the only option)"/> |
| </module> |
| <module name="RegexpSinglelineJava"> |
| <property name="id" value="SharedPreferencesCheck"/> |
| <property name="severity" value="error"/> |
| <property name="format" value="getDefaultSharedPreferences"/> |
| <property name="ignoreComments" value="true"/> |
| <property name="message" value="Use ContextUtils.getAppSharedPreferences() instead to access app-wide SharedPreferences."/> |
| </module> |
| </module> |
| </module> |