Browse Source

Remove style checks and upgrade Robolectric

Bug: 112048937
Test: ./gradlew test
Change-Id: I4aa4bda4d5b422c49bada65f9e27bffc931bac15
android11-dev
Setup Wizard Team 4 years ago committed by Maurice Lam
parent
commit
f48bfd7ec2
  1. 3
      PREUPLOAD.cfg
  2. 4
      library/self.gradle
  3. 20
      tools/checkstyle/checkstyle.xml
  4. 14
      tools/checkstyle/checkstyle_suppression.xml

3
PREUPLOAD.cfg

@ -1,7 +1,4 @@
[Hook Scripts]
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py
--sha ${PREUPLOAD_COMMIT}
--config_xml tools/checkstyle/checkstyle.xml
[Builtin Hooks]
commit_msg_test_field = true

4
library/self.gradle

@ -51,8 +51,8 @@ android.sourceSets {
java.srcDirs = ['test/robotest/src']
dependencies {
testImplementation 'org.robolectric:robolectric:3.6.1'
testImplementation 'org.robolectric:shadows-framework:3.6.1'
testImplementation 'org.robolectric:robolectric:4.0-alpha-3'
testImplementation 'org.robolectric:shadows-framework:4.0-alpha-3'
testImplementation 'junit:junit:4.+'
testImplementation 'com.google.truth:truth:0.31'
testImplementation 'org.mockito:mockito-core:1.9.5'

20
tools/checkstyle/checkstyle.xml

@ -1,20 +0,0 @@
<?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" [
<!ENTITY defaultCopyrightCheck SYSTEM "../../../../../prebuilts/checkstyle/default-copyright-check.xml">
<!ENTITY defaultJavadocChecks SYSTEM "../../../../../prebuilts/checkstyle/default-javadoc-checks.xml">
<!ENTITY defaultTreewalkerChecks SYSTEM "../../../../../prebuilts/checkstyle/default-treewalker-checks.xml">
<!ENTITY defaultModuleChecks SYSTEM "../../../../../prebuilts/checkstyle/default-module-checks.xml">
]>
<module name="Checker">
&defaultModuleChecks;
&defaultCopyrightCheck;
<module name="TreeWalker">
&defaultJavadocChecks;
&defaultTreewalkerChecks;
</module>
<module name="SuppressionFilter">
<property name="file" value="tools/checkstyle/checkstyle_suppression.xml" />
</module>
</module>

14
tools/checkstyle/checkstyle_suppression.xml

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Note: Checkstyle puts the absolute path of files through the suppress filter, so the
patterns below will match sub-directories. Notably, for overlays where the path is
something like overlay/frameworks/opt/setupwizard will match the regex filter
"frameworks/opt/setupwizard". This is probably OK for most cases since they are overlay
of the original app and should have the same coding style. -->
<!-- Robolectric uses magic method names like `__constructor__` -->
<suppress files="/robotest/" checks="MethodName" />
</suppressions>
Loading…
Cancel
Save