Skip to content

Commit

Permalink
Update lint documentation snapshot
Browse files Browse the repository at this point in the history
In addition to picking up later versions, this corrects the
TOML version catalog names, and includes the android-security-lints
libraries as distributed on maven now.
  • Loading branch information
tnorbye committed Aug 30, 2024
1 parent ae66c5b commit cc0ce12
Show file tree
Hide file tree
Showing 339 changed files with 2,739 additions and 1,166 deletions.
2 changes: 1 addition & 1 deletion docs/checks/AccessibilityFocus.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Category
: Accessibility
Platform
: Any
: Android
Vendor
: Android Open Source Project
Feedback
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AccessibilityScrollActions.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Category
: Accessibility
Platform
: Any
: Android
Vendor
: Android Open Source Project
Feedback
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AccessibilityWindowStateChangedEvent.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Category
: Accessibility
Platform
: Any
: Android
Vendor
: Android Open Source Project
Feedback
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AlertDialogUsage.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
lintChecks 'com.vanniktech:lint-rules-android:0.25.0'

// build.gradle.kts with version catalogs:
lintChecks(libs.lint-rules-android)
lintChecks(libs.lint.rules.android)

# libs.versions.toml
[versions]
Expand Down
10 changes: 5 additions & 5 deletions docs/checks/ArcAnimationSpecTypeIssue.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,25 @@

```
// build.gradle.kts
implementation("androidx.compose.animation:animation-core-android:1.7.0-beta05")
implementation("androidx.compose.animation:animation-core-android:1.7.0-rc01")

// build.gradle
implementation 'androidx.compose.animation:animation-core-android:1.7.0-beta05'
implementation 'androidx.compose.animation:animation-core-android:1.7.0-rc01'

// build.gradle.kts with version catalogs:
implementation(libs.animation-core-android)
implementation(libs.animation.core.android)

# libs.versions.toml
[versions]
animation-core-android = "1.7.0-beta05"
animation-core-android = "1.7.0-rc01"
[libraries]
animation-core-android = {
module = "androidx.compose.animation:animation-core-android",
version.ref = "animation-core-android"
}
```

1.7.0-beta05 is the version this documentation was generated from;
1.7.0-rc01 is the version this documentation was generated from;
there may be newer versions available.

[Additional details about androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html).
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/ArgInFormattedQuantityStringRes.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AssertjImport.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
lintChecks 'com.vanniktech:lint-rules-android:0.25.0'

// build.gradle.kts with version catalogs:
lintChecks(libs.lint-rules-android)
lintChecks(libs.lint.rules.android)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AutoDispose.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
lintChecks 'com.uber.autodispose2:autodispose-lint:2.2.1'

// build.gradle.kts with version catalogs:
lintChecks(libs.autodispose-lint)
lintChecks(libs.autodispose.lint)

# libs.versions.toml
[versions]
Expand Down
10 changes: 5 additions & 5 deletions docs/checks/AutoboxingStateCreation.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,25 @@

```
// build.gradle.kts
implementation("androidx.compose.runtime:runtime-android:1.7.0-beta05")
implementation("androidx.compose.runtime:runtime-android:1.7.0-rc01")

// build.gradle
implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta05'
implementation 'androidx.compose.runtime:runtime-android:1.7.0-rc01'

// build.gradle.kts with version catalogs:
implementation(libs.runtime-android)
implementation(libs.runtime.android)

# libs.versions.toml
[versions]
runtime-android = "1.7.0-beta05"
runtime-android = "1.7.0-rc01"
[libraries]
runtime-android = {
module = "androidx.compose.runtime:runtime-android",
version.ref = "runtime-android"
}
```

1.7.0-beta05 is the version this documentation was generated from;
1.7.0-rc01 is the version this documentation was generated from;
there may be newer versions available.

[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html).
Expand Down
10 changes: 5 additions & 5 deletions docs/checks/AutoboxingStateValueProperty.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,25 @@

```
// build.gradle.kts
implementation("androidx.compose.runtime:runtime-android:1.7.0-beta05")
implementation("androidx.compose.runtime:runtime-android:1.7.0-rc01")

// build.gradle
implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta05'
implementation 'androidx.compose.runtime:runtime-android:1.7.0-rc01'

// build.gradle.kts with version catalogs:
implementation(libs.runtime-android)
implementation(libs.runtime.android)

# libs.versions.toml
[versions]
runtime-android = "1.7.0-beta05"
runtime-android = "1.7.0-rc01"
[libraries]
runtime-android = {
module = "androidx.compose.runtime:runtime-android",
version.ref = "runtime-android"
}
```

