Skip to content

Commit 01703ae

Browse files
committed
Update lint docs to current versions
1 parent ed5fc41 commit 01703ae

File tree

11 files changed

+1010
-140
lines changed

11 files changed

+1010
-140
lines changed

docs/api-guide.html

Lines changed: 470 additions & 97 deletions
Large diffs are not rendered by default.

docs/api-guide/basics.md.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@
432432
This is a \`code symbol\` | This is a `code symbol`
433433
This is `*italics*` | This is *italics*
434434
This is `**bold**` | This is **bold**
435+
This is `~~strikethrough~~` | This is ~~strikethrough~~
435436
http://, https:// | [](http://), [](https://)
436437
`\*not italics*` | `\*not italics*`
437438
\`\`\`language\n text\n\`\`\`| (preformatted text block)
@@ -787,7 +788,7 @@
787788
val incident = Incident(context, ISSUE)
788789
.message( "Use `<vector>` instead of `<bitmap>`")
789790
.at(element)
790-
context.report(incident))
791+
context.report(incident)
791792
}
792793
}
793794
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -894,7 +895,7 @@
894895
Line 1 says we want to have line 3 called whenever lint comes across a
895896
method to `setRepeating`.
896897

897-
On lines 8-4 we make sure we're talking about the correct method on the
898+
On lines 8-14 we make sure we're talking about the correct method on the
898899
correct class with the correct signature. This uses the `JavaEvaluator`
899900
to check that the called method is a member of the named class. This is
900901
necessary because the callback would also be invoked if lint came
@@ -1067,7 +1068,7 @@
10671068
wrappers yourself, via `UBinaryExpression.asCall()`,
10681069
`UUnaryExpression.asCall()`, and `UArrayAccessExpression.asCall()`.
10691070

1070-
There is also a visitor you can use to visit call calls --
1071+
There is also a visitor you can use to visit all calls --
10711072
`UastCallVisitor`, which will visit all calls, including those from
10721073
array accesses and unary operators and binary operators.
10731074

docs/api-guide/changes.md.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,49 @@
55
information about user visible changes to lint, see the User
66
Guide.
77

8+
**8.4**
9+
10+
* You can now use `~~` in text messages (error messages, issue
11+
explanations, etc) to create strikethrough text. For example, “`Don't
12+
do this: ~~super.onCreate()~~`” will render as “Don't do this:
13+
~~super.onCreate()~~”.
14+
15+
**8.3**
16+
17+
* If you'd like to change your error message reported by your
18+
detector, you can now override your `Detector`'s `sameMessage`
19+
method: match the details in the previous error message with the
20+
new format. This is used by the baseline mechanism such that your
21+
message change doesn't suddenly invalidate all existing baseline
22+
files for your issue.
23+
24+
* The replace-string quickfix descriptor now lets you replace a string
25+
repeatedly. Example:
26+
```
27+
fix().replace().text("Foo").with("Bar").repeatedly().build()
28+
```
29+
30+
You can also match an element optionally. Example:
31+
```
32+
fix().composite(
33+
fix().replace().text("<Tag>").with("<tag>").build(),
34+
fix().replace().text("</Tag>").with("</tag>").optional().build()
35+
)
36+
```
37+
38+
* The quickfix machinery was improved significantly. It now does a
39+
better job inserting imports (in alphabetical order instead of always
40+
prepending to the import list), inserting new XML attributes in the
41+
right canonical Android order, cleaning up whitespace after edits,
42+
etc. This may result in some diffs in any quickfix-related unit tests
43+
(e.g. `lint().run().expectFixDiffs(...)`)
44+
45+
* The `getFileNameWithParent` utility method now always uses / as
46+
a file separator instead of the platform-specific one (e.g. \ on
47+
Windows). This ensures that baselines don't vary their error
48+
messages (where this utility method is typically used) based on
49+
which OS they were generated on.
50+
851
**8.2**
952

1053
* For unit tests, you can now specify the language level to be used

docs/api-guide/messages.md.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
This is a \`code symbol\` | This is a `code symbol`
3030
This is `*italics*` | This is *italics*
3131
This is `**bold**` | This is **bold**
32+
This is `~~strikethrough~~` | This is ~~strikethrough~~
3233
http://, https:// | [](http://), [](https://)
3334
`\*not italics*` | `\*not italics*`
3435
\`\`\`language\n text\n\`\`\`| (preformatted text block)

docs/api-guide/publishing.md.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
### lintPublish Configuration
5353

5454
The Android Gradle library plugin provides some special configurations,
55-
`lintConfig` and `lintPublish`.
55+
`lintChecks` and `lintPublish`.
5656

5757
The `lintPublish` configuration lets you reference another project, and
5858
it will take that project's output jar and package it as a `lint.jar`
@@ -94,7 +94,7 @@
9494
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9595
apply plugin: 'com.android.application'
9696
dependencies {
97-
lintConfig project(':checks')
97+
lintChecks project(':checks')
9898
// other dependencies
9999
}
100100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/book.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 9 additions & 2 deletions
Large diffs are not rendered by default.

docs/usage/agp-dsl.md.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
will be checked during release builds (even if the lint target is not
7777
included).
7878

79-
Example: `fatal 'NewApi', 'InlineApi'`
79+
Example: `fatal 'NewApi', 'InlinedApi'`
8080

8181
`error` issue-list
8282
: Sets the severity of the given issues to error.

docs/usage/changes.md.html

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,65 @@
44
For information about internal improvements and API changes affecting
55
lint check authors, see the API Guide.
66

7+
**8.4**
8+
9+
* New built-in lint-checks:
10+
11+
Issue ID | Summary
12+
----------------------------------|-----------------------------------
13+
`BuildListAdds` | Missing `add` call in `buildList`
14+
`PublicKeyCredential` | Creating public key credential
15+
`SecretInSource` | Secret in source code
16+
`LintBaselineFixed` | Baseline issues fixed
17+
18+
* The `LintBaseline` issue was reporting two different types of issues:
19+
20+
1. An informational message that a baseline was applied, listing the
21+
number of errors and warnings that were filtered out because of the
22+
baseline
23+
24+
2. Whether one or more problems listed in the baseline are no longer
25+
reported, meaning the issue has likely been fixed -- so the baseline
26+
can be updated (for example to prevent the issue from silently
27+
reoccurring).
28+
29+
Since these are separate problems and you may want to configure one
30+
and not the other to be a warning or an error, the `LintBaseline`
31+
issue id is now only used for the first type of issue, and the second
32+
one is reported under a new issue ID, `LintBaselineFixed`. If you had
33+
previously suppressed `LintBaseline` in order to remove both of these
34+
reports, you'l need to also suppress `LintBaselineFixed`.
35+
36+
**8.3**
37+
38+
* New built-in lint-checks:
39+
40+
Issue ID | Summary
41+
---------------------------------|-----------------------------------
42+
`ActivityIconColor` | Ongoing activity icon is not white
43+
`SelectedPhotoAccess` | Behavior change when requesting photo library access
44+
`UseSdkSuppress` | Using `@SdkSuppress` instead of `@RequiresApi`
45+
`WrongCommentType` | Wrong Comment Type
46+
47+
**8.2**
48+
49+
* New built-in lint-checks:
50+
51+
Issue ID | Summary
52+
-------------------------------------|-----------------------------------
53+
`ForegroundServicePermission` | Missing permissions required by foregroundServiceType
54+
`ForegroundServiceType` | Missing `foregroundServiceType` attribute in manifest
55+
`IntentWithNullActionLaunch` | Unsafe intent launched with no action set
56+
`MutableImplicitPendingIntent` | Mutable Implicit PendingIntent is disallowed
57+
`PlaySdkIndexGenericIssues` | Library has issues in SDK Index
58+
`StartActivityAndCollapseDeprecated` | TileService.startActivityAndCollapse(Intent) is deprecated
59+
`TilePreviewImageFormat` | Tile preview is not compliant with standards
60+
`WearBackNavigation` | Wear: Disabling Back navigation
61+
`WearMaterialTheme` | Using not non-Wear `MaterialTheme` in a Wear OS project
62+
`WearPasswordInput` | Wear: Using password input
63+
`WearRecents` | Wear OS: Recents and app resume
64+
`WearSplashScreen` | Wear: Use `SplashScreen` library
65+
766
**8.1**
867

968
* Lint now supports and includes checks for Gradle version catalog
@@ -16,12 +75,14 @@
1675
----------------------------------|-----------------------------------
1776
`NoOp` | Finds leftover code constructs which have no side effect or purpose
1877
`UnspecifiedRegisterReceiverFlag` | Missing `registerReceiver()` exported flag
78+
`UnsafeIntentLaunch` | Launched unsafe Intent
1979
`UnsafeImplicitIntentLaunch` | Implicit intent matches an internal non-exported component
20-
`ShortcutUsageDetector` | Shortcut usage should be reported
80+
`ReportShortcutUsage` | Shortcut usage should be reported
2181
`UseTomlInstead` | Mixing and matching Gradle build file and TOML dependencies
2282
`KaptUsageInsteadOfKsp` | Using kapt where KSP would also be available
2383
`BomWithoutPlatform` | BOM artifact added as a dependency instead of as a platform
2484
`ProviderReadPermissionOnly` | Provider with readPermission only and implemented write APIs
85+
`MutableImplicitPendingIntent` | Mutable implicit PendingIntent is disallowed
2586

2687
(The `NoOp` and `UnsafeImplicitIntentLaunch` lint checks are
2788
currently disabled by default.)

docs/usage/variables.md.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@
113113
`bytecode` test file, lint can generate the .class file binary
114114
content automatically if it is pointed to the `javac` compiler.
115115

116+
`LINT_TEST_KOTLINC_NATIVE`
117+
: When writing a lint check unit test, when creating a `klib` file,
118+
lint can generate the `.klib` file binary content automatically
119+
if it is pointed to `kotlinc-native`.
120+
121+
`LINT_TEST_INTEROP`
122+
: When writing a lint check unit test, when creating a `c` or `def`
123+
test file, lint can generate the `.klib` file binary content
124+
automatically if it is pointed to `cinterop`.
125+
116126
`INCLUDE_EXPENSIVE_LINT_TESTS`
117127
: When working on lint itself, set this environment variable to `true`
118128
some really, really expensive tests that we don't want run on the CI
@@ -134,6 +144,19 @@
134144
shortcut for invoking the `lintFix` targets or running the `lint`
135145
command with `--apply-suggestions`.
136146

147+
`lint.autofix.imports`
148+
: If `lint.autofix` is on, setting this flag will also include updating
149+
imports and applying reference shortening for updated code. This
150+
is normally only done in the IDE, relying on the safe refactoring
151+
machinery there. Lint's implementation isn't accurate in all cases
152+
(for example, it may apply reference shortening in comments), but
153+
can be enabled when useful (such as large bulk operations along with
154+
manual verification.)
155+
156+
: Turns on auto-fixing (applying safe quickfixes) by default. This is a
157+
shortcut for invoking the `lintFix` targets or running the `lint`
158+
command with `--apply-suggestions`.
159+
137160
`lint.html.prefs`
138161
: This property allows you to customize lint's HTML reports. It
139162
consists of a comma separated list of property assignments, e.g.

docs/user-guide.html

Lines changed: 393 additions & 32 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)