From 86e9e467dfaac03e85f15f992876a5f1f3648772 Mon Sep 17 00:00:00 2001
From: Cheryl Potter
Date: Tue, 12 Apr 2016 19:39:08 -0700
Subject: [PATCH] docs: Update Lint instructions for Android Studio b/26627201
b/26987391
Change-Id: Ic9fcc927b5e0d05e0284038f3f73538c2147d68d
---
docs/html/tools/debugging/improving-w-lint.jd | 79 +++++++++++++------
1 file changed, 56 insertions(+), 23 deletions(-)
diff --git a/docs/html/tools/debugging/improving-w-lint.jd b/docs/html/tools/debugging/improving-w-lint.jd
index 3b220b56f2f80..2f5e50d5a5ef9 100644
--- a/docs/html/tools/debugging/improving-w-lint.jd
+++ b/docs/html/tools/debugging/improving-w-lint.jd
@@ -13,7 +13,7 @@ parent.link=index.html
Running lint from the command-line
Configuring lint
- - Configuring lint in Android Studio
+ - Configuring Lint in Android Studio
- Configuring the lint file
- Configuring lint checking in Java and XML source files
@@ -169,37 +169,70 @@ severity level.
Per Version Control System (VCS) scopes
-Configuring lint in Android Studio
-Android Studio allows you to enable or disable individual inspections and configure
-project-global, directory-specific, and file-specific settings for {@code lint}.
+Configuring Lint in Android Studio
-You can manage inspection profiles and configure inspection severity within Android Studio using
-the File > Settings > Project Settings menu to open the Inspections
-page with a list of the supported profiles and inspections.
-
-Figure 3. Inspection Configuration
+The built-in Lint tool checks your code while you're using
+Android Studio. You can view warnings and errors in two ways:
+
+- As pop-up text in the Code Editor. When Lint finds a problem, it highlights
+the problematic code in yellow, or underlines the code in red for more serious
+issues.
+- In the Lint Inspection Results window after you select
+Analyze > Inspect Code.
+
-Global preferences
+
+
+To set default Lint checks:
-- To specify global project settings, select the project folder in the Project View and choose
-Analyze > Inspect Code.
+- In Android Studio, open your project.
+
+- Select File > Other Settings >
+ Default Settings.
+- In the Default Preferences dialog, select Editor
+> Inspections.
+- In the Profile field, select Default or
+ Project Default to set the
+ scope for Android Studio or just for this project,
+ respectively.
+- Expand a category and change the Lint settings as needed.
+You can select individual checks, or entire categories.
-- Specify your inspection scope and profile, and click OK.
+- Click OK.
-The configured settings run the specified {@code lint} inspections. The {@code lint}
-inspections are also run whenever you build and run your Android project and modules.
-Module and file-specific preferences
+
+
+To produce a list of Lint checks displayed in the Inspection Results
+window:
-- Run the {@code lint} tool on your module by right-clicking on your module folder or file in the
-Project View and selecting Analyze > Inspect Code. This displays the
-{@code lint} inspection results
-with a list of issues that {@code lint} detected in your module.
-- From the Lint Warnings view, use the toolbar options to configure {@code lint}
-preferences for individual modules and files, and set the issue display options.
+- In Android Studio, open your project
+ and select a portion of your project that you want to test.
+- Select Analyze > Inspect Code.
+- In the Specify Inspection Scope dialog, select the inspection
+scope and profile.
+
+The scope specifies the files you want to analyze, and the profile specifies
+the Lint checks you’d like to perform.
+- If you want to change the Lint settings, click …. In the
+Inspections dialog, optionally click Manage to define
+a new profile, specify the Lint settings you want, and then click
+OK.
+In the Inspections dialog, you can search for a string
+to find Lint checks. Note that changing Lint settings for a
+profile in the Inspections dialog doesn’t change the default settings,
+as described in the previous procedure. It does change the settings for profiles
+displayed in the Inspections dialog, however.
+- Click OK.
+The results appear in the Inspection Results window, organized by
+category.
+
+
Configuring the lint file
You can specify your {@code lint} checking preferences in the lint.xml file. If you
are creating this file manually, place it in the root directory of your Android project. If you are
@@ -289,7 +322,7 @@ file. The ignore attribute is inherited by the children elements o
in which the attribute is declared. In this example, the {@code lint} check is also disabled for the
child <TextView> element.
-<LinearLayout
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="UnusedResources" >