1.7.0-beta05 is the version this documentation was generated from;
1.7.0-rc01 is the version this documentation was generated from;
there may be newer versions available.

[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html).
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BadConfigurationProvider.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
implementation 'androidx.work:work-runtime:2.10.0-alpha02'

// build.gradle.kts with version catalogs:
implementation(libs.work-runtime)
implementation(libs.work.runtime)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BadPeriodicWorkRequestEnqueue.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
implementation 'androidx.work:work-runtime:2.10.0-alpha02'

// build.gradle.kts with version catalogs:
implementation(libs.work-runtime)
implementation(libs.work.runtime)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BindingReceiverParameter.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BindingReturnType.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BindsMustBeAbstract.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BindsTypeMismatch.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/BindsWrongParameterCount.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/CastingViewContextToActivity.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
lintChecks 'com.slack.lint:slack-lint-checks:0.7.4'

// build.gradle.kts with version catalogs:
lintChecks(libs.slack-lint-checks)
lintChecks(libs.slack.lint.checks)

# libs.versions.toml
[versions]
Expand Down
115 changes: 115 additions & 0 deletions docs/checks/ChildInNonViewGroup.md.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<meta charset="utf-8">
(#) Only view groups can have children

!!! ERROR: Only view groups can have children
This is an error.

Id
: `ChildInNonViewGroup`
Summary
: Only view groups can have children
Severity
: Error
Category
: Correctness
Platform
: Android
Vendor
: Android Open Source Project
Feedback
: https://issuetracker.google.com/issues/new?component=192708
Affects
: Resource files
Editing
: This check runs on the fly in the IDE editor
Implementation
: [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/ChildInNonViewGroupDetector.kt)
Tests
: [Source Code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/ChildInNonViewGroupDetectorTest.kt)
Copyright Year
: 2011

Only classes inheriting from `ViewGroup` can have children.

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
res/layout/wrong.xml:9:Error: A ImageView should have no children
declared in XML [ChildInNonViewGroup]
&lt;TextView /&gt;
--------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here is the source file referenced above:

`res/layout/wrong.xml`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"&gt;

&lt;ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"&gt;
&lt;TextView /&gt;
&lt;/ImageView&gt;

&lt;/LinearLayout&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also visit the
[source code](https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:lint/libs/lint-tests/src/test/java/com/android/tools/lint/checks/ChildInNonViewGroupDetectorTest.kt)
for the unit tests for this check to see additional scenarios.

The above example was automatically extracted from the first unit test
found for this lint check, `ChildInNonViewGroupDetector.test wrong nesting of TextView within ImageView`.
To report a problem with this extracted sample, visit
https://issuetracker.google.com/issues/new?component=192708.

(##) Suppressing

You can suppress false positives using one of the following mechanisms:

* Adding the suppression attribute
`tools:ignore="ChildInNonViewGroup"` on the problematic XML element
(or one of its enclosing elements). You may also need to add the
following namespace declaration on the root element in the XML file
if it's not already there:
`xmlns:tools="http://schemas.android.com/tools"`.

* Using a special `lint.xml` file in the source tree which turns off
the check in that folder and any sub folder. A simple file might look
like this:
```xml
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;lint&gt;
&lt;issue id="ChildInNonViewGroup" severity="ignore" /&gt;
&lt;/lint&gt;
```
Instead of `ignore` you can also change the severity here, for
example from `error` to `warning`. You can find additional
documentation on how to filter issues by path, regular expression and
so on
[here](https://googlesamples.github.io/android-custom-lint-rules/usage/lintxml.md.html).

* In Gradle projects, using the DSL syntax to configure lint. For
example, you can use something like
```gradle
lintOptions {
disable 'ChildInNonViewGroup'
}
```
In Android projects this should be nested inside an `android { }`
block.

* For manual invocations of `lint`, using the `--ignore` flag:
```
$ lint --ignore ChildInNonViewGroup ...`
```

* Last, but not least, using baselines, as discussed
[here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html).

<!-- 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>
2 changes: 1 addition & 1 deletion docs/checks/ColorCasing.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
lintChecks 'com.vanniktech:lint-rules-android:0.25.0'

// build.gradle.kts with version catalogs:
lintChecks(libs.lint-rules-android)
lintChecks(libs.lint.rules.android)

# libs.versions.toml
[versions]
Expand Down
Loading

0 comments on commit cc0ce12

Please sign in to comment.