Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update issue documentation: include test resources #102

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions docs/checks/Aligned16KB.md.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<meta charset="utf-8">
(#) Native library dependency not 16 KB aligned

!!! WARNING: Native library dependency not 16 KB aligned
This is a warning.

Id
: `Aligned16KB`
Summary
: Native library dependency not 16 KB aligned
Severity
: Warning
Category
: Correctness
Platform
: Android
Vendor
: Android Open Source Project
Feedback
: https://issuetracker.google.com/issues/new?component=192708
Affects
: Gradle build files and TOML files
Editing
: This check can *not* run live in the IDE editor
See
: https://developer.android.com/guide/practices/page-sizes
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/PageAlignmentDetector.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/PageAlignmentDetectorTest.kt)
Copyright Year
: 2025

Historically, Android has aligned memory using 4 KB memory page sizes,
which optimized system memory performance for the average amount of
total memory that Android devices have typically had.

To support devices that only support 16 KB aligned libraries in the
future, the Google Play Store will soon require all apps to be compiled
with 16 KB aligned libraries.

An app compiled with 4 KB aligned libraries will not work correctly on
these devices. To ensure compatibility with these devices and to
future-proof your app, the Play Store will require native libraries to
be aligned to 16 KB boundaries.

If your app uses any NDK libraries, either directly or indirectly
through an SDK, you'll need to rebuild your app to meet this new
requirement. This means ensuring that all native libraries within your
app, including those from any dependencies, are built with 16 KB page
alignment.

This lint check helps identify potential issues by inspecting all
transitive libraries your app depends on. If any nested native libraries
are found to be aligned only to 4 KB, you'll need to take action.

If lint flags a library, try updating to a newer version that supports
16 KB alignment. If no updated version is available, reach out to the
library vendor for assistance.

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
build.gradle:2:Warning: The native library
arm64-v8a/libtensorflowlite_jni.so (from
org.tensorflow:tensorflow-lite:2.16.1) is not 16 KB aligned
[Aligned16KB]
implementation("org.tensorflow:tensorflow-lite:2.16.1")
---------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here are the relevant test files:

`build.gradle`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers
dependencies {
implementation("org.tensorflow:tensorflow-lite:2.16.1")
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[build/intermediates/exploded-aar/org.tensorflow/tensorflow-lite/2.16.1/jni/arm64-v8a/libtensorflowlite_jni.so](examples/arm64-v8a/libtensorflowlite_jni.so)

[build/intermediates/exploded-aar/org.tensorflow/tensorflow-lite/2.16.1/jni/x86_64/libtensorflowlite_jni.so](examples/x86_64/libtensorflowlite_jni.so)

[build/intermediates/exploded-aar/org.tensorflow/tensorflow-lite/2.16.1/jni/armeabi-v7a/libtensorflowlite_jni.so](examples/armeabi-v7a/libtensorflowlite_jni.so)

[build/intermediates/exploded-aar/org.tensorflow/tensorflow-lite/2.16.1/jni/x86/libtensorflowlite_jni.so](examples/x86/libtensorflowlite_jni.so)

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/PageAlignmentDetectorTest.kt)
for the unit tests for this check to see additional scenarios.

(##) Suppressing

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

* Using a suppression comment like this on the line above:

```kt
//noinspection Aligned16KB
problematicStatement()
```

* 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="Aligned16KB" 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 'Aligned16KB'
}
```
In Android projects this should be nested inside an `android { }`
block.

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

* 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/AppLinkSplitToWebAndCustom.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Feedback
: https://issuetracker.google.com/issues/new?component=192708
Since
: 8.8.0-alpha08 (October 2024)
: 8.8.0 (January 2025)
Affects
: Manifest files
Editing
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/AppLinkWarning.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Feedback
: https://issuetracker.google.com/issues/new?component=192708
Since
: 8.8.0-alpha06 (October 2024)
: 8.8.0 (January 2025)
Affects
: Manifest files
Editing
Expand Down
4 changes: 2 additions & 2 deletions docs/checks/ArcAnimationSpecTypeIssue.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
(#) ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.

!!! Tip: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.
Advice from this check is just a tip.
Advice from this check is just a hint; it's "weak" warning.

Id
: `ArcAnimationSpecTypeIssue`
Summary
: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.
Severity
: Information
: Hint
Category
: Correctness
Platform
Expand Down
4 changes: 2 additions & 2 deletions docs/checks/AutoboxingStateCreation.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
(#) `State<T>` will autobox values assigned to this state. Use a specialized state type instead.

!!! Tip: `State<T>` will autobox values assigned to this state. Use a specialized state type instead.
Advice from this check is just a tip.
Advice from this check is just a hint; it's "weak" warning.

Id
: `AutoboxingStateCreation`
Summary
: `State<T>` will autobox values assigned to this state. Use a specialized state type instead.
Severity
: Information
: Hint
Category
: Performance
Platform
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/CredentialManagerMisuse.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Feedback
: https://issuetracker.google.com/issues/new?component=192708
Since
: 8.8.0-alpha02 (September 2024)
: 8.8.0 (January 2025)
Affects
: Kotlin and Java files
Editing
Expand Down
8 changes: 4 additions & 4 deletions docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@

```
// build.gradle.kts
implementation("com.google.dagger:dagger-lint:2.54")
implementation("com.google.dagger:dagger-lint:2.55")

// build.gradle
implementation 'com.google.dagger:dagger-lint:2.54'
implementation 'com.google.dagger:dagger-lint:2.55'

// build.gradle.kts with version catalogs:
implementation(libs.dagger.lint)

