You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Already on GitHub?
Sign in
to your account
Infra upgrades, team productivity, code health, technical debt. See also team: labels.
team-android
Owned by Android platform team
triaged-android
Triaged by Android platform team
In
flutter/plugins#4206
we are turning on Android linting, but it does not attempt to fix existing issues. Instead, all existing issues have been codified into lint-baseline.xml so that any new issues will be caught by CI.
We should go plugin by plugin and fix (or explicitly disable in a targetted way) all of the issues, and remove both lint-baseline.xml, and the corresponding
baseline file("lint-baseline.xml")
from build.gradle.
[Edit: Updated the list with more plugins since https://github.com/
flutter/packages/pull/3648
adds more baseline files]
Remove Android lint-baseline.xml files from flutter/plugins
Remove Android lint-baseline.xml files from flutter/packages
Mar 6, 2023
For anyone interested in working on this, the process is:
Pick a plugin from the list above.
Look at the issues in that plugin's
android/lint-baseline.xml
, and fix any number of the issues there, removing them from the baseline file as they are fixed.
For packages that use
pigeon
, if they aren't using 9.2.3 or later, just updating to the latest version will almost certainly fix some warnings. (For a mass update like this, you can generate a new
lint-baseline.xml
by deleting the file locally then re-running the lint check.)
If you are using Android Studio, see
these docs
for instruction on enabling the lints in the IDE. By default, most will not show up. (Unfortunately, they must be individually enabled; there is no option to sync them with build.gradle's lint settings.)
If you fix all remaining issues, delete the
lint-baseline.xml
file and remove the
baseline file("lint-baseline.xml")
entry from
android/build.gradle
.
Fixing all issues in one PR is
not
required; incremental PRs to reduce the size of
lint-baseline.xml
are very welcome.
Note to anyone finding this via the
good first contribution
label
: this is marked as such because it's a good first contribution
specifically in the Android plugin domain
. If you don't have any experience with Java, or just aren't interested in plugins, this is not going to be a good first contribution for you.
(It's not necessary to pre-announce that you are interested in working on this; the chances of two people working on exactly the same fixes at the same time are very low.)
For all Android plugins:
- Enable all warnings for `lint`
- Treat all warnings as errors for `lint`
This significantly increases the scope of issues that we'll catch in CI. To
allow enabling this without having to make tons of fixes first, so that
we get the incremental benefit immediately, this adds new baselines for
all plugins. We can incrementally clean those baselines up over time.
(In practice we haven't prioritized that, but it would be good to start
paying down that technical debt incrementally at some point.)
See
flutter/flutter#88011
Fixes Android lint warnings found by the `lint-android` repo tool
command, and removes the baseline file.
Also fixes a few warnings that showed up in Android Studio.
Part of flutter/flutter#88011
Fixes Android lint warnings found by the `lint-android` repo tool
command, and removes the baseline file.
Also fixes a few warnings that showed up in Android Studio.
Part of flutter/flutter#88011
Removes list-baseline.xml and fixes all violations. Includes a few minor opporunistic fixes of warnings surfaced in Android Studio but not by the linter.
Part of flutter/flutter#88011
Removes lint-baseline.xml, fixing all resulting warnings.
Also makes some fixes that weren't flagged by the command-line lint, but
were flagged by Android Studio's linter, to reduce the noise in the UI.
This includes all of the conversions of anonymous subclasses to lambdas,
which were entirely tool-generated.
Part of flutter/flutter#88011
Removes lint-baseline.xml, fixing all resulting warnings.
Also makes some fixes that weren't flagged by the command-line lint, but
were flagged by Android Studio's linter, to reduce the noise in the UI.
This includes all of the conversions of anonymous subclasses to lambdas,
which were entirely tool-generated.
Part of flutter/flutter#88011
Everything is done now except for
espresso
. That will be non-trivial; there are hundreds of missing nullability violations, and it's all public API, so will require someone to dig into the API structure and make decisions about what the nullability should be (unlike all of the other plugins, where the decision almost always just involved looking at local code).
Removes lint-baseline.xml, fixing all resulting warnings.
Also makes some fixes that weren't flagged by the command-line lint, but were flagged by Android Studio's linter, to reduce the noise in the UI. This includes all of the conversions of anonymous subclasses to lambdas, which were entirely tool-generated.
Part of flutter/flutter#88011
For all Android plugins:
- Enable all warnings for `lint`
- Treat all warnings as errors for `lint`
This significantly increases the scope of issues that we'll catch in CI. To
allow enabling this without having to make tons of fixes first, so that
we get the incremental benefit immediately, this adds new baselines for
all plugins. We can incrementally clean those baselines up over time.
(In practice we haven't prioritized that, but it would be good to start
paying down that technical debt incrementally at some point.)
See
flutter/flutter#88011
Removes lint-baseline.xml and fixes all exposed lints. Includes an update of Pigeon to the latest version, to pick up warning fixes in generated code.
Part of flutter/flutter#88011
For all Android plugins:
- Enable all warnings for `lint`
- Treat all warnings as errors for `lint`
This significantly increases the scope of issues that we'll catch in CI. To
allow enabling this without having to make tons of fixes first, so that
we get the incremental benefit immediately, this adds new baselines for
all plugins. We can incrementally clean those baselines up over time.
(In practice we haven't prioritized that, but it would be good to start
paying down that technical debt incrementally at some point.)
See
flutter/flutter#88011
Removes the lint-baseline.xml file, and fixes all issues. Includes updating to the latest version of Pigeon to pick up the lint fixes for the generated file.
Part of flutter/flutter#88011
Removes the lint-baseline.xml file, and fixes all issues.
The `KotlinPropertyAccess` doesn't seem to work well with generics. For example,
```java
class CameraFeature<T> {
T getValue();
class ExposureFeature extends CameraFeature<Exposure> {
@OverRide
Exposure getValue() {
The `ExposureFeature.getValue` causes the lint warning. I went ahead and suppressed this for all `CameraFeatures`.
I also added `@Nonnull` or `@Nullable` to some private fields that weren't required. This helped deduce whether a value was always nonnull or not.
Part of flutter/flutter#88011
Removes lint-baseline.xml, and fixes all resulting warnings. Also fixes some warnings that only show up in the AS linter as opportunistic fixes.
All anonymous object->lambda conversions were auto-generated by the AS auto-fix for those warnings.
Fixed an edge case bug found during warning fixes; the Dart `getTokens` call has an argument that was (I assume accidentally) declared as `bool? shouldRecoverAuth = true` instead of `bool shouldRecoverAuth = true`, which means that while it defaults to `true` if not passed, it can be explicitly passed `null` and will keep that value. This was being passed directly into the method channel, and on the Java side was extracted as a `boolean` which would throw an exception on null.
Part of flutter/flutter#88011
Removed lint-baseline.xml and fixed all warnings.
The removal is mainly for unused resources that were identified by the `./gradlew lint` check.
Part of flutter/flutter#88011
Removes lint-baseline.xml and fixes all exposed lints. Includes an update of Pigeon to the latest version, to pick up warning fixes in generated code.
Part of flutter/flutter#88011
Removes the lint-baseline.xml and fixes the resulting issues. Also does some Andoid-Studio-suggested auto-conversions of anonymous classes to lambdas.
Part of flutter/flutter#88011
Removes list-baseline.xml and fixes all violations. Includes a few minor opporunistic fixes of warnings surfaced in Android Studio but not by the linter.
Part of flutter/flutter#88011
For all Android plugins:
- Enable all warnings for `lint`
- Treat all warnings as errors for `lint`
This significantly increases the scope of issues that we'll catch in CI. To
allow enabling this without having to make tons of fixes first, so that
we get the incremental benefit immediately, this adds new baselines for
all plugins. We can incrementally clean those baselines up over time.
(In practice we haven't prioritized that, but it would be good to start
paying down that technical debt incrementally at some point.)
See
flutter/flutter#88011
Infra upgrades, team productivity, code health, technical debt. See also team: labels.
team-android
Owned by Android platform team
triaged-android
Triaged by Android platform team