Skip to content

Commit a357168

Browse files
committed
Update issue documentation
This CL updates the documentation for the built-in lint checks as well as the AndroidX lint checks and some new 3rd party lint checks. This was generated by the issue metadata extraction tool which was updated as follows: * Includes the relevant Gradle dependencies to use to include the lint checks in your project. * Includes information about other versions of the library, including change notes (which checks are added in each version), compatibility (minimum- and compiled-with- versions of lint for each version of the library), license, etc. * A new index page listing all the availble libraries, and a dedicated page for each library listing which issues each library contains, license information, a library description, etc. extracted from the POM file. * The documentation generation code now directly pulls jars, poms and source files from the network; you don't have to have a checkout of AndroidX (or the other libraries listed below). * Includes additional well known 3rd party lint checks in the report, such as Slack's Compose lint checks. * Looks for ID conflicts between libraries; if a link check is found in separate libraries, the conflicts are listed on the issue pages stating that you cannot combine these libraries. * Fixes the code which extracts examples from unit tests such that they also work with lint checks which emit multi-line error messages * Fixes artifact handling for multi-platform dependencies ("-android").
1 parent 6b9ba23 commit a357168

File tree

722 files changed

+42918
-2248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

722 files changed

+42918
-2248
lines changed

docs/checks/AaptCrash.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747

4848
<item name="android:id">@+id/titlebar</item>
4949
--------------------------------------------
50-
51-
5250
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5351

5452
Here is the source file referenced above:

docs/checks/AcceptsUserCertificates.md.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
Editing
2424
: This check runs on the fly in the IDE editor
2525
See
26+
: https://goo.gle/AcceptsUserCertificates
27+
See
2628
: https://developer.android.com/training/articles/security-config#TrustingDebugCa
2729
Implementation
2830
: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/NetworkSecurityConfigDetector.java)
@@ -47,8 +49,6 @@
4749

4850
<certificates src="user"/>
4951
--------------------------
50-
51-
5252
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5353

5454
Here is the source file referenced above:

docs/checks/AccidentalOctal.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343

4444
versionCode 010
4545
---
46-
47-
4846
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4947

5048
Here is the source file referenced above:

docs/checks/AdapterViewChildren.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343

4444
<ListView
4545
--------
46-
47-
4846
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4947

5048
Here is the source file referenced above:

docs/checks/AddJavascriptInterface.md.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
: https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String)
2727
See
2828
: https://support.google.com/faqs/answer/9095419?hl=en
29+
See
30+
: https://goo.gle/AddJavascriptInterface
2931
Implementation
3032
: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/AddJavascriptInterfaceDetector.kt)
3133
Tests
@@ -59,8 +61,6 @@
5961

6062
webView.addJavascriptInterface(object, string);
6163
----------------------
62-
63-
6464
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6565

6666
Here is the source file referenced above:

docs/checks/AlertDialogUsage.md.html