# libs.versions.toml
[versions]
dagger-lint = "2.54"
dagger-lint = "2.55"
[libraries]
# For clarity and text wrapping purposes the following declaration is
# shown split up across lines, but in TOML it needs to be on a single
Expand All @@ -207,7 +207,7 @@
}
```

2.54 is the version this documentation was generated from;
2.55 is the version this documentation was generated from;
there may be newer versions available.

[Additional details about com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html).
Expand Down
28 changes: 28 additions & 0 deletions docs/checks/IconDipSize.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,34 @@
catches errors where images are either placed in the wrong folder, or
icons are changed to new sizes but some folders are forgotten.

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
res/drawable-mdpi/my_lossy_72dp.webp:Warning: Suspicious file name
my_lossy_72dp.webp: The implied 72 dp size does not match the actual dp
size (pixel size 58×56 in a drawable-mdpi folder computes to 58×56 dp)
[IconDipSize]
0 errors, 3 warnings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here are the relevant test files:

![res/drawable-mdpi/my_lossy_72dp.webp](examples/drawable-mdpi/my_lossy_72dp.webp)

![res/mipmap-mdpi/my_lossy2_72dp.webp](examples/mipmap-mdpi/my_lossy2_72dp.webp)

![res/drawable-mdpi/my_lossless_72dp.webp](examples/drawable-mdpi/my_lossless_72dp.webp)

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/IconDetectorTest.java)
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, `IconDetector.testClaimedSizeWebp`.
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:
Expand Down
24 changes: 24 additions & 0 deletions docs/checks/IconExtension.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@
is really in the PNG format and not for example a GIF file named
`.png`).

(##) Example

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
res/drawable-mdpi/foo.png:Warning: Misleading file extension; named .png
but the file format is webp [IconExtension]
0 errors, 1 warnings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here are the relevant test files:

![res/drawable-mdpi/foo.png](examples/drawable-mdpi/foo.png)

![res/drawable-mdpi/ok.webp](examples/drawable-mdpi/ok.webp)

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/IconDetectorTest.java)
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, `IconDetector.testMisleadingWebpFileName`.
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:
Expand Down
7 changes: 2 additions & 5 deletions docs/checks/InvalidPackage.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
2 errors, 0 warnings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here are the relevant source files:
Here are the relevant test files:

`res/layout/layout.xml`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers
Expand Down Expand Up @@ -136,10 +136,7 @@
&lt;/resources&gt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`libs/unsupported.jar`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text linenumbers
H4sIAAAAAAAAAAvwZmYRYeAAwmMzkxwZkAAnAwuDr2uIo66nn5v+v1MMDMwMAd7sHCApJqiSAJyaRY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~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[libs/unsupported.jar](examples/libs/unsupported.jar)

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/InvalidPackageDetectorTest.java)
Expand Down
8 changes: 4 additions & 4 deletions docs/checks/JvmStaticProvidesInObjectDetector.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@

```
// build.gradle.kts
implementation("com.google.dagger:dagger-lint:2.54")
implementation("com.google.dagger:dagger-lint:2.55")

// build.gradle
implementation 'com.google.dagger:dagger-lint:2.54'
implementation 'com.google.dagger:dagger-lint:2.55'

// build.gradle.kts with version catalogs:
implementation(libs.dagger.lint)

# libs.versions.toml
[versions]
dagger-lint = "2.54"
dagger-lint = "2.55"
[libraries]
# For clarity and text wrapping purposes the following declaration is
# shown split up across lines, but in TOML it needs to be on a single
Expand All @@ -216,7 +216,7 @@
}
```

2.54 is the version this documentation was generated from;
2.55 is the version this documentation was generated from;
there may be newer versions available.

[Additional details about com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html).
Expand Down
8 changes: 4 additions & 4 deletions docs/checks/KtxExtensionAvailable.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
(#) KTX Extension Available

!!! Tip: KTX Extension Available
Advice from this check is just a tip.
Advice from this check is just a hint; it's "weak" warning.

Id
: `KtxExtensionAvailable`
Summary
: KTX Extension Available
Severity
: Information
: Hint
Category
: Productivity
Platform
Expand Down Expand Up @@ -46,8 +46,8 @@

Here is an example of lint warnings produced by this check:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text
build.gradle:7:Information: Add suffix -ktx to enable the Kotlin
extensions for this library [KtxExtensionAvailable]
build.gradle:7:Hint: Add suffix -ktx to enable the Kotlin extensions for
this library [KtxExtensionAvailable]
implementation "androidx.core:core:1.2.0"
--------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 1 addition & 4 deletions docs/checks/MangledCRLF.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@

Here is the source file referenced above:

`res/layout/crcrlf.xml`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers
H4sIAAAAAAAA/42Ry2rDMBBF9wb/g9EHWHtjB7LLItmEkK0Z5KEaKktGGtdxvz7yA5qE1o12uvdc5lWe0QDTFx5hdD1nt9bYUIBtvKOmEpq5K6QMSmMLIV/1XLlWQvcpPQa5aiJNsviWPDtnwmZ6JtbMqhdmbqEeqGFdiRZY6boDj5Z/BzXSh+YXMtulSbrg5QVvfCUclu/fpQYPXa2c5Z9SG+Xeo1V00R+cp++IgqkE+x7/46/omdQGzXGkShzQGPfgztss5p4mOz8B2b2KZyUeRSanlSSlfD51FO+BbabY/QEAAA==
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[res/layout/crcrlf.xml](examples/layout/crcrlf.xml)

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/DosLineEndingDetectorTest.kt)
Expand Down
Loading
Loading