0

[Android] Add inspections settings for AndroidStudio

1. Add ChromiumInspections.xml that specifies Chromium-specific inspection
  profiles for AndroidStudio.
2. Update docs for importing ChromiumStyle.xml and ChromiumInspections.xml.

Bug: 620034
Change-Id: Icd6821142bc87fc2dcd458910330e61173dc48aa
Reviewed-on: https://chromium-review.googlesource.com/662785
Reviewed-by: Peter Wen <wnwen@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501931}
This commit is contained in:
Boris Sazonov
2017-09-14 12:29:18 +00:00
committed by Commit Bot
parent d6443c3172
commit a084e8f979
2 changed files with 12 additions and 3 deletions
docs
tools/android/android_studio

@ -88,10 +88,13 @@ includes `R.java`).
* Launch it with more RAM:
`STUDIO_VM_OPTIONS=-Xmx2048m /opt/android-studio-stable/bin/studio-launcher.sh`
* If you ever need to reset it: `rm -r ~/.AndroidStudio*/`
* Import Android style settings:
* Import Chromium-specific style and inspections settings:
* Help -&gt; Find Action -&gt; "Code Style" (settings) -&gt; Java -&gt;
Manage -&gt; Import -&gt; select "Intellij IDEA code style XML" -&gt; OK
* Select `tools/android/android_studio/ChromiumStyle.xml`
Scheme -&gt; Import Scheme
* Select `tools/android/android_studio/ChromiumStyle.xml` -&gt; OK
* Help -&gt; Find Action -&gt; "Inspections" (settings) -&gt;
Profile -&gt; Import profile
* Select `tools/android/android_studio/ChromiumInspections.xml` -&gt; OK
* Turn on automatic import:
* Help -&gt; Find Action -&gt; "Auto Import"
* Tick all the boxes under "Java" and change the dropdown to "All".

@ -0,0 +1,6 @@
<profile version="1.0">
<option name="myName" value="Chromium" />
<!-- We use asserts in Chromium. See https://chromium.googlesource.com/chromium/src/+/master/styleguide/java/java.md#Asserts -->
<inspection_tool class="AndroidLintAssert" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlCompat" enabled="false" level="ERROR" enabled_by_default="false" />
</profile>