+168
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
<meta charset="utf-8">
2+
(#) Use the support library AlertDialog instead of android.app.AlertDialog.
3+
4+
!!! WARNING: Use the support library AlertDialog instead of android.app.AlertDialog.
5+
This is a warning.
6+
7+
Id
8+
: `AlertDialogUsage`
9+
Summary
10+
: Use the support library AlertDialog instead of android.app.AlertDialog.
11+
Severity
12+
: Warning
13+
Category
14+
: Correctness
15+
Platform
16+
: Any
17+
Vendor
18+
: vanniktech/lint-rules/
19+
Feedback
20+
: https://github.com/vanniktech/lint-rules/issues
21+
Min
22+
: Lint 7.3 and 7.4
23+
Compiled
24+
: Lint 7.3 and 7.4
25+
Artifact
26+
: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html)
27+
28+
Affects
29+
: Kotlin and Java files
30+
Editing
31+
: This check runs on the fly in the IDE editor
32+
Implementation
33+
: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AlertDialogUsageDetector.kt)
34+
Tests
35+
: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.kt)
36+
37+
Support library AlertDialog is much more powerful and plays better
38+
together with the new theming / styling than the AlertDialog built into
39+
the framework.
40+
41+
(##) Example
42+
43+
Here is an example of lint warnings produced by this check:
44+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
45+
src/Test.java:4:Warning: Should not be using android.app.AlertDialog
46+
[AlertDialogUsage]
47+
48+
public Test(AlertDialog dialog) { }
49+
------------------
50+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51+
52+
Here is the source file referenced above:
53+
54+
`src/Test.java`:
55+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers
56+
import android.app.AlertDialog;
57+
58+
class Test {
59+
public Test(AlertDialog dialog) { }
60+
}
61+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62+
63+
You can also visit the
64+
[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.kt)
65+
for the unit tests for this check to see additional scenarios.
66+
67+
The above example was automatically extracted from the first unit test
68+
found for this lint check, `AlertDialogUsageDetector.constructorParameterInJava`.
69+
To report a problem with this extracted sample, visit
70+
https://github.com/vanniktech/lint-rules/issues.
71+
72+
(##) Including
73+
74+
!!!
75+
This is not a built-in check. To include it, add the below dependency
76+
to your project. This lint check is included in the lint documentation,
77+
but the Android team may or may not agree with its recommendations.
78+
79+
```
80+
// build.gradle.kts
81+
lintChecks("com.vanniktech:lint-rules-android:0.24.0")
82+
83+
// build.gradle
84+
lintChecks 'com.vanniktech:lint-rules-android:0.24.0'
85+
86+
// build.gradle.kts with version catalogs:
87+
lintChecks(libs.lint-rules-android)
88+
89+
# libs.versions.toml
90+
[versions]
91+
lint-rules-android = "0.24.0"
92+
[libraries]
93+
lint-rules-android = {
94+
module = "com.vanniktech:lint-rules-android",
95+
version.ref = "lint-rules-android"
96+
}
97+
```
98+
99+
0.24.0 is the version this documentation was generated from;
100+
there may be newer versions available.
101+
102+
[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html).
103+
(##) Suppressing
104+
105+
You can suppress false positives using one of the following mechanisms:
106+
107+
* Using a suppression annotation like this on the enclosing
108+
element:
109+
110+
```kt
111+
// Kotlin
112+
@Suppress("AlertDialogUsage")
113+
fun method() {
114+
problematicStatement()
115+
}
116+
```
117+
118+
or
119+
120+
```java
121+
// Java
122+
@SuppressWarnings("AlertDialogUsage")
123+
void method() {
124+
problematicStatement();
125+
}
126+
```
127+
128+
* Using a suppression comment like this on the line above:
129+
130+
```kt
131+
//noinspection AlertDialogUsage
132+
problematicStatement()
133+
```
134+
135+
* Using a special `lint.xml` file in the source tree which turns off
136+
the check in that folder and any sub folder. A simple file might look
137+
like this:
138+
```xml
139+
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
140+
&lt;lint&gt;
141+
&lt;issue id="AlertDialogUsage" severity="ignore" /&gt;
142+
&lt;/lint&gt;
143+
```
144+
Instead of `ignore` you can also change the severity here, for
145+
example from `error` to `warning`. You can find additional
146+
documentation on how to filter issues by path, regular expression and
147+
so on
148+
[here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html).
149+
150+
* In Gradle projects, using the DSL syntax to configure lint. For
151+
example, you can use something like
152+
```gradle
153+
lintOptions {
154+
disable 'AlertDialogUsage'
155+
}
156+
```
157+
In Android projects this should be nested inside an `android { }`
158+
block.
159+
160+
* For manual invocations of `lint`, using the `--ignore` flag:
161+
```
162+
$ lint --ignore AlertDialogUsage ...`
163+
```
164+
165+
* Last, but not least, using baselines, as discussed
166+
[here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).
167+
168+
<!-- Markdeep: --><style class="fallback">body{visibility:hidden;white-space:pre;font-family:monospace}</style><script src="markdeep.min.js" charset="utf-8"></script><script src="https://morgan3d.github.io/markdeep/latest/markdeep.min.js" charset="utf-8"></script><script>window.alreadyProcessedMarkdeep||(document.body.style.visibility="visible")</script>

docs/checks/AllCaps.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444

4545
android:textAllCaps="true"
4646
--------------------------
47-
48-
4947
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5048

5149
Here is the source file referenced above:

docs/checks/AllowAllHostnameVerifier.md.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
: Kotlin and Java files
2323
Editing
2424
: This check runs on the fly in the IDE editor
25+
See
26+
: https://goo.gle/AllowAllHostnameVerifier
2527
Implementation
2628
: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-checks/src/main/java/com/android/tools/lint/checks/AllowAllHostnameVerifierDetector.java)
2729
Tests
@@ -56,8 +58,6 @@
5658

5759
connection.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
5860
--------------------------------------------
59-
60-
6161
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6262

6363
Here is the source file referenced above:

docs/checks/AlwaysShowAction.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757

5858
android:showAsAction="always|collapseActionView"
5959
------------------------------------------------
60-
61-
6260
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6361

6462
Here is the source file referenced above:

docs/checks/AndroidGradlePluginVersion.md.html

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Feedback
2020
: https://issuetracker.google.com/issues/new?component=192708
2121
Affects
22-
: Gradle build files
22+
: Gradle build files and TOML files
2323
Editing
2424
: This check runs on the fly in the IDE editor
2525
Implementation
@@ -44,13 +44,11 @@
4444
Here is an example of lint warnings produced by this check:
4545
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
4646
build.gradle:7:Warning: A newer version of
47-
com.android.tools.build:gradle than 3.4.0-alpha3 is available:
48-
3.6.0-alpha01 [AndroidGradlePluginVersion]
47+
com.android.tools.build:gradle than 3.4.0-alpha3 is available: 3.5.0
48+
[AndroidGradlePluginVersion]
4949

5050
classpath 'com.android.tools.build:gradle:3.4.0-alpha3'
5151
-------------------------------------------------------
52-
53-
5452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5553

5654
Here is the source file referenced above:

docs/checks/AnimatorKeep.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161

6262
private void setProp2(float x) {
6363
-----------------
64-
65-
6664
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6765

6866
Here is the source file referenced above:

docs/checks/AnnotateVersionCheck.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363

6464
inline fun &lt;T&gt; T.applyForOreoOrAbove(block: T.() -&gt; Unit): T {
6565
-------------------
66-
67-
6866
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6967

7068
Here is the source file referenced above:

docs/checks/AnnotationProcessorOnCompilePath.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585

8686
debugCompile "android.arch.persistence.room:compiler:1.1.1"
8787
------------
88-
89-
9088
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9189

9290
Here is the source file referenced above:

docs/checks/AppBundleLocaleChanges.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747

4848
configuration.locale = locale
4949
------
50-
51-
5250
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5351

5452
Here is the source file referenced above:

docs/checks/AppCompatCustomView.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@
155155

156156
public class MySpinner extends Spinner { // ERROR
157157
-------
158-
159-
160158
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161159

162160
Here is the source file referenced above:

docs/checks/AppCompatMethod.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@
9090

9191
setProgressBarIndeterminateVisibility(true); // ERROR
9292
-------------------------------------------
93-
94-
9593
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9694

9795
Here is the source file referenced above:

docs/checks/AppCompatResource.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949

5050
app:showAsAction="never" /&gt;
5151
------------------------
52-
53-
5452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5553

5654
Here is the source file referenced above:

docs/checks/AppIndexingService.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646

4747
&lt;action android:name="com.google.firebase.appindexing.UPDATE_INDEX" /&gt;
4848
-----------------------------------------------------------
49-
50-
5149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5250

5351
Here is the source file referenced above:

docs/checks/AppLinkUrlError.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646

4747
&lt;tools:validation /&gt;
4848
--------------------
49-
50-
5149
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5250

5351
Here is the source file referenced above:

docs/checks/AppLinksAutoVerify.md.html

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949

5050
android:host="example.com"
5151
--------------------------
52-
53-
5452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5553

5654
Here is the source file referenced above:

0 commit comments

Comments
 (0)