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
      -
    1. Configuring lint in Android Studio
    2. +
    3. Configuring Lint in Android Studio
    4. Configuring the lint file
    5. 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:

    + -

    Global preferences

    + + +

    To set default Lint checks:

      -
    1. To specify global project settings, select the project folder in the Project View and choose -Analyze > Inspect Code.
    2. +
    3. In Android Studio, open your project. +
    4. +
    5. Select File > Other Settings > + Default Settings.
    6. +
    7. In the Default Preferences dialog, select Editor +> Inspections.
    8. +
    9. In the Profile field, select Default or + Project Default to set the + scope for Android Studio or just for this project, + respectively.
    10. +
    11. Expand a category and change the Lint settings as needed.
    12. +

      You can select individual checks, or entire categories.

      -
    13. Specify your inspection scope and profile, and click OK.
    14. +
    15. 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:

      -
    1. 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.
    2. -
    3. 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.
    4. +
    5. In Android Studio, open your project + and select a portion of your project that you want to test.
    6. +
    7. Select Analyze > Inspect Code.
    8. +
    9. In the Specify Inspection Scope dialog, select the inspection +scope and profile.
    10. + +

      The scope specifies the files you want to analyze, and the profile specifies +the Lint checks you’d like to perform.

      +
    11. 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.
    12. +

      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.

      +
    13. Click OK.
    14. +

      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" >