From a3571680a545d0ffdd8104855afad066b84cc2c7 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Mon, 26 Jun 2023 16:14:42 -0700 Subject: [PATCH 01/20] 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"). --- docs/checks/AaptCrash.md.html | 2 - docs/checks/AcceptsUserCertificates.md.html | 4 +- docs/checks/AccidentalOctal.md.html | 2 - docs/checks/AdapterViewChildren.md.html | 2 - docs/checks/AddJavascriptInterface.md.html | 4 +- docs/checks/AlertDialogUsage.md.html | 168 +++++++ docs/checks/AllCaps.md.html | 2 - docs/checks/AllowAllHostnameVerifier.md.html | 4 +- docs/checks/AlwaysShowAction.md.html | 2 - .../checks/AndroidGradlePluginVersion.md.html | 8 +- docs/checks/AnimatorKeep.md.html | 2 - docs/checks/AnnotateVersionCheck.md.html | 2 - .../AnnotationProcessorOnCompilePath.md.html | 2 - docs/checks/AppBundleLocaleChanges.md.html | 2 - docs/checks/AppCompatCustomView.md.html | 2 - docs/checks/AppCompatMethod.md.html | 2 - docs/checks/AppCompatResource.md.html | 2 - docs/checks/AppIndexingService.md.html | 2 - docs/checks/AppLinkUrlError.md.html | 2 - docs/checks/AppLinksAutoVerify.md.html | 2 - docs/checks/ApplySharedPref.md.html | 4 +- .../ArgInFormattedQuantityStringRes.md.html | 182 +++++++ docs/checks/AssertionSideEffect.md.html | 2 - docs/checks/AssertjImport.md.html | 141 ++++++ docs/checks/AuthLeak.md.html | 4 +- docs/checks/AutoDispose.md.html | 186 +++++++ docs/checks/AutoboxingStateCreation.md.html | 183 +++++++ .../AutoboxingStateValueProperty.md.html | 182 +++++++ docs/checks/Autofill.md.html | 2 - docs/checks/BackButton.md.html | 4 +- docs/checks/BadConfigurationProvider.md.html | 39 ++ docs/checks/BadHostnameVerifier.md.html | 4 +- .../BadPeriodicWorkRequestEnqueue.md.html | 37 ++ docs/checks/BatteryLife.md.html | 2 - docs/checks/BidiSpoofing.md.html | 4 +- docs/checks/BinaryOperationInTimber.md.html | 172 +++++++ .../BinderGetCallingInMainThread.md.html | 144 ++++++ .../BindsCanBeExtensionFunction.md.html | 249 +++++++++ docs/checks/BlockedPrivateApi.md.html | 2 - docs/checks/BomWithoutPlatform.md.html | 138 +++++ docs/checks/BottomAppBar.md.html | 2 - docs/checks/BrokenIterator.md.html | 2 - docs/checks/ButtonCase.md.html | 2 - docs/checks/ButtonOrder.md.html | 4 +- docs/checks/ButtonStyle.md.html | 4 +- docs/checks/ByteOrderMark.md.html | 2 - docs/checks/CanvasSize.md.html | 2 - .../CastingViewContextToActivity.md.html | 144 ++++++ docs/checks/CheckResult.md.html | 4 +- docs/checks/ChromeOsAbiSupport.md.html | 127 +++++ .../ChromeOsOnConfigurationChanged.md.html | 155 ++++++ .../checks/ClickableViewAccessibility.md.html | 2 - docs/checks/CoarseFineLocation.md.html | 2 - docs/checks/ColorCasing.md.html | 145 ++++++ docs/checks/CommitPrefEdits.md.html | 4 +- docs/checks/CommitTransaction.md.html | 2 - ...omposableDestinationInComposeScope.md.html | 39 +- .../ComposableLambdaParameterNaming.md.html | 39 +- .../ComposableLambdaParameterPosition.md.html | 39 +- docs/checks/ComposableModifierFactory.md.html | 39 +- docs/checks/ComposableNaming.md.html | 39 +- .../ComposableNavGraphInComposeScope.md.html | 39 +- docs/checks/ComposeComposableModifier.md.html | 195 ++++++++ .../ComposeCompositionLocalUsage.md.html | 221 ++++++++ ...mposeContentEmitterReturningValues.md.html | 221 ++++++++ docs/checks/ComposeM2Api.md.html | 246 +++++++++ docs/checks/ComposeModifierMissing.md.html | 252 ++++++++++ docs/checks/ComposeModifierReused.md.html | 357 +++++++++++++ .../ComposeModifierWithoutDefault.md.html | 189 +++++++ .../ComposeMultipleContentEmitters.md.html | 212 ++++++++ docs/checks/ComposeMutableParameters.md.html | 225 +++++++++ docs/checks/ComposeNamingLowercase.md.html | 200 ++++++++ docs/checks/ComposeNamingUppercase.md.html | 216 ++++++++ docs/checks/ComposeParameterOrder.md.html | 248 +++++++++ docs/checks/ComposePreviewNaming.md.html | 194 +++++++ docs/checks/ComposePreviewPublic.md.html | 212 ++++++++ docs/checks/ComposeRememberMissing.md.html | 189 +++++++ .../checks/ComposeUnstableCollections.md.html | 222 ++++++++ .../checks/ComposeViewModelForwarding.md.html | 174 +++++++ docs/checks/ComposeViewModelInjection.md.html | 225 +++++++++ docs/checks/CompositionLocalNaming.md.html | 39 +- docs/checks/ConflictingOnColor.md.html | 39 +- docs/checks/ConstantLocale.md.html | 2 - ...nstraintLayoutToolsEditorAttribute.md.html | 148 ++++++ docs/checks/ContentDescription.md.html | 8 +- ...CoroutineCreationDuringComposition.md.html | 39 +- docs/checks/CustomPermissionTypo.md.html | 4 +- docs/checks/CustomSplashScreen.md.html | 2 - docs/checks/CustomViewStyleable.md.html | 2 - docs/checks/CustomX509TrustManager.md.html | 4 +- docs/checks/CutPasteId.md.html | 2 - docs/checks/DalvikOverride.md.html | 2 - docs/checks/DataBindingWithoutKapt.md.html | 2 - docs/checks/DataExtractionRules.md.html | 4 +- .../DeepLinkInActivityDestination.md.html | 39 +- docs/checks/DefaultEncoding.md.html | 2 - docs/checks/DefaultLayoutAttribute.md.html | 149 ++++++ docs/checks/DefaultLocale.md.html | 2 - docs/checks/DeletedProvider.md.html | 4 +- docs/checks/DenyListedApi.md.html | 193 +++++++ docs/checks/Deprecated.md.html | 4 +- docs/checks/DeprecatedCall.md.html | 178 +++++++ docs/checks/DeprecatedProvider.md.html | 4 +- docs/checks/DeprecatedSinceApi.md.html | 2 - docs/checks/DeprecatedSqlUsage.md.html | 176 +++++++ .../DetachAndAttachSameFragment.md.html | 37 ++ docs/checks/DevModeObsolete.md.html | 2 - docs/checks/DeviceAdmin.md.html | 2 - .../DialogFragmentCallbacksDetector.md.html | 39 +- docs/checks/DiffUtilEquals.md.html | 2 - docs/checks/DisableBaselineAlignment.md.html | 2 - docs/checks/DiscouragedApi.md.html | 79 +-- docs/checks/DiscouragedPrivateApi.md.html | 2 - docs/checks/DoNotCallProviders.md.html | 232 +++++++++ ...DoNotExposeEitherNetInRepositories.md.html | 181 +++++++ docs/checks/DoNotMock.md.html | 212 ++++++++ docs/checks/DoNotMockAutoValue.md.html | 142 ++++++ docs/checks/DoNotMockDataClass.md.html | 142 ++++++ docs/checks/DoNotMockObjectClass.md.html | 142 ++++++ docs/checks/DoNotMockRecordClass.md.html | 142 ++++++ docs/checks/DoNotMockSealedClass.md.html | 143 ++++++ docs/checks/DrawAllocation.md.html | 2 - docs/checks/DuplicateActivity.md.html | 2 - docs/checks/DuplicateDefinition.md.html | 2 - docs/checks/DuplicateDivider.md.html | 2 - docs/checks/DuplicateIds.md.html | 2 - docs/checks/DuplicateIncludedIds.md.html | 2 - docs/checks/DuplicateStrings.md.html | 2 - docs/checks/DuplicateUsesFeature.md.html | 2 - docs/checks/EasterEgg.md.html | 2 - docs/checks/EditedTargetSdkVersion.md.html | 101 ++++ docs/checks/EllipsizeMaxLines.md.html | 2 - docs/checks/EmptyNavDeepLink.md.html | 39 +- docs/checks/EmptySuperCall.md.html | 2 - docs/checks/EnforceUTF8.md.html | 2 - docs/checks/EnqueueWork.md.html | 2 - docs/checks/EnsureInitializerMetadata.md.html | 39 ++ .../EnsureInitializerNoArgConstr.md.html | 39 ++ docs/checks/ErroneousLayoutAttribute.md.html | 149 ++++++ docs/checks/ErrorProneDoNotMockUsage.md.html | 202 ++++++++ docs/checks/ExactAlarm.md.html | 149 ++++++ docs/checks/ExifInterface.md.html | 2 - docs/checks/ExpensiveAssertion.md.html | 2 - .../ExperimentalAnnotationRetention.md.html | 37 ++ docs/checks/ExpiredTargetSdkVersion.md.html | 46 +- docs/checks/ExpiringTargetSdkVersion.md.html | 19 +- docs/checks/ExportedContentProvider.md.html | 4 +- .../checks/ExportedPreferenceActivity.md.html | 4 +- docs/checks/ExportedReceiver.md.html | 4 +- docs/checks/ExportedService.md.html | 4 +- docs/checks/ExtraText.md.html | 2 - docs/checks/ExtraTranslation.md.html | 2 - ...eldSiteTargetOnQualifierAnnotation.md.html | 275 ++++++++++ docs/checks/FileEndsWithExt.md.html | 2 - docs/checks/FindViewByIdCast.md.html | 2 - .../FlowOperatorInvokedInComposition.md.html | 39 +- docs/checks/FontValidation.md.html | 2 - .../ForegroundServicePermission.md.html | 204 ++++++++ docs/checks/ForegroundServiceType.md.html | 162 ++++++ docs/checks/FormalGerman.md.html | 183 +++++++ docs/checks/FragmentAddMenuProvider.md.html | 39 ++ .../FragmentBackPressedCallback.md.html | 39 ++ .../FragmentConstructorInjection.md.html | 229 +++++++++ docs/checks/FragmentFieldInjection.md.html | 200 ++++++++ .../FragmentGradleConfiguration-2.md.html | 151 ++++++ .../FragmentGradleConfiguration.md.html | 51 +- docs/checks/FragmentLiveDataObserve.md.html | 39 ++ docs/checks/FragmentTagUsage.md.html | 39 +- ...entlyChangedStateReadInComposition.md.html | 39 +- docs/checks/FullBackupContent.md.html | 2 - docs/checks/FullyQualifiedResource.md.html | 203 ++++++++ docs/checks/GestureBackNavigation.md.html | 2 - docs/checks/GetInstance.md.html | 4 +- docs/checks/GetLocales.md.html | 2 - docs/checks/GradleCompatible.md.html | 2 - docs/checks/GradleDependency.md.html | 4 +- docs/checks/GradleDeprecated.md.html | 2 - .../GradleDeprecatedConfiguration.md.html | 2 - docs/checks/GradleDynamicVersion.md.html | 2 - docs/checks/GradleGetter.md.html | 2 - docs/checks/GradleOverrides.md.html | 2 - docs/checks/GradlePath.md.html | 2 - docs/checks/GradlePluginVersion.md.html | 2 - docs/checks/GrantAllUris.md.html | 4 +- docs/checks/GridLayout.md.html | 2 - docs/checks/GuavaChecksUsed.md.html | 211 ++++++++ .../GuavaPreconditionsUsedInKotlin.md.html | 212 ++++++++ docs/checks/HalfFloat.md.html | 2 - docs/checks/HandlerLeak.md.html | 2 - docs/checks/HardcodedDebugMode.md.html | 4 +- docs/checks/HardcodedText.md.html | 2 - docs/checks/HardwareIds.md.html | 2 - docs/checks/HighAppVersionCode.md.html | 2 - docs/checks/HighSamplingRate.md.html | 2 - docs/checks/IconColors.md.html | 3 +- docs/checks/IconDensities.md.html | 3 - docs/checks/IconDipSize.md.html | 3 - docs/checks/IconExpectedSize.md.html | 2 +- docs/checks/IconExtension.md.html | 3 - docs/checks/IconLauncherShape.md.html | 8 +- docs/checks/IconMissingDensityFolder.md.html | 3 - docs/checks/IconXmlAndPng.md.html | 2 - .../IdleBatteryChargingConstraints.md.html | 37 ++ docs/checks/IgnoreWithoutReason.md.html | 2 - docs/checks/IllegalResourceRef.md.html | 2 - docs/checks/ImplicitSamInstance.md.html | 2 - docs/checks/ImplicitStringPlaceholder.md.html | 155 ++++++ docs/checks/ImpliedQuantity.md.html | 2 - .../checks/ImpliedTouchscreenHardware.md.html | 2 - docs/checks/InOrMmUsage.md.html | 2 - docs/checks/IncludeLayoutParam.md.html | 2 - docs/checks/InclusiveNaming.md.html | 149 ++++++ ...leMediaBrowserServiceCompatVersion.md.html | 4 +- docs/checks/InconsistentArrays.md.html | 2 - docs/checks/InconsistentLayout.md.html | 2 - .../checks/IncorrectChainMarginsUsage.md.html | 142 ++++++ docs/checks/IncorrectMatchParentUsage.md.html | 141 ++++++ .../IncorrectReferencesDeclaration.md.html | 214 ++++++++ docs/checks/InefficientWeight.md.html | 2 - docs/checks/InflateParams.md.html | 2 - docs/checks/InjectInJava.md.html | 239 +++++++++ ...hScopeRequiredLoggedInUserProvider.md.html | 209 ++++++++ ...thTypeMustImplementAnvilInjectable.md.html | 199 ++++++++ docs/checks/InlinedApi.md.html | 2 - docs/checks/InnerclassSeparator.md.html | 2 - docs/checks/InsecureBaseConfiguration.md.html | 4 +- docs/checks/InstantApps.md.html | 2 - docs/checks/Instantiatable.md.html | 6 +- .../IntentFilterExportedReceiver.md.html | 4 +- .../IntentFilterUniqueDataAttributes.md.html | 2 - docs/checks/IntentReset.md.html | 2 - docs/checks/InvalidAccessibility.md.html | 148 ++++++ docs/checks/InvalidAnalyticsName.md.html | 2 - docs/checks/InvalidColorHexValue.md.html | 39 +- ...idFragmentVersionForActivityResult.md.html | 39 +- docs/checks/InvalidId.md.html | 2 - docs/checks/InvalidImeActionId.md.html | 2 - docs/checks/InvalidImport.md.html | 168 +++++++ docs/checks/InvalidNavigation.md.html | 2 - docs/checks/InvalidPackage.md.html | 3 - ...InvalidPeriodicWorkRequestInterval.md.html | 37 ++ docs/checks/InvalidPermission.md.html | 2 - docs/checks/InvalidResourceFolder.md.html | 5 +- docs/checks/InvalidSetHasFixedSize.md.html | 39 ++ docs/checks/InvalidSingleLineComment.md.html | 172 +++++++ docs/checks/InvalidString.md.html | 156 ++++++ docs/checks/InvalidUsesTagAttribute.md.html | 2 - docs/checks/InvalidVectorPath.md.html | 2 - docs/checks/InvalidWakeLockTag.md.html | 2 - .../InvalidWearFeatureAttribute.md.html | 6 +- docs/checks/JCenter.md.html | 149 ++++++ docs/checks/JavaOnlyDetector.md.html | 192 +++++++ docs/checks/JavaPluginLanguageLevel.md.html | 2 - docs/checks/JavascriptInterface.md.html | 4 +- docs/checks/JcenterRepositoryObsolete.md.html | 2 - docs/checks/JobSchedulerService.md.html | 4 +- .../JvmStaticProvidesInObjectDetector.md.html | 290 +++++++++++ docs/checks/KaptUsageInsteadOfKsp.md.html | 151 ++++++ .../checks/KeyboardInaccessibleWidget.md.html | 2 - docs/checks/KnownPermissionError.md.html | 4 +- docs/checks/KotlinNullnessAnnotation.md.html | 2 - docs/checks/KotlinPairNotCreated.md.html | 184 +++++++ docs/checks/KotlinPropertyAccess.md.html | 2 - .../KotlinRequireNotNullUseMessage.md.html | 165 ++++++ docs/checks/KotlincFE10.md.html | 236 +++++++++ docs/checks/KtxExtensionAvailable.md.html | 2 - docs/checks/LabelFor.md.html | 2 - docs/checks/LambdaLast.md.html | 2 - .../LaunchActivityFromNotification.md.html | 4 +- docs/checks/LaunchDuringComposition.md.html | 39 +- .../checks/LayoutFileNameMatchesClass.md.html | 172 +++++++ docs/checks/LeanbackUsesWifi.md.html | 2 - docs/checks/LibraryCustomView.md.html | 2 - ...ecycleAnnotationProcessorWithJava8.md.html | 2 - docs/checks/LintDocExample.md.html | 2 - docs/checks/LintImplBadUrl.md.html | 2 - docs/checks/LintImplDollarEscapes.md.html | 2 - docs/checks/LintImplIdFormat.md.html | 2 - docs/checks/LintImplPsiEquals.md.html | 2 - docs/checks/LintImplTextFormat.md.html | 2 - docs/checks/LintImplTrimIndent.md.html | 2 - docs/checks/LintImplUnexpectedDomain.md.html | 2 - docs/checks/LintImplUseKotlin.md.html | 2 - docs/checks/LintImplUseUast.md.html | 2 - docs/checks/LocalSuppress.md.html | 2 - docs/checks/LocaleFolder.md.html | 5 +- docs/checks/LockedOrientationActivity.md.html | 2 - docs/checks/LogConditional.md.html | 2 - docs/checks/LogNotTimber.md.html | 171 +++++++ docs/checks/LogTagMismatch.md.html | 2 - docs/checks/LongLogTag.md.html | 2 - docs/checks/MainScopeUsage.md.html | 178 +++++++ docs/checks/MangledCRLF.md.html | 4 +- docs/checks/ManifestOrder.md.html | 2 - docs/checks/ManifestResource.md.html | 2 - docs/checks/ManifestTypo.md.html | 2 - docs/checks/MatchingMenuId.md.html | 147 ++++++ docs/checks/MatchingViewId.md.html | 145 ++++++ docs/checks/MenuTitle.md.html | 2 - docs/checks/MergeMarker.md.html | 2 - docs/checks/MergeRootFrame.md.html | 2 - docs/checks/MinSdkTooLow.md.html | 2 - docs/checks/MipmapIcons.md.html | 2 - docs/checks/MissingApplicationIcon.md.html | 2 - docs/checks/MissingBackupPin.md.html | 2 - docs/checks/MissingClass.md.html | 2 - docs/checks/MissingColorAlphaChannel.md.html | 39 +- docs/checks/MissingConstraints.md.html | 2 - docs/checks/MissingDefaultResource.md.html | 2 - ...issingFirebaseInstanceTokenRefresh.md.html | 2 - docs/checks/MissingId.md.html | 2 - docs/checks/MissingInflatedId.md.html | 2 - .../MissingIntentFilterForMediaSearch.md.html | 2 - docs/checks/MissingLeanbackLauncher.md.html | 2 - docs/checks/MissingLeanbackSupport.md.html | 2 - ...ingMediaBrowserServiceIntentFilter.md.html | 2 - docs/checks/MissingOnPlayFromSearch.md.html | 2 - docs/checks/MissingPermission.md.html | 2 - docs/checks/MissingPrefix.md.html | 2 - docs/checks/MissingQuantity.md.html | 2 - .../checks/MissingResourceImportAlias.md.html | 197 ++++++++ docs/checks/MissingScrollbars.md.html | 148 ++++++ docs/checks/MissingSuperCall.md.html | 2 - docs/checks/MissingTranslation.md.html | 2 - docs/checks/MissingTvBanner.md.html | 2 - docs/checks/MissingVersion.md.html | 2 - docs/checks/MissingXmlHeader.md.html | 144 ++++++ docs/checks/MockLocation.md.html | 2 - .../ModifierFactoryExtensionFunction.md.html | 39 +- docs/checks/ModifierFactoryReturnType.md.html | 39 +- ...odifierFactoryUnreferencedReceiver.md.html | 39 +- .../ModifierNodeInspectableProperties.md.html | 182 +++++++ docs/checks/ModifierParameter.md.html | 39 +- docs/checks/ModuleCompanionObjects.md.html | 290 +++++++++++ ...eCompanionObjectsNotInModuleParent.md.html | 146 ++++++ docs/checks/MonochromeLauncherIcon.md.html | 2 - ...MoshiUsageAdaptedByRequiresAdapter.md.html | 208 ++++++++ .../MoshiUsageAdaptedByRequiresKeep.md.html | 199 ++++++++ docs/checks/MoshiUsageArray.md.html | 256 ++++++++++ docs/checks/MoshiUsageBlankGenerator.md.html | 174 +++++++ docs/checks/MoshiUsageBlankJsonName.md.html | 176 +++++++ docs/checks/MoshiUsageBlankTypeLabel.md.html | 174 +++++++ docs/checks/MoshiUsageClassVisibility.md.html | 188 +++++++ .../MoshiUsageDoubleClassAnnotation.md.html | 188 +++++++ docs/checks/MoshiUsageDoubleTypeLabel.md.html | 187 +++++++ .../MoshiUsageDuplicateJsonName.md.html | 201 ++++++++ .../MoshiUsageEnumAnnotatedUnknown.md.html | 143 ++++++ docs/checks/MoshiUsageEnumCasing.md.html | 143 ++++++ .../MoshiUsageEnumJsonClassGenerated.md.html | 142 ++++++ .../MoshiUsageEnumMissingJsonClass.md.html | 143 ++++++ .../MoshiUsageEnumMissingUnknown.md.html | 143 ++++++ ...MoshiUsageEnumPropertyCouldBeMoshi.md.html | 180 +++++++ ...shiUsageEnumPropertyDefaultUnknown.md.html | 202 ++++++++ ...hiUsageGenerateAdapterShouldBeTrue.md.html | 175 +++++++ .../MoshiUsageGenericSealedSubtype.md.html | 185 +++++++ .../MoshiUsageInappropriateTypeLabel.md.html | 198 ++++++++ docs/checks/MoshiUsageMissingPrimary.md.html | 176 +++++++ .../checks/MoshiUsageMissingTypeLabel.md.html | 188 +++++++ .../MoshiUsageMutableCollections.md.html | 253 ++++++++++ .../MoshiUsageNonMoshiClassCollection.md.html | 243 +++++++++ .../MoshiUsageNonMoshiClassExternal.md.html | 257 ++++++++++ .../MoshiUsageNonMoshiClassInternal.md.html | 234 +++++++++ .../checks/MoshiUsageNonMoshiClassMap.md.html | 233 +++++++++ .../MoshiUsageNonMoshiClassPlatform.md.html | 235 +++++++++ docs/checks/MoshiUsageObject.md.html | 176 +++++++ docs/checks/MoshiUsageParamNeedsInit.md.html | 176 +++++++ .../MoshiUsagePrivateConstructor.md.html | 184 +++++++ ...shiUsagePrivateConstructorProperty.md.html | 174 +++++++ .../MoshiUsageQualifierRetention.md.html | 209 ++++++++ docs/checks/MoshiUsageQualifierTarget.md.html | 208 ++++++++ .../MoshiUsageRedundantJsonName.md.html | 177 +++++++ .../MoshiUsageRedundantSiteTarget.md.html | 177 +++++++ .../MoshiUsageSealedMustBeSealed.md.html | 173 +++++++ docs/checks/MoshiUsageSerializedName.md.html | 213 ++++++++ docs/checks/MoshiUsageSnakeCase.md.html | 179 +++++++ .../MoshiUsageTransientNeedsInit.md.html | 176 +++++++ docs/checks/MoshiUsageUnsupportedType.md.html | 207 ++++++++ docs/checks/MoshiUsageUseData.md.html | 178 +++++++ docs/checks/MoshiUsageVarProperty.md.html | 175 +++++++ ...ionLayoutInvalidSceneFileReference.md.html | 2 - docs/checks/MotionLayoutMissingId.md.html | 2 - .../MotionSceneFileValidationError.md.html | 2 - .../MultipleAwaitPointerEventScopes.md.html | 142 ++++++ docs/checks/MultipleUsesSdk.md.html | 2 - .../MutableCollectionMutableState.md.html | 39 +- docs/checks/MutatingSharedPrefs.md.html | 2 - docs/checks/NamespaceTypo.md.html | 2 - docs/checks/NamingPattern.md.html | 171 +++++++ docs/checks/NegativeMargin.md.html | 2 - docs/checks/NestedScrolling.md.html | 2 - docs/checks/NestedWeights.md.html | 2 - docs/checks/NetworkSecurityConfig.md.html | 2 - docs/checks/NewApi.md.html | 2 - docs/checks/NewerVersionAvailable.md.html | 4 +- docs/checks/NfcTechWhitespace.md.html | 2 - docs/checks/NoHardKeywords.md.html | 2 - docs/checks/NoOp.md.html | 166 ++++++ docs/checks/NonConstantResourceId.md.html | 2 - docs/checks/NonResizeableActivity.md.html | 2 - docs/checks/NotConstructor.md.html | 2 - docs/checks/NotInterpolated.md.html | 2 - docs/checks/NotSibling.md.html | 2 - .../NotificationIconCompatibility.md.html | 5 +- docs/checks/NotificationId0.md.html | 2 - docs/checks/NotificationPermission.md.html | 2 - docs/checks/NotificationTrampoline.md.html | 2 - docs/checks/NotifyDataSetChanged.md.html | 2 - docs/checks/NullSafeMutableLiveData.md.html | 42 ++ docs/checks/ObjectAnimatorBinding.md.html | 2 - docs/checks/ObsoleteLayoutParam.md.html | 2 - docs/checks/ObsoleteSdkInt.md.html | 2 - docs/checks/OldTargetApi.md.html | 2 - docs/checks/OnClick.md.html | 2 - docs/checks/OpaqueUnitKey.md.html | 189 +++++++ docs/checks/OpenForTesting.md.html | 2 - docs/checks/Orientation.md.html | 2 - docs/checks/OutdatedLibrary.md.html | 4 +- docs/checks/Overdraw.md.html | 2 - docs/checks/Override.md.html | 214 +------- docs/checks/OverrideAbstract.md.html | 2 - .../PackageManagerGetSignatures.md.html | 147 +----- docs/checks/PackagedPrivateKey.md.html | 5 +- docs/checks/ParcelClassLoader.md.html | 2 - docs/checks/ParcelCreator.md.html | 2 - docs/checks/ParcelizeFunctionProperty.md.html | 244 +++++++++ docs/checks/PendingBindings.md.html | 2 - ...ImpliesUnsupportedChromeOsHardware.md.html | 14 +- ...rmissionImpliesUnsupportedHardware.md.html | 2 - .../checks/PermissionNamingConvention.md.html | 2 - docs/checks/PinSetExpiry.md.html | 2 - docs/checks/PlaySdkIndexNonCompliant.md.html | 2 +- docs/checks/PluralsCandidate.md.html | 4 +- docs/checks/PrivateApi.md.html | 2 - docs/checks/PrivateResource.md.html | 2 - .../ProduceStateDoesNotAssignValue.md.html | 39 +- docs/checks/Proguard.md.html | 2 - docs/checks/ProguardSplit.md.html | 2 - docs/checks/PropertyEscape.md.html | 2 - docs/checks/ProtectedPermissions.md.html | 2 - .../checks/ProviderReadPermissionOnly.md.html | 210 ++++++++ docs/checks/ProxyPassword.md.html | 2 - docs/checks/PxUsage.md.html | 2 - .../checks/QueryAllPackagesPermission.md.html | 2 - docs/checks/QueryPermissionsNeeded.md.html | 2 - docs/checks/Range.md.html | 2 - docs/checks/RawColor.md.html | 144 ++++++ docs/checks/RawDimen.md.html | 144 ++++++ docs/checks/RawDispatchersUse.md.html | 228 +++++++++ docs/checks/Recycle.md.html | 2 - docs/checks/RecyclerView.md.html | 2 - docs/checks/RedactedInJavaUsage.md.html | 208 ++++++++ docs/checks/RedundantLabel.md.html | 2 - docs/checks/RedundantNamespace.md.html | 3 - docs/checks/ReferenceType.md.html | 2 - docs/checks/RelativeOverlap.md.html | 2 - docs/checks/RememberReturnType.md.html | 134 ++++- .../RememberSaveableSaverParameter.md.html | 39 +- docs/checks/RemoteViewLayout.md.html | 2 - .../RemoveWorkManagerInitializer.md.html | 57 ++- .../RepeatOnLifecycleWrongUsage.md.html | 39 ++ docs/checks/ReportShortcutUsage.md.html | 119 +++++ docs/checks/RequiredSize.md.html | 2 - docs/checks/RequiresFeature.md.html | 2 - docs/checks/ResAuto.md.html | 2 - docs/checks/ReservedSystemPermission.md.html | 13 +- docs/checks/ResourceAsColor.md.html | 2 - docs/checks/ResourceCycle.md.html | 2 - docs/checks/ResourceType.md.html | 2 - docs/checks/ResourcesGetColorCall.md.html | 170 +++++++ .../ResourcesGetColorStateListCall.md.html | 170 +++++++ docs/checks/ResourcesGetDrawableCall.md.html | 170 +++++++ docs/checks/RestrictCallsTo.md.html | 214 ++++++++ docs/checks/RestrictedApi.md.html | 2 - docs/checks/RetrofitUsage.md.html | 207 ++++++++ .../ReturnFromAwaitPointerEventScope.md.html | 37 ++ docs/checks/ReturnThis.md.html | 2 - docs/checks/RiskyLibrary.md.html | 6 +- docs/checks/RtlCompat.md.html | 2 - docs/checks/RtlEnabled.md.html | 3 - docs/checks/RtlHardcoded.md.html | 2 - docs/checks/RtlSymmetry.md.html | 2 - docs/checks/RxJava2DefaultScheduler.md.html | 173 +++++++ .../RxJava2DisposableAddAllCall.md.html | 170 +++++++ .../RxJava2DisposableDisposeCall.md.html | 176 +++++++ ...Java2MethodMissingCheckReturnValue.md.html | 296 +++++++++++ ...va2MissingCompositeDisposableClear.md.html | 171 +++++++ .../RxJava2SchedulersFactoryCall.md.html | 175 +++++++ .../RxJava2SubscribeMissingOnError.md.html | 173 +++++++ docs/checks/SQLiteString.md.html | 2 - ...rtificateSocketFactoryCreateSocket.md.html | 4 +- ...ertificateSocketFactoryGetInsecure.md.html | 4 +- docs/checks/ScheduleExactAlarm.md.html | 162 ++++++ docs/checks/ScopedStorage.md.html | 14 +- docs/checks/ScrollViewCount.md.html | 2 - docs/checks/ScrollViewSize.md.html | 2 - docs/checks/SdCardPath.md.html | 2 - docs/checks/SecureRandom.md.html | 4 +- docs/checks/SelectableText.md.html | 2 - docs/checks/SerializableUsage.md.html | 176 +++++++ docs/checks/ServiceCast.md.html | 2 - .../SetAndClearCommunicationDevice.md.html | 124 +++++ docs/checks/SetJavaScriptEnabled.md.html | 4 +- docs/checks/SetTextI18n.md.html | 2 - docs/checks/SetWorldReadable.md.html | 4 +- docs/checks/SetWorldWritable.md.html | 4 +- docs/checks/ShiftFlags.md.html | 2 - docs/checks/ShortAlarm.md.html | 19 +- docs/checks/ShouldUseStaticImport.md.html | 169 +++++++ docs/checks/ShowToast.md.html | 2 - .../SignatureOrSystemPermissions.md.html | 2 - docs/checks/SimpleDateFormat.md.html | 2 - docs/checks/Slices.md.html | 2 - docs/checks/SmallSp.md.html | 2 - docs/checks/SoonBlockedPrivateApi.md.html | 2 - .../SourceLockedOrientationActivity.md.html | 9 +- docs/checks/SpUsage.md.html | 2 - docs/checks/SpanMarkPointMissingMask.md.html | 182 +++++++ .../SpecifyForegroundServiceType.md.html | 37 ++ .../checks/SpecifyJobSchedulerIdRange.md.html | 37 ++ .../checks/SquareAndRoundTilePreviews.md.html | 2 - .../StateFlowValueCalledInComposition.md.html | 140 ++---- docs/checks/StateListReachable.md.html | 2 - docs/checks/StaticFieldLeak.md.html | 2 - docs/checks/StopShip.md.html | 2 - docs/checks/StringEscaping.md.html | 2 - docs/checks/StringFormatCount.md.html | 4 +- docs/checks/StringFormatInTimber.md.html | 171 +++++++ docs/checks/StringFormatInvalid.md.html | 4 +- docs/checks/StringFormatMatches.md.html | 4 +- docs/checks/StringFormatTrivial.md.html | 4 +- docs/checks/StringNotCapitalized.md.html | 155 ++++++ docs/checks/StringShouldBeInt.md.html | 2 - docs/checks/SubscribeOnMain.md.html | 188 +++++++ .../SuperfluousMarginDeclaration.md.html | 150 ++++++ docs/checks/SuperfluousNameSpace.md.html | 148 ++++++ .../SuperfluousPaddingDeclaration.md.html | 150 ++++++ docs/checks/SupportAnnotationUsage.md.html | 2 - docs/checks/Suspicious0dp.md.html | 2 - ...iciousCompositionLocalModifierRead.md.html | 210 ++++++++ docs/checks/SuspiciousImport.md.html | 2 - docs/checks/SuspiciousIndentation.md.html | 2 - docs/checks/SwitchIntDef.md.html | 15 +- docs/checks/SyntheticAccessor.md.html | 2 - docs/checks/SystemPermissionTypo.md.html | 2 - docs/checks/TestAppLink.md.html | 2 - .../TestManifestGradleConfiguration.md.html | 116 +++++ docs/checks/TextFields.md.html | 2 - docs/checks/TextViewEdits.md.html | 2 - docs/checks/ThrowableNotAtBeginning.md.html | 171 +++++++ docs/checks/TileProviderPermissions.md.html | 2 - docs/checks/TimberArgCount.md.html | 171 +++++++ docs/checks/TimberArgTypes.md.html | 173 +++++++ docs/checks/TimberExceptionLogging.md.html | 172 +++++++ docs/checks/TimberTagLength.md.html | 170 +++++++ docs/checks/Todo.md.html | 173 +++++++ docs/checks/TranslucentOrientation.md.html | 2 - docs/checks/TrulyRandom.md.html | 4 +- docs/checks/TrustAllX509TrustManager.md.html | 4 +- docs/checks/TypographyDashes.md.html | 7 - docs/checks/TypographyEllipsis.md.html | 7 - docs/checks/TypographyFractions.md.html | 7 - docs/checks/TypographyOther.md.html | 7 - docs/checks/TypographyQuotes.md.html | 7 - docs/checks/Typos.md.html | 2 - docs/checks/UastImplementation.md.html | 41 +- docs/checks/UniqueConstants.md.html | 2 - docs/checks/UniquePermission.md.html | 2 - docs/checks/UnknownId.md.html | 2 - docs/checks/UnknownIdInLayout.md.html | 2 - docs/checks/UnknownNullness.md.html | 2 - docs/checks/UnlocalizedSms.md.html | 2 - .../UnnecessaryComposedModifier.md.html | 39 +- .../UnprotectedSMSBroadcastReceiver.md.html | 4 +- docs/checks/UnrememberedAnimatable.md.html | 39 +- .../UnrememberedGetBackStackEntry.md.html | 39 +- docs/checks/UnrememberedMutableState.md.html | 43 +- .../UnsafeDynamicallyLoadedCode.md.html | 2 - .../checks/UnsafeImplicitIntentLaunch.md.html | 160 ++++++ docs/checks/UnsafeIntentLaunch.md.html | 159 ++++++ docs/checks/UnsafeLifecycleWhenUsage.md.html | 39 ++ docs/checks/UnsafeOptInUsageError.md.html | 37 ++ docs/checks/UnsafeOptInUsageWarning.md.html | 37 ++ .../UnsafeProtectedBroadcastReceiver.md.html | 4 +- .../UnsafeRepeatOnLifecycleDetector.md.html | 37 ++ docs/checks/UnspecifiedImmutableFlag.md.html | 62 +-- .../UnspecifiedRegisterReceiverFlag.md.html | 155 ++++++ ...pportedChromeOsCameraSystemFeature.md.html | 12 +- .../UnsupportedChromeOsHardware.md.html | 11 +- .../checks/UnsupportedLayoutAttribute.md.html | 149 ++++++ docs/checks/UnsupportedTvHardware.md.html | 2 - docs/checks/Untranslatable.md.html | 2 - docs/checks/UnusedAttribute.md.html | 2 - ...dContentLambdaTargetStateParameter.md.html | 269 ++++++++++ ...nusedCrossfadeTargetStateParameter.md.html | 39 +- docs/checks/UnusedIds.md.html | 2 - ...dMaterial3ScaffoldPaddingParameter.md.html | 39 +- ...edMaterialScaffoldPaddingParameter.md.html | 39 +- docs/checks/UnusedMergeAttributes.md.html | 158 ++++++ docs/checks/UnusedNamespace.md.html | 2 - docs/checks/UnusedQuantity.md.html | 2 - docs/checks/UnusedResources.md.html | 2 - ...usedTransitionTargetStateParameter.md.html | 39 +- docs/checks/UnusedTranslation.md.html | 2 - docs/checks/UsableSpace.md.html | 2 - docs/checks/UseAlpha2.md.html | 5 +- docs/checks/UseAndroidAlpha.md.html | 42 ++ docs/checks/UseAppTint.md.html | 42 ++ docs/checks/UseCheckPermission.md.html | 2 - ...UseCompatLoadingForColorStateLists.md.html | 39 ++ .../UseCompatLoadingForDrawables.md.html | 39 ++ .../UseCompatTextViewDrawableApis.md.html | 39 ++ .../UseCompatTextViewDrawableXml.md.html | 42 ++ docs/checks/UseCompoundDrawables.md.html | 2 - docs/checks/UseGetLayoutInflater.md.html | 39 +- .../UseOfBundledGooglePlayServices.md.html | 2 - .../UseOfNonLambdaOffsetOverload.md.html | 37 ++ docs/checks/UseRequireInsteadOfGet.md.html | 39 +- docs/checks/UseRxSetProgress2.md.html | 37 ++ docs/checks/UseSparseArrays.md.html | 2 - docs/checks/UseSupportActionBar.md.html | 39 ++ .../UseSwitchCompatOrMaterialCode.md.html | 39 ++ .../UseSwitchCompatOrMaterialXml.md.html | 39 ++ docs/checks/UseTomlInstead.md.html | 112 +++++ docs/checks/UseValueOf.md.html | 2 - docs/checks/UselessLeaf.md.html | 2 - docs/checks/UselessParent.md.html | 2 - docs/checks/UsesMinSdkAttributes.md.html | 140 +----- docs/checks/UsingC2DM.md.html | 2 - docs/checks/UsingHttp.md.html | 4 +- docs/checks/UsingOnClickInXml.md.html | 39 ++ docs/checks/ValidActionsXml.md.html | 2 - docs/checks/ValidFragment.md.html | 2 - docs/checks/ValidRestrictions.md.html | 2 - docs/checks/VectorPath.md.html | 2 - docs/checks/VectorRaster.md.html | 2 - docs/checks/ViewBindingType.md.html | 2 - docs/checks/ViewConstructor.md.html | 2 - docs/checks/ViewHolder.md.html | 2 - docs/checks/VisibleForTests.md.html | 2 - docs/checks/VulnerableCordovaVersion.md.html | 3 - docs/checks/Wakelock.md.html | 2 - docs/checks/WakelockTimeout.md.html | 2 - docs/checks/WatchFaceEditor.md.html | 6 +- docs/checks/WatchFaceForAndroidX.md.html | 2 - docs/checks/WearBackNavigation.md.html | 130 +++++ docs/checks/WearPasswordInput.md.html | 153 ++++++ docs/checks/WearStandaloneAppFlag.md.html | 10 +- docs/checks/WearableActionDuplicate.md.html | 2 - docs/checks/WearableBindListener.md.html | 2 - .../WearableConfigurationAction.md.html | 2 - docs/checks/WebViewApiAvailability.md.html | 2 - .../WebViewClientOnReceivedSslError.md.html | 4 +- docs/checks/WebViewLayout.md.html | 2 - docs/checks/WebpUnsupported.md.html | 3 - docs/checks/WeekBasedYear.md.html | 2 - docs/checks/WifiManagerLeak.md.html | 2 - docs/checks/WifiManagerPotentialLeak.md.html | 2 - docs/checks/WorkerHasAPublicModifier.md.html | 37 ++ docs/checks/WorldReadableFiles.md.html | 4 +- docs/checks/WorldWriteableFiles.md.html | 4 +- docs/checks/WrongAnnotationOrder.md.html | 172 +++++++ docs/checks/WrongCall.md.html | 2 - docs/checks/WrongCase.md.html | 2 - docs/checks/WrongConstant.md.html | 2 - .../checks/WrongConstraintLayoutUsage.md.html | 150 ++++++ docs/checks/WrongDrawableName.md.html | 145 ++++++ docs/checks/WrongFolder.md.html | 2 - docs/checks/WrongGlobalIconColor.md.html | 155 ++++++ docs/checks/WrongLayoutName.md.html | 143 ++++++ docs/checks/WrongManifestParent.md.html | 2 - docs/checks/WrongMenuIdFormat.md.html | 146 ++++++ docs/checks/WrongRegion.md.html | 5 +- docs/checks/WrongRequiresOptIn.md.html | 142 ++++++ docs/checks/WrongResourceImportAlias.md.html | 198 ++++++++ docs/checks/WrongTestMethodName.md.html | 172 +++++++ docs/checks/WrongThread.md.html | 2 - .../checks/WrongThreadInterprocedural.md.html | 158 ++++++ docs/checks/WrongViewCast.md.html | 2 - docs/checks/WrongViewIdFormat.md.html | 145 ++++++ docs/checks/XmlEscapeNeeded.md.html | 2 - docs/checks/XmlSpacing.md.html | 174 +++++++ docs/checks/alphabetical.md.html | 473 ------------------ ...androidx_activity_activity-compose.md.html | 81 +++ .../checks/androidx_activity_activity.md.html | 90 ++++ ...annotation_annotation-experimental.md.html | 88 ++++ .../androidx_appcompat_appcompat.md.html | 96 ++++ ...x_compose_animation_animation-core.md.html | 95 ++++ ...droidx_compose_animation_animation.md.html | 94 ++++ ...oidx_compose_foundation_foundation.md.html | 87 ++++ ...droidx_compose_material3_material3.md.html | 74 +++ ...androidx_compose_material_material.md.html | 92 ++++ ...x_compose_runtime_runtime-saveable.md.html | 92 ++++ .../androidx_compose_runtime_runtime.md.html | 114 +++++ .../androidx_compose_ui_ui-graphics.md.html | 94 ++++ ...droidx_compose_ui_ui-test-manifest.md.html | 86 ++++ docs/checks/androidx_compose_ui_ui.md.html | 109 ++++ ...intlayout_constraintlayout-compose.md.html | 82 +++ ...fragment_fragment-testing-manifest.md.html | 72 +++ ...androidx_fragment_fragment-testing.md.html | 91 ++++ .../checks/androidx_fragment_fragment.md.html | 113 +++++ ...ecycle_lifecycle-livedata-core-ktx.md.html | 76 +++ ...dx_lifecycle_lifecycle-runtime-ktx.md.html | 79 +++ ...roidx_navigation_navigation-common.md.html | 71 +++ ...oidx_navigation_navigation-compose.md.html | 79 +++ ...oidx_navigation_navigation-runtime.md.html | 75 +++ ...androidx_recyclerview_recyclerview.md.html | 73 +++ .../androidx_startup_startup-runtime.md.html | 75 +++ .../checks/androidx_work_work-runtime.md.html | 95 ++++ docs/checks/categories.md.html | 228 ++++++++- .../com_google_dagger_dagger-lint.md.html | 101 ++++ .../com_jakewharton_timber_timber.md.html | 86 ++++ ...k_lint_compose_compose-lint-checks.md.html | 100 ++++ .../com_slack_lint_slack-lint-checks.md.html | 210 ++++++++ ...uber_autodispose2_autodispose-lint.md.html | 73 +++ .../com_vanniktech_lint-rules-android.md.html | 139 +++++ .../com_vanniktech_lint-rules-kotlin.md.html | 72 +++ .../com_vanniktech_lint-rules-rxjava2.md.html | 102 ++++ docs/checks/index.md.html | 206 +++++++- docs/checks/libraries.md.html | 46 ++ docs/checks/severity.md.html | 223 ++++++++- docs/checks/vendors.md.html | 238 ++++++++- docs/checks/year.md.html | 228 ++++++++- 722 files changed, 42918 insertions(+), 2248 deletions(-) create mode 100644 docs/checks/AlertDialogUsage.md.html create mode 100644 docs/checks/ArgInFormattedQuantityStringRes.md.html create mode 100644 docs/checks/AssertjImport.md.html create mode 100644 docs/checks/AutoDispose.md.html create mode 100644 docs/checks/AutoboxingStateCreation.md.html create mode 100644 docs/checks/AutoboxingStateValueProperty.md.html create mode 100644 docs/checks/BinaryOperationInTimber.md.html create mode 100644 docs/checks/BinderGetCallingInMainThread.md.html create mode 100644 docs/checks/BindsCanBeExtensionFunction.md.html create mode 100644 docs/checks/BomWithoutPlatform.md.html create mode 100644 docs/checks/CastingViewContextToActivity.md.html create mode 100644 docs/checks/ChromeOsAbiSupport.md.html create mode 100644 docs/checks/ChromeOsOnConfigurationChanged.md.html create mode 100644 docs/checks/ColorCasing.md.html create mode 100644 docs/checks/ComposeComposableModifier.md.html create mode 100644 docs/checks/ComposeCompositionLocalUsage.md.html create mode 100644 docs/checks/ComposeContentEmitterReturningValues.md.html create mode 100644 docs/checks/ComposeM2Api.md.html create mode 100644 docs/checks/ComposeModifierMissing.md.html create mode 100644 docs/checks/ComposeModifierReused.md.html create mode 100644 docs/checks/ComposeModifierWithoutDefault.md.html create mode 100644 docs/checks/ComposeMultipleContentEmitters.md.html create mode 100644 docs/checks/ComposeMutableParameters.md.html create mode 100644 docs/checks/ComposeNamingLowercase.md.html create mode 100644 docs/checks/ComposeNamingUppercase.md.html create mode 100644 docs/checks/ComposeParameterOrder.md.html create mode 100644 docs/checks/ComposePreviewNaming.md.html create mode 100644 docs/checks/ComposePreviewPublic.md.html create mode 100644 docs/checks/ComposeRememberMissing.md.html create mode 100644 docs/checks/ComposeUnstableCollections.md.html create mode 100644 docs/checks/ComposeViewModelForwarding.md.html create mode 100644 docs/checks/ComposeViewModelInjection.md.html create mode 100644 docs/checks/ConstraintLayoutToolsEditorAttribute.md.html create mode 100644 docs/checks/DefaultLayoutAttribute.md.html create mode 100644 docs/checks/DenyListedApi.md.html create mode 100644 docs/checks/DeprecatedCall.md.html create mode 100644 docs/checks/DeprecatedSqlUsage.md.html create mode 100644 docs/checks/DoNotCallProviders.md.html create mode 100644 docs/checks/DoNotExposeEitherNetInRepositories.md.html create mode 100644 docs/checks/DoNotMock.md.html create mode 100644 docs/checks/DoNotMockAutoValue.md.html create mode 100644 docs/checks/DoNotMockDataClass.md.html create mode 100644 docs/checks/DoNotMockObjectClass.md.html create mode 100644 docs/checks/DoNotMockRecordClass.md.html create mode 100644 docs/checks/DoNotMockSealedClass.md.html create mode 100644 docs/checks/EditedTargetSdkVersion.md.html create mode 100644 docs/checks/ErroneousLayoutAttribute.md.html create mode 100644 docs/checks/ErrorProneDoNotMockUsage.md.html create mode 100644 docs/checks/ExactAlarm.md.html create mode 100644 docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html create mode 100644 docs/checks/ForegroundServicePermission.md.html create mode 100644 docs/checks/ForegroundServiceType.md.html create mode 100644 docs/checks/FormalGerman.md.html create mode 100644 docs/checks/FragmentConstructorInjection.md.html create mode 100644 docs/checks/FragmentFieldInjection.md.html create mode 100644 docs/checks/FragmentGradleConfiguration-2.md.html create mode 100644 docs/checks/FullyQualifiedResource.md.html create mode 100644 docs/checks/GuavaChecksUsed.md.html create mode 100644 docs/checks/GuavaPreconditionsUsedInKotlin.md.html create mode 100644 docs/checks/ImplicitStringPlaceholder.md.html create mode 100644 docs/checks/InclusiveNaming.md.html create mode 100644 docs/checks/IncorrectChainMarginsUsage.md.html create mode 100644 docs/checks/IncorrectMatchParentUsage.md.html create mode 100644 docs/checks/IncorrectReferencesDeclaration.md.html create mode 100644 docs/checks/InjectInJava.md.html create mode 100644 docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html create mode 100644 docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html create mode 100644 docs/checks/InvalidAccessibility.md.html create mode 100644 docs/checks/InvalidImport.md.html create mode 100644 docs/checks/InvalidSingleLineComment.md.html create mode 100644 docs/checks/InvalidString.md.html create mode 100644 docs/checks/JCenter.md.html create mode 100644 docs/checks/JavaOnlyDetector.md.html create mode 100644 docs/checks/JvmStaticProvidesInObjectDetector.md.html create mode 100644 docs/checks/KaptUsageInsteadOfKsp.md.html create mode 100644 docs/checks/KotlinPairNotCreated.md.html create mode 100644 docs/checks/KotlinRequireNotNullUseMessage.md.html create mode 100644 docs/checks/KotlincFE10.md.html create mode 100644 docs/checks/LayoutFileNameMatchesClass.md.html create mode 100644 docs/checks/LogNotTimber.md.html create mode 100644 docs/checks/MainScopeUsage.md.html create mode 100644 docs/checks/MatchingMenuId.md.html create mode 100644 docs/checks/MatchingViewId.md.html create mode 100644 docs/checks/MissingResourceImportAlias.md.html create mode 100644 docs/checks/MissingScrollbars.md.html create mode 100644 docs/checks/MissingXmlHeader.md.html create mode 100644 docs/checks/ModifierNodeInspectableProperties.md.html create mode 100644 docs/checks/ModuleCompanionObjects.md.html create mode 100644 docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html create mode 100644 docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html create mode 100644 docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html create mode 100644 docs/checks/MoshiUsageArray.md.html create mode 100644 docs/checks/MoshiUsageBlankGenerator.md.html create mode 100644 docs/checks/MoshiUsageBlankJsonName.md.html create mode 100644 docs/checks/MoshiUsageBlankTypeLabel.md.html create mode 100644 docs/checks/MoshiUsageClassVisibility.md.html create mode 100644 docs/checks/MoshiUsageDoubleClassAnnotation.md.html create mode 100644 docs/checks/MoshiUsageDoubleTypeLabel.md.html create mode 100644 docs/checks/MoshiUsageDuplicateJsonName.md.html create mode 100644 docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html create mode 100644 docs/checks/MoshiUsageEnumCasing.md.html create mode 100644 docs/checks/MoshiUsageEnumJsonClassGenerated.md.html create mode 100644 docs/checks/MoshiUsageEnumMissingJsonClass.md.html create mode 100644 docs/checks/MoshiUsageEnumMissingUnknown.md.html create mode 100644 docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html create mode 100644 docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html create mode 100644 docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html create mode 100644 docs/checks/MoshiUsageGenericSealedSubtype.md.html create mode 100644 docs/checks/MoshiUsageInappropriateTypeLabel.md.html create mode 100644 docs/checks/MoshiUsageMissingPrimary.md.html create mode 100644 docs/checks/MoshiUsageMissingTypeLabel.md.html create mode 100644 docs/checks/MoshiUsageMutableCollections.md.html create mode 100644 docs/checks/MoshiUsageNonMoshiClassCollection.md.html create mode 100644 docs/checks/MoshiUsageNonMoshiClassExternal.md.html create mode 100644 docs/checks/MoshiUsageNonMoshiClassInternal.md.html create mode 100644 docs/checks/MoshiUsageNonMoshiClassMap.md.html create mode 100644 docs/checks/MoshiUsageNonMoshiClassPlatform.md.html create mode 100644 docs/checks/MoshiUsageObject.md.html create mode 100644 docs/checks/MoshiUsageParamNeedsInit.md.html create mode 100644 docs/checks/MoshiUsagePrivateConstructor.md.html create mode 100644 docs/checks/MoshiUsagePrivateConstructorProperty.md.html create mode 100644 docs/checks/MoshiUsageQualifierRetention.md.html create mode 100644 docs/checks/MoshiUsageQualifierTarget.md.html create mode 100644 docs/checks/MoshiUsageRedundantJsonName.md.html create mode 100644 docs/checks/MoshiUsageRedundantSiteTarget.md.html create mode 100644 docs/checks/MoshiUsageSealedMustBeSealed.md.html create mode 100644 docs/checks/MoshiUsageSerializedName.md.html create mode 100644 docs/checks/MoshiUsageSnakeCase.md.html create mode 100644 docs/checks/MoshiUsageTransientNeedsInit.md.html create mode 100644 docs/checks/MoshiUsageUnsupportedType.md.html create mode 100644 docs/checks/MoshiUsageUseData.md.html create mode 100644 docs/checks/MoshiUsageVarProperty.md.html create mode 100644 docs/checks/MultipleAwaitPointerEventScopes.md.html create mode 100644 docs/checks/NamingPattern.md.html create mode 100644 docs/checks/NoOp.md.html create mode 100644 docs/checks/OpaqueUnitKey.md.html create mode 100644 docs/checks/ParcelizeFunctionProperty.md.html create mode 100644 docs/checks/ProviderReadPermissionOnly.md.html create mode 100644 docs/checks/RawColor.md.html create mode 100644 docs/checks/RawDimen.md.html create mode 100644 docs/checks/RawDispatchersUse.md.html create mode 100644 docs/checks/RedactedInJavaUsage.md.html create mode 100644 docs/checks/ReportShortcutUsage.md.html create mode 100644 docs/checks/ResourcesGetColorCall.md.html create mode 100644 docs/checks/ResourcesGetColorStateListCall.md.html create mode 100644 docs/checks/ResourcesGetDrawableCall.md.html create mode 100644 docs/checks/RestrictCallsTo.md.html create mode 100644 docs/checks/RetrofitUsage.md.html create mode 100644 docs/checks/RxJava2DefaultScheduler.md.html create mode 100644 docs/checks/RxJava2DisposableAddAllCall.md.html create mode 100644 docs/checks/RxJava2DisposableDisposeCall.md.html create mode 100644 docs/checks/RxJava2MethodMissingCheckReturnValue.md.html create mode 100644 docs/checks/RxJava2MissingCompositeDisposableClear.md.html create mode 100644 docs/checks/RxJava2SchedulersFactoryCall.md.html create mode 100644 docs/checks/RxJava2SubscribeMissingOnError.md.html create mode 100644 docs/checks/ScheduleExactAlarm.md.html create mode 100644 docs/checks/SerializableUsage.md.html create mode 100644 docs/checks/SetAndClearCommunicationDevice.md.html create mode 100644 docs/checks/ShouldUseStaticImport.md.html create mode 100644 docs/checks/SpanMarkPointMissingMask.md.html create mode 100644 docs/checks/StringFormatInTimber.md.html create mode 100644 docs/checks/StringNotCapitalized.md.html create mode 100644 docs/checks/SubscribeOnMain.md.html create mode 100644 docs/checks/SuperfluousMarginDeclaration.md.html create mode 100644 docs/checks/SuperfluousNameSpace.md.html create mode 100644 docs/checks/SuperfluousPaddingDeclaration.md.html create mode 100644 docs/checks/SuspiciousCompositionLocalModifierRead.md.html create mode 100644 docs/checks/ThrowableNotAtBeginning.md.html create mode 100644 docs/checks/TimberArgCount.md.html create mode 100644 docs/checks/TimberArgTypes.md.html create mode 100644 docs/checks/TimberExceptionLogging.md.html create mode 100644 docs/checks/TimberTagLength.md.html create mode 100644 docs/checks/Todo.md.html create mode 100644 docs/checks/UnsafeImplicitIntentLaunch.md.html create mode 100644 docs/checks/UnsafeIntentLaunch.md.html create mode 100644 docs/checks/UnspecifiedRegisterReceiverFlag.md.html create mode 100644 docs/checks/UnsupportedLayoutAttribute.md.html create mode 100644 docs/checks/UnusedContentLambdaTargetStateParameter.md.html create mode 100644 docs/checks/UnusedMergeAttributes.md.html create mode 100644 docs/checks/UseTomlInstead.md.html create mode 100644 docs/checks/WearBackNavigation.md.html create mode 100644 docs/checks/WearPasswordInput.md.html create mode 100644 docs/checks/WrongAnnotationOrder.md.html create mode 100644 docs/checks/WrongConstraintLayoutUsage.md.html create mode 100644 docs/checks/WrongDrawableName.md.html create mode 100644 docs/checks/WrongGlobalIconColor.md.html create mode 100644 docs/checks/WrongLayoutName.md.html create mode 100644 docs/checks/WrongMenuIdFormat.md.html create mode 100644 docs/checks/WrongRequiresOptIn.md.html create mode 100644 docs/checks/WrongResourceImportAlias.md.html create mode 100644 docs/checks/WrongTestMethodName.md.html create mode 100644 docs/checks/WrongViewIdFormat.md.html create mode 100644 docs/checks/XmlSpacing.md.html delete mode 100644 docs/checks/alphabetical.md.html create mode 100644 docs/checks/androidx_activity_activity-compose.md.html create mode 100644 docs/checks/androidx_activity_activity.md.html create mode 100644 docs/checks/androidx_annotation_annotation-experimental.md.html create mode 100644 docs/checks/androidx_appcompat_appcompat.md.html create mode 100644 docs/checks/androidx_compose_animation_animation-core.md.html create mode 100644 docs/checks/androidx_compose_animation_animation.md.html create mode 100644 docs/checks/androidx_compose_foundation_foundation.md.html create mode 100644 docs/checks/androidx_compose_material3_material3.md.html create mode 100644 docs/checks/androidx_compose_material_material.md.html create mode 100644 docs/checks/androidx_compose_runtime_runtime-saveable.md.html create mode 100644 docs/checks/androidx_compose_runtime_runtime.md.html create mode 100644 docs/checks/androidx_compose_ui_ui-graphics.md.html create mode 100644 docs/checks/androidx_compose_ui_ui-test-manifest.md.html create mode 100644 docs/checks/androidx_compose_ui_ui.md.html create mode 100644 docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html create mode 100644 docs/checks/androidx_fragment_fragment-testing-manifest.md.html create mode 100644 docs/checks/androidx_fragment_fragment-testing.md.html create mode 100644 docs/checks/androidx_fragment_fragment.md.html create mode 100644 docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html create mode 100644 docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html create mode 100644 docs/checks/androidx_navigation_navigation-common.md.html create mode 100644 docs/checks/androidx_navigation_navigation-compose.md.html create mode 100644 docs/checks/androidx_navigation_navigation-runtime.md.html create mode 100644 docs/checks/androidx_recyclerview_recyclerview.md.html create mode 100644 docs/checks/androidx_startup_startup-runtime.md.html create mode 100644 docs/checks/androidx_work_work-runtime.md.html create mode 100644 docs/checks/com_google_dagger_dagger-lint.md.html create mode 100644 docs/checks/com_jakewharton_timber_timber.md.html create mode 100644 docs/checks/com_slack_lint_compose_compose-lint-checks.md.html create mode 100644 docs/checks/com_slack_lint_slack-lint-checks.md.html create mode 100644 docs/checks/com_uber_autodispose2_autodispose-lint.md.html create mode 100644 docs/checks/com_vanniktech_lint-rules-android.md.html create mode 100644 docs/checks/com_vanniktech_lint-rules-kotlin.md.html create mode 100644 docs/checks/com_vanniktech_lint-rules-rxjava2.md.html create mode 100644 docs/checks/libraries.md.html diff --git a/docs/checks/AaptCrash.md.html b/docs/checks/AaptCrash.md.html index 4a08ab52..cac7a4a7 100644 --- a/docs/checks/AaptCrash.md.html +++ b/docs/checks/AaptCrash.md.html @@ -47,8 +47,6 @@ <item name="android:id">@+id/titlebar</item> -------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AcceptsUserCertificates.md.html b/docs/checks/AcceptsUserCertificates.md.html index dbb09289..82aed21e 100644 --- a/docs/checks/AcceptsUserCertificates.md.html +++ b/docs/checks/AcceptsUserCertificates.md.html @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://goo.gle/AcceptsUserCertificates +See : https://developer.android.com/training/articles/security-config#TrustingDebugCa 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/NetworkSecurityConfigDetector.java) @@ -47,8 +49,6 @@ <certificates src="user"/> -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AccidentalOctal.md.html b/docs/checks/AccidentalOctal.md.html index 2addc3af..b0cc25aa 100644 --- a/docs/checks/AccidentalOctal.md.html +++ b/docs/checks/AccidentalOctal.md.html @@ -43,8 +43,6 @@ versionCode 010 --- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AdapterViewChildren.md.html b/docs/checks/AdapterViewChildren.md.html index 0a97398d..6ab2d4d2 100644 --- a/docs/checks/AdapterViewChildren.md.html +++ b/docs/checks/AdapterViewChildren.md.html @@ -43,8 +43,6 @@ <ListView -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AddJavascriptInterface.md.html b/docs/checks/AddJavascriptInterface.md.html index 9a6646e6..c81aa6ff 100644 --- a/docs/checks/AddJavascriptInterface.md.html +++ b/docs/checks/AddJavascriptInterface.md.html @@ -26,6 +26,8 @@ : https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object,%20java.lang.String) See : https://support.google.com/faqs/answer/9095419?hl=en +See +: https://goo.gle/AddJavascriptInterface 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/AddJavascriptInterfaceDetector.kt) Tests @@ -59,8 +61,6 @@ webView.addJavascriptInterface(object, string); ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AlertDialogUsage.md.html b/docs/checks/AlertDialogUsage.md.html new file mode 100644 index 00000000..e0ef65d2 --- /dev/null +++ b/docs/checks/AlertDialogUsage.md.html @@ -0,0 +1,168 @@ + +(#) Use the support library AlertDialog instead of android.app.AlertDialog. + +!!! WARNING: Use the support library AlertDialog instead of android.app.AlertDialog. + This is a warning. + +Id +: `AlertDialogUsage` +Summary +: Use the support library AlertDialog instead of android.app.AlertDialog. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AlertDialogUsageDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.kt) + +Support library AlertDialog is much more powerful and plays better +together with the new theming / styling than the AlertDialog built into +the framework. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/Test.java:4:Warning: Should not be using android.app.AlertDialog +[AlertDialogUsage] + + public Test(AlertDialog dialog) { } + ------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/Test.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +import android.app.AlertDialog; + +class Test { + public Test(AlertDialog dialog) { } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.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, `AlertDialogUsageDetector.constructorParameterInJava`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("AlertDialogUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("AlertDialogUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection AlertDialogUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="AlertDialogUsage" severity="ignore" /> + </lint> + ``` + 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 'AlertDialogUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore AlertDialogUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/AllCaps.md.html b/docs/checks/AllCaps.md.html index ce7f4815..fbd72a09 100644 --- a/docs/checks/AllCaps.md.html +++ b/docs/checks/AllCaps.md.html @@ -44,8 +44,6 @@ android:textAllCaps="true" -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AllowAllHostnameVerifier.md.html b/docs/checks/AllowAllHostnameVerifier.md.html index e868a420..1ec2c940 100644 --- a/docs/checks/AllowAllHostnameVerifier.md.html +++ b/docs/checks/AllowAllHostnameVerifier.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/AllowAllHostnameVerifier 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/AllowAllHostnameVerifierDetector.java) Tests @@ -56,8 +58,6 @@ connection.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); -------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AlwaysShowAction.md.html b/docs/checks/AlwaysShowAction.md.html index ac6fbf4b..ad057ea3 100644 --- a/docs/checks/AlwaysShowAction.md.html +++ b/docs/checks/AlwaysShowAction.md.html @@ -57,8 +57,6 @@ android:showAsAction="always|collapseActionView" ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AndroidGradlePluginVersion.md.html b/docs/checks/AndroidGradlePluginVersion.md.html index 64d1ab47..f27e22ae 100644 --- a/docs/checks/AndroidGradlePluginVersion.md.html +++ b/docs/checks/AndroidGradlePluginVersion.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor Implementation @@ -44,13 +44,11 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text build.gradle:7:Warning: A newer version of -com.android.tools.build:gradle than 3.4.0-alpha3 is available: -3.6.0-alpha01 [AndroidGradlePluginVersion] +com.android.tools.build:gradle than 3.4.0-alpha3 is available: 3.5.0 +[AndroidGradlePluginVersion] classpath 'com.android.tools.build:gradle:3.4.0-alpha3' ------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AnimatorKeep.md.html b/docs/checks/AnimatorKeep.md.html index db6a8b5c..1daf421b 100644 --- a/docs/checks/AnimatorKeep.md.html +++ b/docs/checks/AnimatorKeep.md.html @@ -61,8 +61,6 @@ private void setProp2(float x) { ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AnnotateVersionCheck.md.html b/docs/checks/AnnotateVersionCheck.md.html index e5e2386e..7dcb1969 100644 --- a/docs/checks/AnnotateVersionCheck.md.html +++ b/docs/checks/AnnotateVersionCheck.md.html @@ -63,8 +63,6 @@ inline fun <T> T.applyForOreoOrAbove(block: T.() -> Unit): T { ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AnnotationProcessorOnCompilePath.md.html b/docs/checks/AnnotationProcessorOnCompilePath.md.html index e3b8c806..9b99a2f1 100644 --- a/docs/checks/AnnotationProcessorOnCompilePath.md.html +++ b/docs/checks/AnnotationProcessorOnCompilePath.md.html @@ -85,8 +85,6 @@ debugCompile "android.arch.persistence.room:compiler:1.1.1" ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppBundleLocaleChanges.md.html b/docs/checks/AppBundleLocaleChanges.md.html index 15f2da28..dcb255fd 100644 --- a/docs/checks/AppBundleLocaleChanges.md.html +++ b/docs/checks/AppBundleLocaleChanges.md.html @@ -47,8 +47,6 @@ configuration.locale = locale ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppCompatCustomView.md.html b/docs/checks/AppCompatCustomView.md.html index 771052ea..d1fd257f 100644 --- a/docs/checks/AppCompatCustomView.md.html +++ b/docs/checks/AppCompatCustomView.md.html @@ -155,8 +155,6 @@ public class MySpinner extends Spinner { // ERROR ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppCompatMethod.md.html b/docs/checks/AppCompatMethod.md.html index 1bf8f746..526a6a31 100644 --- a/docs/checks/AppCompatMethod.md.html +++ b/docs/checks/AppCompatMethod.md.html @@ -90,8 +90,6 @@ setProgressBarIndeterminateVisibility(true); // ERROR ------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppCompatResource.md.html b/docs/checks/AppCompatResource.md.html index b8b8d918..557c19f3 100644 --- a/docs/checks/AppCompatResource.md.html +++ b/docs/checks/AppCompatResource.md.html @@ -49,8 +49,6 @@ app:showAsAction="never" /> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppIndexingService.md.html b/docs/checks/AppIndexingService.md.html index c3b0e85f..681ec4e9 100644 --- a/docs/checks/AppIndexingService.md.html +++ b/docs/checks/AppIndexingService.md.html @@ -46,8 +46,6 @@ <action android:name="com.google.firebase.appindexing.UPDATE_INDEX" /> ----------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppLinkUrlError.md.html b/docs/checks/AppLinkUrlError.md.html index 2e5e8ee4..6070e7ad 100644 --- a/docs/checks/AppLinkUrlError.md.html +++ b/docs/checks/AppLinkUrlError.md.html @@ -46,8 +46,6 @@ <tools:validation /> -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppLinksAutoVerify.md.html b/docs/checks/AppLinksAutoVerify.md.html index 6a273276..a1d6abca 100644 --- a/docs/checks/AppLinksAutoVerify.md.html +++ b/docs/checks/AppLinksAutoVerify.md.html @@ -49,8 +49,6 @@ android:host="example.com" -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ApplySharedPref.md.html b/docs/checks/ApplySharedPref.md.html index f467037b..c7b7ef39 100644 --- a/docs/checks/ApplySharedPref.md.html +++ b/docs/checks/ApplySharedPref.md.html @@ -46,8 +46,6 @@ editor.commit(); -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -138,7 +136,7 @@ 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, `CleanupDetector.test`. +found for this lint check, `CleanupDetector.testSharedPrefs`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/ArgInFormattedQuantityStringRes.md.html b/docs/checks/ArgInFormattedQuantityStringRes.md.html new file mode 100644 index 00000000..7a5caa77 --- /dev/null +++ b/docs/checks/ArgInFormattedQuantityStringRes.md.html @@ -0,0 +1,182 @@ + +(#) Count value in formatted string resource. + +!!! WARNING: Count value in formatted string resource. + This is a warning. + +Id +: `ArgInFormattedQuantityStringRes` +Summary +: Count value in formatted string resource. +Severity +: Warning +Category +: Internationalization +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/ArgInFormattedQuantityStringResDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/ArgInFormattedQuantityStringResDetectorTest.kt) +Copyright Year +: 2021 + +Some languages require modifiers to counted values in written text. +Consider consulting #plz-localization if you are unsure if this +formatted string requires a special modifier. If one is required, +consider using `LocalizationUtils.getFormattedCount()`. If not, suppress +this warning. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/com/slack/lint/Foo.java:7:Warning: This may require a localized +count modifier. If so, use LocalizationUtils.getFormattedCount(). +Consult #plz-localization if you are unsure. +[ArgInFormattedQuantityStringRes] + + String s = res.getQuantityString(0, 3, 3, "asdf"); + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/com/slack/lint/Foo.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package com.slack.lint; + +import android.content.res.Resources; + +public class Foo { + public void bar(Resources res) { + String s = res.getQuantityString(0, 3, 3, "asdf"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/ArgInFormattedQuantityStringResDetectorTest.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, `ArgInFormattedQuantityStringResDetector.getQuantityStringWithNoLocalizedFormatTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ArgInFormattedQuantityStringRes") + fun method() { + getQuantityString(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ArgInFormattedQuantityStringRes") + void method() { + getQuantityString(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ArgInFormattedQuantityStringRes + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ArgInFormattedQuantityStringRes" severity="ignore" /> + </lint> + ``` + 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 'ArgInFormattedQuantityStringRes' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ArgInFormattedQuantityStringRes ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/AssertionSideEffect.md.html b/docs/checks/AssertionSideEffect.md.html index 2f84b680..4124f441 100644 --- a/docs/checks/AssertionSideEffect.md.html +++ b/docs/checks/AssertionSideEffect.md.html @@ -117,8 +117,6 @@ assert(method7()) // WARN 11 --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AssertjImport.md.html b/docs/checks/AssertjImport.md.html new file mode 100644 index 00000000..28ca2c0d --- /dev/null +++ b/docs/checks/AssertjImport.md.html @@ -0,0 +1,141 @@ + +(#) Flags Java 6 incompatible imports. + +!!! WARNING: Flags Java 6 incompatible imports. + This is a warning. + +Id +: `AssertjImport` +Summary +: Flags Java 6 incompatible imports. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AssertjDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AssertjDetectorTest.kt) + +Importing org.assertj.core.api.Assertions is not ideal. Since it can +require Java 8. It's simple as instead +org.assertj.core.api.Java6Assertions can be imported and provides +guarantee to run on Java 6 as well. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("AssertjImport") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("AssertjImport") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection AssertjImport + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="AssertjImport" severity="ignore" /> + </lint> + ``` + 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 'AssertjImport' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore AssertjImport ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/AuthLeak.md.html b/docs/checks/AuthLeak.md.html index 0c3b526a..cbe76299 100644 --- a/docs/checks/AuthLeak.md.html +++ b/docs/checks/AuthLeak.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/AuthLeak 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/StringAuthLeakDetector.java) Tests @@ -47,8 +49,6 @@ private static final String LEAK = "http://someuser:%restofmypass@example.com"; // WARN 2 ----------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AutoDispose.md.html b/docs/checks/AutoDispose.md.html new file mode 100644 index 00000000..fd66a752 --- /dev/null +++ b/docs/checks/AutoDispose.md.html @@ -0,0 +1,186 @@ + +(#) Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode. + +!!! ERROR: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode. + This is an error. + +Id +: `AutoDispose` +Summary +: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Uber +Identifier +: AutoDispose +Feedback +: https://github.com/uber/AutoDispose/issues +Min +: Lint 7.0 +Compiled +: Lint 7.0 +Artifact +: [com.uber.autodispose2:autodispose-lint](com_uber_autodispose2_autodispose-lint.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/uber/AutoDispose/tree/main/static-analysis/autodispose-lint/src/main/kotlin/autodispose2/lint/AutoDisposeDetector.kt) +Tests +: [Source Code](https://github.com/uber/AutoDispose/tree/main/static-analysis/autodispose-lint/src/test/kotlin/autodispose2/lint/AutoDisposeDetectorTest.kt) +Copyright Year +: 2019 + +You're subscribing to an observable but not handling its subscription. +This can result in memory leaks. You can avoid memory leaks by appending +`.as(autoDisposable(this))` before you subscribe or cache the Disposable +instance manually and enable lenient mode. More: +https://github.com/uber/AutoDispose/wiki/Lint-Check. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyActivity.kt:10:Error: [AutoDispose] + Observable.just(1).subscribe() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +src/foo/MyActivity.kt:12: Error: [AutoDispose] + + Observable.just(2).subscribe() + ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyActivity.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import androidx.appcompat.app.AppCompatActivity +import io.reactivex.rxjava3.core.Observable +import io.reactivex.rxjava3.disposables.CompositeDisposable + +class MyActivity: AppCompatActivity { + private val disposables = CompositeDisposable() + fun doSomething(flag: Boolean) { + if (flag) { + Observable.just(1).subscribe() + } else { + Observable.just(2).subscribe() + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/uber/AutoDispose/tree/main/static-analysis/autodispose-lint/src/test/kotlin/autodispose2/lint/AutoDisposeDetectorTest.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, `AutoDisposeDetector.checkLenientLintInIfExpression`. +To report a problem with this extracted sample, visit +https://github.com/uber/AutoDispose/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.uber.autodispose2:autodispose-lint:2.1.1") + +// build.gradle +lintChecks 'com.uber.autodispose2:autodispose-lint:2.1.1' + +// build.gradle.kts with version catalogs: +lintChecks(libs.autodispose-lint) + +# libs.versions.toml +[versions] +autodispose-lint = "2.1.1" +[libraries] +autodispose-lint = { + module = "com.uber.autodispose2:autodispose-lint", + version.ref = "autodispose-lint" +} +``` + +2.1.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.uber.autodispose2:autodispose-lint](com_uber_autodispose2_autodispose-lint.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("AutoDispose") + fun method() { + subscribe(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("AutoDispose") + void method() { + subscribe(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection AutoDispose + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="AutoDispose" severity="ignore" /> + </lint> + ``` + 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 'AutoDispose' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore AutoDispose ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/AutoboxingStateCreation.md.html b/docs/checks/AutoboxingStateCreation.md.html new file mode 100644 index 00000000..b234dc94 --- /dev/null +++ b/docs/checks/AutoboxingStateCreation.md.html @@ -0,0 +1,183 @@ + +(#) `State` will autobox values assigned to this state. Use a specialized state type instead. + +!!! WARNING: `State` will autobox values assigned to this state. Use a specialized state type instead. + This is a warning. + +Id +: `AutoboxingStateCreation` +Summary +: `State` will autobox values assigned to this state. Use a specialized state type instead. +Severity +: Warning +Category +: Performance +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.kt) +Copyright Year +: 2023 + +Calling `mutableStateOf()` when `T` is either backed by a primitive +type on the JVM or is a value class results in a state implementation +that requires all state values to be boxed. This usually causes an +additional allocation for each state write, and adds some additional +work to auto-unbox values when reading the value of the state. Instead, +prefer to use a specialized primitive state implementation for `Int`, +`Long`, `Float`, and `Double` when the state does not need to track null +values and does not override the default `SnapshotMutationPolicy`. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/androidx/compose/runtime/lint/test/test.kt:8:Information: Prefer +mutableStateOf instead of mutableStateOf [AutoboxingStateCreation] + + val state = mutableStateOf<>() + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/androidx/compose/runtime/lint/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package androidx.compose.runtime.lint.test + +import androidx.compose.runtime.* +import + +fun valueAssignment() { + val state = mutableStateOf<>() + state.value = +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.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, `AutoboxingStateCreationDetector.testTrivialMutableStateOf_thatCouldBeMutablePrimitiveStateOf`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("AutoboxingStateCreation") + fun method() { + mutableStateOf(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("AutoboxingStateCreation") + void method() { + mutableStateOf(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection AutoboxingStateCreation + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="AutoboxingStateCreation" severity="ignore" /> + </lint> + ``` + 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 'AutoboxingStateCreation' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore AutoboxingStateCreation ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/AutoboxingStateValueProperty.md.html b/docs/checks/AutoboxingStateValueProperty.md.html new file mode 100644 index 00000000..7a5c381b --- /dev/null +++ b/docs/checks/AutoboxingStateValueProperty.md.html @@ -0,0 +1,182 @@ + +(#) State access causes value to be autoboxed + +!!! WARNING: State access causes value to be autoboxed + This is a warning. + +Id +: `AutoboxingStateValueProperty` +Summary +: State access causes value to be autoboxed +Severity +: Warning +Category +: Performance +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateValuePropertyDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateValuePropertyDetectorTest.kt) +Copyright Year +: 2023 + +Avoid using the generic value accessor when using a State objects with a +specialized types. Usages of the generic value property result in an +unnecessary autoboxing operation whenever the state's value is read or +written to. Use the specialized value accessor or property delegation to +avoid unnecessary allocations. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/androidx/compose/runtime/lint/test/test.kt:9:Warning: Reading value +will cause an autoboxing operation. Use intValue to avoid unnecessary +allocations. [AutoboxingStateValueProperty] + + val value = state.value + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/androidx/compose/runtime/lint/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package androidx.compose.runtime.lint.test + +import androidx.compose.runtime.sandbox.MutableIntState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.setValue + +fun valueAssignment() { + val state = MutableIntState() + val value = state.value +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateValuePropertyDetectorTest.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, `AutoboxingStateValuePropertyDetector.testReadAutoboxingPropertyAsVariableAssignment`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("AutoboxingStateValueProperty") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("AutoboxingStateValueProperty") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection AutoboxingStateValueProperty + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="AutoboxingStateValueProperty" severity="ignore" /> + </lint> + ``` + 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 'AutoboxingStateValueProperty' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore AutoboxingStateValueProperty ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/Autofill.md.html b/docs/checks/Autofill.md.html index a30c7168..9896898d 100644 --- a/docs/checks/Autofill.md.html +++ b/docs/checks/Autofill.md.html @@ -60,8 +60,6 @@ <EditText -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BackButton.md.html b/docs/checks/BackButton.md.html index ee27b1d1..8da30d90 100644 --- a/docs/checks/BackButton.md.html +++ b/docs/checks/BackButton.md.html @@ -25,7 +25,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://material.io/design/ +: https://d.android.com/r/studio-ui/designer/material/design 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/ButtonDetector.java) Tests @@ -53,8 +53,6 @@ <Button ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BadConfigurationProvider.md.html b/docs/checks/BadConfigurationProvider.md.html index 78269796..2d1a71f4 100644 --- a/docs/checks/BadConfigurationProvider.md.html +++ b/docs/checks/BadConfigurationProvider.md.html @@ -22,12 +22,21 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/work/work-lint/src/main/java/androidx/work/lint/BadConfigurationProviderIssueDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/work/work-lint/src/test/java/androidx/work/lint/BadConfigurationProviderTest.kt) Copyright Year : 2019 @@ -35,6 +44,36 @@ `androidx.work.Configuration.Provider` for on-demand initialization. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/BadHostnameVerifier.md.html b/docs/checks/BadHostnameVerifier.md.html index bb5aec48..fb27f543 100644 --- a/docs/checks/BadHostnameVerifier.md.html +++ b/docs/checks/BadHostnameVerifier.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/BadHostnameVerifier 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/BadHostnameVerifierDetector.java) Tests @@ -44,8 +46,6 @@ public boolean verify(String hostname, SSLSession session) { ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html index 798b1873..a60d530d 100644 --- a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html +++ b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html @@ -20,6 +20,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -37,6 +44,36 @@ `enqueueUniquePeriodicWork` with an `ExistingPeriodicWorkPolicy.KEEP` instead. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/BatteryLife.md.html b/docs/checks/BatteryLife.md.html index 9fa2cc00..ebce6991 100644 --- a/docs/checks/BatteryLife.md.html +++ b/docs/checks/BatteryLife.md.html @@ -80,8 +80,6 @@ <action android:name="android.hardware.action.NEW_PICTURE" /> ----------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BidiSpoofing.md.html b/docs/checks/BidiSpoofing.md.html index dfba0957..62b25f5c 100644 --- a/docs/checks/BidiSpoofing.md.html +++ b/docs/checks/BidiSpoofing.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : https://krebsonsecurity.com/2021/11/trojan-source-bug-threatens-the-security-of-all-code/ +See +: https://goo.gle/BidiSpoofing 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/BidirectionalTextDetector.kt) Tests @@ -60,8 +62,6 @@ /* end admins only ‮ { ⁦*/ -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/BinaryOperationInTimber.md.html b/docs/checks/BinaryOperationInTimber.md.html new file mode 100644 index 00000000..68b1444c --- /dev/null +++ b/docs/checks/BinaryOperationInTimber.md.html @@ -0,0 +1,172 @@ + +(#) Use String#format() + +!!! WARNING: Use String#format() + This is a warning. + +Id +: `BinaryOperationInTimber` +Summary +: Use String#format() +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +Since Timber handles String#format() automatically, use this instead of +String concatenation. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Replace String concatenation with +Timber's string formatting [BinaryOperationInTimber] + + Timber.d(foo + "bar"); + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + String foo = "foo"; + Timber.d(foo + "bar"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.stringConcatenationLeftLiteral`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BinaryOperationInTimber") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BinaryOperationInTimber") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BinaryOperationInTimber + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BinaryOperationInTimber" severity="ignore" /> + </lint> + ``` + 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 'BinaryOperationInTimber' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BinaryOperationInTimber ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BinderGetCallingInMainThread.md.html b/docs/checks/BinderGetCallingInMainThread.md.html new file mode 100644 index 00000000..b45eeab1 --- /dev/null +++ b/docs/checks/BinderGetCallingInMainThread.md.html @@ -0,0 +1,144 @@ + +(#) Incorrect usage of getCallingUid() or getCallingPid() + +!!! ERROR: Incorrect usage of getCallingUid() or getCallingPid() + This is an error. + +Id +: `BinderGetCallingInMainThread` +Summary +: Incorrect usage of getCallingUid() or getCallingPid() +Severity +: Error +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/BinderGetCallingInMainThreadDetector.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/BinderGetCallingInMainThreadDetectorTest.kt) +Copyright Year +: 2022 + +`Binder.getCallingUid()` and `Binder.getCallingPid()` will return +information about the current process if called inside a thread that is +not handling a binder transaction. This can cause security issues. If +you still want to use your own uid/pid, use `Process.myUid()` or +`Process.myPid()`. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/MyService.kt:10:Error: Binder.getCallingUid() should not be +used inside onBind() [BinderGetCallingInMainThread] + + Binder.getCallingUid() + ---------------------- + + +src/test/pkg/MyService.kt:11:Error: Binder.getCallingPid() should not be +used inside onBind() [BinderGetCallingInMainThread] + + Binder.getCallingPid() + ---------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/MyService.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.app.Service +import android.content.Intent +import android.os.Binder +import android.os.IBinder + +class MyService : Service() { + override fun onBind(intent: Intent): IBinder { + Binder.getCallingUid() + Binder.getCallingPid() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/BinderGetCallingInMainThreadDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BinderGetCallingInMainThread") + fun method() { + getCallingUid(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BinderGetCallingInMainThread") + void method() { + getCallingUid(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BinderGetCallingInMainThread + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BinderGetCallingInMainThread" severity="ignore" /> + </lint> + ``` + 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 'BinderGetCallingInMainThread' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BinderGetCallingInMainThread ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BindsCanBeExtensionFunction.md.html b/docs/checks/BindsCanBeExtensionFunction.md.html new file mode 100644 index 00000000..7499980e --- /dev/null +++ b/docs/checks/BindsCanBeExtensionFunction.md.html @@ -0,0 +1,249 @@ + +(#) @Binds-annotated functions can be extension functions. + +!!! Tip: @Binds-annotated functions can be extension functions. + Advice from this check is just a tip. + +Id +: `BindsCanBeExtensionFunction` +Summary +: @Binds-annotated functions can be extension functions. +Severity +: Information +Category +: Usability +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerKotlinIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerKotlinIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds-annotated functions can be extension functions to simplify code +readability. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:13:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Int): Number + ------------------------------------ + + +src/foo/MyQualifier.kt:14:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Long): Number + ------------------------------------- + + +src/foo/MyQualifier.kt:15:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Double): Number + --------------------------------------- + + +src/foo/MyQualifier.kt:16:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Float): Number + -------------------------------------- + + +src/foo/MyQualifier.kt:17:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Short): Number + -------------------------------------- + + +src/foo/MyQualifier.kt:18:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Byte): Number + ------------------------------------- + + +src/foo/MyQualifier.kt:19:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: Char): Comparable<Char> + ----------------------------------------------- + + +src/foo/MyQualifier.kt:20:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(number: String): Comparable<String> + --------------------------------------------------- + + +src/foo/MyQualifier.kt:21:Information: @Binds-annotated functions can be +extension functions. [BindsCanBeExtensionFunction] + + @Binds fun bind(@MyQualifier number: Boolean): Comparable<Boolean> + ------------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Inject +import javax.inject.Qualifier +import kotlin.jvm.JvmStatic +import dagger.Binds +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +interface MyModule { + @Binds fun bind(number: Int): Number + @Binds fun bind(number: Long): Number + @Binds fun bind(number: Double): Number + @Binds fun bind(number: Float): Number + @Binds fun bind(number: Short): Number + @Binds fun bind(number: Byte): Number + @Binds fun bind(number: Char): Comparable + @Binds fun bind(number: String): Comparable + @Binds fun bind(@MyQualifier number: Boolean): Comparable +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerKotlinIssuesDetectorTest.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, `DaggerKotlinIssuesDetector.binds can be extension functions`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindsCanBeExtensionFunction") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindsCanBeExtensionFunction") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindsCanBeExtensionFunction + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindsCanBeExtensionFunction" severity="ignore" /> + </lint> + ``` + 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 'BindsCanBeExtensionFunction' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindsCanBeExtensionFunction ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BlockedPrivateApi.md.html b/docs/checks/BlockedPrivateApi.md.html index c3f1b5d4..11a40dbf 100644 --- a/docs/checks/BlockedPrivateApi.md.html +++ b/docs/checks/BlockedPrivateApi.md.html @@ -48,8 +48,6 @@ Field deniedField = TelephonyManager.class.getDeclaredField("NETWORK_TYPES"); // ERROR 1 -------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BomWithoutPlatform.md.html b/docs/checks/BomWithoutPlatform.md.html new file mode 100644 index 00000000..427f479d --- /dev/null +++ b/docs/checks/BomWithoutPlatform.md.html @@ -0,0 +1,138 @@ + +(#) Using a BOM without platform call + +!!! WARNING: Using a BOM without platform call + This is a warning. + +Id +: `BomWithoutPlatform` +Summary +: Using a BOM without platform call +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 runs on the fly in the IDE editor +See +: https://developer.android.com/r/tools/gradle-bom-docs +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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +When including a BOM, the dependency's coordinates must be wrapped in a +call to `platform()` for Gradle to interpret it correctly. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:6:Warning: BOM should be added with a call to platform() +[BomWithoutPlatform] + + implementation(libs.compose.bom) + ---------------- + + +build.gradle:7:Warning: BOM should be added with a call to platform() +[BomWithoutPlatform] + + testImplementation(libs.compose.bom) + ---------------- + + +build.gradle:8:Warning: BOM should be added with a call to platform() +[BomWithoutPlatform] + + testImplementation "androidx.compose:compose-bom:2023.01.00" + ----------------------------------------- + + +build.gradle:9:Warning: BOM should be added with a call to platform() +[BomWithoutPlatform] + + api("androidx.compose:compose-bom:2023.01.00") + ----------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +plugins { + id 'com.android.application' + id 'kotlin-android' +} +dependencies { + implementation(libs.compose.bom) + testImplementation(libs.compose.bom) + testImplementation "androidx.compose:compose-bom:2023.01.00" + api("androidx.compose:compose-bom:2023.01.00") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testBomWithoutPlatform`. +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: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BomWithoutPlatform + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BomWithoutPlatform" severity="ignore" /> + </lint> + ``` + 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 'BomWithoutPlatform' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BomWithoutPlatform ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BottomAppBar.md.html b/docs/checks/BottomAppBar.md.html index ee7e4ca7..96217120 100644 --- a/docs/checks/BottomAppBar.md.html +++ b/docs/checks/BottomAppBar.md.html @@ -41,8 +41,6 @@ <android.support.design.bottomappbar.BottomAppBar ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/BrokenIterator.md.html b/docs/checks/BrokenIterator.md.html index 95cad947..531226f1 100644 --- a/docs/checks/BrokenIterator.md.html +++ b/docs/checks/BrokenIterator.md.html @@ -100,8 +100,6 @@ StreamSupport.stream(c2a.spliterator(), false); // Warn ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ButtonCase.md.html b/docs/checks/ButtonCase.md.html index 69714347..30acb18c 100644 --- a/docs/checks/ButtonCase.md.html +++ b/docs/checks/ButtonCase.md.html @@ -51,8 +51,6 @@ <string name="giveup2">"CANCEL"</string> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ButtonOrder.md.html b/docs/checks/ButtonOrder.md.html index cdff1ab0..0240ec19 100644 --- a/docs/checks/ButtonOrder.md.html +++ b/docs/checks/ButtonOrder.md.html @@ -23,7 +23,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://material.io/components/dialogs/ +: https://d.android.com/r/studio-ui/designer/material/dialogs 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/ButtonDetector.java) Tests @@ -95,8 +95,6 @@ <Button ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ButtonStyle.md.html b/docs/checks/ButtonStyle.md.html index beb7c6dc..edef8b4d 100644 --- a/docs/checks/ButtonStyle.md.html +++ b/docs/checks/ButtonStyle.md.html @@ -23,7 +23,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://material.io/components/dialogs/ +: https://d.android.com/r/studio-ui/designer/material/dialogs 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/ButtonDetector.java) Tests @@ -201,8 +201,6 @@ <Button ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ByteOrderMark.md.html b/docs/checks/ByteOrderMark.md.html index 56e02ba3..31ec3b68 100644 --- a/docs/checks/ByteOrderMark.md.html +++ b/docs/checks/ByteOrderMark.md.html @@ -51,8 +51,6 @@ <manifest package='foo.bar'> - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CanvasSize.md.html b/docs/checks/CanvasSize.md.html index 25700631..e709295c 100644 --- a/docs/checks/CanvasSize.md.html +++ b/docs/checks/CanvasSize.md.html @@ -82,8 +82,6 @@ int height4 = canvas.getHeight(); // WARN ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CastingViewContextToActivity.md.html b/docs/checks/CastingViewContextToActivity.md.html new file mode 100644 index 00000000..e846799a --- /dev/null +++ b/docs/checks/CastingViewContextToActivity.md.html @@ -0,0 +1,144 @@ + +(#) Unsafe cast of `Context` to `Activity` + +!!! ERROR: Unsafe cast of `Context` to `Activity` + This is an error. + +Id +: `CastingViewContextToActivity` +Summary +: Unsafe cast of `Context` to `Activity` +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/ViewContextDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/ViewContextDetectorTest.kt) +Copyright Year +: 2021 + +`View.getContext()` is not guaranteed to return an `Activity` and can +often return a `ContextWrapper` instead resulting in a +`ClassCastException`. Instead, use +`UiUtils.getActivityFromView()`. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("CastingViewContextToActivity") + fun method() { + getContext(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("CastingViewContextToActivity") + void method() { + getContext(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection CastingViewContextToActivity + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="CastingViewContextToActivity" severity="ignore" /> + </lint> + ``` + 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 'CastingViewContextToActivity' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore CastingViewContextToActivity ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/CheckResult.md.html b/docs/checks/CheckResult.md.html index 32a8007c..62908f17 100644 --- a/docs/checks/CheckResult.md.html +++ b/docs/checks/CheckResult.md.html @@ -30,7 +30,7 @@ : 2017 Some methods have no side effects, and calling them without doing -something without the result is suspicious. +something with the result is suspicious. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -44,8 +44,6 @@ score.double() -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ChromeOsAbiSupport.md.html b/docs/checks/ChromeOsAbiSupport.md.html new file mode 100644 index 00000000..3f263883 --- /dev/null +++ b/docs/checks/ChromeOsAbiSupport.md.html @@ -0,0 +1,127 @@ + +(#) Missing ABI Support for ChromeOS + +!!! WARNING: Missing ABI Support for ChromeOS + This is a warning. + +Id +: `ChromeOsAbiSupport` +Summary +: Missing ABI Support for ChromeOS +Severity +: Warning +Category +: Correctness: Chrome OS +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Gradle build files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/ndk/guides/abis +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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +To properly support ChromeOS, your Android application should have an +x86 and/or x86_64 binary as part of the build configuration. To fix the +issue, ensure your files are properly optimized for ARM; the binary +translator will then ensure compatibility with x86. Alternatively, add +an `abiSplit` for x86 within your `build.gradle` file and create the +required x86 dependencies. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:10:Warning: Missing x86 and x86_64 ABI support for ChromeOS +[ChromeOsAbiSupport] + + abiFilters 'arm64-v8a' + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +apply plugin: 'com.android.application' + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + defaultConfig { + minSdkVersion 15 + targetSdkVersion 17 + ndk { + abiFilters 'arm64-v8a' + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testChromeOSAbiFiltersMissingX86`. +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: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ChromeOsAbiSupport + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ChromeOsAbiSupport" severity="ignore" /> + </lint> + ``` + 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 'ChromeOsAbiSupport' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ChromeOsAbiSupport ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ChromeOsOnConfigurationChanged.md.html b/docs/checks/ChromeOsOnConfigurationChanged.md.html new file mode 100644 index 00000000..14904cf7 --- /dev/null +++ b/docs/checks/ChromeOsOnConfigurationChanged.md.html @@ -0,0 +1,155 @@ + +(#) Poor performance with APIs inside `onConfigurationChanged()` + +!!! WARNING: Poor performance with APIs inside `onConfigurationChanged()` + This is a warning. + +Id +: `ChromeOsOnConfigurationChanged` +Summary +: Poor performance with APIs inside `onConfigurationChanged()` +Severity +: Warning +Category +: Correctness: Chrome OS +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/ChromeOsSourceDetector.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/ChromeOsSourceDetectorTest.kt) +Copyright Year +: 2018 + +When users resize the Android emulator in Android 13 and Chrome OS, an +`onConfigurationChanged()` API call occurs. If your +`onConfigurationChanged()` method contains any code that can cause a +redraw, your app might take a performance hit on large screens. To fix +the issue, ensure your `onConfigurationChanged()` method does not +contain any calls to UI redraw logic for specific elements. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/MainActivity.java:19:Warning: Calling finish() within +onConfigurationChanged() can lead to redraws +[ChromeOsOnConfigurationChanged] + + finish(); // ERROR 1 + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/MainActivity.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; +import android.app.Activity; +import android.content.pm.PackageManager; +import android.os.Bundle; + + +public class MainActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); + } + + @Override + protected void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + finish(); // ERROR 1 + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/ChromeOsSourceDetectorTest.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, `ChromeOsSourceDetector.testFinishFoundInsideOnConfigurationChanged`. +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: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ChromeOsOnConfigurationChanged") + fun method() { + setRequestedOrientation(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ChromeOsOnConfigurationChanged") + void method() { + setRequestedOrientation(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ChromeOsOnConfigurationChanged + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ChromeOsOnConfigurationChanged" severity="ignore" /> + </lint> + ``` + 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 'ChromeOsOnConfigurationChanged' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ChromeOsOnConfigurationChanged ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ClickableViewAccessibility.md.html b/docs/checks/ClickableViewAccessibility.md.html index 64722988..07579599 100644 --- a/docs/checks/ClickableViewAccessibility.md.html +++ b/docs/checks/ClickableViewAccessibility.md.html @@ -46,8 +46,6 @@ public boolean onTouchEvent(MotionEvent event) { ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CoarseFineLocation.md.html b/docs/checks/CoarseFineLocation.md.html index a939e3db..68daa280 100644 --- a/docs/checks/CoarseFineLocation.md.html +++ b/docs/checks/CoarseFineLocation.md.html @@ -44,8 +44,6 @@ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> ------------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ColorCasing.md.html b/docs/checks/ColorCasing.md.html new file mode 100644 index 00000000..8e02a72f --- /dev/null +++ b/docs/checks/ColorCasing.md.html @@ -0,0 +1,145 @@ + +(#) Raw colors should be defined with uppercase letters. + +!!! WARNING: Raw colors should be defined with uppercase letters. + This is a warning. + +Id +: `ColorCasing` +Summary +: Raw colors should be defined with uppercase letters. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ColorCasingDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ColorCasingDetectorTest.kt) + +Colors should have uppercase letters. #FF0099 is valid while #ff0099 +isn't since the ff should be written in uppercase. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/layout.xml:2:Warning: Should be using uppercase letters +[ColorCasing] + + tools:textColor="#fff"/> + ---- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/layout.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView xmlns:tools="http://schemas.android.com/tools" + tools:textColor="#fff"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ColorCasingDetectorTest.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, `ColorCasingDetector.lowercaseColor`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="ColorCasing"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ColorCasing" severity="ignore" /> + </lint> + ``` + 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 'ColorCasing' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ColorCasing ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/CommitPrefEdits.md.html b/docs/checks/CommitPrefEdits.md.html index 0d5a6e5f..7995b185 100644 --- a/docs/checks/CommitPrefEdits.md.html +++ b/docs/checks/CommitPrefEdits.md.html @@ -51,8 +51,6 @@ SharedPreferences.Editor editor = preferences.edit(); ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -143,7 +141,7 @@ 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, `CleanupDetector.test`. +found for this lint check, `CleanupDetector.testSharedPrefs`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/CommitTransaction.md.html b/docs/checks/CommitTransaction.md.html index 74d666e6..4f4cf0a6 100644 --- a/docs/checks/CommitTransaction.md.html +++ b/docs/checks/CommitTransaction.md.html @@ -76,8 +76,6 @@ transaction = getFragmentManager().beginTransaction(); // ERROR 6 ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ComposableDestinationInComposeScope.md.html b/docs/checks/ComposableDestinationInComposeScope.md.html index 2d936cbc..4ace057e 100644 --- a/docs/checks/ComposableDestinationInComposeScope.md.html +++ b/docs/checks/ComposableDestinationInComposeScope.md.html @@ -18,6 +18,13 @@ : Jetpack Navigation Compose Identifier : androidx.navigation.compose +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -43,8 +50,6 @@ composable("wrong") { } ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -77,6 +82,36 @@ To report a problem with this extracted sample, contact Jetpack Navigation Compose. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-compose:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-compose) + +# libs.versions.toml +[versions] +navigation-compose = "2.7.0-beta01" +[libraries] +navigation-compose = { + module = "androidx.navigation:navigation-compose", + version.ref = "navigation-compose" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableLambdaParameterNaming.md.html b/docs/checks/ComposableLambdaParameterNaming.md.html index 33db6c1e..797a558c 100644 --- a/docs/checks/ComposableLambdaParameterNaming.md.html +++ b/docs/checks/ComposableLambdaParameterNaming.md.html @@ -22,6 +22,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -45,8 +52,6 @@ fun Button(foo: Int, text: @Composable () -> Unit) { ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -72,6 +77,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableLambdaParameterPosition.md.html b/docs/checks/ComposableLambdaParameterPosition.md.html index bf7038f8..2b4e2b29 100644 --- a/docs/checks/ComposableLambdaParameterPosition.md.html +++ b/docs/checks/ComposableLambdaParameterPosition.md.html @@ -22,6 +22,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -47,8 +54,6 @@ fun Button(content: @Composable () -> Unit, foo: Int) { ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -74,6 +79,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableModifierFactory.md.html b/docs/checks/ComposableModifierFactory.md.html index 450c8222..59e26b4d 100644 --- a/docs/checks/ComposableModifierFactory.md.html +++ b/docs/checks/ComposableModifierFactory.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -71,8 +78,6 @@ val Modifier.fooModifier4: Modifier get() = ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -119,6 +124,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableNaming.md.html b/docs/checks/ComposableNaming.md.html index 2987b84d..cf2d975e 100644 --- a/docs/checks/ComposableNaming.md.html +++ b/docs/checks/ComposableNaming.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -49,8 +56,6 @@ fun button() {} ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -74,6 +79,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableNavGraphInComposeScope.md.html b/docs/checks/ComposableNavGraphInComposeScope.md.html index f32d8232..3e9601bc 100644 --- a/docs/checks/ComposableNavGraphInComposeScope.md.html +++ b/docs/checks/ComposableNavGraphInComposeScope.md.html @@ -18,6 +18,13 @@ : Jetpack Navigation Compose Identifier : androidx.navigation.compose +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -41,8 +48,6 @@ navigation("wrong") { } ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -76,6 +81,36 @@ To report a problem with this extracted sample, contact Jetpack Navigation Compose. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-compose:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-compose) + +# libs.versions.toml +[versions] +navigation-compose = "2.7.0-beta01" +[libraries] +navigation-compose = { + module = "androidx.navigation:navigation-compose", + version.ref = "navigation-compose" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposeComposableModifier.md.html b/docs/checks/ComposeComposableModifier.md.html new file mode 100644 index 00000000..312b4067 --- /dev/null +++ b/docs/checks/ComposeComposableModifier.md.html @@ -0,0 +1,195 @@ + +(#) Using @Composable builder functions for modifiers is not recommended + +!!! ERROR: Using @Composable builder functions for modifiers is not recommended + This is an error. + +Id +: `ComposeComposableModifier` +Summary +: Using @Composable builder functions for modifiers is not recommended +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ModifierComposableDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierComposableDetectorTest.kt) +Copyright Year +: 2023 + +Using @Composable builder functions for modifiers is not recommended, as +they cause unnecessary recompositions. +You should use Modifier.composed { ... } instead, as it limits +recomposition to just the modifier instance, rather than the whole +function tree. +See +https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions + for more information. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:1:Error: Using @Composable builder functions for modifiers +is not recommended, as they cause unnecessary recompositions. +You should use Modifier.composed { ... } instead, as it limits +recomposition to just the modifier instance, rather than the whole +function tree. +See +https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions + for more information. [ComposeComposableModifier] + +@Composable +^ + + +src/test.kt:3:Error: Using @Composable builder functions for modifiers +is not recommended, as they cause unnecessary recompositions. +You should use Modifier.composed { ... } instead, as it limits +recomposition to just the modifier instance, rather than the whole +function tree. +See +https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions + for more information. [ComposeComposableModifier] + +@Composable +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Modifier.something1(): Modifier { } +@Composable +fun Modifier.something2() = somethingElse() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierComposableDetectorTest.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, `ModifierComposableDetector.errors when a composable Modifier extension is detected`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeComposableModifier") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeComposableModifier") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeComposableModifier + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeComposableModifier" severity="ignore" /> + </lint> + ``` + 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 'ComposeComposableModifier' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeComposableModifier ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeCompositionLocalUsage.md.html b/docs/checks/ComposeCompositionLocalUsage.md.html new file mode 100644 index 00000000..b280f529 --- /dev/null +++ b/docs/checks/ComposeCompositionLocalUsage.md.html @@ -0,0 +1,221 @@ + +(#) CompositionLocals are discouraged + +!!! WARNING: CompositionLocals are discouraged + This is a warning. + +Id +: `ComposeCompositionLocalUsage` +Summary +: CompositionLocals are discouraged +Severity +: Warning +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/CompositionLocalUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/CompositionLocalUsageDetectorTest.kt) +Copyright Year +: 2023 + +`CompositionLocal`s are implicit dependencies and creating new ones +should be avoided. +See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) allowed-composition-locals + +A comma-separated list of CompositionLocals that should be allowed. +This property should define a comma-separated list of `CompositionLocal`s that should be allowed. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeCompositionLocalUsage"> + <option name="allowed-composition-locals" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Warning: `CompositionLocal`s are implicit dependencies and +creating new ones should be avoided. +See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +more information. [ComposeCompositionLocalUsage] + + private val LocalApple = staticCompositionLocalOf<String> { "Apple" } + --------------------------------------------------------------------- + + +src/test.kt:3:Warning: `CompositionLocal`s are implicit dependencies and +creating new ones should be avoided. +See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +more information. [ComposeCompositionLocalUsage] + + internal val LocalPlum: String = staticCompositionLocalOf { "Plum" } + -------------------------------------------------------------------- + + +src/test.kt:4:Warning: `CompositionLocal`s are implicit dependencies and +creating new ones should be avoided. +See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +more information. [ComposeCompositionLocalUsage] + + val LocalPrune = compositionLocalOf { "Prune" } + ----------------------------------------------- + + +src/test.kt:5:Warning: `CompositionLocal`s are implicit dependencies and +creating new ones should be avoided. +See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +more information. [ComposeCompositionLocalUsage] + + private val LocalKiwi: String = compositionLocalOf { "Kiwi" } + ------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +private val LocalApple = staticCompositionLocalOf { "Apple" } +internal val LocalPlum: String = staticCompositionLocalOf { "Plum" } +val LocalPrune = compositionLocalOf { "Prune" } +private val LocalKiwi: String = compositionLocalOf { "Kiwi" } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/CompositionLocalUsageDetectorTest.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, `CompositionLocalUsageDetector.warning when a CompositionLocal is defined`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeCompositionLocalUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeCompositionLocalUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeCompositionLocalUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeCompositionLocalUsage" severity="ignore" /> + </lint> + ``` + 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 'ComposeCompositionLocalUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeCompositionLocalUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeContentEmitterReturningValues.md.html b/docs/checks/ComposeContentEmitterReturningValues.md.html new file mode 100644 index 00000000..154b12c7 --- /dev/null +++ b/docs/checks/ComposeContentEmitterReturningValues.md.html @@ -0,0 +1,221 @@ + +(#) Composable functions should emit XOR return + +!!! ERROR: Composable functions should emit XOR return + This is an error. + +Id +: `ComposeContentEmitterReturningValues` +Summary +: Composable functions should emit XOR return +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ContentEmitterReturningValuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ContentEmitterReturningValuesDetectorTest.kt) +Copyright Year +: 2023 + +Composable functions should either emit content into the composition or +return a value, but not both. +If a composable should offer additional control surfaces to its caller, +those control surfaces or callbacks should be provided as parameters to +the composable function by the caller. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result + for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) content-emitters + +A comma-separated list of known content-emitting composables. +This property should define a comma-separated list of known content-emitting composables. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeContentEmitterReturningValues"> + <option name="content-emitters" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:1:Error: Composable functions should either emit content +into the composition or return a value, but not both. +If a composable should offer additional control surfaces to its caller, +those control surfaces or callbacks should be provided as parameters to +the composable function by the caller. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result + for more information. [ComposeContentEmitterReturningValues] + +@Composable +^ + + +src/test.kt:6:Error: Composable functions should either emit content +into the composition or return a value, but not both. +If a composable should offer additional control surfaces to its caller, +those control surfaces or callbacks should be provided as parameters to +the composable function by the caller. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result + for more information. [ComposeContentEmitterReturningValues] + +@Composable +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something() { + Text("Hi") + Text("Hola") +} +@Composable +fun Something() { + Spacer16() + Text("Hola") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ContentEmitterReturningValuesDetectorTest.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, `ContentEmitterReturningValuesDetector.errors when a Composable function has more than one UI emitter at the top level`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeContentEmitterReturningValues") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeContentEmitterReturningValues") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeContentEmitterReturningValues + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeContentEmitterReturningValues" severity="ignore" /> + </lint> + ``` + 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 'ComposeContentEmitterReturningValues' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeContentEmitterReturningValues ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeM2Api.md.html b/docs/checks/ComposeM2Api.md.html new file mode 100644 index 00000000..79fd9822 --- /dev/null +++ b/docs/checks/ComposeM2Api.md.html @@ -0,0 +1,246 @@ + +(#) Using a Compose M2 API is not recommended + +!!! ERROR: Using a Compose M2 API is not recommended + This is an error. + +Id +: `ComposeM2Api` +Summary +: Using a Compose M2 API is not recommended +Note +: **This issue is disabled by default**; use `--enable ComposeM2Api` +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/M2ApiDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/M2ApiDetectorTest.kt) +Copyright Year +: 2022 + +Compose Material 2 (M2) is succeeded by Material 3 (M3). Please use M3 +APIs. +See https://slackhq.github.io/compose-lints/rules/#use-material-3 for +more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) allowed-m2-apis + +A comma-separated list of APIs in androidx.compose.material that should be allowed.. +This property should define a comma-separated list of APIs in androidx.compose.material that should be allowed. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeM2Api"> + <option name="allowed-m2-apis" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:9:Error: Compose Material 2 (M2) is succeeded by Material 3 +(M3). Please use M3 APIs. +See https://slackhq.github.io/compose-lints/rules/#use-material-3 for +more information. [ComposeM2Api] + + Text("Hello, world!") + --------------------- + + +src/test.kt:23:Error: Compose Material 2 (M2) is succeeded by Material 3 +(M3). Please use M3 APIs. +See https://slackhq.github.io/compose-lints/rules/#use-material-3 for +more information. [ComposeM2Api] + + Text("Hello, world!") + --------------------- + + +src/test.kt:24:Error: Compose Material 2 (M2) is succeeded by Material 3 +(M3). Please use M3 APIs. +See https://slackhq.github.io/compose-lints/rules/#use-material-3 for +more information. [ComposeM2Api] + + val elevation = BottomNavigationDefaults.Elevation + ---------------------------------- + + +src/test.kt:25:Error: Compose Material 2 (M2) is succeeded by Material 3 +(M3). Please use M3 APIs. +See https://slackhq.github.io/compose-lints/rules/#use-material-3 for +more information. [ComposeM2Api] + + val drawerValue = BottomDrawerValue.Closed + ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.material.BottomDrawerValue +import androidx.compose.material.BottomNavigationDefaults +import androidx.compose.material.Text +import androidx.compose.material.ripple.rememberRipple +import androidx.compose.runtime.Composable + +@Composable +fun Example() { + Text("Hello, world!") +} + +@Composable +fun AllowedExample() { + Surface { + + } +} + +@Composable +fun Composite() { + Surface { + val ripple = rememberRipple() + Text("Hello, world!") + val elevation = BottomNavigationDefaults.Elevation + val drawerValue = BottomDrawerValue.Closed + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/M2ApiDetectorTest.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, `M2ApiDetector.smokeTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeM2Api") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeM2Api") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeM2Api + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeM2Api" severity="ignore" /> + </lint> + ``` + 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 'ComposeM2Api' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeM2Api ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeModifierMissing.md.html b/docs/checks/ComposeModifierMissing.md.html new file mode 100644 index 00000000..f748f187 --- /dev/null +++ b/docs/checks/ComposeModifierMissing.md.html @@ -0,0 +1,252 @@ + +(#) Missing modifier parameter + +!!! ERROR: Missing modifier parameter + This is an error. + +Id +: `ComposeModifierMissing` +Summary +: Missing modifier parameter +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ModifierMissingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierMissingDetectorTest.kt) +Copyright Year +: 2023 + +This @Composable function emits content but doesn't have a modifier +parameter. +See +https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters + for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) content-emitters + +A comma-separated list of known content-emitting composables. +This property should define a comma-separated list of known content-emitting composables. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeModifierMissing"> + <option name="content-emitters" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) visibility-threshold + +Visibility threshold to check for Modifiers. +You can control the visibility of which composables to check for Modifiers. Possible values are: `only_public` (default), `public_and_internal` and `all` + +Default is "only_public". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeModifierMissing"> + <option name="visibility-threshold" value=""only_public"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: This @Composable function emits content but doesn't +have a modifier parameter. +See +https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters + for more information. [ComposeModifierMissing] + +fun Something1() { + ---------- + + +src/test.kt:7:Error: This @Composable function emits content but doesn't +have a modifier parameter. +See +https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters + for more information. [ComposeModifierMissing] + +fun Something2() { + ---------- + + +src/test.kt:12:Error: This @Composable function emits content but +doesn't have a modifier parameter. +See +https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters + for more information. [ComposeModifierMissing] + +fun Something3(): Unit { + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something1() { + Row { + } +} +@Composable +fun Something2() { + Column(modifier = Modifier.fillMaxSize()) { + } +} +@Composable +fun Something3(): Unit { + SomethingElse { + Box(modifier = Modifier.fillMaxSize()) { + } + } +} +@Composable +fun Something4(modifier: Modifier = Modifier) { + Row { + Text("Hi!") + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierMissingDetectorTest.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, `ModifierMissingDetector.errors when a Composable has a layout inside and it doesn't have a modifier`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeModifierMissing") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeModifierMissing") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeModifierMissing + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeModifierMissing" severity="ignore" /> + </lint> + ``` + 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 'ComposeModifierMissing' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeModifierMissing ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeModifierReused.md.html b/docs/checks/ComposeModifierReused.md.html new file mode 100644 index 00000000..40922aea --- /dev/null +++ b/docs/checks/ComposeModifierReused.md.html @@ -0,0 +1,357 @@ + +(#) Modifiers should only be used once + +!!! ERROR: Modifiers should only be used once + This is an error. + +Id +: `ComposeModifierReused` +Summary +: Modifiers should only be used once +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ModifierReusedDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierReusedDetectorTest.kt) +Copyright Year +: 2023 + +Modifiers should only be used once and by the root level layout of a +Composable. This is true even if appended to or with other modifiers +e.g. `modifier.fillMaxWidth()`. +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) content-emitters + +A comma-separated list of known content-emitting composables. +This property should define a comma-separated list of known content-emitting composables. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeModifierReused"> + <option name="content-emitters" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:3:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + Row(modifier) { + ^ + + +src/test.kt:4:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingElse(modifier) + ----------------------- + + +src/test.kt:9:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + Column(modifier = modifier) { + ^ + + +src/test.kt:11:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingDifferent(modifier = modifier) + --------------------------------------- + + +src/test.kt:16:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + Column(modifier = modifier) { + ^ + + +src/test.kt:19:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingElse(modifier = modifier) + ---------------------------------- + + +src/test.kt:20:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingElse(modifier = modifier.padding12()) + ---------------------------------------------- + + +src/test.kt:25:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingElse(myMod) + -------------------- + + +src/test.kt:26:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + SomethingElse(myMod) + -------------------- + + +src/test.kt:31:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + Box( + ^ + + +src/test.kt:37:Error: Modifiers should only be used once and by the root +level layout of a Composable. This is true even if appended to or with +other modifiers e.g. modifier.fillMaxWidth(). +Use Modifier (with a capital 'M') to construct a new Modifier that you +can pass to other composables. +See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers +for more information. [ComposeModifierReused] + + Box( + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something(modifier: Modifier) { + Row(modifier) { + SomethingElse(modifier) + } +} +@Composable +fun Something(modifier: Modifier): Int { + Column(modifier = modifier) { + SomethingElse(modifier = Modifier) + SomethingDifferent(modifier = modifier) + } +} +@Composable +fun BoxScope.Something(modifier: Modifier) { + Column(modifier = modifier) { + SomethingDifferent() + } + SomethingElse(modifier = modifier) + SomethingElse(modifier = modifier.padding12()) +} +@Composable +fun Something(myMod: Modifier) { + Column { + SomethingElse(myMod) + SomethingElse(myMod) + } +} +@Composable +fun FoundThisOneInTheWild(modifier: Modifier = Modifier) { + Box( + modifier = modifier + .size(AvatarSize.Default.size) + .clip(CircleShape) + .then(colorModifier) + ) { + Box( + modifier = modifier.padding(spacesBorderWidth) + ) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierReusedDetectorTest.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, `ModifierReusedDetector.errors when the modifier parameter of a Composable is used more than once by siblings or parent-children`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeModifierReused") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeModifierReused") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeModifierReused + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeModifierReused" severity="ignore" /> + </lint> + ``` + 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 'ComposeModifierReused' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeModifierReused ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeModifierWithoutDefault.md.html b/docs/checks/ComposeModifierWithoutDefault.md.html new file mode 100644 index 00000000..1a272605 --- /dev/null +++ b/docs/checks/ComposeModifierWithoutDefault.md.html @@ -0,0 +1,189 @@ + +(#) Missing Modifier default value + +!!! ERROR: Missing Modifier default value + This is an error. + +Id +: `ComposeModifierWithoutDefault` +Summary +: Missing Modifier default value +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ModifierWithoutDefaultDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierWithoutDefaultDetectorTest.kt) +Copyright Year +: 2023 + +This @Composable function has a modifier parameter but it doesn't have a +default value. +See +https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters + for more information. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: This @Composable function has a modifier parameter +but it doesn't have a default value. +See +https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters + for more information. [ComposeModifierWithoutDefault] + +fun Something(modifier: Modifier) { } + ------------------ + + +src/test.kt:4:Error: This @Composable function has a modifier parameter +but it doesn't have a default value. +See +https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters + for more information. [ComposeModifierWithoutDefault] + +fun Something(modifier: Modifier = Modifier, modifier2: Modifier) { } + ------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something(modifier: Modifier) { } +@Composable +fun Something(modifier: Modifier = Modifier, modifier2: Modifier) { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierWithoutDefaultDetectorTest.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, `ModifierWithoutDefaultDetector.errors when a Composable has modifiers but without default values`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeModifierWithoutDefault") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeModifierWithoutDefault") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeModifierWithoutDefault + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeModifierWithoutDefault" severity="ignore" /> + </lint> + ``` + 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 'ComposeModifierWithoutDefault' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeModifierWithoutDefault ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeMultipleContentEmitters.md.html b/docs/checks/ComposeMultipleContentEmitters.md.html new file mode 100644 index 00000000..bd9face4 --- /dev/null +++ b/docs/checks/ComposeMultipleContentEmitters.md.html @@ -0,0 +1,212 @@ + +(#) Composables should only be emit from one source + +!!! ERROR: Composables should only be emit from one source + This is an error. + +Id +: `ComposeMultipleContentEmitters` +Summary +: Composables should only be emit from one source +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/MultipleContentEmittersDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/MultipleContentEmittersDetectorTest.kt) +Copyright Year +: 2023 + +Composable functions should only be emitting content into the +composition from one source at their top level. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content + for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) content-emitters + +A comma-separated list of known content-emitting composables. +This property should define a comma-separated list of known content-emitting composables. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeMultipleContentEmitters"> + <option name="content-emitters" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:1:Error: Composable functions should only be emitting +content into the composition from one source at their top level. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content + for more information. [ComposeMultipleContentEmitters] + +@Composable +^ + + +src/test.kt:6:Error: Composable functions should only be emitting +content into the composition from one source at their top level. +See +https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content + for more information. [ComposeMultipleContentEmitters] + +@Composable +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something() { + Text("Hi") + Text("Hola") +} +@Composable +fun Something() { + Spacer16() + Text("Hola") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/MultipleContentEmittersDetectorTest.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, `MultipleContentEmittersDetector.errors when a Composable function has more than one UI emitter at the top level`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeMultipleContentEmitters") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeMultipleContentEmitters") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeMultipleContentEmitters + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeMultipleContentEmitters" severity="ignore" /> + </lint> + ``` + 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 'ComposeMultipleContentEmitters' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeMultipleContentEmitters ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeMutableParameters.md.html b/docs/checks/ComposeMutableParameters.md.html new file mode 100644 index 00000000..3145014c --- /dev/null +++ b/docs/checks/ComposeMutableParameters.md.html @@ -0,0 +1,225 @@ + +(#) Mutable objects in Compose will break state + +!!! ERROR: Mutable objects in Compose will break state + This is an error. + +Id +: `ComposeMutableParameters` +Summary +: Mutable objects in Compose will break state +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/MutableParametersDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/MutableParametersDetectorTest.kt) +Copyright Year +: 2023 + +Using mutable objects as state in Compose will cause your users to see +incorrect or stale data in your app. +Mutable objects that are not observable, such as `ArrayList` or a +mutable data class, cannot be observed by Compose to trigger +recomposition when they change. +See +https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters + for more information. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app. +Mutable objects that are not observable, such as ArrayList or a +mutable data class, cannot be observed by Compose to trigger +recomposition when they change. +See +https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters + for more information. [ComposeMutableParameters] + +fun Something(a: MutableState<String>) {} + -------------------- + + +src/test.kt:4:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app. +Mutable objects that are not observable, such as ArrayList or a +mutable data class, cannot be observed by Compose to trigger +recomposition when they change. +See +https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters + for more information. [ComposeMutableParameters] + +fun Something(a: ArrayList<String>) {} + ----------------- + + +src/test.kt:6:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app. +Mutable objects that are not observable, such as ArrayList or a +mutable data class, cannot be observed by Compose to trigger +recomposition when they change. +See +https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters + for more information. [ComposeMutableParameters] + +fun Something(a: HashSet<String>) {} + --------------- + + +src/test.kt:8:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app. +Mutable objects that are not observable, such as ArrayList or a +mutable data class, cannot be observed by Compose to trigger +recomposition when they change. +See +https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters + for more information. [ComposeMutableParameters] + +fun Something(a: MutableMap<String, String>) {} + -------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something(a: MutableState) {} +@Composable +fun Something(a: ArrayList) {} +@Composable +fun Something(a: HashSet) {} +@Composable +fun Something(a: MutableMap) {} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/MutableParametersDetectorTest.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, `MutableParametersDetector.errors when a Composable has a mutable parameter`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeMutableParameters") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeMutableParameters") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeMutableParameters + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeMutableParameters" severity="ignore" /> + </lint> + ``` + 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 'ComposeMutableParameters' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeMutableParameters ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeNamingLowercase.md.html b/docs/checks/ComposeNamingLowercase.md.html new file mode 100644 index 00000000..018551b4 --- /dev/null +++ b/docs/checks/ComposeNamingLowercase.md.html @@ -0,0 +1,200 @@ + +(#) Value-returning Composables should be lowercase + +!!! ERROR: Value-returning Composables should be lowercase + This is an error. + +Id +: `ComposeNamingLowercase` +Summary +: Value-returning Composables should be lowercase +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ComposableFunctionNamingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.kt) +Copyright Year +: 2023 + +Composable functions that return a value should start with a lowercase +letter. +While useful and accepted outside of @Composable functions, this factory +function convention has drawbacks that set inappropriate expectations +for callers when used with @Composable functions. +See +https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly + for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) allowed-composable-function-names + +A comma-separated list of regexes of allowed composable function names. +This property should define comma-separated list of regexes of allowed composable function names. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeNamingLowercase"> + <option name="allowed-composable-function-names" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: Composable functions that return a value should +start with a lowercase letter. +While useful and accepted outside of @Composable functions, this factory +function convention has drawbacks that set inappropriate expectations +for callers when used with @Composable functions. +See +https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly + for more information. [ComposeNamingLowercase] + +fun MyComposable(): Something { } + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun MyComposable(): Something { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.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, `ComposableFunctionNamingDetector.errors when a composable returns a value and is capitalized`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeNamingLowercase") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeNamingLowercase") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeNamingLowercase + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeNamingLowercase" severity="ignore" /> + </lint> + ``` + 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 'ComposeNamingLowercase' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeNamingLowercase ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeNamingUppercase.md.html b/docs/checks/ComposeNamingUppercase.md.html new file mode 100644 index 00000000..8ceaa50e --- /dev/null +++ b/docs/checks/ComposeNamingUppercase.md.html @@ -0,0 +1,216 @@ + +(#) Unit Composables should be uppercase + +!!! ERROR: Unit Composables should be uppercase + This is an error. + +Id +: `ComposeNamingUppercase` +Summary +: Unit Composables should be uppercase +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ComposableFunctionNamingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.kt) +Copyright Year +: 2023 + +Composable functions that return Unit should start with an uppercase +letter. +They are considered declarative entities that can be either present or +absent in a composition and therefore follow the naming rules for +classes. +See +https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly + for more information. + +(##) Options + +You can configure this lint checks using the following options: + +(###) allowed-composable-function-names + +A comma-separated list of regexes of allowed composable function names. +This property should define comma-separated list of regexes of allowed composable function names. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeNamingUppercase"> + <option name="allowed-composable-function-names" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: Composable functions that return Unit should start +with an uppercase letter. +They are considered declarative entities that can be either present or +absent in a composition and therefore follow the naming rules for +classes. +See +https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly + for more information. [ComposeNamingUppercase] + +fun myComposable() { } + ------------ + + +src/test.kt:5:Error: Composable functions that return Unit should start +with an uppercase letter. +They are considered declarative entities that can be either present or +absent in a composition and therefore follow the naming rules for +classes. +See +https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly + for more information. [ComposeNamingUppercase] + +fun myComposable(): Unit { } + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun myComposable() { } + +@Composable +fun myComposable(): Unit { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.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, `ComposableFunctionNamingDetector.errors when a composable returns nothing or Unit and is lowercase`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeNamingUppercase") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeNamingUppercase") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeNamingUppercase + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeNamingUppercase" severity="ignore" /> + </lint> + ``` + 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 'ComposeNamingUppercase' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeNamingUppercase ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeParameterOrder.md.html b/docs/checks/ComposeParameterOrder.md.html new file mode 100644 index 00000000..8a658568 --- /dev/null +++ b/docs/checks/ComposeParameterOrder.md.html @@ -0,0 +1,248 @@ + +(#) Composable function parameters should be ordered + +!!! ERROR: Composable function parameters should be ordered + This is an error. + +Id +: `ComposeParameterOrder` +Summary +: Composable function parameters should be ordered +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ParameterOrderDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ParameterOrderDetectorTest.kt) +Copyright Year +: 2023 + +This is replaced when reported. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:1:Error: Parameters in a composable function should be +ordered following this pattern: params without defaults, modifiers, +params with defaults and optionally, a trailing function that might not +have a default param. +Current params are: [modifier: Modifier = Modifier, other: String, +other2: String] but should be [other: String, other2: String, modifier: +Modifier = Modifier]. +See +https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly + for more information. [ComposeParameterOrder] + +@Composable +^ + + +src/test.kt:4:Error: Parameters in a composable function should be +ordered following this pattern: params without defaults, modifiers, +params with defaults and optionally, a trailing function that might not +have a default param. +Current params are: [text: String = "deffo", modifier: Modifier = +Modifier] but should be [modifier: Modifier = Modifier, text: String = +"deffo"]. +See +https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly + for more information. [ComposeParameterOrder] + +@Composable +^ + + +src/test.kt:7:Error: Parameters in a composable function should be +ordered following this pattern: params without defaults, modifiers, +params with defaults and optionally, a trailing function that might not +have a default param. +Current params are: [modifier: Modifier = Modifier, text: String = +"123", modifier2: Modifier = Modifier] but should be [modifier: Modifier += Modifier, modifier2: Modifier = Modifier, text: String = "123"]. +See +https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly + for more information. [ComposeParameterOrder] + +@Composable +^ + + +src/test.kt:10:Error: Parameters in a composable function should be +ordered following this pattern: params without defaults, modifiers, +params with defaults and optionally, a trailing function that might not +have a default param. +Current params are: [text: String = "123", modifier: Modifier = +Modifier, lambda: () -> Unit] but should be [modifier: Modifier = +Modifier, text: String = "123", lambda: () -> Unit]. +See +https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly + for more information. [ComposeParameterOrder] + +@Composable +^ + + +src/test.kt:13:Error: Parameters in a composable function should be +ordered following this pattern: params without defaults, modifiers, +params with defaults and optionally, a trailing function that might not +have a default param. +Current params are: [text1: String, m2: Modifier = Modifier, modifier: +Modifier = Modifier, trailing: () -> Unit] but should be [text1: String, +modifier: Modifier = Modifier, m2: Modifier = Modifier, trailing: () -> +Unit]. +See +https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly + for more information. [ComposeParameterOrder] + +@Composable +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun MyComposable(modifier: Modifier = Modifier, other: String, other2: String) { } + +@Composable +fun MyComposable(text: String = "deffo", modifier: Modifier = Modifier) { } + +@Composable +fun MyComposable(modifier: Modifier = Modifier, text: String = "123", modifier2: Modifier = Modifier) { } + +@Composable +fun MyComposable(text: String = "123", modifier: Modifier = Modifier, lambda: () -> Unit) { } + +@Composable +fun MyComposable(text1: String, m2: Modifier = Modifier, modifier: Modifier = Modifier, trailing: () -> Unit) { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ParameterOrderDetectorTest.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, `ParameterOrderDetector.errors found when ordering is wrong`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeParameterOrder") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeParameterOrder") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeParameterOrder + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeParameterOrder" severity="ignore" /> + </lint> + ``` + 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 'ComposeParameterOrder' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeParameterOrder ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposePreviewNaming.md.html b/docs/checks/ComposePreviewNaming.md.html new file mode 100644 index 00000000..621fcdeb --- /dev/null +++ b/docs/checks/ComposePreviewNaming.md.html @@ -0,0 +1,194 @@ + +(#) Preview annotations require certain suffixes + +!!! ERROR: Preview annotations require certain suffixes + This is an error. + +Id +: `ComposePreviewNaming` +Summary +: Preview annotations require certain suffixes +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/PreviewNamingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/PreviewNamingDetectorTest.kt) +Copyright Year +: 2023 + +This is replaced when reporting. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/Banana.kt:1:Error: Preview annotations with 1 preview annotations +should end with the Preview suffix. +See +https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly + for more information. [ComposePreviewNaming] + +@Preview +^ + + +src/Banana.kt:3:Error: Preview annotations with 1 preview annotations +should end with the Preview suffix. +See +https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly + for more information. [ComposePreviewNaming] + +@Preview +^ + + +src/Banana.kt:5:Error: Preview annotations with 1 preview annotations +should end with the Preview suffix. +See +https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly + for more information. [ComposePreviewNaming] + +@BananaPreview +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/Banana.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Preview +annotation class Banana +@Preview +annotation class BananaPreviews +@BananaPreview +annotation class WithBananaPreviews +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/PreviewNamingDetectorTest.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, `PreviewNamingDetector.errors when a multipreview annotation is not correctly named for 1 preview`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposePreviewNaming") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposePreviewNaming") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposePreviewNaming + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposePreviewNaming" severity="ignore" /> + </lint> + ``` + 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 'ComposePreviewNaming' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposePreviewNaming ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposePreviewPublic.md.html b/docs/checks/ComposePreviewPublic.md.html new file mode 100644 index 00000000..37c497eb --- /dev/null +++ b/docs/checks/ComposePreviewPublic.md.html @@ -0,0 +1,212 @@ + +(#) Preview composables should be private + +!!! ERROR: Preview composables should be private + This is an error. + +Id +: `ComposePreviewPublic` +Summary +: Preview composables should be private +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/PreviewPublicDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/PreviewPublicDetectorTest.kt) +Copyright Year +: 2023 + +Composables annotated with `@Preview` that are used only for previewing +the UI should not be public. +See +https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public + for more information. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Options + +You can configure this lint checks using the following options: + +(###) preview-public-only-if-params + +If set to true, this check will only enforce on previews that have no PreviewParameters. +If set to true, this check will only enforce on previews that have no PreviewParameters + +Default is true. + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposePreviewPublic"> + <option name="preview-public-only-if-params" value="true" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:1:Error: Composables annotated with @Preview that are used +only for previewing the UI should not be public. +See +https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public + for more information. [ComposePreviewPublic] + +@Preview +^ + + +src/test.kt:4:Error: Composables annotated with @Preview that are used +only for previewing the UI should not be public. +See +https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public + for more information. [ComposePreviewPublic] + +@CombinedPreviews +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Preview +@Composable +fun MyComposable() { } +@CombinedPreviews +@Composable +fun MyComposable() { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/PreviewPublicDetectorTest.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, `PreviewPublicDetector.errors when a public preview composable is used when previewPublicOnlyIfParams is false`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposePreviewPublic") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposePreviewPublic") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposePreviewPublic + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposePreviewPublic" severity="ignore" /> + </lint> + ``` + 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 'ComposePreviewPublic' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposePreviewPublic ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeRememberMissing.md.html b/docs/checks/ComposeRememberMissing.md.html new file mode 100644 index 00000000..c0f43fb6 --- /dev/null +++ b/docs/checks/ComposeRememberMissing.md.html @@ -0,0 +1,189 @@ + +(#) State values should be remembered + +!!! ERROR: State values should be remembered + This is an error. + +Id +: `ComposeRememberMissing` +Summary +: State values should be remembered +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/RememberMissingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/RememberMissingDetectorTest.kt) +Copyright Year +: 2023 + +This is replaced when reported. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:3:Error: Using mutableStateOf in a @Composable function +without it being inside of a remember function. +If you don't remember the state instance, a new state instance will be +created when the function is recomposed. +See +https://slackhq.github.io/compose-lints/rules/#state-should-be-remembered-in-composables + for more information. [ComposeRememberMissing] + + val something = mutableStateOf("X") + ------------------- + + +src/test.kt:6:Error: Using mutableStateOf in a @Composable function +without it being inside of a remember function. +If you don't remember the state instance, a new state instance will be +created when the function is recomposed. +See +https://slackhq.github.io/compose-lints/rules/#state-should-be-remembered-in-composables + for more information. [ComposeRememberMissing] + +fun MyComposable(something: State<String> = mutableStateOf("X")) { + ------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun MyComposable() { + val something = mutableStateOf("X") +} +@Composable +fun MyComposable(something: State = mutableStateOf("X")) { +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/RememberMissingDetectorTest.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, `RememberMissingDetector.errors when a non-remembered mutableStateOf is used in a Composable`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeRememberMissing") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeRememberMissing") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeRememberMissing + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeRememberMissing" severity="ignore" /> + </lint> + ``` + 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 'ComposeRememberMissing' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeRememberMissing ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeUnstableCollections.md.html b/docs/checks/ComposeUnstableCollections.md.html new file mode 100644 index 00000000..8a33d1ca --- /dev/null +++ b/docs/checks/ComposeUnstableCollections.md.html @@ -0,0 +1,222 @@ + +(#) Immutable collections should ideally be used in Composables + +!!! WARNING: Immutable collections should ideally be used in Composables + This is a warning. + +Id +: `ComposeUnstableCollections` +Summary +: Immutable collections should ideally be used in Composables +Severity +: Warning +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/UnstableCollectionsDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/UnstableCollectionsDetectorTest.kt) +Copyright Year +: 2023 + +This is replaced when reported. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Warning: The Compose Compiler cannot infer the stability +of a parameter if a Collection is used in it, even if the item +type is stable. +You should use Kotlinx Immutable Collections instead: a: +ImmutableCollection or create an @Immutable wrapper for this +class: @Immutable data class ACollection(val items: Collection) +See +https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections + for more information. [ComposeUnstableCollections] + +fun Something(a: Collection<String>) {} + ------------------ + + +src/test.kt:4:Warning: The Compose Compiler cannot infer the stability +of a parameter if a List is used in it, even if the item type is +stable. +You should use Kotlinx Immutable Collections instead: a: +ImmutableList or create an @Immutable wrapper for this class: +@Immutable data class AList(val items: List) +See +https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections + for more information. [ComposeUnstableCollections] + +fun Something(a: List<String>) {} + ------------ + + +src/test.kt:6:Warning: The Compose Compiler cannot infer the stability +of a parameter if a Set is used in it, even if the item type is +stable. +You should use Kotlinx Immutable Collections instead: a: +ImmutableSet or create an @Immutable wrapper for this class: +@Immutable data class ASet(val items: Set) +See +https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections + for more information. [ComposeUnstableCollections] + +fun Something(a: Set<String>) {} + ----------- + + +src/test.kt:8:Warning: The Compose Compiler cannot infer the stability +of a parameter if a Map is used in it, even if the item +type is stable. +You should use Kotlinx Immutable Collections instead: a: +ImmutableMap or create an @Immutable wrapper for this +class: @Immutable data class AMap(val items: Map) +See +https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections + for more information. [ComposeUnstableCollections] + +fun Something(a: Map<String, Int>) {} + ---------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun Something(a: Collection) {} +@Composable +fun Something(a: List) {} +@Composable +fun Something(a: Set) {} +@Composable +fun Something(a: Map) {} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/UnstableCollectionsDetectorTest.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, `UnstableCollectionsDetector.warnings when a Composable has a Collection List Set Map parameter`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeUnstableCollections") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeUnstableCollections") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeUnstableCollections + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeUnstableCollections" severity="ignore" /> + </lint> + ``` + 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 'ComposeUnstableCollections' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeUnstableCollections ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeViewModelForwarding.md.html b/docs/checks/ComposeViewModelForwarding.md.html new file mode 100644 index 00000000..24bdd51e --- /dev/null +++ b/docs/checks/ComposeViewModelForwarding.md.html @@ -0,0 +1,174 @@ + +(#) Forwarding a ViewModel through multiple @Composable functions should be avoided + +!!! ERROR: Forwarding a ViewModel through multiple @Composable functions should be avoided + This is an error. + +Id +: `ComposeViewModelForwarding` +Summary +: Forwarding a ViewModel through multiple @Composable functions should be avoided +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelForwardingDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ViewModelForwardingDetectorTest.kt) +Copyright Year +: 2023 + +Forwarding a ViewModel through multiple @Composable functions should be +avoided. Consider using state hoisting. +See https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things +for more information. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:3:Error: Forwarding a ViewModel through multiple @Composable +functions should be avoided. Consider using state hoisting. +See https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things +for more information. [ComposeViewModelForwarding] + + AnotherComposable(viewModel) + ---------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun MyComposable(viewModel: MyViewModel) { + AnotherComposable(viewModel) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ViewModelForwardingDetectorTest.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, `ViewModelForwardingDetector.errors when a ViewModel is forwarded to another Composable`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeViewModelForwarding") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeViewModelForwarding") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeViewModelForwarding + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeViewModelForwarding" severity="ignore" /> + </lint> + ``` + 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 'ComposeViewModelForwarding' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeViewModelForwarding ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeViewModelInjection.md.html b/docs/checks/ComposeViewModelInjection.md.html new file mode 100644 index 00000000..e6719378 --- /dev/null +++ b/docs/checks/ComposeViewModelInjection.md.html @@ -0,0 +1,225 @@ + +(#) Implicit dependencies of composables should be made explicit + +!!! ERROR: Implicit dependencies of composables should be made explicit + This is an error. + +Id +: `ComposeViewModelInjection` +Summary +: Implicit dependencies of composables should be made explicit +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ViewModelInjectionDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ViewModelInjectionDetectorTest.kt) +Copyright Year +: 2023 + +Replaced when reporting. + +(##) Options + +You can configure this lint checks using the following options: + +(###) viewmodel-factories + +A comma-separated list of viewModel factories.. +This property should define comma-separated list of allowed viewModel factory function names. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeViewModelInjection"> + <option name="viewmodel-factories" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:3:Error: Implicit dependencies of composables should be made +explicit. +Usages of to acquire a ViewModel should be done in composable default +parameters, so that it is more testable and flexible. +See https://slackhq.github.io/compose-lints/rules/#viewmodels for more +information. [ComposeViewModelInjection] + + val viewModel = <MyVM>() + ------------------------ + + +src/test.kt:8:Error: Implicit dependencies of composables should be made +explicit. +Usages of to acquire a ViewModel should be done in composable default +parameters, so that it is more testable and flexible. +See https://slackhq.github.io/compose-lints/rules/#viewmodels for more +information. [ComposeViewModelInjection] + + val viewModel: MyVM = () + ------------------------ + + +src/test.kt:13:Error: Implicit dependencies of composables should be +made explicit. +Usages of to acquire a ViewModel should be done in composable default +parameters, so that it is more testable and flexible. +See https://slackhq.github.io/compose-lints/rules/#viewmodels for more +information. [ComposeViewModelInjection] + + val viewModel: MyVM = () + ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@Composable +fun MyComposable(modifier: Modifier) { + val viewModel = () +} + +@Composable +fun MyComposableNoParams() { + val viewModel: MyVM = () +} + +@Composable +fun MyComposableTrailingLambda(block: () -> Unit) { + val viewModel: MyVM = () +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ViewModelInjectionDetectorTest.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, `ViewModelInjectionDetector.errors when a weaverViewModel is used at the beginning of a Composable`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeViewModelInjection") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeViewModelInjection") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeViewModelInjection + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeViewModelInjection" severity="ignore" /> + </lint> + ``` + 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 'ComposeViewModelInjection' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeViewModelInjection ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/CompositionLocalNaming.md.html b/docs/checks/CompositionLocalNaming.md.html index fd180e48..74767e6e 100644 --- a/docs/checks/CompositionLocalNaming.md.html +++ b/docs/checks/CompositionLocalNaming.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -60,8 +67,6 @@ val BazCompositionLocal: ProvidableCompositionLocal<Int> = ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -97,6 +102,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ConflictingOnColor.md.html b/docs/checks/ConflictingOnColor.md.html index 9ba619ac..31c719ee 100644 --- a/docs/checks/ConflictingOnColor.md.html +++ b/docs/checks/ConflictingOnColor.md.html @@ -20,6 +20,13 @@ : androidx.compose.material Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.material:material](androidx_compose_material_material.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -126,8 +133,6 @@ yellow500, --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -201,6 +206,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material:material:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.material:material:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.material) + +# libs.versions.toml +[versions] +material = "1.5.0-beta02" +[libraries] +material = { + module = "androidx.compose.material:material", + version.ref = "material" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.material:material](androidx_compose_material_material.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ConstantLocale.md.html b/docs/checks/ConstantLocale.md.html index 514c7b6c..e03ee79b 100644 --- a/docs/checks/ConstantLocale.md.html +++ b/docs/checks/ConstantLocale.md.html @@ -43,8 +43,6 @@ static final Locale errorLocale = Locale.getDefault(); ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html b/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html new file mode 100644 index 00000000..d42901b0 --- /dev/null +++ b/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html @@ -0,0 +1,148 @@ + +(#) Flags tools:layout_editor xml properties. + +!!! WARNING: Flags tools:layout_editor xml properties. + This is a warning. + +Id +: `ConstraintLayoutToolsEditorAttribute` +Summary +: Flags tools:layout_editor xml properties. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetectorTest.kt) + +The tools:layout_editor xml properties are only used for previewing and +won't be used in your APK hence they're unnecessary and just add +overhead. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/layout.xml:3:Warning: Don't use tools:layout_editor_absoluteX +[ConstraintLayoutToolsEditorAttribute] + + tools:layout_editor_absoluteX="4dp"/> + ----------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/layout.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView + xmlns:tools="http://schemas.android.com/tools" + tools:layout_editor_absoluteX="4dp"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetectorTest.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, `ConstraintLayoutToolsEditorAttributeDetector.toolsLayoutEditor`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="ConstraintLayoutToolsEditorAttribute"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ConstraintLayoutToolsEditorAttribute" severity="ignore" /> + </lint> + ``` + 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 'ConstraintLayoutToolsEditorAttribute' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ConstraintLayoutToolsEditorAttribute ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ContentDescription.md.html b/docs/checks/ContentDescription.md.html index 23e2c999..4d896cb8 100644 --- a/docs/checks/ContentDescription.md.html +++ b/docs/checks/ContentDescription.md.html @@ -38,8 +38,10 @@ Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have -accessibility content descriptions. In this case, just suppress the lint -warning with a tools:ignore="ContentDescription" attribute. +accessibility content descriptions. In this case, set their descriptions +to `@null`. If your app's minSdkVersion is 16 or higher, you can instead +set these graphical elements' `android:importantForAccessibility` +attributes to `no`. Note that for text fields, you should not set both the `hint` and the `contentDescription` attributes since the hint will never be shown. Just @@ -93,8 +95,6 @@ <ImageButton android:id="@+id/summary3" android:contentDescription="TODO" /> --------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CoroutineCreationDuringComposition.md.html b/docs/checks/CoroutineCreationDuringComposition.md.html index 88e0a8bd..3897df63 100644 --- a/docs/checks/CoroutineCreationDuringComposition.md.html +++ b/docs/checks/CoroutineCreationDuringComposition.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -210,8 +217,6 @@ flowOf(Unit).launchIn(CoroutineScope) -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -284,6 +289,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/CustomPermissionTypo.md.html b/docs/checks/CustomPermissionTypo.md.html index d5636257..712a21cc 100644 --- a/docs/checks/CustomPermissionTypo.md.html +++ b/docs/checks/CustomPermissionTypo.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/CustomPermissionTypo 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/PermissionErrorDetector.kt) Tests @@ -50,8 +52,6 @@ <activity android:permission="my.custom.permission.BAZQXX" /> ------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CustomSplashScreen.md.html b/docs/checks/CustomSplashScreen.md.html index 85d67831..475d0f3f 100644 --- a/docs/checks/CustomSplashScreen.md.html +++ b/docs/checks/CustomSplashScreen.md.html @@ -46,8 +46,6 @@ class SplashActivity : AppCompatActivity() { -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CustomViewStyleable.md.html b/docs/checks/CustomViewStyleable.md.html index bea0544e..7f926399 100644 --- a/docs/checks/CustomViewStyleable.md.html +++ b/docs/checks/CustomViewStyleable.md.html @@ -94,8 +94,6 @@ context.obtainStyledAttributes(R.styleable.MyDeclareStyleable); // Wrong ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CustomX509TrustManager.md.html b/docs/checks/CustomX509TrustManager.md.html index e608f541..7f7f219e 100644 --- a/docs/checks/CustomX509TrustManager.md.html +++ b/docs/checks/CustomX509TrustManager.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files and library bytecode Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/CustomX509TrustManager 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/X509TrustManagerDetector.java) Tests @@ -43,8 +45,6 @@ TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/CutPasteId.md.html b/docs/checks/CutPasteId.md.html index a3363d4a..ae9c5858 100644 --- a/docs/checks/CutPasteId.md.html +++ b/docs/checks/CutPasteId.md.html @@ -111,8 +111,6 @@ view2 = requireViewById(R.id.duplicated); -------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DalvikOverride.md.html b/docs/checks/DalvikOverride.md.html index 89b894ab..86090d07 100644 --- a/docs/checks/DalvikOverride.md.html +++ b/docs/checks/DalvikOverride.md.html @@ -53,8 +53,6 @@ void method() { // Flag this as an accidental override ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DataBindingWithoutKapt.md.html b/docs/checks/DataBindingWithoutKapt.md.html index c183baf9..7dc3dc30 100644 --- a/docs/checks/DataBindingWithoutKapt.md.html +++ b/docs/checks/DataBindingWithoutKapt.md.html @@ -44,8 +44,6 @@ enabled true ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DataExtractionRules.md.html b/docs/checks/DataExtractionRules.md.html index 1bb82c8e..7bcb0207 100644 --- a/docs/checks/DataExtractionRules.md.html +++ b/docs/checks/DataExtractionRules.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : https://developer.android.com/about/versions/12/backup-restore#xml-changes +See +: https://goo.gle/DataExtractionRules 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/ManifestDetector.kt) Tests @@ -57,8 +59,6 @@ android:allowBackup="true" > ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DeepLinkInActivityDestination.md.html b/docs/checks/DeepLinkInActivityDestination.md.html index 52a7158d..93d2244a 100644 --- a/docs/checks/DeepLinkInActivityDestination.md.html +++ b/docs/checks/DeepLinkInActivityDestination.md.html @@ -20,6 +20,13 @@ : androidx.navigation.runtime Feedback : https://issuetracker.google.com/issues/new?component=409828 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html) + Affects : Resource files Editing @@ -51,8 +58,6 @@ <deepLink app:uri="www.example.com" /> -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -89,6 +94,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=409828. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-runtime:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-runtime:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-runtime) + +# libs.versions.toml +[versions] +navigation-runtime = "2.7.0-beta01" +[libraries] +navigation-runtime = { + module = "androidx.navigation:navigation-runtime", + version.ref = "navigation-runtime" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/DefaultEncoding.md.html b/docs/checks/DefaultEncoding.md.html index 67b97b1e..723c2b16 100644 --- a/docs/checks/DefaultEncoding.md.html +++ b/docs/checks/DefaultEncoding.md.html @@ -122,8 +122,6 @@ new String(bytes); // ERROR 8 ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DefaultLayoutAttribute.md.html b/docs/checks/DefaultLayoutAttribute.md.html new file mode 100644 index 00000000..0747042b --- /dev/null +++ b/docs/checks/DefaultLayoutAttribute.md.html @@ -0,0 +1,149 @@ + +(#) Flags default layout values. + +!!! WARNING: Flags default layout values. + This is a warning. + +Id +: `DefaultLayoutAttribute` +Summary +: Flags default layout values. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetectorTest.kt) + +Flags default layout values that are not needed. One for instance is the +textStyle="normal" that can be just removed. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:5:Warning: This is the default and hence you don't +need to specify it [DefaultLayoutAttribute] + + android:textStyle="normal"/> + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textStyle="normal"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetectorTest.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, `DefaultLayoutAttributeDetector.textStyleNormal`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="DefaultLayoutAttribute"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DefaultLayoutAttribute" severity="ignore" /> + </lint> + ``` + 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 'DefaultLayoutAttribute' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DefaultLayoutAttribute ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DefaultLocale.md.html b/docs/checks/DefaultLocale.md.html index ce94e8d3..8c601092 100644 --- a/docs/checks/DefaultLocale.md.html +++ b/docs/checks/DefaultLocale.md.html @@ -122,8 +122,6 @@ String.format("WRONG: %1$tm %1$te,%1$tY", ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DeletedProvider.md.html b/docs/checks/DeletedProvider.md.html index e7307f2f..008934f3 100644 --- a/docs/checks/DeletedProvider.md.html +++ b/docs/checks/DeletedProvider.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html +See +: https://goo.gle/DeletedProvider 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/DeletedProviderDetector.kt) Tests @@ -47,8 +49,6 @@ SecureRandom instance2 = SecureRandom.getInstance("SHA1PRNG", "Crypto"); -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DenyListedApi.md.html b/docs/checks/DenyListedApi.md.html new file mode 100644 index 00000000..20435bf5 --- /dev/null +++ b/docs/checks/DenyListedApi.md.html @@ -0,0 +1,193 @@ + +(#) Deny-listed API + +!!! ERROR: Deny-listed API + This is an error. + +Id +: `DenyListedApi` +Summary +: Deny-listed API +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files, resource files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt) +Copyright Year +: 2022 + +This lint check flags usages of APIs in external libraries that we +prefer not to use. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/SomeView.kt:9:Error: Use Context#getDrawableCompat() instead +[DenyListedApi] + + ContextCompat.getDrawable(context, 42) + -------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/SomeView.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import android.content.Context +import android.graphics.drawable.Drawable +import androidx.core.content.ContextCompat + +class SomeView(context: Context) { + init { + ContextCompat.getDrawable(context, 42) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.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, `DenyListedApiDetector.flag function with params in deny list`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DenyListedApi") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DenyListedApi") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DenyListedApi + problematicStatement() + ``` + +* Adding the suppression attribute `tools:ignore="DenyListedApi"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <java.util.LinkedList xmlns:tools="http://schemas.android.com/tools" + tools:ignore="DenyListedApi" ...> + ... + </java.util.LinkedList> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DenyListedApi" severity="ignore" /> + </lint> + ``` + 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 'DenyListedApi' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DenyListedApi ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/Deprecated.md.html b/docs/checks/Deprecated.md.html index dc8368e2..75b250b5 100644 --- a/docs/checks/Deprecated.md.html +++ b/docs/checks/Deprecated.md.html @@ -104,8 +104,6 @@ <EditText android:editable="false" /> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -165,7 +163,7 @@ <?xml version="1.0" encoding="UTF-8"?> <manifest xmlns:tools="http://schemas.android.com/tools"> ... - <AbsoluteLayout editable="..." tools:ignore="Deprecated" .../> + <AbsoluteLayout sharedUserId="..." tools:ignore="Deprecated" .../> ... </manifest> ``` diff --git a/docs/checks/DeprecatedCall.md.html b/docs/checks/DeprecatedCall.md.html new file mode 100644 index 00000000..2e7091f8 --- /dev/null +++ b/docs/checks/DeprecatedCall.md.html @@ -0,0 +1,178 @@ + +(#) This class or method is deprecated; consider using an alternative. + +!!! WARNING: This class or method is deprecated; consider using an alternative. + This is a warning. + +Id +: `DeprecatedCall` +Summary +: This class or method is deprecated; consider using an alternative. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DeprecatedAnnotationDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DeprecatedAnnotationDetectorTest.kt) +Copyright Year +: 2021 + +Using deprecated classes is not advised; please consider using an +alternative. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/test/TestClass.java:8:Warning: This class or method is +deprecated; consider using an alternative. [DeprecatedCall] + + new ThisIsDeprecated(); + ---------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/test/TestClass.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package slack.test; + +import slack.test.ThisIsDeprecated; + +public class TestClass { + + public void doStuff() { + new ThisIsDeprecated(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DeprecatedAnnotationDetectorTest.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, `DeprecatedAnnotationDetector.deprecated class has a warning`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DeprecatedCall") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DeprecatedCall") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DeprecatedCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DeprecatedCall" severity="ignore" /> + </lint> + ``` + 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 'DeprecatedCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DeprecatedCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DeprecatedProvider.md.html b/docs/checks/DeprecatedProvider.md.html index 08e72c41..207a5a44 100644 --- a/docs/checks/DeprecatedProvider.md.html +++ b/docs/checks/DeprecatedProvider.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html +See +: https://goo.gle/DeprecatedProvider 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/CipherGetInstanceDetector.kt) Tests @@ -72,8 +74,6 @@ Cipher.getInstance("AES/CBC/PKCS7PADDING", Security.getProvider(BC_PROVIDER)); // Error --------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DeprecatedSinceApi.md.html b/docs/checks/DeprecatedSinceApi.md.html index 263e6b48..5dea317a 100644 --- a/docs/checks/DeprecatedSinceApi.md.html +++ b/docs/checks/DeprecatedSinceApi.md.html @@ -86,8 +86,6 @@ println(api::someMethod2) // WARN 7 ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DeprecatedSqlUsage.md.html b/docs/checks/DeprecatedSqlUsage.md.html new file mode 100644 index 00000000..15c5d175 --- /dev/null +++ b/docs/checks/DeprecatedSqlUsage.md.html @@ -0,0 +1,176 @@ + +(#) Use SqlDelight! + +!!! WARNING: Use SqlDelight! + This is a warning. + +Id +: `DeprecatedSqlUsage` +Summary +: Use SqlDelight! +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DeprecatedSqlUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DeprecatedSqlUsageDetectorTest.kt) +Copyright Year +: 2021 + +Safer, faster, etc. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/SqlUsageTestFailure.java:7:Warning: All SQL querying should be +performed using SqlDelight [DeprecatedSqlUsage] + + db.execSQL("DROP TABLE IF EXISTS foo"); + -------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/SqlUsageTestFailure.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import android.database.sqlite.SQLiteDatabase; + +public static class SqlUsageTestFailure { + public static void delete(SQLiteDatabase db) { + db.execSQL("DROP TABLE IF EXISTS foo"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DeprecatedSqlUsageDetectorTest.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, `DeprecatedSqlUsageDetector.testJavaInspection`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DeprecatedSqlUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DeprecatedSqlUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DeprecatedSqlUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DeprecatedSqlUsage" severity="ignore" /> + </lint> + ``` + 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 'DeprecatedSqlUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DeprecatedSqlUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DetachAndAttachSameFragment.md.html b/docs/checks/DetachAndAttachSameFragment.md.html index f4a75860..5996253b 100644 --- a/docs/checks/DetachAndAttachSameFragment.md.html +++ b/docs/checks/DetachAndAttachSameFragment.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing @@ -40,6 +47,36 @@ should separate the attach() and detach() calls into separate FragmentTransactions. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/DevModeObsolete.md.html b/docs/checks/DevModeObsolete.md.html index 9734659f..89268ca5 100644 --- a/docs/checks/DevModeObsolete.md.html +++ b/docs/checks/DevModeObsolete.md.html @@ -61,8 +61,6 @@ minSdk 21 --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DeviceAdmin.md.html b/docs/checks/DeviceAdmin.md.html index 437a4d2c..a938041a 100644 --- a/docs/checks/DeviceAdmin.md.html +++ b/docs/checks/DeviceAdmin.md.html @@ -65,8 +65,6 @@ <meta-data android:name="android.app.device_admin" --------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DialogFragmentCallbacksDetector.md.html b/docs/checks/DialogFragmentCallbacksDetector.md.html index 7d806e44..fbef426e 100644 --- a/docs/checks/DialogFragmentCallbacksDetector.md.html +++ b/docs/checks/DialogFragmentCallbacksDetector.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing @@ -48,8 +55,6 @@ dialog.setOnCancelListener({ }); ------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -81,6 +86,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=460964. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/DiffUtilEquals.md.html b/docs/checks/DiffUtilEquals.md.html index 54816009..205e0f74 100644 --- a/docs/checks/DiffUtilEquals.md.html +++ b/docs/checks/DiffUtilEquals.md.html @@ -45,8 +45,6 @@ oldItem === newItem // ERROR --- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DisableBaselineAlignment.md.html b/docs/checks/DisableBaselineAlignment.md.html index f9e74772..a19b1cd9 100644 --- a/docs/checks/DisableBaselineAlignment.md.html +++ b/docs/checks/DisableBaselineAlignment.md.html @@ -46,8 +46,6 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DiscouragedApi.md.html b/docs/checks/DiscouragedApi.md.html index 6d930c36..68710b75 100644 --- a/docs/checks/DiscouragedApi.md.html +++ b/docs/checks/DiscouragedApi.md.html @@ -36,40 +36,66 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/MainActivity.kt:13:Warning: don't use this +src/test/pkg/Test1.java:9:Warning: Use of this function is discouraged. +It is more efficient to retrieve resources by identifier than by name. +See getValue(int id, TypedValue outValue, boolean resolveRefs). [DiscouragedApi] - findViewById<TextView>(R.id.text)?.text = getSomeString() - ------------- + Resources.getValue("name", testValue, false); + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: +`src/test/pkg/Test1.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; +import android.content.res.Resources; +import android.util.TypedValue; + +public class Test1 { + public void setValue() { + TypedValue testValue; + Resources.getValue("name", testValue, false); + Resources.getValue(0, testValue, false); + } +} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Here is the source file referenced above: +`src/android/content/res/Resources.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package android.content.res; -`src/test/pkg/MainActivity.kt`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -package test.pkg +import android.util.TypedValue; +import androidx.annotation.Discouraged; -import android.app.Activity -import android.os.Bundle -import android.widget.TextView -import androidx.annotation.Discouraged -import java.util.UUID +public class Resources { -class MainActivity : Activity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - findViewById(R.id.text)?.text = getSomeString() - } + @Discouraged(message="Use of this function is discouraged. It is more efficient " + + "to retrieve resources by identifier than by name.\n" + + "See `getValue(int id, TypedValue outValue, boolean " + + "resolveRefs)`.") + public int getValue(String name, TypedValue outValue, boolean resolveRefs) { } - companion object { - @Discouraged(message = "don't use this") - fun getSomeString(): String { - return UUID.randomUUID().toString() - } - } + public int getValue(int id, TypedValue outValue, boolean resolveRefs) { } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/androidx/annotation/Discouraged.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package androidx.annotation; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.SOURCE; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +// Stub annotation for unit test. +@Retention(SOURCE) +@Target({METHOD}) +public @interface Discouraged { + String message() default ""; } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -77,11 +103,6 @@ [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/DiscouragedDetectorTest.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, `DiscouragedDetector.test205800560`. -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: diff --git a/docs/checks/DiscouragedPrivateApi.md.html b/docs/checks/DiscouragedPrivateApi.md.html index 8705501f..34354ce7 100644 --- a/docs/checks/DiscouragedPrivateApi.md.html +++ b/docs/checks/DiscouragedPrivateApi.md.html @@ -65,8 +65,6 @@ Method m3 = AssetManager.class.getDeclaredMethod("addAssetPath", path.getClass()); --------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DoNotCallProviders.md.html b/docs/checks/DoNotCallProviders.md.html new file mode 100644 index 00000000..948d62aa --- /dev/null +++ b/docs/checks/DoNotCallProviders.md.html @@ -0,0 +1,232 @@ + +(#) Dagger provider methods should not be called directly by user code. + +!!! ERROR: Dagger provider methods should not be called directly by user code. + This is an error. + +Id +: `DoNotCallProviders` +Summary +: Dagger provider methods should not be called directly by user code. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DoNotCallProvidersDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DoNotCallProvidersDetectorTest.kt) +Copyright Year +: 2021 + +Dagger provider methods should not be called directly by user code. +These are intended solely for use by Dagger-generated code and it is +programmer error to call them from user code. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyModule.kt:15:Error: Dagger provider methods should not be +called directly by user code. [DoNotCallProviders] + + binds1("this is bad") + --------------------- + + +src/foo/MyModule.kt:16:Error: Dagger provider methods should not be +called directly by user code. [DoNotCallProviders] + + "this is bad".binds2() + --------------------- + + +src/foo/MyModule.kt:17:Error: Dagger provider methods should not be +called directly by user code. [DoNotCallProviders] + + provider() + ---------- + + +src/foo/MyModule.kt:18:Error: Dagger provider methods should not be +called directly by user code. [DoNotCallProviders] + + producer() + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyModule.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.producers.Produces +import javax.annotation.Generated + +@Module +abstract class MyModule { + + @Binds fun binds1(input: String): Comparable + @Binds fun String.binds2(): Comparable + + fun badCode() { + binds1("this is bad") + "this is bad".binds2() + provider() + producer() + } + + companion object { + @Provides + fun provider(): String { + return "" + } + @Produces + fun producer(): String { + return "" + } + } +} + +@Generated("Totes generated code") +abstract class GeneratedCode { + fun doStuff() { + moduleInstance().binds1("this is technically fine but would never happen in dagger") + MyModule.provider() + MyModule.producer() + } + + abstract fun moduleInstance(): MyModule +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DoNotCallProvidersDetectorTest.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, `DoNotCallProvidersDetector.kotlin`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotCallProviders") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotCallProviders") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotCallProviders + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotCallProviders" severity="ignore" /> + </lint> + ``` + 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 'DoNotCallProviders' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotCallProviders ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotExposeEitherNetInRepositories.md.html b/docs/checks/DoNotExposeEitherNetInRepositories.md.html new file mode 100644 index 00000000..6eccdbff --- /dev/null +++ b/docs/checks/DoNotExposeEitherNetInRepositories.md.html @@ -0,0 +1,181 @@ + +(#) Repository APIs should not expose EitherNet types directly. + +!!! ERROR: Repository APIs should not expose EitherNet types directly. + This is an error. + +Id +: `DoNotExposeEitherNetInRepositories` +Summary +: Repository APIs should not expose EitherNet types directly. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/eithernet/DoNotExposeEitherNetInRepositoriesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/eithernet/DoNotExposeEitherNetInRepositoriesDetectorTest.kt) +Copyright Year +: 2022 + +EitherNet (and networking in general) should be an implementation detail +of the repository layer. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/MyRepository.java:8:Error: Repository APIs should not expose +EitherNet types directly. [DoNotExposeEitherNetInRepositories] + + ApiResult<String, Exception> getResult(); + ---------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/MyRepository.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test; + +import com.slack.eithernet.ApiResult; + +interface MyRepository { + // Bad + + ApiResult getResult(); + + // Good + + String getString(); +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/eithernet/DoNotExposeEitherNetInRepositoriesDetectorTest.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, `DoNotExposeEitherNetInRepositoriesDetector.javaTests`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotExposeEitherNetInRepositories") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotExposeEitherNetInRepositories") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotExposeEitherNetInRepositories + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotExposeEitherNetInRepositories" severity="ignore" /> + </lint> + ``` + 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 'DoNotExposeEitherNetInRepositories' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotExposeEitherNetInRepositories ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMock.md.html b/docs/checks/DoNotMock.md.html new file mode 100644 index 00000000..6a6b8fed --- /dev/null +++ b/docs/checks/DoNotMock.md.html @@ -0,0 +1,212 @@ + +(#) + +!!! ERROR: + This is an error. + +Id +: `DoNotMock` +Summary +: +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +Do not mock classes annotated with `@DoNotMock`, as they are explicitly +asking not to be mocked in favor of better options (test fakes, etc). +These types should define explanations/alternatives in their +annotation. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +test/test/slack/test/TestClass.kt:6:Error: Do not mock TestClass: Use +fake() [DoNotMock] + + @Mock lateinit var mock1: TestClass + ----------------------------------- + + +test/test/slack/test/TestClass.kt:7:Error: Do not mock TestClass2: Use +fake() [DoNotMock] + + @Mock lateinit var mock2: TestClass2 + ------------------------------------ + + +test/test/slack/test/TestClass.kt:8:Error: Do not mock TestClass3: +BECAUSE REASONS [DoNotMock] + + @Mock lateinit var mock3: TestClass3 + ------------------------------------ + + +test/test/slack/test/TestClass.kt:9:Error: Do not mock TestClass4: +BECAUSE REASONS [DoNotMock] + + @Mock lateinit var mock4: TestClass4 + ------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`test/test/slack/test/TestClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.test + +@slack.lint.annotations.DoNotMock("Use fake()") +interface TestClass { + fun fake(): TestClass? = null +} + +@com.google.errorprone.annotations.DoNotMock("Use fake()") +interface TestClass2 { + fun fake(): TestClass2? = null +} + +@slack.lint.annotations.DoNotMock +interface TestClass3 { + fun fake(): TestClass3? = null +} + +@com.google.errorprone.annotations.DoNotMock +interface TestClass4 { + fun fake(): TestClass4? = null +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.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, `MockDetector.kotlinTests`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMock") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMock") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMock + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMock" severity="ignore" /> + </lint> + ``` + 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 'DoNotMock' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMock ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockAutoValue.md.html b/docs/checks/DoNotMockAutoValue.md.html new file mode 100644 index 00000000..e954d8c5 --- /dev/null +++ b/docs/checks/DoNotMockAutoValue.md.html @@ -0,0 +1,142 @@ + +(#) AutoValue classes represent pure data classes, so mocking them should not be necessary. + +!!! ERROR: AutoValue classes represent pure data classes, so mocking them should not be necessary. + This is an error. + +Id +: `DoNotMockAutoValue` +Summary +: AutoValue classes represent pure data classes, so mocking them should not be necessary. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +`AutoValue` classes represent pure data classes, so mocking them should +not be necessary. Construct a real instance of the class instead. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockAutoValue") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockAutoValue") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockAutoValue + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockAutoValue" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockAutoValue' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockAutoValue ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockDataClass.md.html b/docs/checks/DoNotMockDataClass.md.html new file mode 100644 index 00000000..e0be7bde --- /dev/null +++ b/docs/checks/DoNotMockDataClass.md.html @@ -0,0 +1,142 @@ + +(#) data classes represent pure data classes, so mocking them should not be necessary. + +!!! ERROR: data classes represent pure data classes, so mocking them should not be necessary. + This is an error. + +Id +: `DoNotMockDataClass` +Summary +: data classes represent pure data classes, so mocking them should not be necessary. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +data classes represent pure data classes, so mocking them should not be +necessary. Construct a real instance of the class instead. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockDataClass") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockDataClass") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockDataClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockDataClass" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockDataClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockDataClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockObjectClass.md.html b/docs/checks/DoNotMockObjectClass.md.html new file mode 100644 index 00000000..8d4e9aa8 --- /dev/null +++ b/docs/checks/DoNotMockObjectClass.md.html @@ -0,0 +1,142 @@ + +(#) object classes are singletons, so mocking them should not be necessary + +!!! ERROR: object classes are singletons, so mocking them should not be necessary + This is an error. + +Id +: `DoNotMockObjectClass` +Summary +: object classes are singletons, so mocking them should not be necessary +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +object classes are global singletons, so mocking them should not be +necessary. Use the object instance instead. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockObjectClass") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockObjectClass") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockObjectClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockObjectClass" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockObjectClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockObjectClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockRecordClass.md.html b/docs/checks/DoNotMockRecordClass.md.html new file mode 100644 index 00000000..3a5a6fbb --- /dev/null +++ b/docs/checks/DoNotMockRecordClass.md.html @@ -0,0 +1,142 @@ + +(#) record classes represent pure data classes, so mocking them should not be necessary. + +!!! ERROR: record classes represent pure data classes, so mocking them should not be necessary. + This is an error. + +Id +: `DoNotMockRecordClass` +Summary +: record classes represent pure data classes, so mocking them should not be necessary. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +record classes represent pure data classes, so mocking them should not +be necessary. Construct a real instance of the class instead. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockRecordClass") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockRecordClass") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockRecordClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockRecordClass" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockRecordClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockRecordClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockSealedClass.md.html b/docs/checks/DoNotMockSealedClass.md.html new file mode 100644 index 00000000..4c74e8f0 --- /dev/null +++ b/docs/checks/DoNotMockSealedClass.md.html @@ -0,0 +1,143 @@ + +(#) sealed classes have a restricted type hierarchy, use a subtype instead + +!!! ERROR: sealed classes have a restricted type hierarchy, use a subtype instead + This is an error. + +Id +: `DoNotMockSealedClass` +Summary +: sealed classes have a restricted type hierarchy, use a subtype instead +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +sealed classes have a restricted type hierarchy, so creating new +unrestricted mocks will break runtime expectations. Use a subtype +instead. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockSealedClass") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockSealedClass") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockSealedClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockSealedClass" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockSealedClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockSealedClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DrawAllocation.md.html b/docs/checks/DrawAllocation.md.html index 64976977..0b75aab5 100644 --- a/docs/checks/DrawAllocation.md.html +++ b/docs/checks/DrawAllocation.md.html @@ -115,8 +115,6 @@ new String("foo"); ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateActivity.md.html b/docs/checks/DuplicateActivity.md.html index afa1f9ae..0285a6a3 100644 --- a/docs/checks/DuplicateActivity.md.html +++ b/docs/checks/DuplicateActivity.md.html @@ -45,8 +45,6 @@ <activity android:name="com.example.helloworld.HelloWorld" ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateDefinition.md.html b/docs/checks/DuplicateDefinition.md.html index 4f788dde..e2c34ef2 100644 --- a/docs/checks/DuplicateDefinition.md.html +++ b/docs/checks/DuplicateDefinition.md.html @@ -44,8 +44,6 @@ <string name="wallpaper_instructions">Tap image to set landscape wallpaper</string> ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateDivider.md.html b/docs/checks/DuplicateDivider.md.html index 401cc656..35a238d4 100644 --- a/docs/checks/DuplicateDivider.md.html +++ b/docs/checks/DuplicateDivider.md.html @@ -47,8 +47,6 @@ public abstract class DividerItemDecoration extends RecyclerView.ItemDecoration { --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateIds.md.html b/docs/checks/DuplicateIds.md.html index da242b91..a79803f5 100644 --- a/docs/checks/DuplicateIds.md.html +++ b/docs/checks/DuplicateIds.md.html @@ -43,8 +43,6 @@ <ImageButton android:id="@+id/android_logo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/android_button" android:focusable="false" android:clickable="false" android:layout_weight="1.0" /> ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateIncludedIds.md.html b/docs/checks/DuplicateIncludedIds.md.html index 79a4e6ae..4a70db42 100644 --- a/docs/checks/DuplicateIncludedIds.md.html +++ b/docs/checks/DuplicateIncludedIds.md.html @@ -45,8 +45,6 @@ <include ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateStrings.md.html b/docs/checks/DuplicateStrings.md.html index ad32f506..327bbc8e 100644 --- a/docs/checks/DuplicateStrings.md.html +++ b/docs/checks/DuplicateStrings.md.html @@ -59,8 +59,6 @@ <string name="hello_world">hello world</string> ----------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/DuplicateUsesFeature.md.html b/docs/checks/DuplicateUsesFeature.md.html index 4fd4edb0..3d3d64cc 100644 --- a/docs/checks/DuplicateUsesFeature.md.html +++ b/docs/checks/DuplicateUsesFeature.md.html @@ -40,8 +40,6 @@ <uses-feature android:name="android.hardware.camera"/> -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EasterEgg.md.html b/docs/checks/EasterEgg.md.html index fb0eb952..18553892 100644 --- a/docs/checks/EasterEgg.md.html +++ b/docs/checks/EasterEgg.md.html @@ -53,8 +53,6 @@ /* \u002A\U002F static { System.out.println("I'm executed on class load"); } \u002f\u002a */ ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EditedTargetSdkVersion.md.html b/docs/checks/EditedTargetSdkVersion.md.html new file mode 100644 index 00000000..f44145b3 --- /dev/null +++ b/docs/checks/EditedTargetSdkVersion.md.html @@ -0,0 +1,101 @@ + +(#) Manually Edited TargetSdkVersion + +!!! ERROR: Manually Edited TargetSdkVersion + This is an error. + +Id +: `EditedTargetSdkVersion` +Summary +: Manually Edited TargetSdkVersion +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Gradle build 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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +Updating the `targetSdkVersion` of an app is seemingly easy: just +increment the `targetSdkVersion` number in the manifest file! + +But that's not actually safe. The `targetSdkVersion` controls a wide +range of behaviors that change from release to release, and to update, +you should carefully consult the documentation to see what has changed, +how your app may need to adjust, and then of course, carefully test +everything. + +In new versions of Android Studio, there is a special migration +assistant, available from the tools menu (and as a quickfix from this +lint warning) which analyzes your specific app and filters the set of +applicable migration steps to those needed for your app. + +This lint check does something very simple: it just detects whether it +looks like you've manually edited the targetSdkVersion field in a +build.gradle file. Obviously, as part of doing the above careful steps, +you may end up editing the value, which would trigger the check -- and +it's safe to ignore it; this lint check *only* runs in the IDE, not from +the command line; it's sole purpose to bring *awareness* to the (many) +developers who haven't been aware of this issue and have just bumped the +targetSdkVersion, recompiled, and uploaded their updated app to the +Google Play Store, sometimes leading to crashes or other problems on +newer devices. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection EditedTargetSdkVersion + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="EditedTargetSdkVersion" severity="ignore" /> + </lint> + ``` + 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 'EditedTargetSdkVersion' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore EditedTargetSdkVersion ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/EllipsizeMaxLines.md.html b/docs/checks/EllipsizeMaxLines.md.html index 2884fff4..b93ec784 100644 --- a/docs/checks/EllipsizeMaxLines.md.html +++ b/docs/checks/EllipsizeMaxLines.md.html @@ -55,8 +55,6 @@ android:maxLines="1" -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EmptyNavDeepLink.md.html b/docs/checks/EmptyNavDeepLink.md.html index 58735ef8..9f8620e2 100644 --- a/docs/checks/EmptyNavDeepLink.md.html +++ b/docs/checks/EmptyNavDeepLink.md.html @@ -20,6 +20,13 @@ : androidx.navigation.common Feedback : https://issuetracker.google.com/issues/new?component=409828 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.navigation:navigation-common](androidx_navigation_navigation-common.md.html) + Affects : Kotlin and Java files Editing @@ -44,8 +51,6 @@ navDeepLink { } ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -70,6 +75,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=409828. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-common:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-common:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-common) + +# libs.versions.toml +[versions] +navigation-common = "2.7.0-beta01" +[libraries] +navigation-common = { + module = "androidx.navigation:navigation-common", + version.ref = "navigation-common" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.navigation:navigation-common](androidx_navigation_navigation-common.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/EmptySuperCall.md.html b/docs/checks/EmptySuperCall.md.html index 1ae0eae1..49d2a02c 100644 --- a/docs/checks/EmptySuperCall.md.html +++ b/docs/checks/EmptySuperCall.md.html @@ -43,8 +43,6 @@ super.someOtherMethod(arg) // ERROR --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EnforceUTF8.md.html b/docs/checks/EnforceUTF8.md.html index da8aa96a..28a14a3d 100644 --- a/docs/checks/EnforceUTF8.md.html +++ b/docs/checks/EnforceUTF8.md.html @@ -52,8 +52,6 @@ <?xml version="1.0" encoding="iso-latin-1"?> ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EnqueueWork.md.html b/docs/checks/EnqueueWork.md.html index 3e5028ac..54b0bd5e 100644 --- a/docs/checks/EnqueueWork.md.html +++ b/docs/checks/EnqueueWork.md.html @@ -70,8 +70,6 @@ WorkContinuation cont4 = WorkContinuation.combine(workRequest6, cont2, cont3); // ERROR ---------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/EnsureInitializerMetadata.md.html b/docs/checks/EnsureInitializerMetadata.md.html index 0fce01c9..47efdd52 100644 --- a/docs/checks/EnsureInitializerMetadata.md.html +++ b/docs/checks/EnsureInitializerMetadata.md.html @@ -22,18 +22,57 @@ : androidx.startup Feedback : https://issuetracker.google.com/issues/new?component=823348 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html) + Affects : Kotlin and Java files and manifest files Editing : This check can *not* run live in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/EnsureInitializerMetadataDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/test/java/androidx/startup/lint/EnsureInitializerMetadataTest.kt) Copyright Year : 2020 When a library defines a Initializer, it needs to be accompanied by a corresponding entry in the AndroidManifest.xml file. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.startup:startup-runtime:1.2.0-alpha02") + +// build.gradle +implementation 'androidx.startup:startup-runtime:1.2.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.startup-runtime) + +# libs.versions.toml +[versions] +startup-runtime = "1.2.0-alpha02" +[libraries] +startup-runtime = { + module = "androidx.startup:startup-runtime", + version.ref = "startup-runtime" +} +``` + +1.2.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/EnsureInitializerNoArgConstr.md.html b/docs/checks/EnsureInitializerNoArgConstr.md.html index 6c6c6f80..36b429cb 100644 --- a/docs/checks/EnsureInitializerNoArgConstr.md.html +++ b/docs/checks/EnsureInitializerNoArgConstr.md.html @@ -22,17 +22,56 @@ : androidx.startup Feedback : https://issuetracker.google.com/issues/new?component=823348 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/InitializerConstructorDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/test/java/androidx/startup/lint/InitializerConstructorTest.kt) Copyright Year : 2020 Every `Initializer` must have a no argument constructor. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.startup:startup-runtime:1.2.0-alpha02") + +// build.gradle +implementation 'androidx.startup:startup-runtime:1.2.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.startup-runtime) + +# libs.versions.toml +[versions] +startup-runtime = "1.2.0-alpha02" +[libraries] +startup-runtime = { + module = "androidx.startup:startup-runtime", + version.ref = "startup-runtime" +} +``` + +1.2.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ErroneousLayoutAttribute.md.html b/docs/checks/ErroneousLayoutAttribute.md.html new file mode 100644 index 00000000..325db458 --- /dev/null +++ b/docs/checks/ErroneousLayoutAttribute.md.html @@ -0,0 +1,149 @@ + +(#) Layout attribute that's not applicable to a particular view. + +!!! WARNING: Layout attribute that's not applicable to a particular view. + This is a warning. + +Id +: `ErroneousLayoutAttribute` +Summary +: Layout attribute that's not applicable to a particular view. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetectorTest.kt) + +Flags if a layout attribute is not applicable to a particular view. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:5:Warning: Attribute is erroneous on FrameLayout +[ErroneousLayoutAttribute] + + android:orientation="horizontal" + -------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal" + /> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetectorTest.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, `ErroneousLayoutAttributeDetector.erroneousFrameLayoutOrientation`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="ErroneousLayoutAttribute"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ErroneousLayoutAttribute" severity="ignore" /> + </lint> + ``` + 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 'ErroneousLayoutAttribute' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ErroneousLayoutAttribute ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ErrorProneDoNotMockUsage.md.html b/docs/checks/ErrorProneDoNotMockUsage.md.html new file mode 100644 index 00000000..a9fae114 --- /dev/null +++ b/docs/checks/ErrorProneDoNotMockUsage.md.html @@ -0,0 +1,202 @@ + +(#) Use Slack's internal `@DoNotMock` annotation. + +!!! ERROR: Use Slack's internal `@DoNotMock` annotation. + This is an error. + +Id +: `ErrorProneDoNotMockUsage` +Summary +: Use Slack's internal `@DoNotMock` annotation. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/ErrorProneDoNotMockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockUsageDetectorTest.kt) +Copyright Year +: 2021 + +While error-prone has a `@DoNotMock` annotation, prefer to use Slack's +internal one as it's not specific to error-prone and won't go away in a +Java-less world. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/test/TestClass.kt:10:Error: Use Slack's internal @DoNotMock +annotation. [ErrorProneDoNotMockUsage] + +@com.google.errorprone.annotations.DoNotMock("Use fake()") +---------------------------------------------------------- + + +src/slack/test/TestClass.kt:20:Error: Use Slack's internal @DoNotMock +annotation. [ErrorProneDoNotMockUsage] + +@DoNotMock +---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/test/TestClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.test + +import com.google.errorprone.annotations.DoNotMock + +@slack.lint.annotations.DoNotMock("Use fake()") +interface TestClass { + fun fake(): TestClass? = null +} + +@com.google.errorprone.annotations.DoNotMock("Use fake()") +interface TestClass2 { + fun fake(): TestClass2? = null +} + +@slack.lint.annotations.DoNotMock +interface TestClass3 { + fun fake(): TestClass3? = null +} + +@DoNotMock +interface TestClass4 { + fun fake(): TestClass4? = null +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockUsageDetectorTest.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, `ErrorProneDoNotMockDetector.kotlinTests`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ErrorProneDoNotMockUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ErrorProneDoNotMockUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ErrorProneDoNotMockUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ErrorProneDoNotMockUsage" severity="ignore" /> + </lint> + ``` + 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 'ErrorProneDoNotMockUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ErrorProneDoNotMockUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ExactAlarm.md.html b/docs/checks/ExactAlarm.md.html new file mode 100644 index 00000000..73d09974 --- /dev/null +++ b/docs/checks/ExactAlarm.md.html @@ -0,0 +1,149 @@ + +(#) Invalid Usage of Exact Alarms + +!!! ERROR: Invalid Usage of Exact Alarms + This is an error. + +Id +: `ExactAlarm` +Summary +: Invalid Usage of Exact Alarms +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/training/scheduling/alarms +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/AlarmDetector.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/AlarmDetectorTest.kt) +Copyright Year +: 2015 + +The `USE_EXACT_ALARM` permission is only available when targeting API +level 33 and above. Also, note that this permission is only permitted +for apps whose core functionality requires precisely-timed actions for +user facing features. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:2:Error: USE_EXACT_ALARM can only be used when +targeting API level 33 or higher [ExactAlarm] + + <uses-permission android:name="android.permission.USE_EXACT_ALARM" /> + ---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android"> + <uses-permission android:name="android.permission.USE_EXACT_ALARM" /> + <uses-sdk android:targetSdkVersion="32" /> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/AlarmDetectorTest.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, `AlarmDetector.testExactAlarmPermissions`. +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="ExactAlarm"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <uses-permission tools:ignore="ExactAlarm" .../> + ... + </manifest> + ``` + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ExactAlarm") + fun method() { + setRepeating(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ExactAlarm") + void method() { + setRepeating(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ExactAlarm + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ExactAlarm" severity="ignore" /> + </lint> + ``` + 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 'ExactAlarm' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ExactAlarm ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ExifInterface.md.html b/docs/checks/ExifInterface.md.html index 7c4e391f..657dfe43 100644 --- a/docs/checks/ExifInterface.md.html +++ b/docs/checks/ExifInterface.md.html @@ -59,8 +59,6 @@ new android.media.ExifInterface(path); --------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExpensiveAssertion.md.html b/docs/checks/ExpensiveAssertion.md.html index a519bbf2..aed6d663 100644 --- a/docs/checks/ExpensiveAssertion.md.html +++ b/docs/checks/ExpensiveAssertion.md.html @@ -83,8 +83,6 @@ assert(expensive()) // WARN ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExperimentalAnnotationRetention.md.html b/docs/checks/ExperimentalAnnotationRetention.md.html index 393fc52d..1f07a618 100644 --- a/docs/checks/ExperimentalAnnotationRetention.md.html +++ b/docs/checks/ExperimentalAnnotationRetention.md.html @@ -20,6 +20,13 @@ : androidx.annotation.experimental Feedback : https://issuetracker.google.com/issues/new?component=459778 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) + Affects : Kotlin and Java files Editing @@ -35,6 +42,36 @@ (`CLASS`) retention, while Kotlin-sourced annotations should use `BINARY` retention. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") + +// build.gradle +implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' + +// build.gradle.kts with version catalogs: +implementation(libs.annotation-experimental) + +# libs.versions.toml +[versions] +annotation-experimental = "1.4.0-dev01" +[libraries] +annotation-experimental = { + module = "androidx.annotation:annotation-experimental", + version.ref = "annotation-experimental" +} +``` + +1.4.0-dev01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ExpiredTargetSdkVersion.md.html b/docs/checks/ExpiredTargetSdkVersion.md.html index e8eae0b0..9454f2bc 100644 --- a/docs/checks/ExpiredTargetSdkVersion.md.html +++ b/docs/checks/ExpiredTargetSdkVersion.md.html @@ -35,9 +35,6 @@ Copyright Year : 2014 -As of the second half of 2018, Google Play requires that new apps and -app updates target API level 26 or higher. - Configuring your app to target a recent API level ensures that users benefit from significant security and performance improvements, while still allowing your app to run on older Android versions (down to the @@ -50,6 +47,49 @@ !!! Tip This lint check has an associated quickfix available in the IDE. +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:5:Error: Google Play requires that apps target API level +or higher. + [ExpiredTargetSdkVersion] + + targetSdkVersion 17 + ------------------- + + +build.gradle:6:Error: Google Play requires that apps target API level +or higher. + [ExpiredTargetSdkVersion] + + targetSdk 17 + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +apply plugin: 'com.android.application' + +android { + defaultConfig { + targetSdkVersion 17 + targetSdk 17 + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testExpiring1`. +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: diff --git a/docs/checks/ExpiringTargetSdkVersion.md.html b/docs/checks/ExpiringTargetSdkVersion.md.html index b8cfde11..ed7c0e04 100644 --- a/docs/checks/ExpiringTargetSdkVersion.md.html +++ b/docs/checks/ExpiringTargetSdkVersion.md.html @@ -33,20 +33,11 @@ Copyright Year : 2014 -In the second half of 2018, Google Play will require that new apps and -app updates target API level 26 or higher. This will be required for new -apps in August 2018, and for updates to existing apps in November 2018. - Configuring your app to target a recent API level ensures that users benefit from significant security and performance improvements, while still allowing your app to run on older Android versions (down to the `minSdkVersion`). -This lint check starts warning you some months **before** these changes -go into effect if your `targetSdkVersion` is 25 or lower. This is -intended to give you a heads up to update your app, since depending on -your current `targetSdkVersion` the work can be nontrivial. - To update your `targetSdkVersion`, follow the steps from "Meeting Google Play requirements for target API level", https://developer.android.com/distribute/best-practices/develop/target-sdk.html. @@ -59,13 +50,11 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text build.gradle:6:Error: Google Play will soon require that apps target API -level or higher. This will be required for new apps in August , and for -updates to existing apps in November . [ExpiringTargetSdkVersion] +level or higher. This will be required for new apps and updates +starting on August 31, . [ExpiringTargetSdkVersion] targetSdkVersion ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -77,9 +66,9 @@ android { defaultConfig { // Already meeting last year's requirement but not this year's requirement - targetSdkVersion + targetSdkVersion + targetSdkVersion // OK targetSdkVersion // OK - // OK } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/ExportedContentProvider.md.html b/docs/checks/ExportedContentProvider.md.html index 1aba0209..e2f5bd25 100644 --- a/docs/checks/ExportedContentProvider.md.html +++ b/docs/checks/ExportedContentProvider.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/ExportedContentProvider 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/SecurityDetector.java) Tests @@ -54,8 +56,6 @@ <provider -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExportedPreferenceActivity.md.html b/docs/checks/ExportedPreferenceActivity.md.html index 38f3044f..88e86d8b 100644 --- a/docs/checks/ExportedPreferenceActivity.md.html +++ b/docs/checks/ExportedPreferenceActivity.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : http://securityintelligence.com/new-vulnerability-android-framework-fragment-injection +See +: https://goo.gle/ExportedPreferenceActivity 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/PreferenceActivityDetector.kt) Tests @@ -44,8 +46,6 @@ <activity ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExportedReceiver.md.html b/docs/checks/ExportedReceiver.md.html index a13b8848..96f4afdd 100644 --- a/docs/checks/ExportedReceiver.md.html +++ b/docs/checks/ExportedReceiver.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/ExportedReceiver 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/SecurityDetector.java) Tests @@ -47,8 +49,6 @@ <receiver -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExportedService.md.html b/docs/checks/ExportedService.md.html index e73476ac..025550e1 100644 --- a/docs/checks/ExportedService.md.html +++ b/docs/checks/ExportedService.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/ExportedService 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/SecurityDetector.java) Tests @@ -46,8 +48,6 @@ <service ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ExtraText.md.html b/docs/checks/ExtraText.md.html index 15087222..6371609e 100644 --- a/docs/checks/ExtraText.md.html +++ b/docs/checks/ExtraText.md.html @@ -51,8 +51,6 @@ <shape>> - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/ExtraTranslation.md.html b/docs/checks/ExtraTranslation.md.html index c2c3899a..ff035a8c 100644 --- a/docs/checks/ExtraTranslation.md.html +++ b/docs/checks/ExtraTranslation.md.html @@ -53,8 +53,6 @@ <string name="continue_skip_label">"Weiter"</string> -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html new file mode 100644 index 00000000..da6493ad --- /dev/null +++ b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html @@ -0,0 +1,275 @@ + +(#) Redundant 'field:' used for Dagger qualifier annotation. + +!!! WARNING: Redundant 'field:' used for Dagger qualifier annotation. + This is a warning. + +Id +: `FieldSiteTargetOnQualifierAnnotation` +Summary +: Redundant 'field:' used for Dagger qualifier annotation. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Google +Identifier +: com.google.dagger:dagger-lint +Contact +: https://github.com/google/dagger +Feedback +: https://github.com/google/dagger/issues +Min +: Lint 7.1 +Compiled +: Lint 7.1 +Artifact +: [com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/google/dagger/tree/master/java/dagger/lint/DaggerKotlinIssueDetector.kt) +Tests +: [Source Code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.kt) +Copyright Year +: 2020 + +It's redundant to use 'field:' site-targets for qualifier annotations. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:14:Warning: Redundant 'field:' used for Dagger +qualifier annotation. [FieldSiteTargetOnQualifierAnnotation] + + @field:MyQualifier + ------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Inject +import javax.inject.Qualifier +import kotlin.jvm.JvmStatic +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +class InjectedTest { + // This should fail because of `:field` + @Inject + @field:MyQualifier + lateinit var prop: String + + // This is fine! + @Inject + @MyQualifier + lateinit var prop2: String +} + +@Module +object ObjectModule { + // This should fail because it uses `@JvmStatic` + @JvmStatic + @Provides + fun provideFoo(): String { + + } + + // This is fine! + @Provides + fun provideBar(): String { + + } +} + +@Module +class ClassModule { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + @JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModuleQualified { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + // This specifically tests a fully qualified annotation + @kotlin.jvm.JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2 { + // This should fail because the companion object is part of ClassModule + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2Qualified { + // This should fail because the companion object is part of ClassModule + // This specifically tests a fully qualified annotation + @dagger.Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +// This is correct as of Dagger 2.26! +@Module +class ClassModule3 { + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +class ClassModule4 { + // This is should fail because this should be extracted to a standalone object. + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.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, `DaggerKotlinIssueDetector.simpleSmokeTestForQualifiersAndProviders`. +To report a problem with this extracted sample, visit +https://github.com/google/dagger/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("com.google.dagger:dagger-lint:2.46.1") + +// build.gradle +implementation 'com.google.dagger:dagger-lint:2.46.1' + +// build.gradle.kts with version catalogs: +implementation(libs.dagger-lint) + +# libs.versions.toml +[versions] +dagger-lint = "2.46.1" +[libraries] +dagger-lint = { + module = "com.google.dagger:dagger-lint", + version.ref = "dagger-lint" +} +``` + +2.46.1 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). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("FieldSiteTargetOnQualifierAnnotation") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("FieldSiteTargetOnQualifierAnnotation") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection FieldSiteTargetOnQualifierAnnotation + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FieldSiteTargetOnQualifierAnnotation" severity="ignore" /> + </lint> + ``` + 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 'FieldSiteTargetOnQualifierAnnotation' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FieldSiteTargetOnQualifierAnnotation ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FileEndsWithExt.md.html b/docs/checks/FileEndsWithExt.md.html index bf7dd952..1ac89eff 100644 --- a/docs/checks/FileEndsWithExt.md.html +++ b/docs/checks/FileEndsWithExt.md.html @@ -58,8 +58,6 @@ fun isWebp(path: File) = path.extension.startsWith(".webp") ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/FindViewByIdCast.md.html b/docs/checks/FindViewByIdCast.md.html index b22a0f84..efbb154a 100644 --- a/docs/checks/FindViewByIdCast.md.html +++ b/docs/checks/FindViewByIdCast.md.html @@ -52,8 +52,6 @@ checkNotNull1(findViewById(R.id.textView)).setAlpha(0.5f); // WARN --------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/FlowOperatorInvokedInComposition.md.html b/docs/checks/FlowOperatorInvokedInComposition.md.html index 7dfb3042..591b38d1 100644 --- a/docs/checks/FlowOperatorInvokedInComposition.md.html +++ b/docs/checks/FlowOperatorInvokedInComposition.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -199,8 +206,6 @@ .drop(0) ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -283,6 +288,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FontValidation.md.html b/docs/checks/FontValidation.md.html index c010997b..72ac5496 100644 --- a/docs/checks/FontValidation.md.html +++ b/docs/checks/FontValidation.md.html @@ -49,8 +49,6 @@ <font ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ForegroundServicePermission.md.html b/docs/checks/ForegroundServicePermission.md.html new file mode 100644 index 00000000..67abee9e --- /dev/null +++ b/docs/checks/ForegroundServicePermission.md.html @@ -0,0 +1,204 @@ + +(#) Missing permissions required by foregroundServiceType + +!!! ERROR: Missing permissions required by foregroundServiceType + This is an error. + +Id +: `ForegroundServicePermission` +Summary +: Missing permissions required by foregroundServiceType +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest 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/ForegroundServicePermissionDetector.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/ForegroundServicePermissionDetectorTest.kt) +Copyright Year +: 2023 + +For targetSdkVersion >= 34, each `foregroundServiceType` listed in the +`` element requires specific sets of permissions to be declared +in the manifest. If permissions are missing, then when the foreground +service is started with a `foregroundServiceType` that has missing +permissions, a `SecurityException` will be thrown. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:13:Error: foregroundServiceType:camera requires +permission:[android.permission.FOREGROUND_SERVICE_CAMERA] AND any +permission in list:[android.permission.CAMERA, +android.permission.SYSTEM_CAMERA] [ForegroundServicePermission] + + <service + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="foo.bar2" + android:versionCode="1" + android:versionName="1.0" > + + <uses-sdk android:targetSdkVersion="34" /> + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> + + <application + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" > + <service + android:exported="true" + android:label="@string/app_name" + android:name="com.sample.service.serviceClass" + android:foregroundServiceType="camera" + android:process=":remote" > + <intent-filter > + <action android:name="com.sample.service.serviceClass" > + </action> + </intent-filter> + </service> + </application> + +</manifest> + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`res/values/strings.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2007 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<resources> + <!-- Home --> + <string name="home_title">Home Sample</string> + <string name="show_all_apps">All</string> + + <!-- Home Menus --> + <string name="menu_wallpaper">Wallpaper</string> + <string name="menu_search">Search</string> + <string name="menu_settings">Settings</string> + <string name="sample" translatable="false">Ignore Me</string> + + <!-- Wallpaper --> + <string name="wallpaper_instructions">Tap picture to set portrait wallpaper</string> +</resources> + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/ForegroundServicePermissionDetectorTest.kt) +for the unit tests for this check to see additional scenarios. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="ForegroundServicePermission"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <service tools:ignore="ForegroundServicePermission" .../> + ... + </manifest> + ``` + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ForegroundServicePermission") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ForegroundServicePermission") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ForegroundServicePermission + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ForegroundServicePermission" severity="ignore" /> + </lint> + ``` + 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 'ForegroundServicePermission' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ForegroundServicePermission ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ForegroundServiceType.md.html b/docs/checks/ForegroundServiceType.md.html new file mode 100644 index 00000000..90a0fef8 --- /dev/null +++ b/docs/checks/ForegroundServiceType.md.html @@ -0,0 +1,162 @@ + +(#) Missing `foregroundServiceType` attribute in manifest + +!!! ERROR: Missing `foregroundServiceType` attribute in manifest + This is an error. + +Id +: `ForegroundServiceType` +Summary +: Missing `foregroundServiceType` attribute in manifest +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest 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/ForegroundServiceTypesDetector.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/ForegroundServiceTypesDetectorTest.kt) +Copyright Year +: 2023 + +For `targetSdkVersion` >= 34, to call `Service.startForeground()`, the + element in the manifest file must have the +`foregroundServiceType` attribute specified. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/MyService.java:8:Error: To call Service.startForeground(), +the element of manifest file must have the +foregroundServiceType attribute specified [ForegroundServiceType] + + startForeground(1, null); + --------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="test.pkg"> + <uses-sdk android:targetSdkVersion="34" /> + <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> + <application> + <service + android:exported="true" + android:name="test.pkg.MyService"> + </service> + </application> +</manifest> + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/test/pkg/MyService.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +public class MyService extends Service { + @Override + public int onStartCommand(Intent intent, int flags, int startId) { + startForeground(1, null); + return START_NOT_STICKY; + } + @Override + public IBinder onBind(Intent intent) { + return null; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/ForegroundServiceTypesDetectorTest.kt) +for the unit tests for this check to see additional scenarios. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="ForegroundServiceType"` 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 suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ForegroundServiceType") + fun method() { + startForeground(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ForegroundServiceType") + void method() { + startForeground(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ForegroundServiceType + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ForegroundServiceType" severity="ignore" /> + </lint> + ``` + 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 'ForegroundServiceType' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ForegroundServiceType ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FormalGerman.md.html b/docs/checks/FormalGerman.md.html new file mode 100644 index 00000000..cb08baf0 --- /dev/null +++ b/docs/checks/FormalGerman.md.html @@ -0,0 +1,183 @@ + +(#) Marks strings which contain formal German words. + +!!! WARNING: Marks strings which contain formal German words. + This is a warning. + +Id +: `FormalGerman` +Summary +: Marks strings which contain formal German words. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/FormalGermanDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/FormalGermanDetectorTest.kt) + +Informal language should be used at all times. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/config.xml:2:Warning: Formal language "Ihr" detected +[FormalGerman] + + <string name="my_string_1">Wie lautet Ihr Name?</string> + ^ + + +res/values/config.xml:3:Warning: Formal language "Sie?" detected +[FormalGerman] + + <string name="my_string_2">Wie heissen Sie?</string> + ^ + + +res/values/config.xml:4:Warning: Formal language "Ihrem" detected +[FormalGerman] + + <string name="my_string_3">Frag nach Ihrem Namen.</string> + ^ + + +res/values/config.xml:5:Warning: Formal language "Sie" detected +[FormalGerman] + + <string name="my_string_4">Wie Sie möchten</string> + ^ + + +res/values/config.xml:6:Warning: Formal language "Ihre" detected +[FormalGerman] + + <string name="my_string_5">Ihre Historie</string> + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/values/config.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<resources> + <string name="my_string_1">Wie lautet Ihr Name?</string> + <string name="my_string_2">Wie heissen Sie?</string> + <string name="my_string_3">Frag nach Ihrem Namen.</string> + <string name="my_string_4">Wie Sie möchten</string> + <string name="my_string_5">Ihre Historie</string> +</resources> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/FormalGermanDetectorTest.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, `FormalGermanDetector.formal`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="FormalGerman"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <resources xmlns:tools="http://schemas.android.com/tools"> + ... + <string tools:ignore="FormalGerman" .../> + ... + </resources> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FormalGerman" severity="ignore" /> + </lint> + ``` + 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 'FormalGerman' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FormalGerman ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FragmentAddMenuProvider.md.html b/docs/checks/FragmentAddMenuProvider.md.html index f1194a07..db31f2ba 100644 --- a/docs/checks/FragmentAddMenuProvider.md.html +++ b/docs/checks/FragmentAddMenuProvider.md.html @@ -20,12 +20,21 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/test/java/androidx/fragment/lint/AddMenuProviderDetectorTest.kt) Copyright Year : 2019 @@ -38,6 +47,36 @@ lifecycle in a Fragment's onCreateView, onViewCreated, onActivityCreated, or onViewStateRestored methods. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FragmentBackPressedCallback.md.html b/docs/checks/FragmentBackPressedCallback.md.html index 1586fe45..fe96ae93 100644 --- a/docs/checks/FragmentBackPressedCallback.md.html +++ b/docs/checks/FragmentBackPressedCallback.md.html @@ -20,12 +20,21 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/test/java/androidx/fragment/lint/BackPressedDispatcherCallbackDetectorTest.kt) Copyright Year : 2019 @@ -38,6 +47,36 @@ lifecycle in a Fragment's onCreateView, onViewCreated, onActivityCreated, or onViewStateRestored methods. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FragmentConstructorInjection.md.html b/docs/checks/FragmentConstructorInjection.md.html new file mode 100644 index 00000000..5e162f4b --- /dev/null +++ b/docs/checks/FragmentConstructorInjection.md.html @@ -0,0 +1,229 @@ + +(#) Fragment dependencies should be injected using constructor injections only. + +!!! ERROR: Fragment dependencies should be injected using constructor injections only. + This is an error. + +Id +: `FragmentConstructorInjection` +Summary +: Fragment dependencies should be injected using constructor injections only. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/FragmentDaggerFieldInjectionDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/FragmentDaggerFieldInjectionDetectorTest.kt) +Copyright Year +: 2021 + +This Fragment has been set up to inject its dependencies through the +constructor. This dependency should be declared in the constructor where +dagger will handle the injection at runtime. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyFragment.kt:14:Error: Fragment dependencies should be injected +using constructor injections only. [FragmentConstructorInjection] + + @Inject + ^ + + +src/foo/MyFragment.kt:16:Error: Fragment dependencies should be injected +using constructor injections only. [FragmentConstructorInjection] + + @Inject + ^ + + +src/foo/MyFragment.kt:31:Error: Fragment dependencies should be injected +using constructor injections only. [FragmentConstructorInjection] + + @Inject + ^ + + +src/foo/MyFragment.kt:33:Error: Fragment dependencies should be injected +using constructor injections only. [FragmentConstructorInjection] + + @Inject + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyFragment.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import javax.inject.Inject +import dagger.assisted.AssistedInject +import slack.coreui.fragment.ViewBindingFragment + +class MyFragment @Inject constructor( + private val flag: Boolean +): ViewBindingFragment() { + + private lateinit var notAnnotated: String + private val defaulted: String = "defaulted" + + @Inject + private lateinit var stringValue1: String + @Inject + private lateinit var intValue1: Int + + fun onCreate() { + notAnnotated = "fast" + } +} + +class MyFragmentAssistedInject @AssistedInject constructor( + private val flag: Boolean +): ViewBindingFragment() { + + private lateinit var notAnnotated: String + private val defaulted: String = "defaulted" + + @Inject + private lateinit var stringValue1: String + @Inject + private lateinit var intValue1: Int + + fun onCreate() { + notAnnotated = "fast" + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/FragmentDaggerFieldInjectionDetectorTest.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, `FragmentDaggerFieldInjectionDetector.Kotlin - fragment has field injection errors when constructor injection exists`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("FragmentConstructorInjection") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("FragmentConstructorInjection") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection FragmentConstructorInjection + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FragmentConstructorInjection" severity="ignore" /> + </lint> + ``` + 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 'FragmentConstructorInjection' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FragmentConstructorInjection ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FragmentFieldInjection.md.html b/docs/checks/FragmentFieldInjection.md.html new file mode 100644 index 00000000..d1c24a1c --- /dev/null +++ b/docs/checks/FragmentFieldInjection.md.html @@ -0,0 +1,200 @@ + +(#) Fragment dependencies should be injected using the Fragment's constructor. + +!!! ERROR: Fragment dependencies should be injected using the Fragment's constructor. + This is an error. + +Id +: `FragmentFieldInjection` +Summary +: Fragment dependencies should be injected using the Fragment's constructor. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/FragmentDaggerFieldInjectionDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/FragmentDaggerFieldInjectionDetectorTest.kt) +Copyright Year +: 2021 + +This dependency should be injected by dagger via the constructor. Add +this field's type into the parameter list of the Fragment's constructor. +This constructor should be annotated with either `@AssistedInject` or +`@Inject`. Annotate with `@AssistedInject` if this Fragment requires +runtime arguments via a `Bundle`. Annotate with `@Inject` if this +Fragment does not require any runtime arguments. If this is an abstract +class, the constructor does not need to be annotated with `@Inject` or +`@AssistedInject`. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyFragment.kt:11:Error: Fragment dependencies should be injected +using the Fragment's constructor. [FragmentFieldInjection] + + @Inject + ^ + + +src/foo/MyFragment.kt:13:Error: Fragment dependencies should be injected +using the Fragment's constructor. [FragmentFieldInjection] + + @Inject + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyFragment.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import javax.inject.Inject +import slack.coreui.fragment.ViewBindingFragment + +class MyFragment : ViewBindingFragment() { + + private lateinit var notAnnotated: String + private val defaulted: String = "defaulted" + + @Inject + private lateinit var stringValue1: String + @Inject + private lateinit var intValue1: Int + + fun onCreate() { + notAnnotated = "fast" + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/FragmentDaggerFieldInjectionDetectorTest.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, `FragmentDaggerFieldInjectionDetector.Kotlin - fragment has field injection warnings`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("FragmentFieldInjection") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("FragmentFieldInjection") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection FragmentFieldInjection + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FragmentFieldInjection" severity="ignore" /> + </lint> + ``` + 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 'FragmentFieldInjection' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FragmentFieldInjection ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FragmentGradleConfiguration-2.md.html b/docs/checks/FragmentGradleConfiguration-2.md.html new file mode 100644 index 00000000..5f0a5b2e --- /dev/null +++ b/docs/checks/FragmentGradleConfiguration-2.md.html @@ -0,0 +1,151 @@ + +(#) Include the fragment-testing-manifest library using the debugImplementation configuration. + +!!! ERROR: Include the fragment-testing-manifest library using the debugImplementation configuration. + This is an error. + +Id +: `FragmentGradleConfiguration` +Summary +: Include the fragment-testing-manifest library using the debugImplementation configuration. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.fragment.testing.manifest +Feedback +: https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment-testing-manifest](androidx_fragment_fragment-testing-manifest.md.html) + +Affects +: Gradle build files +Editing +: This check runs on the fly in the IDE editor +See +: https://d.android.com/training/basics/fragments/testing#configure +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetectorTest.kt) +Copyright Year +: 2019 + +The fragment-testing-manifest library defines an EmptyActivity + used when using FragmentScenario. Howver, it only needs to be +present in testing configurations therefore use this +dependency with the debugImplementation configuration. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:2:Error: Replace with debugImplementation. +[FragmentGradleConfiguration] + + androidTestImplementation("androidx.fragment:fragment-testing-manifest:1.2.0-beta02") + ------------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + androidTestImplementation("androidx.fragment:fragment-testing-manifest:1.2.0-beta02") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetectorTest.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, `GradleConfigurationDetector.expectFail`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=460964. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment-testing-manifest) + +# libs.versions.toml +[versions] +fragment-testing-manifest = "1.7.0-alpha01" +[libraries] +fragment-testing-manifest = { + module = "androidx.fragment:fragment-testing-manifest", + version.ref = "fragment-testing-manifest" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment-testing-manifest](androidx_fragment_fragment-testing-manifest.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection FragmentGradleConfiguration + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FragmentGradleConfiguration" severity="ignore" /> + </lint> + ``` + 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 'FragmentGradleConfiguration' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FragmentGradleConfiguration ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/FragmentGradleConfiguration.md.html b/docs/checks/FragmentGradleConfiguration.md.html index 8f71b9c2..5398213f 100644 --- a/docs/checks/FragmentGradleConfiguration.md.html +++ b/docs/checks/FragmentGradleConfiguration.md.html @@ -20,6 +20,13 @@ : androidx.fragment.testing Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment-testing](androidx_fragment_fragment-testing.md.html) + Affects : Gradle build files Editing @@ -27,9 +34,9 @@ See : https://d.android.com/training/basics/fragments/testing#configure Implementation -: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-lint/src/main/java/androidx/fragment/testing/lint/GradleConfigurationDetector.kt) +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/main/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetector.kt) Tests -: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-lint/src/test/java/androidx/fragment/testing/lint/GradleConfigurationDetectorTest.kt) +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetectorTest.kt) Copyright Year : 2019 @@ -46,10 +53,8 @@ build.gradle:2:Error: Replace with debugImplementation. [FragmentGradleConfiguration] - androidTestImplementation("androidx.fragment:fragment-testing:1.2.0-beta02") - ---------------------------------------------------------------------------- - - + androidTestImplementation("androidx.fragment:fragment-testing-manifest:1.2.0-beta02") + ------------------------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -57,12 +62,12 @@ `build.gradle`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers dependencies { - androidTestImplementation("androidx.fragment:fragment-testing:1.2.0-beta02") + androidTestImplementation("androidx.fragment:fragment-testing-manifest:1.2.0-beta02") } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the -[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-lint/src/test/java/androidx/fragment/testing/lint/GradleConfigurationDetectorTest.kt) +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-testing-manifest-lint/src/test/java/androidx/fragment/testing/manifest/lint/GradleConfigurationDetectorTest.kt) for the unit tests for this check to see additional scenarios. The above example was automatically extracted from the first unit test @@ -70,6 +75,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=460964. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment-testing:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment-testing:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment-testing) + +# libs.versions.toml +[versions] +fragment-testing = "1.7.0-alpha01" +[libraries] +fragment-testing = { + module = "androidx.fragment:fragment-testing", + version.ref = "fragment-testing" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment-testing](androidx_fragment_fragment-testing.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FragmentLiveDataObserve.md.html b/docs/checks/FragmentLiveDataObserve.md.html index e7dea8b3..0a660947 100644 --- a/docs/checks/FragmentLiveDataObserve.md.html +++ b/docs/checks/FragmentLiveDataObserve.md.html @@ -20,12 +20,21 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/main/java/androidx/fragment/lint/UnsafeFragmentLifecycleObserverDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/fragment/fragment-lint/src/test/java/androidx/fragment/lint/FragmentLiveDataObserveDetectorTest.kt) Copyright Year : 2019 @@ -38,6 +47,36 @@ LiveData objects being observed longer than the Fragment's view is active. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FragmentTagUsage.md.html b/docs/checks/FragmentTagUsage.md.html index 45d7907a..d8e1ba0e 100644 --- a/docs/checks/FragmentTagUsage.md.html +++ b/docs/checks/FragmentTagUsage.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Resource files Editing @@ -50,8 +57,6 @@ <fragment android:name="androidx.fragment.app.Test'$'InflatedFragment" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -77,6 +82,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=460964. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FrequentlyChangedStateReadInComposition.md.html b/docs/checks/FrequentlyChangedStateReadInComposition.md.html index 24ab046c..c826337b 100644 --- a/docs/checks/FrequentlyChangedStateReadInComposition.md.html +++ b/docs/checks/FrequentlyChangedStateReadInComposition.md.html @@ -20,6 +20,13 @@ : androidx.compose.foundation Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -91,8 +98,6 @@ val layoutInfo = state.layoutInfo ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -129,6 +134,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation) + +# libs.versions.toml +[versions] +foundation = "1.5.0-beta02" +[libraries] +foundation = { + module = "androidx.compose.foundation:foundation", + version.ref = "foundation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FullBackupContent.md.html b/docs/checks/FullBackupContent.md.html index 3aff7b5f..3af55f1a 100644 --- a/docs/checks/FullBackupContent.md.html +++ b/docs/checks/FullBackupContent.md.html @@ -52,8 +52,6 @@ <exclude domain="sharedpref" path="foo.xml"/> ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/FullyQualifiedResource.md.html b/docs/checks/FullyQualifiedResource.md.html new file mode 100644 index 00000000..6ea37eac --- /dev/null +++ b/docs/checks/FullyQualifiedResource.md.html @@ -0,0 +1,203 @@ + +(#) Resources should use an import alias instead of being fully qualified. + +!!! ERROR: Resources should use an import alias instead of being fully qualified. + This is an error. + +Id +: `FullyQualifiedResource` +Summary +: Resources should use an import alias instead of being fully qualified. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/resources/FullyQualifiedResourceDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/FullyQualifiedResourceDetectorTest.kt) +Copyright Year +: 2022 + +Resources should use an import alias instead of being fully qualified. +For example: +import slack.l10n.R as L10nR +... +...getString(L10nR.string.app_name) + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Options + +You can configure this lint checks using the following options: + +(###) import-aliases + +A comma-separated list of package name and their import aliases.. +This property should define a comma-separated list of package name and their import aliases in the format: packageName as importAlias + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="FullyQualifiedResource"> + <option name="import-aliases" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/pkg/subpackage/MyClass.kt:6:Error: Use L10nR as an import +alias instead [FullyQualifiedResource] + + val appName = getString(slack.l10n.R.string.app_name) + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/pkg/subpackage/MyClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.pkg.subpackage + +class MyClass { + + init { + val appName = getString(slack.l10n.R.string.app_name) + } + + } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/FullyQualifiedResourceDetectorTest.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, `FullyQualifiedResourceDetector.test failure no imports`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("FullyQualifiedResource") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("FullyQualifiedResource") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection FullyQualifiedResource + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="FullyQualifiedResource" severity="ignore" /> + </lint> + ``` + 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 'FullyQualifiedResource' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore FullyQualifiedResource ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/GestureBackNavigation.md.html b/docs/checks/GestureBackNavigation.md.html index cae653e3..c104bf96 100644 --- a/docs/checks/GestureBackNavigation.md.html +++ b/docs/checks/GestureBackNavigation.md.html @@ -50,8 +50,6 @@ if (KeyEvent.KEYCODE_BACK == keyCode) { --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/GetInstance.md.html b/docs/checks/GetInstance.md.html index dc5e424c..675cb27b 100644 --- a/docs/checks/GetInstance.md.html +++ b/docs/checks/GetInstance.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/GetInstance 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/CipherGetInstanceDetector.kt) Tests @@ -43,8 +45,6 @@ Cipher.getInstance("AES"); ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GetLocales.md.html b/docs/checks/GetLocales.md.html index 5e527829..4dface10 100644 --- a/docs/checks/GetLocales.md.html +++ b/docs/checks/GetLocales.md.html @@ -45,8 +45,6 @@ String[] locales = assets.getLocales(); ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleCompatible.md.html b/docs/checks/GradleCompatible.md.html index 4fd8be05..3df7a09b 100644 --- a/docs/checks/GradleCompatible.md.html +++ b/docs/checks/GradleCompatible.md.html @@ -49,8 +49,6 @@ compile 'com.android.support:appcompat-v7:13.0.0' ----------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleDependency.md.html b/docs/checks/GradleDependency.md.html index ea590fc8..9e72f1a9 100644 --- a/docs/checks/GradleDependency.md.html +++ b/docs/checks/GradleDependency.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor Implementation @@ -78,8 +78,6 @@ androidTestCompile 'com.android.support.test:runner:0.3' ------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleDeprecated.md.html b/docs/checks/GradleDeprecated.md.html index 4ebbb2b2..0f841da2 100644 --- a/docs/checks/GradleDeprecated.md.html +++ b/docs/checks/GradleDeprecated.md.html @@ -44,8 +44,6 @@ apply plugin: 'android' ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleDeprecatedConfiguration.md.html b/docs/checks/GradleDeprecatedConfiguration.md.html index c3feaba6..f2827393 100644 --- a/docs/checks/GradleDeprecatedConfiguration.md.html +++ b/docs/checks/GradleDeprecatedConfiguration.md.html @@ -58,8 +58,6 @@ debugCompile 'androidx.appcompat:appcompat:1.0.0' ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleDynamicVersion.md.html b/docs/checks/GradleDynamicVersion.md.html index bfbc0db8..57384fee 100644 --- a/docs/checks/GradleDynamicVersion.md.html +++ b/docs/checks/GradleDynamicVersion.md.html @@ -49,8 +49,6 @@ compile 'com.android.support:appcompat-v7:+' ------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleGetter.md.html b/docs/checks/GradleGetter.md.html index 160effc7..463796c5 100644 --- a/docs/checks/GradleGetter.md.html +++ b/docs/checks/GradleGetter.md.html @@ -62,8 +62,6 @@ versionName getVersionName -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradleOverrides.md.html b/docs/checks/GradleOverrides.md.html index 7d4b6de0..c79df6c5 100644 --- a/docs/checks/GradleOverrides.md.html +++ b/docs/checks/GradleOverrides.md.html @@ -44,8 +44,6 @@ package="${packageName}" > ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradlePath.md.html b/docs/checks/GradlePath.md.html index 467e83c9..d7a888df 100644 --- a/docs/checks/GradlePath.md.html +++ b/docs/checks/GradlePath.md.html @@ -55,8 +55,6 @@ compile files('/libs/android-support-v4.jar') ------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GradlePluginVersion.md.html b/docs/checks/GradlePluginVersion.md.html index 9c4f8d3a..92606d0b 100644 --- a/docs/checks/GradlePluginVersion.md.html +++ b/docs/checks/GradlePluginVersion.md.html @@ -44,8 +44,6 @@ classpath 'com.android.tools.build:gradle:0.1.0' ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GrantAllUris.md.html b/docs/checks/GrantAllUris.md.html index a37e9bd8..83634515 100644 --- a/docs/checks/GrantAllUris.md.html +++ b/docs/checks/GrantAllUris.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/GrantAllUris 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/SecurityDetector.java) Tests @@ -49,8 +51,6 @@ <grant-uri-permission android:pathPrefix="/"/> ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GridLayout.md.html b/docs/checks/GridLayout.md.html index 0df7b744..2c54c6a2 100644 --- a/docs/checks/GridLayout.md.html +++ b/docs/checks/GridLayout.md.html @@ -47,8 +47,6 @@ android:layout_column="3" ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/GuavaChecksUsed.md.html b/docs/checks/GuavaChecksUsed.md.html new file mode 100644 index 00000000..0523cfd1 --- /dev/null +++ b/docs/checks/GuavaChecksUsed.md.html @@ -0,0 +1,211 @@ + +(#) Use Slack's JavaPreconditions instead of Guava's Preconditions checks + +!!! ERROR: Use Slack's JavaPreconditions instead of Guava's Preconditions checks + This is an error. + +Id +: `GuavaChecksUsed` +Summary +: Use Slack's JavaPreconditions instead of Guava's Preconditions checks +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/GuavaPreconditionsDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/GuavaPreconditionsDetectorTest.kt) +Copyright Year +: 2021 + +Precondition checks in Java should use Slack's internal +`JavaPreconditions.kt` instead of Guava's Preconditions. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Foo.java:7:Error: Use Slack's JavaPreconditions instead of +Guava's Preconditions checks [GuavaChecksUsed] + + boolean isTrue = Preconditions.checkState(1 == 1); + ---------- + + +src/foo/Foo.java:10:Error: Use Slack's JavaPreconditions instead of +Guava's Preconditions checks [GuavaChecksUsed] + + Preconditions.checkState(1 == 1); + ---------- + + +src/foo/Foo.java:11:Error: Use Slack's JavaPreconditions instead of +Guava's Preconditions checks [GuavaChecksUsed] + + Preconditions.checkArgument(1 == 1); + ------------- + + +src/foo/Foo.java:12:Error: Use Slack's JavaPreconditions instead of +Guava's Preconditions checks [GuavaChecksUsed] + + Preconditions.checkNotNull("Hello"); + ------------ + + +src/foo/Foo.java:13:Error: Use Slack's JavaPreconditions instead of +Guava's Preconditions checks [GuavaChecksUsed] + + Preconditions.checkElementIndex(0, 1); + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Foo.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import com.google.common.base.Preconditions; + +public class Foo { + + boolean isTrue = Preconditions.checkState(1 == 1); + + void act() { + Preconditions.checkState(1 == 1); + Preconditions.checkArgument(1 == 1); + Preconditions.checkNotNull("Hello"); + Preconditions.checkElementIndex(0, 1); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/GuavaPreconditionsDetectorTest.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, `GuavaPreconditionsDetector.Java - Using Guava Preconditions with static reference will show warnings`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("GuavaChecksUsed") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("GuavaChecksUsed") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection GuavaChecksUsed + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="GuavaChecksUsed" severity="ignore" /> + </lint> + ``` + 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 'GuavaChecksUsed' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore GuavaChecksUsed ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/GuavaPreconditionsUsedInKotlin.md.html b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html new file mode 100644 index 00000000..0ef0ec9c --- /dev/null +++ b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html @@ -0,0 +1,212 @@ + +(#) Kotlin precondition checks should use the Kotlin standard library checks + +!!! ERROR: Kotlin precondition checks should use the Kotlin standard library checks + This is an error. + +Id +: `GuavaPreconditionsUsedInKotlin` +Summary +: Kotlin precondition checks should use the Kotlin standard library checks +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/GuavaPreconditionsDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/GuavaPreconditionsDetectorTest.kt) +Copyright Year +: 2021 + +All Kotlin classes that require precondition checks should use the + preconditions checks that are available in the Kotlin standard library +in Preconditions.kt. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Foo.kt:7:Error: Kotlin precondition checks should use the Kotlin +standard library checks [GuavaPreconditionsUsedInKotlin] + + val isTrue = Preconditions.checkState(false) + ---------- + + +src/foo/Foo.kt:10:Error: Kotlin precondition checks should use the +Kotlin standard library checks [GuavaPreconditionsUsedInKotlin] + + Preconditions.checkState(true) + ---------- + + +src/foo/Foo.kt:11:Error: Kotlin precondition checks should use the +Kotlin standard library checks [GuavaPreconditionsUsedInKotlin] + + Preconditions.checkArgument(false) + ------------- + + +src/foo/Foo.kt:12:Error: Kotlin precondition checks should use the +Kotlin standard library checks [GuavaPreconditionsUsedInKotlin] + + Preconditions.checkNotNull("Hello") + ------------ + + +src/foo/Foo.kt:13:Error: Kotlin precondition checks should use the +Kotlin standard library checks [GuavaPreconditionsUsedInKotlin] + + Preconditions.checkElementIndex(0, 1) + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Foo.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import com.google.common.base.Preconditions + +class Foo { + + val isTrue = Preconditions.checkState(false) + + fun act() { + Preconditions.checkState(true) + Preconditions.checkArgument(false) + Preconditions.checkNotNull("Hello") + Preconditions.checkElementIndex(0, 1) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/GuavaPreconditionsDetectorTest.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, `GuavaPreconditionsDetector.Kotlin - Using Guava Preconditions with static reference will show warnings`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("GuavaPreconditionsUsedInKotlin") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("GuavaPreconditionsUsedInKotlin") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection GuavaPreconditionsUsedInKotlin + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="GuavaPreconditionsUsedInKotlin" severity="ignore" /> + </lint> + ``` + 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 'GuavaPreconditionsUsedInKotlin' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore GuavaPreconditionsUsedInKotlin ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/HalfFloat.md.html b/docs/checks/HalfFloat.md.html index e9d53866..caa64978 100644 --- a/docs/checks/HalfFloat.md.html +++ b/docs/checks/HalfFloat.md.html @@ -84,8 +84,6 @@ Math.round(float1); // Error: should use Half.round ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HandlerLeak.md.html b/docs/checks/HandlerLeak.md.html index 835759cd..5cd765c1 100644 --- a/docs/checks/HandlerLeak.md.html +++ b/docs/checks/HandlerLeak.md.html @@ -57,8 +57,6 @@ Handler anonymous = new Handler() { // ERROR ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HardcodedDebugMode.md.html b/docs/checks/HardcodedDebugMode.md.html index 66092e41..217008e6 100644 --- a/docs/checks/HardcodedDebugMode.md.html +++ b/docs/checks/HardcodedDebugMode.md.html @@ -24,6 +24,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/HardcodedDebugMode 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/HardcodedDebugModeDetector.java) Tests @@ -51,8 +53,6 @@ android:debuggable="true" ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HardcodedText.md.html b/docs/checks/HardcodedText.md.html index 23fc8a93..455c3b8e 100644 --- a/docs/checks/HardcodedText.md.html +++ b/docs/checks/HardcodedText.md.html @@ -58,8 +58,6 @@ <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HardwareIds.md.html b/docs/checks/HardwareIds.md.html index c1243da5..da49bdb4 100644 --- a/docs/checks/HardwareIds.md.html +++ b/docs/checks/HardwareIds.md.html @@ -45,8 +45,6 @@ return adapter.getAddress(); -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HighAppVersionCode.md.html b/docs/checks/HighAppVersionCode.md.html index cdbb7748..42038b17 100644 --- a/docs/checks/HighAppVersionCode.md.html +++ b/docs/checks/HighAppVersionCode.md.html @@ -45,8 +45,6 @@ versionCode 2146435071 ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/HighSamplingRate.md.html b/docs/checks/HighSamplingRate.md.html index a12f0e4c..a7aed217 100644 --- a/docs/checks/HighSamplingRate.md.html +++ b/docs/checks/HighSamplingRate.md.html @@ -44,8 +44,6 @@ <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS"/> --------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IconColors.md.html b/docs/checks/IconColors.md.html index 2504caf3..3a397b54 100644 --- a/docs/checks/IconColors.md.html +++ b/docs/checks/IconColors.md.html @@ -34,7 +34,8 @@ Lint decides whether an icon is an action bar icon or a notification icon is based on the filename prefix: `ic_menu_` for action bar icons, `ic_stat_` for notification icons etc. These correspond to the naming -conventions documented in https://material.io/design/iconography/ +conventions documented in +https://d.android.com/r/studio-ui/designer/material/iconography. (##) Suppressing diff --git a/docs/checks/IconDensities.md.html b/docs/checks/IconDensities.md.html index 675fa40f..7f5e4e38 100644 --- a/docs/checks/IconDensities.md.html +++ b/docs/checks/IconDensities.md.html @@ -47,9 +47,6 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text res/drawable-hdpi/.svn:Warning: Missing the following drawables in drawable-hdpi: sample_icon.gif (found in drawable-mdpi) [IconDensities] - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IconDipSize.md.html b/docs/checks/IconDipSize.md.html index 925ca46f..e1e670e8 100644 --- a/docs/checks/IconDipSize.md.html +++ b/docs/checks/IconDipSize.md.html @@ -44,9 +44,6 @@ [IconDipSize] 0 errors, 3 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IconExpectedSize.md.html b/docs/checks/IconExpectedSize.md.html index a4ec8aee..facfbe50 100644 --- a/docs/checks/IconExpectedSize.md.html +++ b/docs/checks/IconExpectedSize.md.html @@ -25,7 +25,7 @@ Editing : This check can *not* run live in the IDE editor See -: https://material.io/design/iconography/ +: https://d.android.com/r/studio-ui/designer/material/iconography 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/IconDetector.java) Tests diff --git a/docs/checks/IconExtension.md.html b/docs/checks/IconExtension.md.html index 51a9ff0e..80b5f008 100644 --- a/docs/checks/IconExtension.md.html +++ b/docs/checks/IconExtension.md.html @@ -41,9 +41,6 @@ but the file format is webp [IconExtension] 0 errors, 1 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IconLauncherShape.md.html b/docs/checks/IconLauncherShape.md.html index 1f48545b..2418db34 100644 --- a/docs/checks/IconLauncherShape.md.html +++ b/docs/checks/IconLauncherShape.md.html @@ -30,10 +30,10 @@ : 2011 According to the Android Design Guide -(https://material.io/design/iconography/) your launcher icons should -"use a distinct silhouette", a "three-dimensional, front view, with a -slight perspective as if viewed from above, so that users perceive some -depth." +(https://d.android.com/r/studio-ui/designer/material/iconography) your +launcher icons should "use a distinct silhouette", a "three-dimensional, +front view, with a slight perspective as if viewed from above, so that +users perceive some depth." The unique silhouette implies that your launcher icon should not be a filled square. diff --git a/docs/checks/IconMissingDensityFolder.md.html b/docs/checks/IconMissingDensityFolder.md.html index 5c227f84..db622c75 100644 --- a/docs/checks/IconMissingDensityFolder.md.html +++ b/docs/checks/IconMissingDensityFolder.md.html @@ -49,9 +49,6 @@ res: drawable-xhdpi, drawable-xxhdpi [IconMissingDensityFolder] 0 errors, 5 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IconXmlAndPng.md.html b/docs/checks/IconXmlAndPng.md.html index 32efc887..cc80c7b6 100644 --- a/docs/checks/IconXmlAndPng.md.html +++ b/docs/checks/IconXmlAndPng.md.html @@ -45,8 +45,6 @@ res/drawable-mdpi/background.png: <No location-specific message> 0 errors, 1 warnings - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IdleBatteryChargingConstraints.md.html b/docs/checks/IdleBatteryChargingConstraints.md.html index 6271777b..dbd608e3 100644 --- a/docs/checks/IdleBatteryChargingConstraints.md.html +++ b/docs/checks/IdleBatteryChargingConstraints.md.html @@ -20,6 +20,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -34,6 +41,36 @@ Some devices are never considered charging and idle at the same time. Consider removing one of these constraints. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/IgnoreWithoutReason.md.html b/docs/checks/IgnoreWithoutReason.md.html index 54d3c8d3..b84b6d96 100644 --- a/docs/checks/IgnoreWithoutReason.md.html +++ b/docs/checks/IgnoreWithoutReason.md.html @@ -66,8 +66,6 @@ @Ignore class MyTest { ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IllegalResourceRef.md.html b/docs/checks/IllegalResourceRef.md.html index 390d0fa8..5c8ea971 100644 --- a/docs/checks/IllegalResourceRef.md.html +++ b/docs/checks/IllegalResourceRef.md.html @@ -51,8 +51,6 @@ <uses-sdk android:minSdkVersion="@dimen/minSdkVersion" android:targetSdkVersion="@dimen/targetSdkVersion" /> -------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ImplicitSamInstance.md.html b/docs/checks/ImplicitSamInstance.md.html index 8ad9f1d7..a9a8628f 100644 --- a/docs/checks/ImplicitSamInstance.md.html +++ b/docs/checks/ImplicitSamInstance.md.html @@ -82,8 +82,6 @@ handler.stash(lambda2, list) // WARN ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ImplicitStringPlaceholder.md.html b/docs/checks/ImplicitStringPlaceholder.md.html new file mode 100644 index 00000000..67439d1a --- /dev/null +++ b/docs/checks/ImplicitStringPlaceholder.md.html @@ -0,0 +1,155 @@ + +(#) Marks implicit placeholders in strings without an index. + +!!! WARNING: Marks implicit placeholders in strings without an index. + This is a warning. + +Id +: `ImplicitStringPlaceholder` +Summary +: Marks implicit placeholders in strings without an index. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetectorTest.kt) + +It's better and more explicit to use numbered placeholders. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/strings.xml:2:Warning: Implicit placeholder +[ImplicitStringPlaceholder] + + <string name="my_string">Hello %s</string> + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/values/strings.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<resources> + <string name="my_string">Hello %s</string> +</resources> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetectorTest.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, `ImplicitStringPlaceholderDetector.invalid`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="ImplicitStringPlaceholder"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <resources xmlns:tools="http://schemas.android.com/tools"> + ... + <string tools:ignore="ImplicitStringPlaceholder" .../> + ... + </resources> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ImplicitStringPlaceholder" severity="ignore" /> + </lint> + ``` + 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 'ImplicitStringPlaceholder' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ImplicitStringPlaceholder ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ImpliedQuantity.md.html b/docs/checks/ImpliedQuantity.md.html index 182f9a61..02194c4c 100644 --- a/docs/checks/ImpliedQuantity.md.html +++ b/docs/checks/ImpliedQuantity.md.html @@ -54,8 +54,6 @@ <item quantity="one">Znaleziono jedną piosenkę.</item> ------------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ImpliedTouchscreenHardware.md.html b/docs/checks/ImpliedTouchscreenHardware.md.html index 0efb2a14..fc8525bc 100644 --- a/docs/checks/ImpliedTouchscreenHardware.md.html +++ b/docs/checks/ImpliedTouchscreenHardware.md.html @@ -47,8 +47,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InOrMmUsage.md.html b/docs/checks/InOrMmUsage.md.html index 459bf450..93578b22 100644 --- a/docs/checks/InOrMmUsage.md.html +++ b/docs/checks/InOrMmUsage.md.html @@ -55,8 +55,6 @@ android:layout_height="120in" ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IncludeLayoutParam.md.html b/docs/checks/IncludeLayoutParam.md.html index 4e72802b..73d01fcd 100644 --- a/docs/checks/IncludeLayoutParam.md.html +++ b/docs/checks/IncludeLayoutParam.md.html @@ -88,8 +88,6 @@ android:layout_height="fill_parent" ----------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InclusiveNaming.md.html b/docs/checks/InclusiveNaming.md.html new file mode 100644 index 00000000..1f4457cb --- /dev/null +++ b/docs/checks/InclusiveNaming.md.html @@ -0,0 +1,149 @@ + +(#) Use inclusive naming. + +!!! ERROR: Use inclusive naming. + This is an error. + +Id +: `InclusiveNaming` +Summary +: Use inclusive naming. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/inclusive/InclusiveNamingResourceScanner.kt) +Copyright Year +: 2021 + +We try to use inclusive naming at Slack. Terms such as blacklist, +whitelist, master, slave, etc, while maybe widely used today, can be +socially charged and make others feel excluded or uncomfortable. + +(##) Options + +You can configure this lint checks using the following options: + +(###) block-list + +A comma-separated list of words that should not be used in source code.. +This property should define a comma-separated list of words that should not be used in source code. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="InclusiveNaming"> + <option name="block-list" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Conflicts + +This issue id has also been used by other, unrelated lint checks. Issue +id's must be unique, so you cannot combine these libraries. Also defined +in: +* InclusiveNaming: Use inclusive naming. (this issue) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.3.0](InclusiveNaming.md.html) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.3.0](InclusiveNaming.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="InclusiveNaming"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InclusiveNaming" severity="ignore" /> + </lint> + ``` + 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 'InclusiveNaming' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InclusiveNaming ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/IncompatibleMediaBrowserServiceCompatVersion.md.html b/docs/checks/IncompatibleMediaBrowserServiceCompatVersion.md.html index 9321cb93..19038615 100644 --- a/docs/checks/IncompatibleMediaBrowserServiceCompatVersion.md.html +++ b/docs/checks/IncompatibleMediaBrowserServiceCompatVersion.md.html @@ -43,8 +43,6 @@ compile 'com.android.support:support-v4:23.4.0' ------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -54,7 +52,7 @@ apply plugin: 'com.android.application' dependencies { - compile 'com.android.support:support-v4:23.4.0' + compile 'com.android.support:support-v4:23.4.0' } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/InconsistentArrays.md.html b/docs/checks/InconsistentArrays.md.html index ce956fc9..7ae02070 100644 --- a/docs/checks/InconsistentArrays.md.html +++ b/docs/checks/InconsistentArrays.md.html @@ -61,8 +61,6 @@ <array name="signal_strength"> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InconsistentLayout.md.html b/docs/checks/InconsistentLayout.md.html index 971f0daa..9d73836e 100644 --- a/docs/checks/InconsistentLayout.md.html +++ b/docs/checks/InconsistentLayout.md.html @@ -61,8 +61,6 @@ android:id="@+id/button4" ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IncorrectChainMarginsUsage.md.html b/docs/checks/IncorrectChainMarginsUsage.md.html new file mode 100644 index 00000000..96fe2382 --- /dev/null +++ b/docs/checks/IncorrectChainMarginsUsage.md.html @@ -0,0 +1,142 @@ + +(#) Use `LayoutReference.withChainParams()` to define margins for elements in a Chain. + +!!! WARNING: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain. + This is a warning. + +Id +: `IncorrectChainMarginsUsage` +Summary +: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Identifier +: androidx.constraintlayout.compose +Feedback +: https://issuetracker.google.com/issues/new?component=323867&template=1023345 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/test/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetectorTest.kt) +Copyright Year +: 2022 + +If you understand how a chain works, it might seem obvious to add +margins by re-creating the constraints with the desired margin. However, +in Compose, helpers will ignore custom constraints in favor of their +layout implementation. So instead, use +`LayoutReference.withChainParams()` to define margins for Chains. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") + +// build.gradle +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' + +// build.gradle.kts with version catalogs: +implementation(libs.constraintlayout-compose) + +# libs.versions.toml +[versions] +constraintlayout-compose = "1.1.0-alpha10" +[libraries] +constraintlayout-compose = { + module = "androidx.constraintlayout:constraintlayout-compose", + version.ref = "constraintlayout-compose" +} +``` + +1.1.0-alpha10 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("IncorrectChainMarginsUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("IncorrectChainMarginsUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection IncorrectChainMarginsUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="IncorrectChainMarginsUsage" severity="ignore" /> + </lint> + ``` + 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 'IncorrectChainMarginsUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore IncorrectChainMarginsUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/IncorrectMatchParentUsage.md.html b/docs/checks/IncorrectMatchParentUsage.md.html new file mode 100644 index 00000000..f7201a01 --- /dev/null +++ b/docs/checks/IncorrectMatchParentUsage.md.html @@ -0,0 +1,141 @@ + +(#) Prefer using `Dimension.percent(1f)` when defining custom constraints. + +!!! WARNING: Prefer using `Dimension.percent(1f)` when defining custom constraints. + This is a warning. + +Id +: `IncorrectMatchParentUsage` +Summary +: Prefer using `Dimension.percent(1f)` when defining custom constraints. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Identifier +: androidx.constraintlayout.compose +Feedback +: https://issuetracker.google.com/issues/new?component=323867&template=1023345 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/test/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetectorTest.kt) +Copyright Year +: 2022 + +`Dimension.matchParent` forces the constraints to be an equivalent of +`centerHorizontallyTo(parent)` or `centerVerticallyTo(parent)` according +to the assigned dimension which can lead to unexpected behavior. To +avoid that, prefer using `Dimension.percent(1f)` + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") + +// build.gradle +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' + +// build.gradle.kts with version catalogs: +implementation(libs.constraintlayout-compose) + +# libs.versions.toml +[versions] +constraintlayout-compose = "1.1.0-alpha10" +[libraries] +constraintlayout-compose = { + module = "androidx.constraintlayout:constraintlayout-compose", + version.ref = "constraintlayout-compose" +} +``` + +1.1.0-alpha10 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("IncorrectMatchParentUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("IncorrectMatchParentUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection IncorrectMatchParentUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="IncorrectMatchParentUsage" severity="ignore" /> + </lint> + ``` + 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 'IncorrectMatchParentUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore IncorrectMatchParentUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/IncorrectReferencesDeclaration.md.html b/docs/checks/IncorrectReferencesDeclaration.md.html new file mode 100644 index 00000000..b8b9c575 --- /dev/null +++ b/docs/checks/IncorrectReferencesDeclaration.md.html @@ -0,0 +1,214 @@ + +(#) `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables + +!!! ERROR: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables + This is an error. + +Id +: `IncorrectReferencesDeclaration` +Summary +: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Identifier +: androidx.constraintlayout.compose +Feedback +: https://issuetracker.google.com/issues/new?component=323867&template=1023345 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/main/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/test/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetectorTest.kt) +Copyright Year +: 2022 + +`createRefsFor(vararg ids: Any)` conveniently allows creating multiple +references using destructuring. However, providing an un-equal amount of +arguments to the assigned variables will result in unexpected behavior +since the variables may reference a ConstrainedLayoutReference with +unknown ID. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/example/test.kt:8:Error: Arguments of createRefsFor (2) do not match +assigned variables (3) [IncorrectReferencesDeclaration] + + val (box1, text1, image1) = createRefsFor("box", "text") + ------------- + + +src/example/test.kt:9:Error: Arguments of createRefsFor (3) do not match +assigned variables (2) [IncorrectReferencesDeclaration] + + val (box2, text2) = createRefsFor("box", "text", "image") + ------------- + + +src/example/test.kt:19:Error: Arguments of createRefsFor (2) do not +match assigned variables (3) [IncorrectReferencesDeclaration] + + val (box1, text1, image1) = createRefsFor("box", "text") + ------------- + + +src/example/test.kt:20:Error: Arguments of createRefsFor (3) do not +match assigned variables (2) [IncorrectReferencesDeclaration] + + val (box2, text2) = createRefsFor("box", "text", "image") + ------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/example/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package example + +import androidx.constraintlayout.compose.* + +fun Test() { + val scopeApplier: ConstraintSetScope.() -> Unit = { + val (box, text) = createRefsFor("box", "text") + val (box1, text1, image1) = createRefsFor("box", "text") + val (box2, text2) = createRefsFor("box", "text", "image") + + val ids = arrayOf("box", "text") + val (box3, text3, image3) = createRefsFor(*ids) + } +} + +fun Test2() { + val scopeApplier: MotionSceneScope.() -> Unit = { + val (box, text) = createRefsFor("box", "text") + val (box1, text1, image1) = createRefsFor("box", "text") + val (box2, text2) = createRefsFor("box", "text", "image") + + val ids = arrayOf("box", "text") + val (box3, text3, image3) = createRefsFor(*ids) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/constraintlayout/constraintlayout-compose-lint/src/test/java/androidx/constraintlayout/compose/lint/ConstraintLayoutDslDetectorTest.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, `ConstraintLayoutDslDetector.createRefsForArgumentTest`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=323867&template=1023345. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") + +// build.gradle +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' + +// build.gradle.kts with version catalogs: +implementation(libs.constraintlayout-compose) + +# libs.versions.toml +[versions] +constraintlayout-compose = "1.1.0-alpha10" +[libraries] +constraintlayout-compose = { + module = "androidx.constraintlayout:constraintlayout-compose", + version.ref = "constraintlayout-compose" +} +``` + +1.1.0-alpha10 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("IncorrectReferencesDeclaration") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("IncorrectReferencesDeclaration") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection IncorrectReferencesDeclaration + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="IncorrectReferencesDeclaration" severity="ignore" /> + </lint> + ``` + 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 'IncorrectReferencesDeclaration' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore IncorrectReferencesDeclaration ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InefficientWeight.md.html b/docs/checks/InefficientWeight.md.html index 85c7ee98..ac68e9bf 100644 --- a/docs/checks/InefficientWeight.md.html +++ b/docs/checks/InefficientWeight.md.html @@ -53,8 +53,6 @@ android:layout_height="wrap_content" ------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InflateParams.md.html b/docs/checks/InflateParams.md.html index 57ba62dc..96a43cfa 100644 --- a/docs/checks/InflateParams.md.html +++ b/docs/checks/InflateParams.md.html @@ -53,8 +53,6 @@ convertView = mInflater.inflate(R.layout.your_layout, null, true); ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InjectInJava.md.html b/docs/checks/InjectInJava.md.html new file mode 100644 index 00000000..31ea63cf --- /dev/null +++ b/docs/checks/InjectInJava.md.html @@ -0,0 +1,239 @@ + +(#) Only Kotlin classes should be injected in order for Anvil to work. + +!!! ERROR: Only Kotlin classes should be injected in order for Anvil to work. + This is an error. + +Id +: `InjectInJava` +Summary +: Only Kotlin classes should be injected in order for Anvil to work. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/InjectInJavaDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectInJavaDetectorTest.kt) +Copyright Year +: 2021 + +Only Kotlin classes should be injected in order for Anvil to work. If +you cannot easily convert this to Kotlin, consider manually providing it +via a Kotlin `@Module`-annotated object. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/JavaClass.java:9:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @Inject String memberInjected; + ------- + + +src/test/pkg/JavaClass.java:11:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @Inject JavaClass(String constructorInjected) { + ------- + + +src/test/pkg/JavaClass.java:15:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @Inject void methodInject(String value) { + ------- + + +src/test/pkg/JavaClass.java:21:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @AssistedInject JavaAssistedClass(@Assisted String assistedParam) { + --------------- + + +src/test/pkg/JavaClass.java:25:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @AssistedFactory + ---------------- + + +src/test/pkg/JavaClass.java:31:Error: Only Kotlin classes should be +injected in order for Anvil to work. [InjectInJava] + + @Module static abstract class ExampleModule { + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/JavaClass.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import javax.inject.Inject; +import dagger.Module; +import dagger.assisted.AssistedInject; +import dagger.assisted.AssistedFactory; + +class JavaClass { + @Inject String memberInjected; + + @Inject JavaClass(String constructorInjected) { + + } + + @Inject void methodInject(String value) { + + } + + static class JavaAssistedClass { + + @AssistedInject JavaAssistedClass(@Assisted String assistedParam) { + + } + + @AssistedFactory + interface Factory { + JavaAssistedClass create(String assistedParam); + } + } + + @Module static abstract class ExampleModule { + + } +} + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectInJavaDetectorTest.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, `InjectInJavaDetector.javaIsNotOk`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InjectInJava") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InjectInJava") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InjectInJava + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InjectInJava" severity="ignore" /> + </lint> + ``` + 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 'InjectInJava' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InjectInJava ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html b/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html new file mode 100644 index 00000000..2f680320 --- /dev/null +++ b/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html @@ -0,0 +1,209 @@ + +(#) @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. + +!!! ERROR: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. + This is an error. + +Id +: `InjectWithScopeRequiredLoggedInUserProvider` +Summary +: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/InjectWithUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.kt) +Copyright Year +: 2021 + +`@InjectWith`-annotated classes must implement LoggedInUserProvider (or +extend something that does) if they target UserScope or OrgScope. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/BaseInjectableAnnotation.kt:24:Error: @InjectWith-annotated +classes must implement LoggedInUserProvider (or extend something that +does) if they target UserScope or OrgScope. +[InjectWithScopeRequiredLoggedInUserProvider] + +class UserActivityWrong : BaseInjectable() + ----------------- + + +src/test/pkg/BaseInjectableAnnotation.kt:27:Error: @InjectWith-annotated +classes must implement LoggedInUserProvider (or extend something that +does) if they target UserScope or OrgScope. +[InjectWithScopeRequiredLoggedInUserProvider] + +class OrgActivityWrong : BaseInjectable() + ---------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/BaseInjectableAnnotation.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import slack.anvil.injection.InjectWith +import slack.anvil.injection.AnvilInjectable +import slack.di.AppScope +import slack.di.UserScope +import slack.di.OrgScope +import slack.foundation.auth.LoggedInUserProvider + +annotation class BaseInjectableAnnotation + +abstract class BaseInjectable : AnvilInjectable + +@InjectWith(AppScope::class) +class AppActivityCorrect : BaseInjectable() + +@InjectWith(UserScope::class) +class UserActivityCorrect : BaseInjectable(), LoggedInUserProvider + +@InjectWith(OrgScope::class) +class OrgActivityCorrect : BaseInjectable(), LoggedInUserProvider + +@InjectWith(UserScope::class) +class UserActivityWrong : BaseInjectable() + +@InjectWith(OrgScope::class) +class OrgActivityWrong : BaseInjectable() + +@InjectWith(AppScope::class) +class MissingAnvilInjectable +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.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, `InjectWithUsageDetector.smokeTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InjectWithScopeRequiredLoggedInUserProvider") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InjectWithScopeRequiredLoggedInUserProvider") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InjectWithScopeRequiredLoggedInUserProvider + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InjectWithScopeRequiredLoggedInUserProvider" severity="ignore" /> + </lint> + ``` + 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 'InjectWithScopeRequiredLoggedInUserProvider' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InjectWithScopeRequiredLoggedInUserProvider ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html b/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html new file mode 100644 index 00000000..4e2a4180 --- /dev/null +++ b/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html @@ -0,0 +1,199 @@ + +(#) @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). + +!!! ERROR: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). + This is an error. + +Id +: `InjectWithTypeMustImplementAnvilInjectable` +Summary +: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/InjectWithUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.kt) +Copyright Year +: 2021 + +`@InjectWith`-annotated classes must implement AnvilInjectable (or +extend something that does). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/BaseInjectableAnnotation.kt:30:Error: @InjectWith-annotated +classes must implement AnvilInjectable (or extend something that does). +[InjectWithTypeMustImplementAnvilInjectable] + +class MissingAnvilInjectable + ---------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/BaseInjectableAnnotation.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import slack.anvil.injection.InjectWith +import slack.anvil.injection.AnvilInjectable +import slack.di.AppScope +import slack.di.UserScope +import slack.di.OrgScope +import slack.foundation.auth.LoggedInUserProvider + +annotation class BaseInjectableAnnotation + +abstract class BaseInjectable : AnvilInjectable + +@InjectWith(AppScope::class) +class AppActivityCorrect : BaseInjectable() + +@InjectWith(UserScope::class) +class UserActivityCorrect : BaseInjectable(), LoggedInUserProvider + +@InjectWith(OrgScope::class) +class OrgActivityCorrect : BaseInjectable(), LoggedInUserProvider + +@InjectWith(UserScope::class) +class UserActivityWrong : BaseInjectable() + +@InjectWith(OrgScope::class) +class OrgActivityWrong : BaseInjectable() + +@InjectWith(AppScope::class) +class MissingAnvilInjectable +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.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, `InjectWithUsageDetector.smokeTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InjectWithTypeMustImplementAnvilInjectable") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InjectWithTypeMustImplementAnvilInjectable") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InjectWithTypeMustImplementAnvilInjectable + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InjectWithTypeMustImplementAnvilInjectable" severity="ignore" /> + </lint> + ``` + 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 'InjectWithTypeMustImplementAnvilInjectable' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InjectWithTypeMustImplementAnvilInjectable ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InlinedApi.md.html b/docs/checks/InlinedApi.md.html index f2036387..d68b3ed0 100644 --- a/docs/checks/InlinedApi.md.html +++ b/docs/checks/InlinedApi.md.html @@ -62,8 +62,6 @@ val format: String = MediaFormat.MIMETYPE_AUDIO_AC4 ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/InnerclassSeparator.md.html b/docs/checks/InnerclassSeparator.md.html index 40ddafea..f8fab894 100644 --- a/docs/checks/InnerclassSeparator.md.html +++ b/docs/checks/InnerclassSeparator.md.html @@ -49,8 +49,6 @@ android:name=".Foo.Bar" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InsecureBaseConfiguration.md.html b/docs/checks/InsecureBaseConfiguration.md.html index e48b43e5..bc4a3b8d 100644 --- a/docs/checks/InsecureBaseConfiguration.md.html +++ b/docs/checks/InsecureBaseConfiguration.md.html @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://goo.gle/InsecureBaseConfiguration +See : https://developer.android.com/preview/features/security-config.html 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/NetworkSecurityConfigDetector.java) @@ -48,8 +50,6 @@ <base-config cleartextTrafficPermitted="true"> ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InstantApps.md.html b/docs/checks/InstantApps.md.html index 55d11b41..451e625e 100644 --- a/docs/checks/InstantApps.md.html +++ b/docs/checks/InstantApps.md.html @@ -54,8 +54,6 @@ <receiver android:name=".DeviceAdminTestReceiver" ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Instantiatable.md.html b/docs/checks/Instantiatable.md.html index 7b18f5b9..8346d276 100644 --- a/docs/checks/Instantiatable.md.html +++ b/docs/checks/Instantiatable.md.html @@ -37,6 +37,10 @@ public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class. +If you use a custom `AppComponentFactory` to instantiate app components +yourself, consider disabling this Lint issue in order to avoid false +positives. + (##) Example Here is an example of lint warnings produced by this check: @@ -46,8 +50,6 @@ android:actionViewClass="test.pkg.NotView" /> ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IntentFilterExportedReceiver.md.html b/docs/checks/IntentFilterExportedReceiver.md.html index a9222f0c..76332312 100644 --- a/docs/checks/IntentFilterExportedReceiver.md.html +++ b/docs/checks/IntentFilterExportedReceiver.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/IntentFilterExportedReceiver 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/ExportedFlagDetector.kt) Tests @@ -66,8 +68,6 @@ <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IntentFilterUniqueDataAttributes.md.html b/docs/checks/IntentFilterUniqueDataAttributes.md.html index 876d4700..aa3b0886 100644 --- a/docs/checks/IntentFilterUniqueDataAttributes.md.html +++ b/docs/checks/IntentFilterUniqueDataAttributes.md.html @@ -115,8 +115,6 @@ <data android:host="example.com" android:mimeType="image/jpeg"/> ---------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/IntentReset.md.html b/docs/checks/IntentReset.md.html index b0bbd45f..aa65eeef 100644 --- a/docs/checks/IntentReset.md.html +++ b/docs/checks/IntentReset.md.html @@ -50,8 +50,6 @@ intent.setData(uri); // ERROR 2.1 ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidAccessibility.md.html b/docs/checks/InvalidAccessibility.md.html new file mode 100644 index 00000000..3bd19fc0 --- /dev/null +++ b/docs/checks/InvalidAccessibility.md.html @@ -0,0 +1,148 @@ + +(#) Marks invalid accessibility usages. + +!!! WARNING: Marks invalid accessibility usages. + This is a warning. + +Id +: `InvalidAccessibility` +Summary +: Marks invalid accessibility usages. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetectorTest.kt) + +Marks usages of invalid accessibility and suggests corrections. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:5:Warning: Either set a proper accessibility text or +use importantForAccessibility [InvalidAccessibility] + + android:contentDescription="@null"/> + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<ImageView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@null"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetectorTest.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, `InvalidAccessibilityDetector.contentDescriptionNull`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="InvalidAccessibility"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidAccessibility" severity="ignore" /> + </lint> + ``` + 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 'InvalidAccessibility' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidAccessibility ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidAnalyticsName.md.html b/docs/checks/InvalidAnalyticsName.md.html index ac3ce8bc..6bf75ded 100644 --- a/docs/checks/InvalidAnalyticsName.md.html +++ b/docs/checks/InvalidAnalyticsName.md.html @@ -44,8 +44,6 @@ FirebaseAnalytics.getInstance(this).logEvent("a;", new Bundle()); ---------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidColorHexValue.md.html b/docs/checks/InvalidColorHexValue.md.html index 23bf7ee8..49d684e0 100644 --- a/docs/checks/InvalidColorHexValue.md.html +++ b/docs/checks/InvalidColorHexValue.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui.graphics Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -58,8 +65,6 @@ val color3 = Color(0x00_0_0_0L) ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -84,6 +89,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-graphics) + +# libs.versions.toml +[versions] +ui-graphics = "1.5.0-beta02" +[libraries] +ui-graphics = { + module = "androidx.compose.ui:ui-graphics", + version.ref = "ui-graphics" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/InvalidFragmentVersionForActivityResult.md.html b/docs/checks/InvalidFragmentVersionForActivityResult.md.html index bc2db804..47ee6c70 100644 --- a/docs/checks/InvalidFragmentVersionForActivityResult.md.html +++ b/docs/checks/InvalidFragmentVersionForActivityResult.md.html @@ -22,6 +22,13 @@ : androidx.activity Feedback : https://issuetracker.google.com/issues/new?component=527362 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.activity:activity](androidx_activity_activity.md.html) + Affects : Gradle build files and Kotlin and Java files Editing @@ -49,8 +56,6 @@ val launcher = ActivityResultCaller().registerForActivityResult(ActivityResultContract()) -------------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -74,6 +79,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=527362. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity:1.8.0-alpha05") + +// build.gradle +implementation 'androidx.activity:activity:1.8.0-alpha05' + +// build.gradle.kts with version catalogs: +implementation(libs.activity) + +# libs.versions.toml +[versions] +activity = "1.8.0-alpha05" +[libraries] +activity = { + module = "androidx.activity:activity", + version.ref = "activity" +} +``` + +1.8.0-alpha05 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.activity:activity](androidx_activity_activity.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/InvalidId.md.html b/docs/checks/InvalidId.md.html index ec0fdae7..51d3201b 100644 --- a/docs/checks/InvalidId.md.html +++ b/docs/checks/InvalidId.md.html @@ -69,8 +69,6 @@ android:id="@+string/whatevs" ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidImeActionId.md.html b/docs/checks/InvalidImeActionId.md.html index 8cc7c891..2550fba8 100644 --- a/docs/checks/InvalidImeActionId.md.html +++ b/docs/checks/InvalidImeActionId.md.html @@ -44,8 +44,6 @@ <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:imeActionId="@+id/login"/> -------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidImport.md.html b/docs/checks/InvalidImport.md.html new file mode 100644 index 00000000..4cddb957 --- /dev/null +++ b/docs/checks/InvalidImport.md.html @@ -0,0 +1,168 @@ + +(#) Flags invalid imports. + +!!! WARNING: Flags invalid imports. + This is a warning. + +Id +: `InvalidImport` +Summary +: Flags invalid imports. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidImportDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidImportDetectorTest.kt) + +Flags invalid imports. One example is com.foo.bar.R.drawable. Instead +just the generated class R should be imported and not R.drawable. Also +you should never import anything that's in an internal package. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:3:Warning: Forbidden import [InvalidImport] + +import foo.R.drawable; + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import foo.R.drawable; + +class Example { +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidImportDetectorTest.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, `InvalidImportDetector.rDrawableImport`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InvalidImport") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InvalidImport") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InvalidImport + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidImport" severity="ignore" /> + </lint> + ``` + 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 'InvalidImport' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidImport ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidNavigation.md.html b/docs/checks/InvalidNavigation.md.html index d5795ece..0945c908 100644 --- a/docs/checks/InvalidNavigation.md.html +++ b/docs/checks/InvalidNavigation.md.html @@ -41,8 +41,6 @@ app:startDestination="@id/includedId"> -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidPackage.md.html b/docs/checks/InvalidPackage.md.html index 73f12844..250d3d91 100644 --- a/docs/checks/InvalidPackage.md.html +++ b/docs/checks/InvalidPackage.md.html @@ -55,9 +55,6 @@ [InvalidPackage] 2 errors, 0 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html index 56b347b0..c928e5fd 100644 --- a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html +++ b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html @@ -22,6 +22,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -36,6 +43,36 @@ The interval duration for a `PeriodicWorkRequest` must be at least 15 minutes. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/InvalidPermission.md.html b/docs/checks/InvalidPermission.md.html index fb606ca9..b4f031e4 100644 --- a/docs/checks/InvalidPermission.md.html +++ b/docs/checks/InvalidPermission.md.html @@ -50,8 +50,6 @@ android:permission="android.permission.SET_WALLPAPER"/> ----------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidResourceFolder.md.html b/docs/checks/InvalidResourceFolder.md.html index 758de225..5743e798 100644 --- a/docs/checks/InvalidResourceFolder.md.html +++ b/docs/checks/InvalidResourceFolder.md.html @@ -52,16 +52,13 @@ res/values-ldtrl-mnc123/strings.xml:Error: Invalid resource folder: make sure qualifiers appear in the correct order, are spelled correctly, etc. [InvalidResourceFolder] - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/values-ldtrl-mnc123/strings.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources></resources> +<resources>null</resources> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/InvalidSetHasFixedSize.md.html b/docs/checks/InvalidSetHasFixedSize.md.html index 406fdb24..0325c80f 100644 --- a/docs/checks/InvalidSetHasFixedSize.md.html +++ b/docs/checks/InvalidSetHasFixedSize.md.html @@ -25,18 +25,57 @@ : androidx.recyclerview Feedback : https://issuetracker.google.com/issues/new?component=460887 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.recyclerview:recyclerview](androidx_recyclerview_recyclerview.md.html) + Affects : Kotlin and Java files and resource files Editing : This check can *not* run live in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/recyclerview/recyclerview-lint/src/main/java/androidx/recyclerview/lint/InvalidSetHasFixedSizeDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/recyclerview/recyclerview-lint/src/test/java/androidx/recyclerview/lint/InvalidSetHasFixedSizeTest.kt) Copyright Year : 2020 When a RecyclerView uses `setHasFixedSize(...)` you cannot use `wrap_content` for size in the scrolling direction. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.recyclerview:recyclerview:1.3.1-rc01") + +// build.gradle +implementation 'androidx.recyclerview:recyclerview:1.3.1-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.recyclerview) + +# libs.versions.toml +[versions] +recyclerview = "1.3.1-rc01" +[libraries] +recyclerview = { + module = "androidx.recyclerview:recyclerview", + version.ref = "recyclerview" +} +``` + +1.3.1-rc01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.recyclerview:recyclerview](androidx_recyclerview_recyclerview.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/InvalidSingleLineComment.md.html b/docs/checks/InvalidSingleLineComment.md.html new file mode 100644 index 00000000..c62f561f --- /dev/null +++ b/docs/checks/InvalidSingleLineComment.md.html @@ -0,0 +1,172 @@ + +(#) Marks single line comments that are not sentences. + +!!! WARNING: Marks single line comments that are not sentences. + This is a warning. + +Id +: `InvalidSingleLineComment` +Summary +: Marks single line comments that are not sentences. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Gradle build files and Kotlin and Java files +Editing +: This check can *not* run live in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetectorTest.kt) + +Single line comments should always be sentences. They're part of the +code and hence they deserve as much detail and respect as code. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Warning: Comment does not contain a space at the +beginning [InvalidSingleLineComment] + + //Something. + --- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +class Example { + public void foo() { + //Something. + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetectorTest.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, `InvalidSingleLineCommentDetector.invalidSingleLineCommentNoSpace`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InvalidSingleLineComment") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InvalidSingleLineComment") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InvalidSingleLineComment + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidSingleLineComment" severity="ignore" /> + </lint> + ``` + 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 'InvalidSingleLineComment' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidSingleLineComment ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidString.md.html b/docs/checks/InvalidString.md.html new file mode 100644 index 00000000..94eba804 --- /dev/null +++ b/docs/checks/InvalidString.md.html @@ -0,0 +1,156 @@ + +(#) Marks invalid translation strings. + +!!! WARNING: Marks invalid translation strings. + This is a warning. + +Id +: `InvalidString` +Summary +: Marks invalid translation strings. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidStringDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidStringDetectorTest.kt) + +A translation string is invalid if it contains new lines instead of the +escaped \n or if it contains trailing whitespace. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/strings.xml:2:Warning: Text contains new line. +[InvalidString] + + <string name="my_string">My string" + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/values/strings.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<resources> + <string name="my_string">My string" +</string> +</resources> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidStringDetectorTest.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, `InvalidStringDetector.stringContainingNewLine`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="InvalidString"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <resources xmlns:tools="http://schemas.android.com/tools"> + ... + <string tools:ignore="InvalidString" .../> + ... + </resources> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidString" severity="ignore" /> + </lint> + ``` + 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 'InvalidString' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidString ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidUsesTagAttribute.md.html b/docs/checks/InvalidUsesTagAttribute.md.html index 66919767..fae03819 100644 --- a/docs/checks/InvalidUsesTagAttribute.md.html +++ b/docs/checks/InvalidUsesTagAttribute.md.html @@ -48,8 +48,6 @@ <uses name="medias"/> ------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidVectorPath.md.html b/docs/checks/InvalidVectorPath.md.html index e09ac1ea..de08ed18 100644 --- a/docs/checks/InvalidVectorPath.md.html +++ b/docs/checks/InvalidVectorPath.md.html @@ -50,8 +50,6 @@ android:pathData="m 1.05e-4,2.75448" /> ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidWakeLockTag.md.html b/docs/checks/InvalidWakeLockTag.md.html index 22fdc34d..8c414fe9 100644 --- a/docs/checks/InvalidWakeLockTag.md.html +++ b/docs/checks/InvalidWakeLockTag.md.html @@ -43,8 +43,6 @@ mWakeLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, ""); ------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/InvalidWearFeatureAttribute.md.html b/docs/checks/InvalidWearFeatureAttribute.md.html index 4b45d0b5..43a1d70c 100644 --- a/docs/checks/InvalidWearFeatureAttribute.md.html +++ b/docs/checks/InvalidWearFeatureAttribute.md.html @@ -44,8 +44,6 @@ <uses-feature android:name="android.hardware.type.watch" android:required="false"/> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -57,8 +55,8 @@ <uses-sdk android:targetSdkVersion="23" /> <uses-feature android:name="android.hardware.type.watch" android:required="false"/> <application> - <meta-data - android:name="com.google.android.wearable.standalone" + <meta-data + android:name="com.google.android.wearable.standalone" android:value="true" /> </application> </manifest> diff --git a/docs/checks/JCenter.md.html b/docs/checks/JCenter.md.html new file mode 100644 index 00000000..1678f535 --- /dev/null +++ b/docs/checks/JCenter.md.html @@ -0,0 +1,149 @@ + +(#) Marks usage of the jcenter() repository. + +!!! WARNING: Marks usage of the jcenter() repository. + This is a warning. + +Id +: `JCenter` +Summary +: Marks usage of the jcenter() repository. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Gradle build files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/JcenterDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/JcenterDetectorTest.kt) + +JCenter has gotten less and less reliable and it's best to avoid if +possible. This check will flag usages of jcenter() in your gradle +files. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:3:Warning: Don't use jcenter() [JCenter] + + jcenter() + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +buildscript { + repositories { + jcenter() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/JcenterDetectorTest.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, `JcenterDetector.jcenter`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection JCenter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="JCenter" severity="ignore" /> + </lint> + ``` + 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 'JCenter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore JCenter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/JavaOnlyDetector.md.html b/docs/checks/JavaOnlyDetector.md.html new file mode 100644 index 00000000..45dfdf3f --- /dev/null +++ b/docs/checks/JavaOnlyDetector.md.html @@ -0,0 +1,192 @@ + +(#) Using @JavaOnly elements in Kotlin code. + +!!! ERROR: Using @JavaOnly elements in Kotlin code. + This is an error. + +Id +: `JavaOnlyDetector` +Summary +: Using @JavaOnly elements in Kotlin code. +Severity +: Error +Category +: Interoperability: Kotlin Interoperability +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/JavaOnlyDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/JavaOnlyDetectorTest.kt) +Copyright Year +: 2020 + +This should not be called from Kotlin code. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +test/test/pkg/Test.kt:7:Error: This method should not be called from +Kotlin, see its documentation for details. [JavaOnlyDetector] + + g() + --- + + +test/test/pkg/Test.kt:8:Error: This method should not be called from +Kotlin: satisfying explanation [JavaOnlyDetector] + + f() + --- + + +test/test/pkg/Test.kt:9:Error: This method should not be called from +Kotlin, see its documentation for details. [JavaOnlyDetector] + + val r = this::g + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`test/test/pkg/Test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg +import slack.lint.annotations.JavaOnly +class Test { + @JavaOnly fun g() {} + @JavaOnly("satisfying explanation") fun f() {} + fun m() { + g() + f() + val r = this::g + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/JavaOnlyDetectorTest.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, `JavaOnlyDetector.positive`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("JavaOnlyDetector") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("JavaOnlyDetector") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection JavaOnlyDetector + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="JavaOnlyDetector" severity="ignore" /> + </lint> + ``` + 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 'JavaOnlyDetector' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore JavaOnlyDetector ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/JavaPluginLanguageLevel.md.html b/docs/checks/JavaPluginLanguageLevel.md.html index 3cc6a926..a0969082 100644 --- a/docs/checks/JavaPluginLanguageLevel.md.html +++ b/docs/checks/JavaPluginLanguageLevel.md.html @@ -51,8 +51,6 @@ id 'java' --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/JavascriptInterface.md.html b/docs/checks/JavascriptInterface.md.html index aa982a08..331fd244 100644 --- a/docs/checks/JavascriptInterface.md.html +++ b/docs/checks/JavascriptInterface.md.html @@ -24,6 +24,8 @@ : This check runs on the fly in the IDE editor See : https://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String) +See +: https://goo.gle/JavascriptInterface 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/JavaScriptInterfaceDetector.kt) Tests @@ -73,8 +75,6 @@ webview.addJavascriptInterface(t, "myobj"); ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/JcenterRepositoryObsolete.md.html b/docs/checks/JcenterRepositoryObsolete.md.html index 7ea7f0e3..ec6475b7 100644 --- a/docs/checks/JcenterRepositoryObsolete.md.html +++ b/docs/checks/JcenterRepositoryObsolete.md.html @@ -56,8 +56,6 @@ jcenter() --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/JobSchedulerService.md.html b/docs/checks/JobSchedulerService.md.html index d5d0796e..8d9129fc 100644 --- a/docs/checks/JobSchedulerService.md.html +++ b/docs/checks/JobSchedulerService.md.html @@ -54,8 +54,6 @@ new ComponentName(this, NotAJobService.class)); --------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -89,7 +87,7 @@ } public void testWrongInlined(JobScheduler jobScheduler) { - JobInfo.Builder builder = new JobInfo.Builder(MY_ID, + JobInfo.Builder builder = new JobInfo.Builder(MY_ID, new ComponentName(this, NotAJobService.class)); jobScheduler.schedule(builder .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) diff --git a/docs/checks/JvmStaticProvidesInObjectDetector.md.html b/docs/checks/JvmStaticProvidesInObjectDetector.md.html new file mode 100644 index 00000000..c84d4de8 --- /dev/null +++ b/docs/checks/JvmStaticProvidesInObjectDetector.md.html @@ -0,0 +1,290 @@ + +(#) @JvmStatic used for @Provides function in an object class + +!!! WARNING: @JvmStatic used for @Provides function in an object class + This is a warning. + +Id +: `JvmStaticProvidesInObjectDetector` +Summary +: @JvmStatic used for @Provides function in an object class +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Google +Identifier +: com.google.dagger:dagger-lint +Contact +: https://github.com/google/dagger +Feedback +: https://github.com/google/dagger/issues +Min +: Lint 7.1 +Compiled +: Lint 7.1 +Artifact +: [com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/google/dagger/tree/master/java/dagger/lint/DaggerKotlinIssueDetector.kt) +Tests +: [Source Code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.kt) +Copyright Year +: 2020 + +It's redundant to annotate @Provides functions in object classes with +@JvmStatic. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:26:Warning: @JvmStatic used for @Provides +function in an object class [JvmStaticProvidesInObjectDetector] + + @JvmStatic + ---------- + + +src/foo/MyQualifier.kt:43:Warning: @JvmStatic used for @Provides +function in an object class [JvmStaticProvidesInObjectDetector] + + @JvmStatic + ---------- + + +src/foo/MyQualifier.kt:56:Warning: @JvmStatic used for @Provides +function in an object class [JvmStaticProvidesInObjectDetector] + + @kotlin.jvm.JvmStatic + --------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Inject +import javax.inject.Qualifier +import kotlin.jvm.JvmStatic +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +class InjectedTest { + // This should fail because of `:field` + @Inject + @field:MyQualifier + lateinit var prop: String + + // This is fine! + @Inject + @MyQualifier + lateinit var prop2: String +} + +@Module +object ObjectModule { + // This should fail because it uses `@JvmStatic` + @JvmStatic + @Provides + fun provideFoo(): String { + + } + + // This is fine! + @Provides + fun provideBar(): String { + + } +} + +@Module +class ClassModule { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + @JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModuleQualified { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + // This specifically tests a fully qualified annotation + @kotlin.jvm.JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2 { + // This should fail because the companion object is part of ClassModule + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2Qualified { + // This should fail because the companion object is part of ClassModule + // This specifically tests a fully qualified annotation + @dagger.Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +// This is correct as of Dagger 2.26! +@Module +class ClassModule3 { + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +class ClassModule4 { + // This is should fail because this should be extracted to a standalone object. + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.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, `DaggerKotlinIssueDetector.simpleSmokeTestForQualifiersAndProviders`. +To report a problem with this extracted sample, visit +https://github.com/google/dagger/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("com.google.dagger:dagger-lint:2.46.1") + +// build.gradle +implementation 'com.google.dagger:dagger-lint:2.46.1' + +// build.gradle.kts with version catalogs: +implementation(libs.dagger-lint) + +# libs.versions.toml +[versions] +dagger-lint = "2.46.1" +[libraries] +dagger-lint = { + module = "com.google.dagger:dagger-lint", + version.ref = "dagger-lint" +} +``` + +2.46.1 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). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("JvmStaticProvidesInObjectDetector") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("JvmStaticProvidesInObjectDetector") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection JvmStaticProvidesInObjectDetector + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="JvmStaticProvidesInObjectDetector" severity="ignore" /> + </lint> + ``` + 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 'JvmStaticProvidesInObjectDetector' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore JvmStaticProvidesInObjectDetector ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/KaptUsageInsteadOfKsp.md.html b/docs/checks/KaptUsageInsteadOfKsp.md.html new file mode 100644 index 00000000..cff8de7f --- /dev/null +++ b/docs/checks/KaptUsageInsteadOfKsp.md.html @@ -0,0 +1,151 @@ + +(#) Kapt usage should be replaced with KSP + +!!! WARNING: Kapt usage should be replaced with KSP + This is a warning. + +Id +: `KaptUsageInsteadOfKsp` +Summary +: Kapt usage should be replaced with KSP +Severity +: Warning +Category +: Performance +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Gradle build files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/studio/build/migrate-to-ksp +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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +KSP is a more efficient replacement for kapt. For libraries that support +both, KSP should be used to improve build times. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:9:Warning: This library supports using KSP instead of kapt, +which greatly improves performance. Learn more: +https://developer.android.com/studio/build/migrate-to-ksp +[KaptUsageInsteadOfKsp] + + kapt 'androidx.room:room-compiler:2.5.0' + ---------------------------------------- + + +build.gradle:10:Warning: This library supports using KSP instead of +kapt, which greatly improves performance. Learn more: +https://developer.android.com/studio/build/migrate-to-ksp +[KaptUsageInsteadOfKsp] + + kapt "androidx.room:room-compiler:$room_version" + ------------------------------------------------ + + +build.gradle:13:Warning: This library supports using KSP instead of +kapt, which greatly improves performance. Learn more: +https://developer.android.com/studio/build/migrate-to-ksp +[KaptUsageInsteadOfKsp] + + kapt 'com.github.bumptech.glide:compiler:4.14.2' + ------------------------------------------------ + + +build.gradle:14:Warning: This library supports using KSP instead of +kapt, which greatly improves performance. Learn more: +https://developer.android.com/studio/build/migrate-to-ksp +[KaptUsageInsteadOfKsp] + + kapt("com.github.bumptech.glide:compiler:glide_version") + -------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'com.google.devtools.ksp' +} +dependencies { + def room_version = "2.5.0" + kapt 'androidx.room:room-compiler:2.5.0' + kapt "androidx.room:room-compiler:$room_version" + + def glide_version = "4.14.2" + kapt 'com.github.bumptech.glide:compiler:4.14.2' + kapt("com.github.bumptech.glide:compiler:glide_version") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testKaptToKspMigration`. +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: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection KaptUsageInsteadOfKsp + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="KaptUsageInsteadOfKsp" severity="ignore" /> + </lint> + ``` + 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 'KaptUsageInsteadOfKsp' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore KaptUsageInsteadOfKsp ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/KeyboardInaccessibleWidget.md.html b/docs/checks/KeyboardInaccessibleWidget.md.html index 68a6c985..91b7c86f 100644 --- a/docs/checks/KeyboardInaccessibleWidget.md.html +++ b/docs/checks/KeyboardInaccessibleWidget.md.html @@ -45,8 +45,6 @@ android:clickable="true" /> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/KnownPermissionError.md.html b/docs/checks/KnownPermissionError.md.html index a2104822..734e3dc4 100644 --- a/docs/checks/KnownPermissionError.md.html +++ b/docs/checks/KnownPermissionError.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/KnownPermissionError 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/PermissionErrorDetector.kt) Tests @@ -80,8 +82,6 @@ <provider android:permission="false" /> ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/KotlinNullnessAnnotation.md.html b/docs/checks/KotlinNullnessAnnotation.md.html index 74260e7d..5b6fcf7b 100644 --- a/docs/checks/KotlinNullnessAnnotation.md.html +++ b/docs/checks/KotlinNullnessAnnotation.md.html @@ -65,8 +65,6 @@ fun testError(@NonNull number: Number?) { } -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/KotlinPairNotCreated.md.html b/docs/checks/KotlinPairNotCreated.md.html new file mode 100644 index 00000000..d169d057 --- /dev/null +++ b/docs/checks/KotlinPairNotCreated.md.html @@ -0,0 +1,184 @@ + +(#) Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons + +!!! WARNING: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons + This is a warning. + +Id +: `KotlinPairNotCreated` +Summary +: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/NonKotlinPairDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/NonKotlinPairDetectorTest.kt) +Copyright Year +: 2021 + +We should consolidate to create and use a single type of Pair in the +code base. Kotlin's Pair is preferred as it works well with Java and +Kotlin. It comes with extension functions that Slack's Pair doesn't +offer. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/test/TestClass.java:10:Warning: Use Kotlin's kotlin.Pair +instead of other Pair types from other libraries like AndroidX and Slack +commons [KotlinPairNotCreated] + + Pair pair = Pair.create("first", "second"); + ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/test/TestClass.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package slack.test; + +import androidx.core.util.Pair; + +public class TestClass { + + public void doStuff() { + new Integer(5); + new String("TestString").toString(); + Pair pair = Pair.create("first", "second"); + pair.first.toString(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/NonKotlinPairDetectorTest.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, `NonKotlinPairDetector.Java - AndroidX Pair create shows warning`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("KotlinPairNotCreated") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("KotlinPairNotCreated") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection KotlinPairNotCreated + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="KotlinPairNotCreated" severity="ignore" /> + </lint> + ``` + 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 'KotlinPairNotCreated' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore KotlinPairNotCreated ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/KotlinPropertyAccess.md.html b/docs/checks/KotlinPropertyAccess.md.html index 4c162022..0b84a4f6 100644 --- a/docs/checks/KotlinPropertyAccess.md.html +++ b/docs/checks/KotlinPropertyAccess.md.html @@ -111,8 +111,6 @@ @Override public Float getNumber3() { return 0.0f; } // ERROR (even though we have corresponding setter) ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/KotlinRequireNotNullUseMessage.md.html b/docs/checks/KotlinRequireNotNullUseMessage.md.html new file mode 100644 index 00000000..ef53f7e6 --- /dev/null +++ b/docs/checks/KotlinRequireNotNullUseMessage.md.html @@ -0,0 +1,165 @@ + +(#) Marks usage of the requireNotNull method without lazy messages. + +!!! WARNING: Marks usage of the requireNotNull method without lazy messages. + This is a warning. + +Id +: `KotlinRequireNotNullUseMessage` +Summary +: Marks usage of the requireNotNull method without lazy messages. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/main/java/com/vanniktech/lintrules/kotlin/KotlinRequireNotNullUseMessageDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/test/java/com/vanniktech/lintrules/rxjava2/KotlinRequireNotNullUseMessageDetectorTest.kt) + +The default generated message from requireNotNull often lacks context, +hence it's best to provide a custom message. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Warning: Provide a message +[KotlinRequireNotNullUseMessage] + + requireNotNull(value) + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +fun test(value: Int?) { + requireNotNull(value) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/test/java/com/vanniktech/lintrules/rxjava2/KotlinRequireNotNullUseMessageDetectorTest.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, `KotlinRequireNotNullUseMessageDetector.requireNotNull`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-kotlin:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-kotlin:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-kotlin) + +# libs.versions.toml +[versions] +lint-rules-kotlin = "0.24.0" +[libraries] +lint-rules-kotlin = { + module = "com.vanniktech:lint-rules-kotlin", + version.ref = "lint-rules-kotlin" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("KotlinRequireNotNullUseMessage") + fun method() { + requireNotNull(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("KotlinRequireNotNullUseMessage") + void method() { + requireNotNull(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection KotlinRequireNotNullUseMessage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="KotlinRequireNotNullUseMessage" severity="ignore" /> + </lint> + ``` + 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 'KotlinRequireNotNullUseMessage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore KotlinRequireNotNullUseMessage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/KotlincFE10.md.html b/docs/checks/KotlincFE10.md.html new file mode 100644 index 00000000..f9245bb1 --- /dev/null +++ b/docs/checks/KotlincFE10.md.html @@ -0,0 +1,236 @@ + +(#) Avoid using old K1 Kotlin compiler APIs + +!!! WARNING: Avoid using old K1 Kotlin compiler APIs + This is a warning. + +Id +: `KotlincFE10` +Summary +: Avoid using old K1 Kotlin compiler APIs +Note +: **This issue is disabled by default**; use `--enable KotlincFE10` +Severity +: Warning +Category +: Lint Implementation Issues +Platform +: JDK +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/KotlincFE10Detector.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/KotlincFE10DetectorTest.kt) +Copyright Year +: 2022 + +K2, the new version of Kotlin compiler, which encompasses the new +frontend, is coming. Try to avoid using internal APIs from the old +frontend if possible. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestVisitor.kt:28:Warning: +org.jetbrains.kotlin.resolve.BindingContext appears to be part of the +old K1 Kotlin compiler. Avoid using it if possible; K1 will be going +away soon. [KotlincFE10] + + val bindingContext = service.getBindingContext(declaration) // ERROR + -------------------------------------- + + +src/test/pkg/TestVisitor.kt:29:Warning: +org.jetbrains.kotlin.resolve.BindingContext appears to be part of the +old K1 Kotlin compiler. Avoid using it if possible; K1 will be going +away soon. [KotlincFE10] + + val type = bindingContext.getType(expression) ?: return // ERROR + -------------- + + +src/test/pkg/TestVisitor.kt:30:Warning: +org.jetbrains.kotlin.types.KotlinType appears to be part of the old K1 +Kotlin compiler. Avoid using it if possible; K1 will be going away soon. +[KotlincFE10] + + if (type.isDynamic()) return // ERROR + ---- + + +src/test/pkg/TestVisitor.kt:37:Warning: +org.jetbrains.kotlin.resolve.BindingContext appears to be part of the +old K1 Kotlin compiler. Avoid using it if possible; K1 will be going +away soon. [KotlincFE10] + + bindingContext: BindingContext, // ERROR + -------------- + + +src/test/pkg/TestVisitor.kt:41:Warning: +org.jetbrains.kotlin.resolve.BindingContext appears to be part of the +old K1 Kotlin compiler. Avoid using it if possible; K1 will be going +away soon. [KotlincFE10] + + val descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, node.sourcePsi) // ERROR + -------------- + + +src/test/pkg/TestVisitor.kt:42:Warning: +org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility +appears to be part of the old K1 Kotlin compiler. Avoid using it if +possible; K1 will be going away soon. [KotlincFE10] + + if (descriptor is DeclarationDescriptorWithVisibility) { // ERROR + ----------------------------------- + + +src/test/pkg/TestVisitor.kt:43:Warning: +org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility +appears to be part of the old K1 Kotlin compiler. Avoid using it if +possible; K1 will be going away soon. [KotlincFE10] + + val effectiveVisibility = descriptor.visibility.effectiveVisibility(descriptor, false) // ERROR + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/TestVisitor.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import com.android.tools.lint.client.api.UElementHandler +import com.android.tools.lint.detector.api.JavaContext +import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility +import org.jetbrains.kotlin.descriptors.EffectiveVisibility +import org.jetbrains.kotlin.descriptors.effectiveVisibility +import org.jetbrains.kotlin.psi.KtElement +import org.jetbrains.kotlin.psi.KtCallableDeclaration +import org.jetbrains.kotlin.psi.KtFunction +import org.jetbrains.kotlin.psi.KtProperty +import org.jetbrains.kotlin.resolve.BindingContext +import org.jetbrains.kotlin.types.isDynamic +import org.jetbrains.uast.UElement +import org.jetbrains.uast.UMethod +import org.jetbrains.uast.kotlin.KotlinUastResolveProviderService + +class TestVisitor(val context: JavaContext) : UElementHandler() { + // Example from [InteroperabilityDetector.KotlinVisitor#visitMethod] + override fun visitMethod(node: UMethod) { + val declaration = node.sourcePsi as? KtCallableDeclaration ?: return + val expression = when (declaration) { + is KtProperty -> declaration.initializer ?: declaration.delegateExpression ?: return + is KtFunction -> declaration.bodyExpression ?: declaration.bodyBlockExpression ?: return + else -> return + } + val service = declaration.project.getService(KotlinUastResolveProviderService::class.java) + val bindingContext = service.getBindingContext(declaration) // ERROR + val type = bindingContext.getType(expression) ?: return // ERROR + if (type.isDynamic()) return // ERROR + // report something at the end + } + + // Example from [PsiModifierItem#computeFlag] in Metalava + private fun computeFlag( + node: UElement, + bindingContext: BindingContext, // ERROR + ) : Int { + var visibilityFlag = PACKAGE_PRIVATE + if (node.sourcePsi is KtElement) { + val descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, node.sourcePsi) // ERROR + if (descriptor is DeclarationDescriptorWithVisibility) { // ERROR + val effectiveVisibility = descriptor.visibility.effectiveVisibility(descriptor, false) // ERROR + if (effectiveVisibility == EffectiveVisibility.Internal) { + visibilityFlag = INTERNAL + } + } + } + return visibilityFlag + } + + companion object { + private const val INTERNAL = 1 + private const val PACKAGE_PRIVATE = 2 + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/KotlincFE10DetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("KotlincFE10") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("KotlincFE10") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection KotlincFE10 + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="KotlincFE10" severity="ignore" /> + </lint> + ``` + 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 'KotlincFE10' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore KotlincFE10 ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/KtxExtensionAvailable.md.html b/docs/checks/KtxExtensionAvailable.md.html index 0c2be2dd..baa0d388 100644 --- a/docs/checks/KtxExtensionAvailable.md.html +++ b/docs/checks/KtxExtensionAvailable.md.html @@ -51,8 +51,6 @@ implementation "androidx.core:core:1.2.0" -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LabelFor.md.html b/docs/checks/LabelFor.md.html index 8a92b056..d2f3e3e4 100644 --- a/docs/checks/LabelFor.md.html +++ b/docs/checks/LabelFor.md.html @@ -65,8 +65,6 @@ android:hint="" --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LambdaLast.md.html b/docs/checks/LambdaLast.md.html index 4554935c..0908b148 100644 --- a/docs/checks/LambdaLast.md.html +++ b/docs/checks/LambdaLast.md.html @@ -58,8 +58,6 @@ public void error2(SamInterface sam, int x) { } ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LaunchActivityFromNotification.md.html b/docs/checks/LaunchActivityFromNotification.md.html index 287c6f9f..e630a845 100644 --- a/docs/checks/LaunchActivityFromNotification.md.html +++ b/docs/checks/LaunchActivityFromNotification.md.html @@ -25,7 +25,7 @@ See : https://developer.android.com/guide/topics/ui/notifiers/notifications?hl=en#Actions See -: https://material.io/design/platform-guidance/android-notifications.html#behavior +: https://d.android.com/r/studio-ui/designer/material/notifications-behavior See : https://developer.android.com/guide/topics/ui/notifiers/notifications?hl=en Implementation @@ -53,8 +53,6 @@ .setContentIntent(serviceIntent) ------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LaunchDuringComposition.md.html b/docs/checks/LaunchDuringComposition.md.html index 0844caaf..3909ed56 100644 --- a/docs/checks/LaunchDuringComposition.md.html +++ b/docs/checks/LaunchDuringComposition.md.html @@ -20,6 +20,13 @@ : androidx.activity.compose Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -87,8 +94,6 @@ launcher.launch("test") ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -153,6 +158,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity-compose:1.8.0-alpha05") + +// build.gradle +implementation 'androidx.activity:activity-compose:1.8.0-alpha05' + +// build.gradle.kts with version catalogs: +implementation(libs.activity-compose) + +# libs.versions.toml +[versions] +activity-compose = "1.8.0-alpha05" +[libraries] +activity-compose = { + module = "androidx.activity:activity-compose", + version.ref = "activity-compose" +} +``` + +1.8.0-alpha05 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.activity:activity-compose](androidx_activity_activity-compose.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/LayoutFileNameMatchesClass.md.html b/docs/checks/LayoutFileNameMatchesClass.md.html new file mode 100644 index 00000000..38d71918 --- /dev/null +++ b/docs/checks/LayoutFileNameMatchesClass.md.html @@ -0,0 +1,172 @@ + +(#) Checks that the layout file matches the class name. + +!!! WARNING: Checks that the layout file matches the class name. + This is a warning. + +Id +: `LayoutFileNameMatchesClass` +Summary +: Checks that the layout file matches the class name. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetectorTest.kt) + +Layout file names should always match the name of the class. FooActivity +should have a layout file named activity_foo hence. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/main/java/foo/FooActivity.java:5:Warning: Parameter should be named +R.layout.unit_test_activity_foo [LayoutFileNameMatchesClass] + + setContentView(R.layout.activity_bar); + --------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/main/java/foo/FooActivity.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +class FooActivity extends Activity { + void foo() { + setContentView(R.layout.activity_bar); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetectorTest.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, `LayoutFileNameMatchesClassDetector.fooActivityUsesActivityBarWithResourcePrefix`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("LayoutFileNameMatchesClass") + fun method() { + setContentView(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("LayoutFileNameMatchesClass") + void method() { + setContentView(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection LayoutFileNameMatchesClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="LayoutFileNameMatchesClass" severity="ignore" /> + </lint> + ``` + 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 'LayoutFileNameMatchesClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore LayoutFileNameMatchesClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/LeanbackUsesWifi.md.html b/docs/checks/LeanbackUsesWifi.md.html index f93b8ffd..177f3964 100644 --- a/docs/checks/LeanbackUsesWifi.md.html +++ b/docs/checks/LeanbackUsesWifi.md.html @@ -50,8 +50,6 @@ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> ---------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LibraryCustomView.md.html b/docs/checks/LibraryCustomView.md.html index d691ef61..3f98d0aa 100644 --- a/docs/checks/LibraryCustomView.md.html +++ b/docs/checks/LibraryCustomView.md.html @@ -48,8 +48,6 @@ xmlns:foo="http://schemas.android.com/apk/res/foo" -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LifecycleAnnotationProcessorWithJava8.md.html b/docs/checks/LifecycleAnnotationProcessorWithJava8.md.html index 0d98f2c4..7d14a703 100644 --- a/docs/checks/LifecycleAnnotationProcessorWithJava8.md.html +++ b/docs/checks/LifecycleAnnotationProcessorWithJava8.md.html @@ -56,8 +56,6 @@ annotationProcessor "android.arch.lifecycle:compiler:1.1.1" --------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintDocExample.md.html b/docs/checks/LintDocExample.md.html index f1d7d9a1..fed848ea 100644 --- a/docs/checks/LintDocExample.md.html +++ b/docs/checks/LintDocExample.md.html @@ -54,8 +54,6 @@ fun testBasic() { ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplBadUrl.md.html b/docs/checks/LintImplBadUrl.md.html index 66cbdf93..c430f589 100644 --- a/docs/checks/LintImplBadUrl.md.html +++ b/docs/checks/LintImplBadUrl.md.html @@ -53,8 +53,6 @@ .addMoreInfo("file://explanation.doc") ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplDollarEscapes.md.html b/docs/checks/LintImplDollarEscapes.md.html index 16c67f56..ff066746 100644 --- a/docs/checks/LintImplDollarEscapes.md.html +++ b/docs/checks/LintImplDollarEscapes.md.html @@ -56,8 +56,6 @@ println("Value=${"$"}") ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplIdFormat.md.html b/docs/checks/LintImplIdFormat.md.html index 1a7a9b85..6c948993 100644 --- a/docs/checks/LintImplIdFormat.md.html +++ b/docs/checks/LintImplIdFormat.md.html @@ -58,8 +58,6 @@ id = "badlyCapitalized id", ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplPsiEquals.md.html b/docs/checks/LintImplPsiEquals.md.html index 786e0acc..131cc844 100644 --- a/docs/checks/LintImplPsiEquals.md.html +++ b/docs/checks/LintImplPsiEquals.md.html @@ -50,8 +50,6 @@ if (element2.equals(element1)) { } ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplTextFormat.md.html b/docs/checks/LintImplTextFormat.md.html index 203abced..a2b35cd1 100644 --- a/docs/checks/LintImplTextFormat.md.html +++ b/docs/checks/LintImplTextFormat.md.html @@ -76,8 +76,6 @@ "Should you use `x ?: y` instead of ```foo ? 1 : 0``` ?"); - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplTrimIndent.md.html b/docs/checks/LintImplTrimIndent.md.html index 5a52f990..307d3860 100644 --- a/docs/checks/LintImplTrimIndent.md.html +++ b/docs/checks/LintImplTrimIndent.md.html @@ -59,8 +59,6 @@ """.trimIndent(), ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplUnexpectedDomain.md.html b/docs/checks/LintImplUnexpectedDomain.md.html index e8d2a36a..bda4d30c 100644 --- a/docs/checks/LintImplUnexpectedDomain.md.html +++ b/docs/checks/LintImplUnexpectedDomain.md.html @@ -45,8 +45,6 @@ .addMoreInfo("http://my.personal.blogger.com/aboutme.htm") ------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplUseKotlin.md.html b/docs/checks/LintImplUseKotlin.md.html index fd3eaa1d..2815b617 100644 --- a/docs/checks/LintImplUseKotlin.md.html +++ b/docs/checks/LintImplUseKotlin.md.html @@ -46,8 +46,6 @@ public class MyJavaLintDetector extends Detector { ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LintImplUseUast.md.html b/docs/checks/LintImplUseUast.md.html index 8478a344..2122014e 100644 --- a/docs/checks/LintImplUseUast.md.html +++ b/docs/checks/LintImplUseUast.md.html @@ -93,8 +93,6 @@ PsiTreeUtil.getParentOfType(method, PsiClass.class); // ERROR --------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LocalSuppress.md.html b/docs/checks/LocalSuppress.md.html index 6f12a498..707d383f 100644 --- a/docs/checks/LocalSuppress.md.html +++ b/docs/checks/LocalSuppress.md.html @@ -88,8 +88,6 @@ @SuppressLint("NewApi") // Invalid ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LocaleFolder.md.html b/docs/checks/LocaleFolder.md.html index 63416342..84c686bb 100644 --- a/docs/checks/LocaleFolder.md.html +++ b/docs/checks/LocaleFolder.md.html @@ -52,16 +52,13 @@ res/values-he/strings.xml:Warning: The locale folder "he" should be called "iw" instead; see the java.util.Locale documentation [LocaleFolder] - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/values-he/strings.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources></resources> +<resources>null</resources> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/LockedOrientationActivity.md.html b/docs/checks/LockedOrientationActivity.md.html index d9808ca5..5294e256 100644 --- a/docs/checks/LockedOrientationActivity.md.html +++ b/docs/checks/LockedOrientationActivity.md.html @@ -52,8 +52,6 @@ <activity android:name=".MainActivity" android:screenOrientation="portrait"/> ------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LogConditional.md.html b/docs/checks/LogConditional.md.html index e09d373b..8bcbb8ae 100644 --- a/docs/checks/LogConditional.md.html +++ b/docs/checks/LogConditional.md.html @@ -52,8 +52,6 @@ Log.i(TAG, "message" + m) // string is not constant; computed each time ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LogNotTimber.md.html b/docs/checks/LogNotTimber.md.html new file mode 100644 index 00000000..edd48655 --- /dev/null +++ b/docs/checks/LogNotTimber.md.html @@ -0,0 +1,171 @@ + +(#) Logging call to Log instead of Timber + +!!! WARNING: Logging call to Log instead of Timber + This is a warning. + +Id +: `LogNotTimber` +Summary +: Logging call to Log instead of Timber +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +Since Timber is included in the project, it is likely that calls to Log +should instead be going to Timber. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Warning: Using 'Log' instead of 'Timber' +[LogNotTimber] + + Log.d("TAG", "msg"); + ------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import android.util.Log; +public class Example { + public void log() { + Log.d("TAG", "msg"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.usingAndroidLogWithTwoArguments`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("LogNotTimber") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("LogNotTimber") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection LogNotTimber + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="LogNotTimber" severity="ignore" /> + </lint> + ``` + 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 'LogNotTimber' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore LogNotTimber ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/LogTagMismatch.md.html b/docs/checks/LogTagMismatch.md.html index 3bdd3973..0a663a45 100644 --- a/docs/checks/LogTagMismatch.md.html +++ b/docs/checks/LogTagMismatch.md.html @@ -45,8 +45,6 @@ Log.d(TAG2, "message") // warn: mismatched tags - TAG1 and TAG2 ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/LongLogTag.md.html b/docs/checks/LongLogTag.md.html index e23d646f..48c0fd7d 100644 --- a/docs/checks/LongLogTag.md.html +++ b/docs/checks/LongLogTag.md.html @@ -41,8 +41,6 @@ Log.d(TAG, "message") --- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MainScopeUsage.md.html b/docs/checks/MainScopeUsage.md.html new file mode 100644 index 00000000..6609329b --- /dev/null +++ b/docs/checks/MainScopeUsage.md.html @@ -0,0 +1,178 @@ + +(#) Use slack.foundation.coroutines.android.MainScope. + +!!! ERROR: Use slack.foundation.coroutines.android.MainScope. + This is an error. + +Id +: `MainScopeUsage` +Summary +: Use slack.foundation.coroutines.android.MainScope. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MainScopeUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MainScopeUsageDetectorTest.kt) +Copyright Year +: 2021 + +Prefer using Slack's internal `MainScope` function, which supports +`SlackDispatchers` and uses Dispatchers.Main.immediate under the hood. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/test.kt:6:Error: Use +slack.foundation.coroutines.android.MainScope. [MainScopeUsage] + + val scope = MainScope() + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import kotlinx.coroutines.MainScope + +fun example() { + val scope = MainScope() +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MainScopeUsageDetectorTest.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, `MainScopeUsageDetector.simple`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MainScopeUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MainScopeUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MainScopeUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MainScopeUsage" severity="ignore" /> + </lint> + ``` + 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 'MainScopeUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MainScopeUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MangledCRLF.md.html b/docs/checks/MangledCRLF.md.html index cc1a7ffc..6315decf 100644 --- a/docs/checks/MangledCRLF.md.html +++ b/docs/checks/MangledCRLF.md.html @@ -50,15 +50,13 @@ android:layout_height="match_parent" > ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/layout/crcrlf.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -PFJlbGF0aXZlTGF5b3V0IHhtbG5zOmFuZHJvaWQ9Imh0dHA6Ly9zY2hlbWFzLmFuZHJvaWQuY29tL2Fway9yZXMvYW5kcm9pZCINCiAgICB4bWxuczp0b29scz0iaHR0cDovL3NjaGVtYXMuYW5kcm9pZC5jb20vdG9vbHMiDQogICAgYW5kcm9pZDpsYXlvdXRfd2lkdGg9Im1hdGNoX3BhcmVudCINCiAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9Im1hdGNoX3BhcmVudCIgPg0KDQ0KICAgIDxUZXh0Vmlldw0KICAgICAgICBhbmRyb2lkOmxheW91dF93aWR0aD0id3JhcF9jb250ZW50Ig0KICAgICAgICBhbmRyb2lkOmxheW91dF9oZWlnaHQ9IndyYXBfY29udGVudCINCiAgICAgICAgYW5kcm9pZDpsYXlvdXRfY2VudGVySG9yaXpvbnRhbD0idHJ1ZSINCiAgICAgICAgYW5kcm9pZDpsYXlvdXRfY2VudGVyVmVydGljYWw9InRydWUiDQogICAgICAgIGFuZHJvaWQ6dGV4dD0iSGVsbG8iDQogICAgICAgIHRvb2xzOmNvbnRleHQ9Ii5NYWluQWN0aXZpdHkiIC8+DQoNCjwvUmVsYXRpdmVMYXlvdXQ+DQo= +H4sIAAAAAAAA/42Ry2rDMBBF9wb/g9EHWHtjB7LLItmEkK0Z5KEaKktGGtdxvz7yA5qE1o12uvdc5lWe0QDTFx5hdD1nt9bYUIBtvKOmEpq5K6QMSmMLIV/1XLlWQvcpPQa5aiJNsviWPDtnwmZ6JtbMqhdmbqEeqGFdiRZY6boDj5Z/BzXSh+YXMtulSbrg5QVvfCUclu/fpQYPXa2c5Z9SG+Xeo1V00R+cp++IgqkE+x7/46/omdQGzXGkShzQGPfgztss5p4mOz8B2b2KZyUeRSanlSSlfD51FO+BbabY/QEAAA== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/ManifestOrder.md.html b/docs/checks/ManifestOrder.md.html index 79764c10..ac09e678 100644 --- a/docs/checks/ManifestOrder.md.html +++ b/docs/checks/ManifestOrder.md.html @@ -45,8 +45,6 @@ <uses-sdk android:minSdkVersion="Froyo" /> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ManifestResource.md.html b/docs/checks/ManifestResource.md.html index 6d5f1e31..2a7bc203 100644 --- a/docs/checks/ManifestResource.md.html +++ b/docs/checks/ManifestResource.md.html @@ -62,8 +62,6 @@ android:enabled="@bool/enable_wearable_location_service"> -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ManifestTypo.md.html b/docs/checks/ManifestTypo.md.html index 6ab09b36..22a02da0 100644 --- a/docs/checks/ManifestTypo.md.html +++ b/docs/checks/ManifestTypo.md.html @@ -43,8 +43,6 @@ <use-sdk android:minSdkVersion="14" /> -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MatchingMenuId.md.html b/docs/checks/MatchingMenuId.md.html new file mode 100644 index 00000000..ee31768e --- /dev/null +++ b/docs/checks/MatchingMenuId.md.html @@ -0,0 +1,147 @@ + +(#) Flags menu ids that don't match with the file name. + +!!! WARNING: Flags menu ids that don't match with the file name. + This is a warning. + +Id +: `MatchingMenuId` +Summary +: Flags menu ids that don't match with the file name. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MatchingMenuIdDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingMenuIdDetectorTest.kt) + +When the layout file is named menu_home all of the containing ids should +be prefixed with menuHome to avoid ambiguity between different menu +files across different menu items. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/menu/menu_main.xml:2:Warning: Id should start with: menuMain +[MatchingMenuId] + + <item android:id="@+id/something"/> + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/menu/menu_main.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/something"/> +</menu> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingMenuIdDetectorTest.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, `MatchingMenuIdDetector.idWithoutPrefix`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="MatchingMenuId"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MatchingMenuId" severity="ignore" /> + </lint> + ``` + 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 'MatchingMenuId' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MatchingMenuId ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MatchingViewId.md.html b/docs/checks/MatchingViewId.md.html new file mode 100644 index 00000000..464a80f6 --- /dev/null +++ b/docs/checks/MatchingViewId.md.html @@ -0,0 +1,145 @@ + +(#) Flags view ids that don't match with the file name. + +!!! WARNING: Flags view ids that don't match with the file name. + This is a warning. + +Id +: `MatchingViewId` +Summary +: Flags view ids that don't match with the file name. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MatchingViewIdDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingViewIdDetectorTest.kt) + +When the layout file is named activity_home all of the containing ids +should be prefixed with activityHome to avoid ambiguity between +different layout files across different views. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/activity_main.xml:1:Warning: Id should start with: +activityMain [MatchingViewId] + +<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"/> + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/activity_main.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingViewIdDetectorTest.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, `MatchingViewIdDetector.idWithoutPrefix`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="MatchingViewId"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MatchingViewId" severity="ignore" /> + </lint> + ``` + 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 'MatchingViewId' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MatchingViewId ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MenuTitle.md.html b/docs/checks/MenuTitle.md.html index 79a93ec0..cf944b29 100644 --- a/docs/checks/MenuTitle.md.html +++ b/docs/checks/MenuTitle.md.html @@ -64,8 +64,6 @@ <item android:id="@+id/menu_plus_one" ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MergeMarker.md.html b/docs/checks/MergeMarker.md.html index 111a37b5..8717aa35 100644 --- a/docs/checks/MergeMarker.md.html +++ b/docs/checks/MergeMarker.md.html @@ -52,8 +52,6 @@ >>>>>>> branch-a ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MergeRootFrame.md.html b/docs/checks/MergeRootFrame.md.html index e413c487..50904f36 100644 --- a/docs/checks/MergeRootFrame.md.html +++ b/docs/checks/MergeRootFrame.md.html @@ -45,8 +45,6 @@ <FrameLayout ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MinSdkTooLow.md.html b/docs/checks/MinSdkTooLow.md.html index 2cce8fd8..69da5f5b 100644 --- a/docs/checks/MinSdkTooLow.md.html +++ b/docs/checks/MinSdkTooLow.md.html @@ -56,8 +56,6 @@ minSdk 7 -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MipmapIcons.md.html b/docs/checks/MipmapIcons.md.html index be5cd003..c836b515 100644 --- a/docs/checks/MipmapIcons.md.html +++ b/docs/checks/MipmapIcons.md.html @@ -65,8 +65,6 @@ android:icon="@drawable/activity1" ---------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingApplicationIcon.md.html b/docs/checks/MissingApplicationIcon.md.html index 21c7b610..4a57da5a 100644 --- a/docs/checks/MissingApplicationIcon.md.html +++ b/docs/checks/MissingApplicationIcon.md.html @@ -47,8 +47,6 @@ <application ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingBackupPin.md.html b/docs/checks/MissingBackupPin.md.html index fbf1940f..96a453b9 100644 --- a/docs/checks/MissingBackupPin.md.html +++ b/docs/checks/MissingBackupPin.md.html @@ -44,8 +44,6 @@ <pin-set> ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingClass.md.html b/docs/checks/MissingClass.md.html index 587af9b5..f475d1a3 100644 --- a/docs/checks/MissingClass.md.html +++ b/docs/checks/MissingClass.md.html @@ -49,8 +49,6 @@ <foo.bar.Baz /> --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingColorAlphaChannel.md.html b/docs/checks/MissingColorAlphaChannel.md.html index aa5e9cd6..4af0523b 100644 --- a/docs/checks/MissingColorAlphaChannel.md.html +++ b/docs/checks/MissingColorAlphaChannel.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui.graphics Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -74,8 +81,6 @@ val color4 = Color(0x00_00_00L) ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -106,6 +111,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-graphics) + +# libs.versions.toml +[versions] +ui-graphics = "1.5.0-beta02" +[libraries] +ui-graphics = { + module = "androidx.compose.ui:ui-graphics", + version.ref = "ui-graphics" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/MissingConstraints.md.html b/docs/checks/MissingConstraints.md.html index eb963163..fbd2925c 100644 --- a/docs/checks/MissingConstraints.md.html +++ b/docs/checks/MissingConstraints.md.html @@ -71,8 +71,6 @@ <TextView -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingDefaultResource.md.html b/docs/checks/MissingDefaultResource.md.html index 69082ae8..7d8673fe 100644 --- a/docs/checks/MissingDefaultResource.md.html +++ b/docs/checks/MissingDefaultResource.md.html @@ -71,8 +71,6 @@ <dimen name="extra_dimen1">1pt</dimen> <!-- error --> ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html b/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html index 8c8de30f..a6fcae7c 100644 --- a/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html +++ b/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html @@ -45,8 +45,6 @@ public class MessagingService extends FirebaseMessagingService { ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingId.md.html b/docs/checks/MissingId.md.html index 0879901f..02c3503e 100644 --- a/docs/checks/MissingId.md.html +++ b/docs/checks/MissingId.md.html @@ -58,8 +58,6 @@ <fragment -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingInflatedId.md.html b/docs/checks/MissingInflatedId.md.html index 8c4adc03..76ccadbd 100644 --- a/docs/checks/MissingInflatedId.md.html +++ b/docs/checks/MissingInflatedId.md.html @@ -49,8 +49,6 @@ val imgView = rootView.findViewById<ImageView>(R.id.image_view) --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/MissingIntentFilterForMediaSearch.md.html b/docs/checks/MissingIntentFilterForMediaSearch.md.html index 5c30bdf3..365a2258 100644 --- a/docs/checks/MissingIntentFilterForMediaSearch.md.html +++ b/docs/checks/MissingIntentFilterForMediaSearch.md.html @@ -53,8 +53,6 @@ <application ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingLeanbackLauncher.md.html b/docs/checks/MissingLeanbackLauncher.md.html index bd4db6dd..497da1a0 100644 --- a/docs/checks/MissingLeanbackLauncher.md.html +++ b/docs/checks/MissingLeanbackLauncher.md.html @@ -45,8 +45,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingLeanbackSupport.md.html b/docs/checks/MissingLeanbackSupport.md.html index a76bbad4..f25e9e53 100644 --- a/docs/checks/MissingLeanbackSupport.md.html +++ b/docs/checks/MissingLeanbackSupport.md.html @@ -54,8 +54,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingMediaBrowserServiceIntentFilter.md.html b/docs/checks/MissingMediaBrowserServiceIntentFilter.md.html index 80c495c4..007ed4dd 100644 --- a/docs/checks/MissingMediaBrowserServiceIntentFilter.md.html +++ b/docs/checks/MissingMediaBrowserServiceIntentFilter.md.html @@ -54,8 +54,6 @@ <application ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingOnPlayFromSearch.md.html b/docs/checks/MissingOnPlayFromSearch.md.html index fbb67efd..8446bb46 100644 --- a/docs/checks/MissingOnPlayFromSearch.md.html +++ b/docs/checks/MissingOnPlayFromSearch.md.html @@ -46,8 +46,6 @@ public class MSessionCallback extends Callback { ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingPermission.md.html b/docs/checks/MissingPermission.md.html index cb2c91fe..cc6bb3e0 100644 --- a/docs/checks/MissingPermission.md.html +++ b/docs/checks/MissingPermission.md.html @@ -51,8 +51,6 @@ LocationManager.Location location = locationManager.myMethod(provider); ---------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingPrefix.md.html b/docs/checks/MissingPrefix.md.html index f622c65c..a5bd28fb 100644 --- a/docs/checks/MissingPrefix.md.html +++ b/docs/checks/MissingPrefix.md.html @@ -56,8 +56,6 @@ <Button style="@style/setupWizardOuterFrame" android.text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"/> --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingQuantity.md.html b/docs/checks/MissingQuantity.md.html index 15f98473..16dab08a 100644 --- a/docs/checks/MissingQuantity.md.html +++ b/docs/checks/MissingQuantity.md.html @@ -55,8 +55,6 @@ <plurals name="numberOfSongsAvailable"> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingResourceImportAlias.md.html b/docs/checks/MissingResourceImportAlias.md.html new file mode 100644 index 00000000..203f86a5 --- /dev/null +++ b/docs/checks/MissingResourceImportAlias.md.html @@ -0,0 +1,197 @@ + +(#) Missing import alias for R class. + +!!! ERROR: Missing import alias for R class. + This is an error. + +Id +: `MissingResourceImportAlias` +Summary +: Missing import alias for R class. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/resources/MissingResourceImportAliasDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/MissingResourceImportAliasDetectorTest.kt) +Copyright Year +: 2022 + +Only the local module's R class is allowed to be imported without an +alias. Add an import alias for this. For example, import slack.l10n.R as +L10nR. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Options + +You can configure this lint checks using the following options: + +(###) import-aliases + +A comma-separated list of package name and their import aliases.. +This property should define a comma-separated list of package name and their import aliases in the format: packageName as importAlias + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="MissingResourceImportAlias"> + <option name="import-aliases" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/lint/test/pkg/MyClass.kt:3:Error: Use an import alias for R classes +from other modules [MissingResourceImportAlias] + +import slack.l10n.R +------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/lint/test/pkg/MyClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package lint.test.pkg + +import slack.l10n.R + +class MyClass +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/MissingResourceImportAliasDetectorTest.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, `MissingResourceImportAliasDetector.test failure no references`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MissingResourceImportAlias") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MissingResourceImportAlias") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MissingResourceImportAlias + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MissingResourceImportAlias" severity="ignore" /> + </lint> + ``` + 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 'MissingResourceImportAlias' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MissingResourceImportAlias ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MissingScrollbars.md.html b/docs/checks/MissingScrollbars.md.html new file mode 100644 index 00000000..3d3b63a7 --- /dev/null +++ b/docs/checks/MissingScrollbars.md.html @@ -0,0 +1,148 @@ + +(#) Scroll views should declare a scrollbar. + +!!! WARNING: Scroll views should declare a scrollbar. + This is a warning. + +Id +: `MissingScrollbars` +Summary +: Scroll views should declare a scrollbar. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MissingScrollbarsDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingScrollbarsDetectorTest.kt) + +Every scroll view should explicitly define whether it has scrollbars +(none | vertical | horizontal). + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:1:Warning: Missing scrollbars on ScrollView +[MissingScrollbars] + +<ScrollView +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + /> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingScrollbarsDetectorTest.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, `MissingScrollbarsDetector.scrollView`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="MissingScrollbars"` + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MissingScrollbars" severity="ignore" /> + </lint> + ``` + 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 'MissingScrollbars' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MissingScrollbars ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MissingSuperCall.md.html b/docs/checks/MissingSuperCall.md.html index 9066ba39..e510ab1c 100644 --- a/docs/checks/MissingSuperCall.md.html +++ b/docs/checks/MissingSuperCall.md.html @@ -44,8 +44,6 @@ override fun someMethod(arg: Int) { ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingTranslation.md.html b/docs/checks/MissingTranslation.md.html index 43949a60..5782fab1 100644 --- a/docs/checks/MissingTranslation.md.html +++ b/docs/checks/MissingTranslation.md.html @@ -72,8 +72,6 @@ <string name="menu_settings">Settings</string> -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingTvBanner.md.html b/docs/checks/MissingTvBanner.md.html index dec9a5a6..2cfa4760 100644 --- a/docs/checks/MissingTvBanner.md.html +++ b/docs/checks/MissingTvBanner.md.html @@ -48,8 +48,6 @@ <application> ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingVersion.md.html b/docs/checks/MissingVersion.md.html index ba860a4e..462e6909 100644 --- a/docs/checks/MissingVersion.md.html +++ b/docs/checks/MissingVersion.md.html @@ -51,8 +51,6 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MissingXmlHeader.md.html b/docs/checks/MissingXmlHeader.md.html new file mode 100644 index 00000000..1a11ddb9 --- /dev/null +++ b/docs/checks/MissingXmlHeader.md.html @@ -0,0 +1,144 @@ + +(#) Flags xml files that don't have a header. + +!!! WARNING: Flags xml files that don't have a header. + This is a warning. + +Id +: `MissingXmlHeader` +Summary +: Flags xml files that don't have a header. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetectorTest.kt) + +An xml file should always have the xml header to declare that it is an +xml file despite the file ending. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/strings.xml:1:Warning: Missing an xml header +[MissingXmlHeader] + +<resources/> +------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/values/strings.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<resources/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetectorTest.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, `MissingXmlHeaderDetector.missingHeader`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="MissingXmlHeader"` + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MissingXmlHeader" severity="ignore" /> + </lint> + ``` + 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 'MissingXmlHeader' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MissingXmlHeader ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MockLocation.md.html b/docs/checks/MockLocation.md.html index 6cbe6a08..c9132626 100644 --- a/docs/checks/MockLocation.md.html +++ b/docs/checks/MockLocation.md.html @@ -54,8 +54,6 @@ <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> ------------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ModifierFactoryExtensionFunction.md.html b/docs/checks/ModifierFactoryExtensionFunction.md.html index f09a711c..a8e04416 100644 --- a/docs/checks/ModifierFactoryExtensionFunction.md.html +++ b/docs/checks/ModifierFactoryExtensionFunction.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -68,8 +75,6 @@ val fooModifier3: Modifier get() = TestModifier ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -106,6 +111,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierFactoryReturnType.md.html b/docs/checks/ModifierFactoryReturnType.md.html index 5084ddaf..0340fd9b 100644 --- a/docs/checks/ModifierFactoryReturnType.md.html +++ b/docs/checks/ModifierFactoryReturnType.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -44,8 +51,6 @@ fun Modifier.fooModifier(): Modifier.Element { ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -72,6 +77,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html index 51f44583..4388f23b 100644 --- a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html +++ b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -51,8 +58,6 @@ fun Modifier.fooModifier() = TestModifier ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -77,6 +82,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierNodeInspectableProperties.md.html b/docs/checks/ModifierNodeInspectableProperties.md.html new file mode 100644 index 00000000..57977f65 --- /dev/null +++ b/docs/checks/ModifierNodeInspectableProperties.md.html @@ -0,0 +1,182 @@ + +(#) ModifierNodeElement missing inspectableProperties + +!!! Tip: ModifierNodeElement missing inspectableProperties + Advice from this check is just a tip. + +Id +: `ModifierNodeInspectableProperties` +Summary +: ModifierNodeElement missing inspectableProperties +Severity +: Information +Category +: Productivity +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierNodeInspectablePropertiesDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/ModifierNodeInspectablePropertiesDetectorTest.kt) +Copyright Year +: 2023 + +ModifierNodeElements may override inspectableProperties() to provide +information about the modifier in the layout inspector. The default +implementation attempts to read all of the properties on the class +reflectively, which may not comprehensively or effectively describe the +modifier. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/Element.kt:8:Information: Element does not override +inspectableProperties(). The layout inspector will use the default +implementation of this function, which will attempt to read Element's +properties reflectively. Override inspectableProperties() if you'd like +to customize this modifier's presentation in the layout inspector. +[ModifierNodeInspectableProperties] + + class Element : ModifierNodeElement<Modifier.Node>() { + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/Element.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.InspectableValue +import androidx.compose.ui.node.ModifierNodeElement + +class Element : ModifierNodeElement() { + override fun create() = object : Modifier.Node() {} + override fun update(node: Modifier.Node) = node +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/ModifierNodeInspectablePropertiesDetectorTest.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, `ModifierNodeInspectablePropertiesDetector.testNodeElementWithNoInspectableValues_flagsError`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ModifierNodeInspectableProperties") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ModifierNodeInspectableProperties") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ModifierNodeInspectableProperties + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ModifierNodeInspectableProperties" severity="ignore" /> + </lint> + ``` + 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 'ModifierNodeInspectableProperties' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ModifierNodeInspectableProperties ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ModifierParameter.md.html b/docs/checks/ModifierParameter.md.html index 8cb113e3..6467557c 100644 --- a/docs/checks/ModifierParameter.md.html +++ b/docs/checks/ModifierParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -50,8 +57,6 @@ buttonModifier: Modifier = Modifier, -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -81,6 +86,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModuleCompanionObjects.md.html b/docs/checks/ModuleCompanionObjects.md.html new file mode 100644 index 00000000..ce67cff5 --- /dev/null +++ b/docs/checks/ModuleCompanionObjects.md.html @@ -0,0 +1,290 @@ + +(#) Module companion objects should not be annotated with @Module. + +!!! WARNING: Module companion objects should not be annotated with @Module. + This is a warning. + +Id +: `ModuleCompanionObjects` +Summary +: Module companion objects should not be annotated with @Module. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Google +Identifier +: com.google.dagger:dagger-lint +Contact +: https://github.com/google/dagger +Feedback +: https://github.com/google/dagger/issues +Min +: Lint 7.1 +Compiled +: Lint 7.1 +Artifact +: [com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/google/dagger/tree/master/java/dagger/lint/DaggerKotlinIssueDetector.kt) +Tests +: [Source Code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.kt) +Copyright Year +: 2020 + +Companion objects in @Module-annotated classes are considered part of +the API. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:66:Warning: Module companion objects should not +be annotated with @Module. [ModuleCompanionObjects] + + // This should fail because the companion object is part of ClassModule + ^ + + +src/foo/MyQualifier.kt:78:Warning: Module companion objects should not +be annotated with @Module. [ModuleCompanionObjects] + + // This should fail because the companion object is part of ClassModule + ^ + + +src/foo/MyQualifier.kt:101:Warning: Module companion objects should not +be annotated with @Module. [ModuleCompanionObjects] + + // This is should fail because this should be extracted to a standalone object. + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Inject +import javax.inject.Qualifier +import kotlin.jvm.JvmStatic +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +class InjectedTest { + // This should fail because of `:field` + @Inject + @field:MyQualifier + lateinit var prop: String + + // This is fine! + @Inject + @MyQualifier + lateinit var prop2: String +} + +@Module +object ObjectModule { + // This should fail because it uses `@JvmStatic` + @JvmStatic + @Provides + fun provideFoo(): String { + + } + + // This is fine! + @Provides + fun provideBar(): String { + + } +} + +@Module +class ClassModule { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + @JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModuleQualified { + companion object { + // This should fail because the companion object is part of ClassModule, so this is unnecessary. + // This specifically tests a fully qualified annotation + @kotlin.jvm.JvmStatic + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2 { + // This should fail because the companion object is part of ClassModule + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +@Module +class ClassModule2Qualified { + // This should fail because the companion object is part of ClassModule + // This specifically tests a fully qualified annotation + @dagger.Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +// This is correct as of Dagger 2.26! +@Module +class ClassModule3 { + companion object { + @Provides + fun provideBaz(): String { + + } + } +} + +class ClassModule4 { + // This is should fail because this should be extracted to a standalone object. + @Module + companion object { + @Provides + fun provideBaz(): String { + + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.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, `DaggerKotlinIssueDetector.simpleSmokeTestForQualifiersAndProviders`. +To report a problem with this extracted sample, visit +https://github.com/google/dagger/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("com.google.dagger:dagger-lint:2.46.1") + +// build.gradle +implementation 'com.google.dagger:dagger-lint:2.46.1' + +// build.gradle.kts with version catalogs: +implementation(libs.dagger-lint) + +# libs.versions.toml +[versions] +dagger-lint = "2.46.1" +[libraries] +dagger-lint = { + module = "com.google.dagger:dagger-lint", + version.ref = "dagger-lint" +} +``` + +2.46.1 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). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ModuleCompanionObjects") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ModuleCompanionObjects") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ModuleCompanionObjects + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ModuleCompanionObjects" severity="ignore" /> + </lint> + ``` + 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 'ModuleCompanionObjects' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ModuleCompanionObjects ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html new file mode 100644 index 00000000..7823c54e --- /dev/null +++ b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html @@ -0,0 +1,146 @@ + +(#) Companion objects should not be annotated with @Module. + +!!! WARNING: Companion objects should not be annotated with @Module. + This is a warning. + +Id +: `ModuleCompanionObjectsNotInModuleParent` +Summary +: Companion objects should not be annotated with @Module. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Google +Identifier +: com.google.dagger:dagger-lint +Contact +: https://github.com/google/dagger +Feedback +: https://github.com/google/dagger/issues +Min +: Lint 7.1 +Compiled +: Lint 7.1 +Artifact +: [com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/google/dagger/tree/master/java/dagger/lint/DaggerKotlinIssueDetector.kt) +Tests +: [Source Code](https://github.com/google/dagger/tree/master/javatests/dagger/lint/DaggerKotlinIssueDetectorTest.kt) +Copyright Year +: 2020 + +Companion objects in @Module-annotated classes are considered part of +the API. This +companion object is not a companion to an @Module-annotated class +though, and should be +moved to a top-level object declaration instead otherwise Dagger will +ignore companion +object. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("com.google.dagger:dagger-lint:2.46.1") + +// build.gradle +implementation 'com.google.dagger:dagger-lint:2.46.1' + +// build.gradle.kts with version catalogs: +implementation(libs.dagger-lint) + +# libs.versions.toml +[versions] +dagger-lint = "2.46.1" +[libraries] +dagger-lint = { + module = "com.google.dagger:dagger-lint", + version.ref = "dagger-lint" +} +``` + +2.46.1 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). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ModuleCompanionObjectsNotInModuleParent") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ModuleCompanionObjectsNotInModuleParent") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ModuleCompanionObjectsNotInModuleParent + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ModuleCompanionObjectsNotInModuleParent" severity="ignore" /> + </lint> + ``` + 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 'ModuleCompanionObjectsNotInModuleParent' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ModuleCompanionObjectsNotInModuleParent ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MonochromeLauncherIcon.md.html b/docs/checks/MonochromeLauncherIcon.md.html index 903e37c2..1d663a97 100644 --- a/docs/checks/MonochromeLauncherIcon.md.html +++ b/docs/checks/MonochromeLauncherIcon.md.html @@ -56,8 +56,6 @@ <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html new file mode 100644 index 00000000..10bcb45e --- /dev/null +++ b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html @@ -0,0 +1,208 @@ + +(#) @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. + +!!! ERROR: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. + This is an error. + +Id +: `MoshiUsageAdaptedByRequiresAdapter` +Summary +: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +@AdaptedBy.adapter must be a subclass of JsonAdapter or implement +JsonAdapter.Factory. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example1.kt:14:Error: @AdaptedBy.adapter must be a +JsonAdapter or JsonAdapter.Factory. +[MoshiUsageAdaptedByRequiresAdapter] + +@AdaptedBy(NotAnAdapter::class) + ------------------- + + +src/slack/model/Example1.kt:20:Error: @AdaptedBy.adapter must be a +JsonAdapter or JsonAdapter.Factory. +[MoshiUsageAdaptedByRequiresAdapter] + + @AdaptedBy(NotAnAdapter::class) val value2: String + ------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example1.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.adapters.AdaptedBy + +@AdaptedBy(CustomFactory::class) +class Example1(val value: String) + +@AdaptedBy(CustomAdapter::class) +class Example2(val value: String) + +@AdaptedBy(NotAnAdapter::class) +class Example3 + +@JsonClass(generateAdapter = true) +data class Example3( + @AdaptedBy(CustomAdapter::class) val value1: String, + @AdaptedBy(NotAnAdapter::class) val value2: String +) + +@AdaptedBy(CustomAdapterMissingKeep::class) +class Example4 + +@Keep +abstract class CustomFactory : JsonAdapter.Factory +@Keep +abstract class CustomAdapter : JsonAdapter() +class NotAnAdapter +abstract class CustomAdapterMissingKeep : JsonAdapter() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.valid_adapters`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageAdaptedByRequiresAdapter") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageAdaptedByRequiresAdapter") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageAdaptedByRequiresAdapter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageAdaptedByRequiresAdapter" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageAdaptedByRequiresAdapter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageAdaptedByRequiresAdapter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html new file mode 100644 index 00000000..1e304ff3 --- /dev/null +++ b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html @@ -0,0 +1,199 @@ + +(#) Adapters targeted by @AdaptedBy must have @Keep. + +!!! ERROR: Adapters targeted by @AdaptedBy must have @Keep. + This is an error. + +Id +: `MoshiUsageAdaptedByRequiresKeep` +Summary +: Adapters targeted by @AdaptedBy must have @Keep. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Adapters targeted by @AdaptedBy must be annotated with @Keep in order to +be reflectively looked up at runtime. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example1.kt:23:Error: Adapters targeted by @AdaptedBy +must have @Keep. [MoshiUsageAdaptedByRequiresKeep] + +@AdaptedBy(CustomAdapterMissingKeep::class) + ------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example1.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.adapters.AdaptedBy + +@AdaptedBy(CustomFactory::class) +class Example1(val value: String) + +@AdaptedBy(CustomAdapter::class) +class Example2(val value: String) + +@AdaptedBy(NotAnAdapter::class) +class Example3 + +@JsonClass(generateAdapter = true) +data class Example3( + @AdaptedBy(CustomAdapter::class) val value1: String, + @AdaptedBy(NotAnAdapter::class) val value2: String +) + +@AdaptedBy(CustomAdapterMissingKeep::class) +class Example4 + +@Keep +abstract class CustomFactory : JsonAdapter.Factory +@Keep +abstract class CustomAdapter : JsonAdapter() +class NotAnAdapter +abstract class CustomAdapterMissingKeep : JsonAdapter() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.valid_adapters`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageAdaptedByRequiresKeep") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageAdaptedByRequiresKeep") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageAdaptedByRequiresKeep + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageAdaptedByRequiresKeep" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageAdaptedByRequiresKeep' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageAdaptedByRequiresKeep ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageArray.md.html b/docs/checks/MoshiUsageArray.md.html new file mode 100644 index 00000000..a8a01c4d --- /dev/null +++ b/docs/checks/MoshiUsageArray.md.html @@ -0,0 +1,256 @@ + +(#) Prefer List over Array. + +!!! WARNING: Prefer List over Array. + This is a warning. + +Id +: `MoshiUsageArray` +Summary +: Prefer List over Array. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Array types are not supported by Moshi, please use a List instead. +Arrays are expensive to manage in JSON as we don't know lengths ahead of +time and they are a mutable code smell in what should be immutable value +classes. Otherwise, moshi-gson-interop will hand serialization of this +property to Gson, which may or may not handle it. This will eventually +become an error after GSON is removed. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:43:Warning: Prefer List over Array. +[MoshiUsageArray] + + val arrayType: Array<String>, + ------------- + + +src/slack/model/Example.kt:44:Warning: Prefer List over Array. +[MoshiUsageArray] + + val intArray: IntArray, + -------- + + +src/slack/model/Example.kt:45:Warning: Prefer List over Array. +[MoshiUsageArray] + + val boolArray: BooleanArray, + ------------ + + +src/slack/model/Example.kt:46:Warning: Prefer List over Array. +[MoshiUsageArray] + + val complexArray: Array<List<String>>, + ------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageArray") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageArray") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageArray + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageArray" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageArray' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageArray ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageBlankGenerator.md.html b/docs/checks/MoshiUsageBlankGenerator.md.html new file mode 100644 index 00000000..6f25c188 --- /dev/null +++ b/docs/checks/MoshiUsageBlankGenerator.md.html @@ -0,0 +1,174 @@ + +(#) Don't use blank JsonClass.generator values. + +!!! ERROR: Don't use blank JsonClass.generator values. + This is an error. + +Id +: `MoshiUsageBlankGenerator` +Summary +: Don't use blank JsonClass.generator values. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The default for JsonClass.generator is "", it's redundant to specify an +empty one and an error to specify a blank one. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:5:Error: Don't use blank JsonClass.generator +values. [MoshiUsageBlankGenerator] + +@JsonClass(generateAdapter = true, generator = "") + -- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true, generator = "") +data class Example(val value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.empty_generator`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageBlankGenerator") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageBlankGenerator") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageBlankGenerator + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageBlankGenerator" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageBlankGenerator' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageBlankGenerator ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageBlankJsonName.md.html b/docs/checks/MoshiUsageBlankJsonName.md.html new file mode 100644 index 00000000..ec49f445 --- /dev/null +++ b/docs/checks/MoshiUsageBlankJsonName.md.html @@ -0,0 +1,176 @@ + +(#) Don't use blank names in `@Json`. + +!!! ERROR: Don't use blank names in `@Json`. + This is an error. + +Id +: `MoshiUsageBlankJsonName` +Summary +: Don't use blank names in `@Json`. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Blank names in `@Json`, while technically legal, are likely a programmer +error and +likely to cause encoding issues. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:7:Error: Don't use blank names in @Json. +[MoshiUsageBlankJsonName] + +data class Example(@Json(name = "") val value: String) + -- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import com.squareup.moshi.Json + +@JsonClass(generateAdapter = true) +data class Example(@Json(name = "") val value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.empty_json_name`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageBlankJsonName") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageBlankJsonName") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageBlankJsonName + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageBlankJsonName" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageBlankJsonName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageBlankJsonName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageBlankTypeLabel.md.html b/docs/checks/MoshiUsageBlankTypeLabel.md.html new file mode 100644 index 00000000..121b97d2 --- /dev/null +++ b/docs/checks/MoshiUsageBlankTypeLabel.md.html @@ -0,0 +1,174 @@ + +(#) Moshi-sealed requires a type label specified after the 'sealed:' prefix. + +!!! ERROR: Moshi-sealed requires a type label specified after the 'sealed:' prefix. + This is an error. + +Id +: `MoshiUsageBlankTypeLabel` +Summary +: Moshi-sealed requires a type label specified after the 'sealed:' prefix. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi-sealed requires a type label specified after the 'sealed:' +prefix. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/BaseType.kt:5:Error: Moshi-sealed requires a type label +specified after the 'sealed:' prefix. [MoshiUsageBlankTypeLabel] + +@JsonClass(generateAdapter = true, generator = "sealed:") + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/BaseType.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true, generator = "sealed:") +sealed class BaseType +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_blank_type`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageBlankTypeLabel") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageBlankTypeLabel") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageBlankTypeLabel + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageBlankTypeLabel" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageBlankTypeLabel' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageBlankTypeLabel ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageClassVisibility.md.html b/docs/checks/MoshiUsageClassVisibility.md.html new file mode 100644 index 00000000..d4c17ff1 --- /dev/null +++ b/docs/checks/MoshiUsageClassVisibility.md.html @@ -0,0 +1,188 @@ + +(#) @JsonClass-annotated types must be public, package-private, or internal. + +!!! ERROR: @JsonClass-annotated types must be public, package-private, or internal. + This is an error. + +Id +: `MoshiUsageClassVisibility` +Summary +: @JsonClass-annotated types must be public, package-private, or internal. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +@JsonClass-annotated types must be public, package-private, or internal. +Otherwise, Moshi +will not be able to access them from generated adapters. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/PrivateClass.kt:6:Error: @JsonClass-annotated types must +be public, package-private, or internal. [MoshiUsageClassVisibility] + +private data class PrivateClass(val value: String) +------- + + +src/slack/model/PrivateClass.kt:10:Error: @JsonClass-annotated types +must be public, package-private, or internal. +[MoshiUsageClassVisibility] + + protected data class ProtectedClass(val value: String) + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/PrivateClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +private data class PrivateClass(val value: String) + +open class EnclosingClass { + @JsonClass(generateAdapter = true) + protected data class ProtectedClass(val value: String) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.unsupported_visibility`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageClassVisibility") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageClassVisibility") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageClassVisibility + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageClassVisibility" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageClassVisibility' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageClassVisibility ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageDoubleClassAnnotation.md.html b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html new file mode 100644 index 00000000..bf315eb5 --- /dev/null +++ b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html @@ -0,0 +1,188 @@ + +(#) Only use one of @AdaptedBy or @JsonClass. + +!!! ERROR: Only use one of @AdaptedBy or @JsonClass. + This is an error. + +Id +: `MoshiUsageDoubleClassAnnotation` +Summary +: Only use one of @AdaptedBy or @JsonClass. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Only one of @AdaptedBy and @JsonClass annotations should be present. It +is an error to declare both! + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:8:Error: Only use one of @AdaptedBy or +@JsonClass. [MoshiUsageDoubleClassAnnotation] + +@JsonClass(generateAdapter = true) +---------------------------------- + + +src/slack/model/Example.kt:9:Error: Only use one of @AdaptedBy or +@JsonClass. [MoshiUsageDoubleClassAnnotation] + +@AdaptedBy(CustomFactory::class) +-------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.adapters.AdaptedBy + +@JsonClass(generateAdapter = true) +@AdaptedBy(CustomFactory::class) +data class Example(val value: String) + +@Keep +abstract class CustomFactory : JsonAdapter.Factory +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.double_class_annotation`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageDoubleClassAnnotation") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageDoubleClassAnnotation") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageDoubleClassAnnotation + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageDoubleClassAnnotation" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageDoubleClassAnnotation' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageDoubleClassAnnotation ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageDoubleTypeLabel.md.html b/docs/checks/MoshiUsageDoubleTypeLabel.md.html new file mode 100644 index 00000000..00539aca --- /dev/null +++ b/docs/checks/MoshiUsageDoubleTypeLabel.md.html @@ -0,0 +1,187 @@ + +(#) Only use one of @TypeLabel or @DefaultObject. + +!!! ERROR: Only use one of @TypeLabel or @DefaultObject. + This is an error. + +Id +: `MoshiUsageDoubleTypeLabel` +Summary +: Only use one of @TypeLabel or @DefaultObject. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Only one of @TypeLabel and @DefaultObject annotations should be present. +It is an error to declare both! + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/BaseType.kt:10:Error: Only use one of @TypeLabel or +@DefaultObject. [MoshiUsageDoubleTypeLabel] + +@TypeLabel(label = "one") +------------------------- + + +src/slack/model/BaseType.kt:11:Error: Only use one of @TypeLabel or +@DefaultObject. [MoshiUsageDoubleTypeLabel] + +@DefaultObject +-------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/BaseType.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.sealed.annotations.TypeLabel +import dev.zacsweers.moshix.sealed.annotations.DefaultObject + +@JsonClass(generateAdapter = true, generator = "sealed:type") +sealed class BaseType + +@TypeLabel(label = "one") +@DefaultObject +object Default : BaseType() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_double_annotation`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageDoubleTypeLabel") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageDoubleTypeLabel") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageDoubleTypeLabel + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageDoubleTypeLabel" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageDoubleTypeLabel' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageDoubleTypeLabel ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageDuplicateJsonName.md.html b/docs/checks/MoshiUsageDuplicateJsonName.md.html new file mode 100644 index 00000000..66f8bbc4 --- /dev/null +++ b/docs/checks/MoshiUsageDuplicateJsonName.md.html @@ -0,0 +1,201 @@ + +(#) Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. + +!!! ERROR: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. + This is an error. + +Id +: `MoshiUsageDuplicateJsonName` +Summary +: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Duplicate JSON names are errors as JSON does not allow duplicate keys in +objects. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:8:Error: Name 'value' is duplicated by member +'anotherValue'. [MoshiUsageDuplicateJsonName] + + val value: String, + ----- + + +src/slack/model/Example.kt:9:Error: Name 'value' is duplicated by member +'value'. [MoshiUsageDuplicateJsonName] + + @Json(name = "value") val anotherValue: String, + ------------ + + +src/slack/model/Example.kt:10:Error: Name 'value2' is duplicated by +member 'anotherValue3'. [MoshiUsageDuplicateJsonName] + + @Json(name = "value2") val anotherValue2: String, + ------------- + + +src/slack/model/Example.kt:11:Error: Name 'value2' is duplicated by +member 'anotherValue2'. [MoshiUsageDuplicateJsonName] + + @Json(name = "value2") val anotherValue3: String + ------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example( + val value: String, + @Json(name = "value") val anotherValue: String, + @Json(name = "value2") val anotherValue2: String, + @Json(name = "value2") val anotherValue3: String +) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.duplicateNames`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageDuplicateJsonName") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageDuplicateJsonName") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageDuplicateJsonName + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageDuplicateJsonName" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageDuplicateJsonName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageDuplicateJsonName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html new file mode 100644 index 00000000..e8b0e7bc --- /dev/null +++ b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html @@ -0,0 +1,143 @@ + +(#) UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json + +!!! ERROR: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json + This is an error. + +Id +: `MoshiUsageEnumAnnotatedUnknown` +Summary +: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +UNKNOWN members in @JsonClass-annotated enums should not be annotated +with @Json. These members are only used as a fallback and never expected +in actual JSON bodies. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumAnnotatedUnknown") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumAnnotatedUnknown") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumAnnotatedUnknown + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumAnnotatedUnknown" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumAnnotatedUnknown' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumAnnotatedUnknown ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumCasing.md.html b/docs/checks/MoshiUsageEnumCasing.md.html new file mode 100644 index 00000000..cf1970c6 --- /dev/null +++ b/docs/checks/MoshiUsageEnumCasing.md.html @@ -0,0 +1,143 @@ + +(#) Consider using `@Json(name = ...)` rather than lower casing. + +!!! WARNING: Consider using `@Json(name = ...)` rather than lower casing. + This is a warning. + +Id +: `MoshiUsageEnumCasing` +Summary +: Consider using `@Json(name = ...)` rather than lower casing. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi offers `@Json` annotations to specify names to use in JSON +serialization, similar to Gson's `@SerializedName`. This can help avoid +lower-casing enum properties in source directly. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumCasing") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumCasing") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumCasing + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumCasing" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumCasing' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumCasing ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html new file mode 100644 index 00000000..db693fd3 --- /dev/null +++ b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html @@ -0,0 +1,142 @@ + +(#) Enums annotated with @JsonClass must not set `generateAdapter` to true. + +!!! ERROR: Enums annotated with @JsonClass must not set `generateAdapter` to true. + This is an error. + +Id +: `MoshiUsageEnumJsonClassGenerated` +Summary +: Enums annotated with @JsonClass must not set `generateAdapter` to true. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Enums annotated with @JsonClass do not need to set "generateAdapter" to +true and should set it to false. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumJsonClassGenerated") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumJsonClassGenerated") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumJsonClassGenerated + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumJsonClassGenerated" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumJsonClassGenerated' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumJsonClassGenerated ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumMissingJsonClass.md.html b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html new file mode 100644 index 00000000..8a1a95f1 --- /dev/null +++ b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html @@ -0,0 +1,143 @@ + +(#) Enums serialized with Moshi should be annotated with @JsonClass. + +!!! ERROR: Enums serialized with Moshi should be annotated with @JsonClass. + This is an error. + +Id +: `MoshiUsageEnumMissingJsonClass` +Summary +: Enums serialized with Moshi should be annotated with @JsonClass. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +This enum appears to use Moshi for serialization. Please also add an +@JsonClass annotation to it to ensure safe handling with unknown values +and R8 optimization. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumMissingJsonClass") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumMissingJsonClass") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumMissingJsonClass + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumMissingJsonClass" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumMissingJsonClass' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumMissingJsonClass ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumMissingUnknown.md.html b/docs/checks/MoshiUsageEnumMissingUnknown.md.html new file mode 100644 index 00000000..04cc2e77 --- /dev/null +++ b/docs/checks/MoshiUsageEnumMissingUnknown.md.html @@ -0,0 +1,143 @@ + +(#) Enums serialized with Moshi must reserve the first member as UNKNOWN. + +!!! ERROR: Enums serialized with Moshi must reserve the first member as UNKNOWN. + This is an error. + +Id +: `MoshiUsageEnumMissingUnknown` +Summary +: Enums serialized with Moshi must reserve the first member as UNKNOWN. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +For backward compatibility, enums serialized with Moshi must reserve the +first member as "UNKNOWN". We will automatically substitute this when +encountering an unrecognized value for this enum during decoding. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumMissingUnknown") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumMissingUnknown") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumMissingUnknown + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumMissingUnknown" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumMissingUnknown' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumMissingUnknown ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html new file mode 100644 index 00000000..e26d933d --- /dev/null +++ b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html @@ -0,0 +1,180 @@ + +(#) Consider making enum properties also use Moshi. + +!!! WARNING: Consider making enum properties also use Moshi. + This is a warning. + +Id +: `MoshiUsageEnumPropertyCouldBeMoshi` +Summary +: Consider making enum properties also use Moshi. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +While we have Gson interop, it's convenient to move enums used by Moshi +classes to also use Moshi so that you can leverage built-in support for +UNKNOWN handling and get lint checks for it. Simply add `@JsonClass` to +this enum class and the appropriate lint will guide you. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Warning: Consider making enum properties +also use Moshi. [MoshiUsageEnumPropertyCouldBeMoshi] + +data class Example(val value: TestEnum) + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example(val value: TestEnum) + +enum class TestEnum { + VALUE +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.enum_prop_suggest_moshi`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumPropertyCouldBeMoshi") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumPropertyCouldBeMoshi") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumPropertyCouldBeMoshi + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumPropertyCouldBeMoshi" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumPropertyCouldBeMoshi' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumPropertyCouldBeMoshi ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html new file mode 100644 index 00000000..5626c5d4 --- /dev/null +++ b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html @@ -0,0 +1,202 @@ + +(#) Suspicious default value to 'UNKNOWN' for a Moshi enum. + +!!! ERROR: Suspicious default value to 'UNKNOWN' for a Moshi enum. + This is an error. + +Id +: `MoshiUsageEnumPropertyDefaultUnknown` +Summary +: Suspicious default value to 'UNKNOWN' for a Moshi enum. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The enum type of this property is handled by Moshi. This means it will +default to 'UNKNOWN' if an unrecognized enum is encountered in decoding. +At best, it is redundant to default a property to this value. At worst, +it can change nullability semantics if the enum should actually allow +nullable values or null on absence. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:9:Error: Suspicious default value to +'UNKNOWN' for a Moshi enum. [MoshiUsageEnumPropertyDefaultUnknown] + + val value3: TestEnum? = UNKNOWN, + ------- + + +src/slack/model/Example.kt:10:Error: Suspicious default value to +'UNKNOWN' for a Moshi enum. [MoshiUsageEnumPropertyDefaultUnknown] + + val value4: TestEnum = UNKNOWN, + ------- + + +src/slack/model/Example.kt:11:Error: Suspicious default value to +'UNKNOWN' for a Moshi enum. [MoshiUsageEnumPropertyDefaultUnknown] + + val value5: TestEnum = TestEnum.UNKNOWN, + ---------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example( + val value1: TestEnum?, + val value2: TestEnum? = null, + val value3: TestEnum? = UNKNOWN, + val value4: TestEnum = UNKNOWN, + val value5: TestEnum = TestEnum.UNKNOWN, +) + +@JsonClass(generateAdapter = false) +enum class TestEnum { + UNKNOWN, VALUE +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.enum_prop_default_unknown`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageEnumPropertyDefaultUnknown") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageEnumPropertyDefaultUnknown") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageEnumPropertyDefaultUnknown + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageEnumPropertyDefaultUnknown" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageEnumPropertyDefaultUnknown' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageEnumPropertyDefaultUnknown ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html new file mode 100644 index 00000000..17fc98bd --- /dev/null +++ b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html @@ -0,0 +1,175 @@ + +(#) JsonClass.generateAdapter must be true in order for Moshi code gen to run. + +!!! ERROR: JsonClass.generateAdapter must be true in order for Moshi code gen to run. + This is an error. + +Id +: `MoshiUsageGenerateAdapterShouldBeTrue` +Summary +: JsonClass.generateAdapter must be true in order for Moshi code gen to run. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +JsonClass.generateAdapter must be true in order for Moshi code gen to +run. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:5:Error: JsonClass.generateAdapter must be +true in order for Moshi code gen to run. +[MoshiUsageGenerateAdapterShouldBeTrue] + +@JsonClass(generateAdapter = false) + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = false) +data class Example(val value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.generateAdapter_should_be_true`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageGenerateAdapterShouldBeTrue") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageGenerateAdapterShouldBeTrue") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageGenerateAdapterShouldBeTrue + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageGenerateAdapterShouldBeTrue" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageGenerateAdapterShouldBeTrue' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageGenerateAdapterShouldBeTrue ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageGenericSealedSubtype.md.html b/docs/checks/MoshiUsageGenericSealedSubtype.md.html new file mode 100644 index 00000000..1f706aef --- /dev/null +++ b/docs/checks/MoshiUsageGenericSealedSubtype.md.html @@ -0,0 +1,185 @@ + +(#) Sealed subtypes used with moshi-sealed cannot be generic. + +!!! ERROR: Sealed subtypes used with moshi-sealed cannot be generic. + This is an error. + +Id +: `MoshiUsageGenericSealedSubtype` +Summary +: Sealed subtypes used with moshi-sealed cannot be generic. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi has no way of conveying generics information to sealed subtypes +when we create an adapter from the base type. As a result, you should +remove generics from this subtype. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/BaseType.kt:11:Error: Sealed subtypes used with +moshi-sealed cannot be generic. [MoshiUsageGenericSealedSubtype] + +data class Subtype<T>(val foo: T) : BaseType<T>() + --- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/BaseType.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.sealed.annotations.TypeLabel + +@JsonClass(generateAdapter = true, generator = "sealed:type") +sealed class BaseType + +@TypeLabel(label = "one") +@JsonClass(generateAdapter = true) +data class Subtype(val foo: T) : BaseType() + +// This is "ok" generics use because the subtype itself has none +@TypeLabel(label = "two") +@JsonClass(generateAdapter = true) +data class SubtypeTwo(val foo: String) : BaseType() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_generic`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageGenericSealedSubtype") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageGenericSealedSubtype") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageGenericSealedSubtype + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageGenericSealedSubtype" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageGenericSealedSubtype' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageGenericSealedSubtype ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageInappropriateTypeLabel.md.html b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html new file mode 100644 index 00000000..373ad5e7 --- /dev/null +++ b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html @@ -0,0 +1,198 @@ + +(#) Inappropriate @TypeLabel or @DefaultObject annotation. + +!!! ERROR: Inappropriate @TypeLabel or @DefaultObject annotation. + This is an error. + +Id +: `MoshiUsageInappropriateTypeLabel` +Summary +: Inappropriate @TypeLabel or @DefaultObject annotation. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +This class declares a @TypeLabel or @DefaultObject annotation but does +not appear to subclass a sealed Moshi type. Please remove these +annotations or extend the appropriate sealed Moshi-serialized class. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Subtype.kt:7:Error: Inappropriate @TypeLabel or +@DefaultObject annotation. [MoshiUsageInappropriateTypeLabel] + +@TypeLabel(label = "one") +------------------------- + + +src/slack/model/Subtype.kt:11:Error: Inappropriate @TypeLabel or +@DefaultObject annotation. [MoshiUsageInappropriateTypeLabel] + +@TypeLabel(label = "two") +------------------------- + + +src/slack/model/Subtype.kt:14:Error: Inappropriate @TypeLabel or +@DefaultObject annotation. [MoshiUsageInappropriateTypeLabel] + +@DefaultObject +-------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Subtype.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import dev.zacsweers.moshix.sealed.annotations.TypeLabel +import dev.zacsweers.moshix.sealed.annotations.DefaultObject + +@TypeLabel(label = "one") +@JsonClass(generateAdapter = true) +data class Subtype(val foo: String) + +@TypeLabel(label = "two") +object ObjectSubType + +@DefaultObject +object Default +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_missing_base_type`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageInappropriateTypeLabel") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageInappropriateTypeLabel") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageInappropriateTypeLabel + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageInappropriateTypeLabel" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageInappropriateTypeLabel' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageInappropriateTypeLabel ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageMissingPrimary.md.html b/docs/checks/MoshiUsageMissingPrimary.md.html new file mode 100644 index 00000000..2d4734b5 --- /dev/null +++ b/docs/checks/MoshiUsageMissingPrimary.md.html @@ -0,0 +1,176 @@ + +(#) @JsonClass-annotated types must have a primary constructor or be sealed. + +!!! ERROR: @JsonClass-annotated types must have a primary constructor or be sealed. + This is an error. + +Id +: `MoshiUsageMissingPrimary` +Summary +: @JsonClass-annotated types must have a primary constructor or be sealed. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +@JsonClass-annotated types must have a primary constructor or be sealed. +Otherwise, they either have no serializable properties or all the +potentially serializable properties are mutable (which is not a case we +want!). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Error: @JsonClass-annotated types must have +a primary constructor or be sealed. [MoshiUsageMissingPrimary] + +class Example + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +class Example +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.missing_primary`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageMissingPrimary") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageMissingPrimary") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageMissingPrimary + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageMissingPrimary" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageMissingPrimary' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageMissingPrimary ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageMissingTypeLabel.md.html b/docs/checks/MoshiUsageMissingTypeLabel.md.html new file mode 100644 index 00000000..a179a33d --- /dev/null +++ b/docs/checks/MoshiUsageMissingTypeLabel.md.html @@ -0,0 +1,188 @@ + +(#) Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. + +!!! ERROR: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. + This is an error. + +Id +: `MoshiUsageMissingTypeLabel` +Summary +: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +moshi-sealed requires sealed subtypes to be annotated with @TypeLabel or +@DefaultObject. Otherwise, moshi-sealed will fail to compile. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/BaseType.kt:9:Error: Sealed Moshi subtypes must be +annotated with @TypeLabel or @DefaultObject. +[MoshiUsageMissingTypeLabel] + +data class Subtype(val foo: String) : BaseType() + ------- + + +src/slack/model/BaseType.kt:11:Error: Sealed Moshi subtypes must be +annotated with @TypeLabel or @DefaultObject. +[MoshiUsageMissingTypeLabel] + +object ObjectSubType : BaseType() + ------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/BaseType.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true, generator = "sealed:type") +sealed class BaseType + +@JsonClass(generateAdapter = true) +data class Subtype(val foo: String) : BaseType() + +object ObjectSubType : BaseType() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_missing_type_label`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageMissingTypeLabel") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageMissingTypeLabel") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageMissingTypeLabel + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageMissingTypeLabel" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageMissingTypeLabel' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageMissingTypeLabel ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageMutableCollections.md.html b/docs/checks/MoshiUsageMutableCollections.md.html new file mode 100644 index 00000000..ce98cffd --- /dev/null +++ b/docs/checks/MoshiUsageMutableCollections.md.html @@ -0,0 +1,253 @@ + +(#) Use immutable collections rather than mutable versions. + +!!! ERROR: Use immutable collections rather than mutable versions. + This is an error. + +Id +: `MoshiUsageMutableCollections` +Summary +: Use immutable collections rather than mutable versions. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +While mutable collections are technically possible, they should not be +used with Moshi classes as it can lead to asymmetric encoding and +thread-safety issues. Please make them immutable versions instead. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:53:Error: Use immutable collections rather +than mutable versions. [MoshiUsageMutableCollections] + + val mutableList: MutableList<Int>, + ---------------- + + +src/slack/model/Example.kt:54:Error: Use immutable collections rather +than mutable versions. [MoshiUsageMutableCollections] + + val mutableSet: MutableSet<Int>, + --------------- + + +src/slack/model/Example.kt:55:Error: Use immutable collections rather +than mutable versions. [MoshiUsageMutableCollections] + + val mutableCollection: MutableCollection<Int>, + ---------------------- + + +src/slack/model/Example.kt:56:Error: Use immutable collections rather +than mutable versions. [MoshiUsageMutableCollections] + + val mutableMap: MutableMap<String, String> + -------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageMutableCollections") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageMutableCollections") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageMutableCollections + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageMutableCollections" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageMutableCollections' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageMutableCollections ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageNonMoshiClassCollection.md.html b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html new file mode 100644 index 00000000..f51d09bc --- /dev/null +++ b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html @@ -0,0 +1,243 @@ + +(#) Concrete Collection type '%HINT%' is not natively supported by Moshi. + +!!! Tip: Concrete Collection type '%HINT%' is not natively supported by Moshi. + Advice from this check is just a tip. + +Id +: `MoshiUsageNonMoshiClassCollection` +Summary +: Concrete Collection type '%HINT%' is not natively supported by Moshi. +Severity +: Information +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The property type is concrete Collection type (i.e. ArrayList, HashSet, +etc). Moshi only natively supports their interface types (List, Set, +etc). Consider upcasting to the +interface type. Otherwise, moshi-gson-interop will hand serialization of +this property to Gson, which may or may not handle it. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:25:Information: Concrete Collection type +'ArrayList' is not natively supported by Moshi. +[MoshiUsageNonMoshiClassCollection] + + val concreteList: ArrayList<Int>, + -------------- + + +src/slack/model/Example.kt:26:Information: Concrete Collection type +'HashSet' is not natively supported by Moshi. +[MoshiUsageNonMoshiClassCollection] + + val concreteSet: HashSet<Int>, + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageNonMoshiClassCollection") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageNonMoshiClassCollection") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageNonMoshiClassCollection + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageNonMoshiClassCollection" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageNonMoshiClassCollection' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageNonMoshiClassCollection ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageNonMoshiClassExternal.md.html b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html new file mode 100644 index 00000000..4259964a --- /dev/null +++ b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html @@ -0,0 +1,257 @@ + +(#) External type '%HINT%' is not natively supported by Moshi. + +!!! ERROR: External type '%HINT%' is not natively supported by Moshi. + This is an error. + +Id +: `MoshiUsageNonMoshiClassExternal` +Summary +: External type '%HINT%' is not natively supported by Moshi. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The property type is an external type (i.e. not a Slack or built-in +type). Moshi will try +to serialize these reflectively, which is not something we want. Either +write a custom adapter and annotating this property with `@AdaptedBy` or +exclude/remove this type's use. Otherwise, moshi-gson-interop will hand +serialization of this property to Gson, which may or may not handle it +(also with reflection). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:32:Error: External type 'ExternalType' is not +natively supported by Moshi. [MoshiUsageNonMoshiClassExternal] + + val externalType: ExternalType, + ------------ + + +src/slack/model/Example.kt:47:Error: External type 'ExternalType' is not +natively supported by Moshi. [MoshiUsageNonMoshiClassExternal] + + val badGeneric: List<ExternalType>, + ------------------ + + +src/slack/model/Example.kt:48:Error: External type 'ExternalType' is not +natively supported by Moshi. [MoshiUsageNonMoshiClassExternal] + + val badGeneric2: CustomGenericType<ExternalType>, + ------------------------------- + + +src/slack/model/Example.kt:49:Error: External type 'ExternalType' is not +natively supported by Moshi. [MoshiUsageNonMoshiClassExternal] + + val badNestedGeneric: CustomGenericType<List<ExternalType>>, + ------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageNonMoshiClassExternal") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageNonMoshiClassExternal") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageNonMoshiClassExternal + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageNonMoshiClassExternal" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageNonMoshiClassExternal' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageNonMoshiClassExternal ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageNonMoshiClassInternal.md.html b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html new file mode 100644 index 00000000..c35eaa3a --- /dev/null +++ b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html @@ -0,0 +1,234 @@ + +(#) Non-Moshi internal type '%HINT%' is not natively supported by Moshi. + +!!! Tip: Non-Moshi internal type '%HINT%' is not natively supported by Moshi. + Advice from this check is just a tip. + +Id +: `MoshiUsageNonMoshiClassInternal` +Summary +: Non-Moshi internal type '%HINT%' is not natively supported by Moshi. +Severity +: Information +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The property type is an internal type (i.e. slack.*) but is not a Moshi +class itself. moshi-gson-interop will hand serialization of this +property to Gson, but consider converting this type to Moshi as well to +improve runtime performance and consistency. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:35:Information: Non-Moshi internal type +'InternalType' is not natively supported by Moshi. +[MoshiUsageNonMoshiClassInternal] + + val internalType: InternalType, + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageNonMoshiClassInternal") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageNonMoshiClassInternal") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageNonMoshiClassInternal + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageNonMoshiClassInternal" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageNonMoshiClassInternal' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageNonMoshiClassInternal ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageNonMoshiClassMap.md.html b/docs/checks/MoshiUsageNonMoshiClassMap.md.html new file mode 100644 index 00000000..5801d664 --- /dev/null +++ b/docs/checks/MoshiUsageNonMoshiClassMap.md.html @@ -0,0 +1,233 @@ + +(#) Concrete Map type '%HINT%' is not natively supported by Moshi. + +!!! Tip: Concrete Map type '%HINT%' is not natively supported by Moshi. + Advice from this check is just a tip. + +Id +: `MoshiUsageNonMoshiClassMap` +Summary +: Concrete Map type '%HINT%' is not natively supported by Moshi. +Severity +: Information +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The property type is concrete Map type (i.e. LinkedHashMap, HashMap, +etc). Moshi only natively supports their interface type (Map). Consider +upcasting to the interface type. Otherwise, moshi-gson-interop will hand +serialization of this property to Gson, which may or may not handle it. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:27:Information: Concrete Map type 'HashMap' +is not natively supported by Moshi. [MoshiUsageNonMoshiClassMap] + + val concreteMap: HashMap<String, String>, + ----------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageNonMoshiClassMap") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageNonMoshiClassMap") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageNonMoshiClassMap + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageNonMoshiClassMap" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageNonMoshiClassMap' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageNonMoshiClassMap ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html new file mode 100644 index 00000000..d971d874 --- /dev/null +++ b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html @@ -0,0 +1,235 @@ + +(#) Platform type '%HINT%' is not natively supported by Moshi. + +!!! WARNING: Platform type '%HINT%' is not natively supported by Moshi. + This is a warning. + +Id +: `MoshiUsageNonMoshiClassPlatform` +Summary +: Platform type '%HINT%' is not natively supported by Moshi. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +The property type is a platform type (i.e. from java.*, kotlin.*, +android.*). Moshi only natively supports a small subset of these +(primitives, String, and collection interfaces). Otherwise, +moshi-gson-interop will hand serialization of this property to Gson, +which may or may not handle it. This will eventually become an error +after GSON is removed. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:29:Warning: Platform type 'Date' is not +natively supported by Moshi. [MoshiUsageNonMoshiClassPlatform] + + val platformType: Date, + ---- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import androidx.annotation.Keep +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.JsonClass +import java.util.ArrayList +import java.util.HashSet +import java.util.HashMap +import java.util.Date +import external.ExternalType +import external.ExternalTypeAnnotated +import slack.InternalType +import slack.InternalTypeAnnotated +import slack.InternalTypeAnnotated2 +import dev.zacsweers.moshix.adapters.AdaptedBy +import test.CustomQualifier + +@JsonClass(generateAdapter = true) +data class Example( + // collections + val okList: List, + val okSet: Set, + val okCollection: Collection, + val okMap: Map, + val concreteList: ArrayList, + val concreteSet: HashSet, + val concreteMap: HashMap, + // platform + val platformType: Date, + @AdaptedBy(DateFactory::class) val adaptedByOk: Date, + // external + val externalType: ExternalType, + val externalTypeAnnotated: ExternalTypeAnnotated, + // internal + val internalType: InternalType, + val internalTypeAnnotated: InternalTypeAnnotated, + val internalTypeAnnotated2: InternalTypeAnnotated2, + val int: Int, + val string: String, + val nullableString: String?, + val any: Any, + // Arrays + val arrayType: Array, + val intArray: IntArray, + val boolArray: BooleanArray, + val complexArray: Array>, + val badGeneric: List, + val badGeneric2: CustomGenericType, + val badNestedGeneric: CustomGenericType>, + // This would normally error but since it has a custom qualifier we skip the check + @CustomQualifier val customQualifier: Date, + // Mutable collections + val mutableList: MutableList, + val mutableSet: MutableSet, + val mutableCollection: MutableCollection, + val mutableMap: MutableMap +) + +@Keep +abstract class DateFactory : JsonAdapter.Factory + +@JsonClass(generateAdapter = true) +data class CustomGenericType(val value: T) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.propertyTypes`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageNonMoshiClassPlatform") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageNonMoshiClassPlatform") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageNonMoshiClassPlatform + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageNonMoshiClassPlatform" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageNonMoshiClassPlatform' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageNonMoshiClassPlatform ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageObject.md.html b/docs/checks/MoshiUsageObject.md.html new file mode 100644 index 00000000..4f4e773d --- /dev/null +++ b/docs/checks/MoshiUsageObject.md.html @@ -0,0 +1,176 @@ + +(#) Object types cannot be annotated with @JsonClass. + +!!! ERROR: Object types cannot be annotated with @JsonClass. + This is an error. + +Id +: `MoshiUsageObject` +Summary +: Object types cannot be annotated with @JsonClass. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Object types cannot be annotated with @JsonClass. The only way they are +permitted to participate in Moshi serialization is if they are a sealed +subtype of a Moshi sealed class and annotated with `@TypeLabel` or +`@DefaultObject` accordingly. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:5:Error: Object types cannot be annotated +with @JsonClass. [MoshiUsageObject] + +@JsonClass(generateAdapter = true) +---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +object Example +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.objects_cannot_jsonClass`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageObject") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageObject") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageObject + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageObject" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageObject' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageObject ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageParamNeedsInit.md.html b/docs/checks/MoshiUsageParamNeedsInit.md.html new file mode 100644 index 00000000..ada1d7cf --- /dev/null +++ b/docs/checks/MoshiUsageParamNeedsInit.md.html @@ -0,0 +1,176 @@ + +(#) Constructor non-property parameters in Moshi classes must have default values. + +!!! ERROR: Constructor non-property parameters in Moshi classes must have default values. + This is an error. + +Id +: `MoshiUsageParamNeedsInit` +Summary +: Constructor non-property parameters in Moshi classes must have default values. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Constructor non-property parameters in Moshi classes must have default +values. Since these parameters do not participate in serialization, +Moshi cannot fulfill them otherwise during construction. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:7:Error: Constructor non-property parameters +in Moshi classes must have default values. [MoshiUsageParamNeedsInit] + +class Example(val value: String, nonProp: String, @Transient val transientProp: String) + --------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import kotlin.jvm.Transient + +@JsonClass(generateAdapter = true) +class Example(val value: String, nonProp: String, @Transient val transientProp: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.params_that_need_init`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageParamNeedsInit") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageParamNeedsInit") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageParamNeedsInit + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageParamNeedsInit" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageParamNeedsInit' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageParamNeedsInit ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsagePrivateConstructor.md.html b/docs/checks/MoshiUsagePrivateConstructor.md.html new file mode 100644 index 00000000..3fd86caf --- /dev/null +++ b/docs/checks/MoshiUsagePrivateConstructor.md.html @@ -0,0 +1,184 @@ + +(#) Constructors in Moshi classes cannot be private. + +!!! ERROR: Constructors in Moshi classes cannot be private. + This is an error. + +Id +: `MoshiUsagePrivateConstructor` +Summary +: Constructors in Moshi classes cannot be private. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Constructors in Moshi classes cannot be private. Otherwise Moshi cannot +invoke it during decoding. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Error: Constructors in Moshi classes cannot +be private. [MoshiUsagePrivateConstructor] + +data class Example private constructor(val value: String) + ------- + + +src/slack/model/Example.kt:9:Error: Constructors in Moshi classes cannot +be private. [MoshiUsagePrivateConstructor] + +data class Example2 protected constructor(val value: String) + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example private constructor(val value: String) + +@JsonClass(generateAdapter = true) +data class Example2 protected constructor(val value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.private_constructor`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsagePrivateConstructor") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsagePrivateConstructor") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsagePrivateConstructor + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsagePrivateConstructor" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsagePrivateConstructor' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsagePrivateConstructor ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsagePrivateConstructorProperty.md.html b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html new file mode 100644 index 00000000..f26ee34c --- /dev/null +++ b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html @@ -0,0 +1,174 @@ + +(#) Constructor parameter properties in Moshi classes cannot be private. + +!!! ERROR: Constructor parameter properties in Moshi classes cannot be private. + This is an error. + +Id +: `MoshiUsagePrivateConstructorProperty` +Summary +: Constructor parameter properties in Moshi classes cannot be private. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Constructor parameter properties in Moshi classes cannot be private. +Otherwise these properties will not be visible in serialization. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Error: Constructor parameter properties in +Moshi classes cannot be private. [MoshiUsagePrivateConstructorProperty] + +data class Example(private val value: String, protected val value2: String) + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example(private val value: String, protected val value2: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.private_prop`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsagePrivateConstructorProperty") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsagePrivateConstructorProperty") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsagePrivateConstructorProperty + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsagePrivateConstructorProperty" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsagePrivateConstructorProperty' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsagePrivateConstructorProperty ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageQualifierRetention.md.html b/docs/checks/MoshiUsageQualifierRetention.md.html new file mode 100644 index 00000000..d306d0ed --- /dev/null +++ b/docs/checks/MoshiUsageQualifierRetention.md.html @@ -0,0 +1,209 @@ + +(#) JsonQualifiers must have RUNTIME retention. + +!!! ERROR: JsonQualifiers must have RUNTIME retention. + This is an error. + +Id +: `MoshiUsageQualifierRetention` +Summary +: JsonQualifiers must have RUNTIME retention. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi uses these annotations at runtime, as such they must be available +at runtime. In Kotlin, this is the default and you can just remove the +Retention annotation. In Java, you must specify it explicitly with +@Retention(RUNTIME). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/NoAnnotationsIsOk.kt:37:Error: JsonQualifiers must have +RUNTIME retention. [MoshiUsageQualifierRetention] + +@Retention(AnnotationRetention.BINARY) +-------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/NoAnnotationsIsOk.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonQualifier +import kotlin.annotation.Retention +import kotlin.annotation.AnnotationRetention +import kotlin.annotation.AnnotationRetention.RUNTIME +import kotlin.annotation.AnnotationTarget.PROPERTY +import kotlin.annotation.AnnotationTarget +import kotlin.annotation.AnnotationTarget.FIELD + +@JsonQualifier +annotation class NoAnnotationsIsOk + +@Target(FIELD) +@JsonQualifier +annotation class NoRetentionIsOk + +@Target(AnnotationRetention.FIELD) +@Retention(AnnotationRetention.RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention + +@Target(PROPERTY, AnnotationRetention.FIELD) +@Retention(RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention2 + +@Target([PROPERTY, FIELD]) +@Retention(RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention3 + +@Target(PROPERTY) +@JsonQualifier +annotation class MissingTarget + +@Retention(AnnotationRetention.BINARY) +@JsonQualifier +annotation class WrongRetention +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.kotlin_jsonQualifierAnnotation_ok`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageQualifierRetention") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageQualifierRetention") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageQualifierRetention + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageQualifierRetention" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageQualifierRetention' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageQualifierRetention ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageQualifierTarget.md.html b/docs/checks/MoshiUsageQualifierTarget.md.html new file mode 100644 index 00000000..f28e2b94 --- /dev/null +++ b/docs/checks/MoshiUsageQualifierTarget.md.html @@ -0,0 +1,208 @@ + +(#) JsonQualifiers must include FIELD targeting. + +!!! ERROR: JsonQualifiers must include FIELD targeting. + This is an error. + +Id +: `MoshiUsageQualifierTarget` +Summary +: JsonQualifiers must include FIELD targeting. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi code gen stores these annotations on generated adapter fields, as +such they must be allowed on fields. Please specify it explicitly as +@Target(FIELD). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/NoAnnotationsIsOk.kt:33:Error: JsonQualifiers must +include FIELD targeting. [MoshiUsageQualifierTarget] + +@Target(PROPERTY) +----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/NoAnnotationsIsOk.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonQualifier +import kotlin.annotation.Retention +import kotlin.annotation.AnnotationRetention +import kotlin.annotation.AnnotationRetention.RUNTIME +import kotlin.annotation.AnnotationTarget.PROPERTY +import kotlin.annotation.AnnotationTarget +import kotlin.annotation.AnnotationTarget.FIELD + +@JsonQualifier +annotation class NoAnnotationsIsOk + +@Target(FIELD) +@JsonQualifier +annotation class NoRetentionIsOk + +@Target(AnnotationRetention.FIELD) +@Retention(AnnotationRetention.RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention + +@Target(PROPERTY, AnnotationRetention.FIELD) +@Retention(RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention2 + +@Target([PROPERTY, FIELD]) +@Retention(RUNTIME) +@JsonQualifier +annotation class CorrectTargetAndRetention3 + +@Target(PROPERTY) +@JsonQualifier +annotation class MissingTarget + +@Retention(AnnotationRetention.BINARY) +@JsonQualifier +annotation class WrongRetention +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.kotlin_jsonQualifierAnnotation_ok`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageQualifierTarget") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageQualifierTarget") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageQualifierTarget + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageQualifierTarget" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageQualifierTarget' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageQualifierTarget ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageRedundantJsonName.md.html b/docs/checks/MoshiUsageRedundantJsonName.md.html new file mode 100644 index 00000000..3566929b --- /dev/null +++ b/docs/checks/MoshiUsageRedundantJsonName.md.html @@ -0,0 +1,177 @@ + +(#) Json.name with the same value as the property/enum member name is redundant. + +!!! WARNING: Json.name with the same value as the property/enum member name is redundant. + This is a warning. + +Id +: `MoshiUsageRedundantJsonName` +Summary +: Json.name with the same value as the property/enum member name is redundant. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Redundant Json.name values can make code noisier and harder to read, +consider removing it or suppress this warning with a commented +suppression explaining why it's needed. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:7:Warning: Json.name with the same value as +the property/enum member name is redundant. +[MoshiUsageRedundantJsonName] + +data class Example(@Json(name = "value") val value: String) + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example(@Json(name = "value") val value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.redundantJsonName`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageRedundantJsonName") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageRedundantJsonName") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageRedundantJsonName + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageRedundantJsonName" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageRedundantJsonName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageRedundantJsonName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageRedundantSiteTarget.md.html b/docs/checks/MoshiUsageRedundantSiteTarget.md.html new file mode 100644 index 00000000..1cc343a5 --- /dev/null +++ b/docs/checks/MoshiUsageRedundantSiteTarget.md.html @@ -0,0 +1,177 @@ + +(#) Use of site-targets on @Json are redundant. + +!!! ERROR: Use of site-targets on @Json are redundant. + This is an error. + +Id +: `MoshiUsageRedundantSiteTarget` +Summary +: Use of site-targets on @Json are redundant. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Use of site-targets on @Json are redundant and can be removed. Only one, +target-less @Json annotation is necessary. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:8:Error: Use of site-targets on @Json are +redundant. [MoshiUsageRedundantSiteTarget] + + @field:Json(name = "foo") val value: String + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import com.squareup.moshi.Json + +@JsonClass(generateAdapter = true) +data class Example( + @field:Json(name = "foo") val value: String +) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.jsonNameSiteTargets`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageRedundantSiteTarget") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageRedundantSiteTarget") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageRedundantSiteTarget + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageRedundantSiteTarget" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageRedundantSiteTarget' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageRedundantSiteTarget ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageSealedMustBeSealed.md.html b/docs/checks/MoshiUsageSealedMustBeSealed.md.html new file mode 100644 index 00000000..928d158a --- /dev/null +++ b/docs/checks/MoshiUsageSealedMustBeSealed.md.html @@ -0,0 +1,173 @@ + +(#) Moshi-sealed can only be applied to 'sealed' types. + +!!! ERROR: Moshi-sealed can only be applied to 'sealed' types. + This is an error. + +Id +: `MoshiUsageSealedMustBeSealed` +Summary +: Moshi-sealed can only be applied to 'sealed' types. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi-sealed can only be applied to 'sealed' types. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/BaseType.kt:6:Error: Moshi-sealed can only be applied to +'sealed' types. [MoshiUsageSealedMustBeSealed] + +abstract class BaseType + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/BaseType.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true, generator = "sealed:type") +abstract class BaseType +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.sealed_must_be_sealed`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageSealedMustBeSealed") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageSealedMustBeSealed") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageSealedMustBeSealed + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageSealedMustBeSealed" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageSealedMustBeSealed' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageSealedMustBeSealed ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageSerializedName.md.html b/docs/checks/MoshiUsageSerializedName.md.html new file mode 100644 index 00000000..8182c298 --- /dev/null +++ b/docs/checks/MoshiUsageSerializedName.md.html @@ -0,0 +1,213 @@ + +(#) Use Moshi's @Json rather than Gson's @SerializedName. + +!!! ERROR: Use Moshi's @Json rather than Gson's @SerializedName. + This is an error. + +Id +: `MoshiUsageSerializedName` +Summary +: Use Moshi's @Json rather than Gson's @SerializedName. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +@SerializedName is specific to Gson and will not work with Moshi. +Replace it with Moshi's equivalent @Json annotation instead (or remove +it if @Json is defined already). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:11:Error: Use Moshi's @Json rather than +Gson's @SerializedName. [MoshiUsageSerializedName] + + @SerializedName("full_gson") val fullGson: String, + ---------------------------- + + +src/slack/model/Example.kt:12:Error: Use Moshi's @Json rather than +Gson's @SerializedName. [MoshiUsageSerializedName] + + @SerializedName("full_gson_alts", alternate = ["foo"]) val fullGsonAlternates: String, + ------------------------------------------------------ + + +src/slack/model/Example.kt:13:Error: Use Moshi's @Json rather than +Gson's @SerializedName. [MoshiUsageSerializedName] + + @Json(name = "mixed") @SerializedName("mixed") val mixedSame: String, + ------------------------ + + +src/slack/model/Example.kt:14:Error: Use Moshi's @Json rather than +Gson's @SerializedName. [MoshiUsageSerializedName] + + @Json(name = "mixed_diff") @SerializedName("mixed_diff_2") val mixedDiff: String, + ------------------------------- + + +src/slack/model/Example.kt:15:Error: Use Moshi's @Json rather than +Gson's @SerializedName. [MoshiUsageSerializedName] + + @Json(name = "mixed_alts") @SerializedName("mixed_alts", alternate = ["foo"]) val mixedAlternates: String, + -------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass +import com.google.gson.annotations.SerializedName + +@JsonClass(generateAdapter = true) +data class Example( + val noAnnotations: String, + @Json(name = "full_moshi") val fullMoshi: String, + @SerializedName("full_gson") val fullGson: String, + @SerializedName("full_gson_alts", alternate = ["foo"]) val fullGsonAlternates: String, + @Json(name = "mixed") @SerializedName("mixed") val mixedSame: String, + @Json(name = "mixed_diff") @SerializedName("mixed_diff_2") val mixedDiff: String, + @Json(name = "mixed_alts") @SerializedName("mixed_alts", alternate = ["foo"]) val mixedAlternates: String, +) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.serializedNameIssues`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageSerializedName") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageSerializedName") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageSerializedName + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageSerializedName" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageSerializedName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageSerializedName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageSnakeCase.md.html b/docs/checks/MoshiUsageSnakeCase.md.html new file mode 100644 index 00000000..d2eb610b --- /dev/null +++ b/docs/checks/MoshiUsageSnakeCase.md.html @@ -0,0 +1,179 @@ + +(#) Consider using `@Json(name = ...)` rather than direct snake casing. + +!!! WARNING: Consider using `@Json(name = ...)` rather than direct snake casing. + This is a warning. + +Id +: `MoshiUsageSnakeCase` +Summary +: Consider using `@Json(name = ...)` rather than direct snake casing. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Moshi offers `@Json` annotations to specify names to use in JSON +serialization, similar to Gson's `@SerializedName`. This can help avoid +snake_case properties in source directly. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:8:Warning: Consider using @Json(name = ...) +rather than direct snake casing. [MoshiUsageSnakeCase] + + val snake_case: String, + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import com.squareup.moshi.Json + +@JsonClass(generateAdapter = true) +data class Example( + val snake_case: String, + @Json(name = "taken") val already_annotated_is_ignored: String +) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.snake_case_name`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageSnakeCase") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageSnakeCase") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageSnakeCase + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageSnakeCase" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageSnakeCase' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageSnakeCase ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageTransientNeedsInit.md.html b/docs/checks/MoshiUsageTransientNeedsInit.md.html new file mode 100644 index 00000000..4bdb5ee6 --- /dev/null +++ b/docs/checks/MoshiUsageTransientNeedsInit.md.html @@ -0,0 +1,176 @@ + +(#) Transient constructor properties must have default values. + +!!! ERROR: Transient constructor properties must have default values. + This is an error. + +Id +: `MoshiUsageTransientNeedsInit` +Summary +: Transient constructor properties must have default values. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Transient constructor property parameters in Moshi classes must have +default values. Since these parameters do not participate in +serialization, Moshi cannot fulfill them otherwise during construction. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:7:Error: Transient constructor properties +must have default values. [MoshiUsageTransientNeedsInit] + +class Example(val value: String, nonProp: String, @Transient val transientProp: String) + ------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import kotlin.jvm.Transient + +@JsonClass(generateAdapter = true) +class Example(val value: String, nonProp: String, @Transient val transientProp: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.params_that_need_init`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageTransientNeedsInit") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageTransientNeedsInit") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageTransientNeedsInit + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageTransientNeedsInit" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageTransientNeedsInit' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageTransientNeedsInit ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageUnsupportedType.md.html b/docs/checks/MoshiUsageUnsupportedType.md.html new file mode 100644 index 00000000..fe0d0003 --- /dev/null +++ b/docs/checks/MoshiUsageUnsupportedType.md.html @@ -0,0 +1,207 @@ + +(#) This type cannot be annotated with @JsonClass. + +!!! ERROR: This type cannot be annotated with @JsonClass. + This is an error. + +Id +: `MoshiUsageUnsupportedType` +Summary +: This type cannot be annotated with @JsonClass. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +Abstract, interface, annotation, and inner class types cannot be +annotated with @JsonClass. If you intend to decode this with a custom +adapter, use @AdaptedBy. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Error: This type cannot be annotated with +@JsonClass. [MoshiUsageUnsupportedType] + + @JsonClass(generateAdapter = true) + ---------------------------------- + + +src/slack/model/Example.kt:9:Error: This type cannot be annotated with +@JsonClass. [MoshiUsageUnsupportedType] + + @JsonClass(generateAdapter = true) + ---------------------------------- + + +src/slack/model/Example.kt:12:Error: This type cannot be annotated with +@JsonClass. [MoshiUsageUnsupportedType] + + @JsonClass(generateAdapter = true) + ---------------------------------- + + +src/slack/model/Example.kt:15:Error: This type cannot be annotated with +@JsonClass. [MoshiUsageUnsupportedType] + + @JsonClass(generateAdapter = true) + ---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +class Example { + @JsonClass(generateAdapter = true) + annotation class UnsupportedAnnotation + + @JsonClass(generateAdapter = true) + inner class UnsupportedInner + + @JsonClass(generateAdapter = true) + abstract class UnsupportedAbstract + + @JsonClass(generateAdapter = true) + interface UnsupportedInterface +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.unsupportedClasses`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageUnsupportedType") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageUnsupportedType") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageUnsupportedType + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageUnsupportedType" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageUnsupportedType' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageUnsupportedType ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageUseData.md.html b/docs/checks/MoshiUsageUseData.md.html new file mode 100644 index 00000000..de13a282 --- /dev/null +++ b/docs/checks/MoshiUsageUseData.md.html @@ -0,0 +1,178 @@ + +(#) Model classes should be immutable data classes. + +!!! ERROR: Model classes should be immutable data classes. + This is an error. + +Id +: `MoshiUsageUseData` +Summary +: Model classes should be immutable data classes. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +@JsonClass-annotated models should be immutable data classes unless +there's a very specific reason not to. If you want a custom +equals/hashcode/toString impls, make it data anyway and override the +ones you need. If you want non-property parameter values, consider +making them `@Transient` properties instead with default values. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:7:Error: Model classes should be immutable +data classes. [MoshiUsageUseData] + +class Example(val value: String, nonProp: String, @Transient val transientProp: String) + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass +import kotlin.jvm.Transient + +@JsonClass(generateAdapter = true) +class Example(val value: String, nonProp: String, @Transient val transientProp: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.params_that_need_init`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageUseData") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageUseData") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageUseData + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageUseData" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageUseData' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageUseData ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MoshiUsageVarProperty.md.html b/docs/checks/MoshiUsageVarProperty.md.html new file mode 100644 index 00000000..a2890119 --- /dev/null +++ b/docs/checks/MoshiUsageVarProperty.md.html @@ -0,0 +1,175 @@ + +(#) Moshi properties should be immutable. + +!!! WARNING: Moshi properties should be immutable. + This is a warning. + +Id +: `MoshiUsageVarProperty` +Summary +: Moshi properties should be immutable. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MoshiUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.kt) +Copyright Year +: 2021 + +While var properties are technically possible, they should not be used +with Moshi classes as it can lead to asymmetric encoding and +thread-safety issues. Consider making this val. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/model/Example.kt:6:Warning: Moshi properties should be +immutable. [MoshiUsageVarProperty] + +data class Example(var value: String) + --- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/model/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class Example(var value: String) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MoshiUsageDetectorTest.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, `MoshiUsageDetector.mutable_prop`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MoshiUsageVarProperty") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MoshiUsageVarProperty") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MoshiUsageVarProperty + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MoshiUsageVarProperty" severity="ignore" /> + </lint> + ``` + 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 'MoshiUsageVarProperty' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MoshiUsageVarProperty ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MotionLayoutInvalidSceneFileReference.md.html b/docs/checks/MotionLayoutInvalidSceneFileReference.md.html index fbc5f0ef..1d103ea0 100644 --- a/docs/checks/MotionLayoutInvalidSceneFileReference.md.html +++ b/docs/checks/MotionLayoutInvalidSceneFileReference.md.html @@ -45,8 +45,6 @@ app:layoutDescription="@xml/motion_scene" ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MotionLayoutMissingId.md.html b/docs/checks/MotionLayoutMissingId.md.html index bc1f4906..9c8ccfd9 100644 --- a/docs/checks/MotionLayoutMissingId.md.html +++ b/docs/checks/MotionLayoutMissingId.md.html @@ -43,8 +43,6 @@ <View ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/MotionSceneFileValidationError.md.html b/docs/checks/MotionSceneFileValidationError.md.html index 08f61969..6be13d6c 100644 --- a/docs/checks/MotionSceneFileValidationError.md.html +++ b/docs/checks/MotionSceneFileValidationError.md.html @@ -45,8 +45,6 @@ <CustomAttribute app:customPixelDimension="2sp"/> --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MultipleAwaitPointerEventScopes.md.html b/docs/checks/MultipleAwaitPointerEventScopes.md.html new file mode 100644 index 00000000..f4de5ceb --- /dev/null +++ b/docs/checks/MultipleAwaitPointerEventScopes.md.html @@ -0,0 +1,142 @@ + +(#) Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped. + +!!! WARNING: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped. + This is a warning. + +Id +: `MultipleAwaitPointerEventScopes` +Summary +: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/MultipleAwaitPointerEventScopesDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/MultipleAwaitPointerEventScopesDetectorTest.kt) +Copyright Year +: 2022 + +Pointer Input events are queued inside awaitPointerEventScope. Multiple +calls to awaitPointerEventScope may exit the scope. During this time +there is no guarantee that the events will be queued and some events may +be dropped. It is recommended to use a single top-level block and +perform the pointer events processing within such block. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MultipleAwaitPointerEventScopes") + fun method() { + awaitPointerEventScope(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MultipleAwaitPointerEventScopes") + void method() { + awaitPointerEventScope(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MultipleAwaitPointerEventScopes + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MultipleAwaitPointerEventScopes" severity="ignore" /> + </lint> + ``` + 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 'MultipleAwaitPointerEventScopes' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MultipleAwaitPointerEventScopes ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MultipleUsesSdk.md.html b/docs/checks/MultipleUsesSdk.md.html index c292dea9..8b871b5b 100644 --- a/docs/checks/MultipleUsesSdk.md.html +++ b/docs/checks/MultipleUsesSdk.md.html @@ -48,8 +48,6 @@ <uses-sdk android:targetSdkVersion="14" /> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/MutableCollectionMutableState.md.html b/docs/checks/MutableCollectionMutableState.md.html index d940e581..86604d57 100644 --- a/docs/checks/MutableCollectionMutableState.md.html +++ b/docs/checks/MutableCollectionMutableState.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -111,8 +118,6 @@ val collectionProperty = mutableStateOf(collectionParam) -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -161,6 +166,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/MutatingSharedPrefs.md.html b/docs/checks/MutatingSharedPrefs.md.html index 7c72dd3a..c109f63a 100644 --- a/docs/checks/MutatingSharedPrefs.md.html +++ b/docs/checks/MutatingSharedPrefs.md.html @@ -52,8 +52,6 @@ s.add("error") -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NamespaceTypo.md.html b/docs/checks/NamespaceTypo.md.html index 2550ca55..4267544d 100644 --- a/docs/checks/NamespaceTypo.md.html +++ b/docs/checks/NamespaceTypo.md.html @@ -48,8 +48,6 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andriod" ------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NamingPattern.md.html b/docs/checks/NamingPattern.md.html new file mode 100644 index 00000000..30fd5f9d --- /dev/null +++ b/docs/checks/NamingPattern.md.html @@ -0,0 +1,171 @@ + +(#) Names should be well named. + +!!! WARNING: Names should be well named. + This is a warning. + +Id +: `NamingPattern` +Summary +: Names should be well named. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/NamingPatternDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/NamingPatternDetectorTest.kt) + +Sometimes there is more than one reasonable way to convert an English +phrase into camel case, such as when acronyms or unusual constructs like +"IPv6" or "iOS" are present. XML HTTP request becomes XmlHttpRequest. +XMLHTTPRequest would be incorrect. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Foo.java:5:Warning: iOSVersion is not named in defined camel +case [NamingPattern] + + String iOSVersion; + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Foo.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +class Foo { + private void fun() { + String iOSVersion; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/NamingPatternDetectorTest.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, `NamingPatternDetector.incorrectVariableName`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("NamingPattern") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("NamingPattern") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection NamingPattern + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="NamingPattern" severity="ignore" /> + </lint> + ``` + 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 'NamingPattern' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore NamingPattern ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/NegativeMargin.md.html b/docs/checks/NegativeMargin.md.html index 0fd8c2eb..13cdf5af 100644 --- a/docs/checks/NegativeMargin.md.html +++ b/docs/checks/NegativeMargin.md.html @@ -49,8 +49,6 @@ <TextView android:layout_marginTop="-1dp"/> <!-- WARNING --> ------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NestedScrolling.md.html b/docs/checks/NestedScrolling.md.html index 60441783..90e7a426 100644 --- a/docs/checks/NestedScrolling.md.html +++ b/docs/checks/NestedScrolling.md.html @@ -42,8 +42,6 @@ <ListView -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NestedWeights.md.html b/docs/checks/NestedWeights.md.html index f8e5b944..dc6014db 100644 --- a/docs/checks/NestedWeights.md.html +++ b/docs/checks/NestedWeights.md.html @@ -43,8 +43,6 @@ android:layout_weight="1" ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NetworkSecurityConfig.md.html b/docs/checks/NetworkSecurityConfig.md.html index 3b92d4f7..8ced6875 100644 --- a/docs/checks/NetworkSecurityConfig.md.html +++ b/docs/checks/NetworkSecurityConfig.md.html @@ -63,8 +63,6 @@ <domain-config> ------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NewApi.md.html b/docs/checks/NewApi.md.html index cc574b09..9c5ba2a1 100644 --- a/docs/checks/NewApi.md.html +++ b/docs/checks/NewApi.md.html @@ -66,8 +66,6 @@ val network = cm.activeNetwork // Error: Requires API 23 ------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/NewerVersionAvailable.md.html b/docs/checks/NewerVersionAvailable.md.html index d1662669..65024773 100644 --- a/docs/checks/NewerVersionAvailable.md.html +++ b/docs/checks/NewerVersionAvailable.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor Implementation @@ -71,8 +71,6 @@ compile 'com.google.guava:guava:16.0' ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NfcTechWhitespace.md.html b/docs/checks/NfcTechWhitespace.md.html index 90b27afb..d34e61c4 100644 --- a/docs/checks/NfcTechWhitespace.md.html +++ b/docs/checks/NfcTechWhitespace.md.html @@ -63,8 +63,6 @@ android.nfc.tech.ndefformatable ------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NoHardKeywords.md.html b/docs/checks/NoHardKeywords.md.html index 1ec1ed04..ebe4ee85 100644 --- a/docs/checks/NoHardKeywords.md.html +++ b/docs/checks/NoHardKeywords.md.html @@ -63,8 +63,6 @@ public Object object = null; ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NoOp.md.html b/docs/checks/NoOp.md.html new file mode 100644 index 00000000..a63a243f --- /dev/null +++ b/docs/checks/NoOp.md.html @@ -0,0 +1,166 @@ + +(#) NoOp Code + +!!! WARNING: NoOp Code + This is a warning. + +Id +: `NoOp` +Alias +: ResultOfMethodCallIgnored +Summary +: NoOp Code +Note +: **This issue is disabled by default**; use `--enable NoOp` +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/NoOpDetector.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/NoOpDetectorTest.kt) +Copyright Year +: 2021 + +This check looks for code which looks like it's a no-op -- usually +leftover expressions from interactive debugging, but in some cases bugs +where you had intended to do something with the expression such as +assign it to a field. + +(##) Options + +You can configure this lint checks using the following options: + +(###) pure-getters + +Whether to assume methods with getter-names have no side effects. +Getter methods (where names start with `get` or `is`, and have non-void return types, and no arguments) should not have side effects. With this option turned on, lint will assume that is the case and will list any getter calls whose results are ignored as suspicious code. + +Default is false. + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="NoOp"> + <option name="pure-getters" value="false" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/Test.kt:3:Warning: This reference is unused: s === o [NoOp] + + s === o // ERROR 1 + ------- + + +src/Test.kt:4:Warning: This call result is unused: toString [NoOp] + + o.toString() // ERROR 2 + ------------ + + +src/Test.kt:5:Warning: This reference is unused: length [NoOp] + + s.length // ERROR 3 + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/Test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +class Test { + fun test(s: String, o: Any) { + s === o // ERROR 1 + o.toString() // ERROR 2 + s.length // ERROR 3 + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/NoOpDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("NoOp") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("NoOp") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection NoOp + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="NoOp" severity="ignore" /> + </lint> + ``` + 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 'NoOp' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore NoOp ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/NonConstantResourceId.md.html b/docs/checks/NonConstantResourceId.md.html index fe038d52..99ad669c 100644 --- a/docs/checks/NonConstantResourceId.md.html +++ b/docs/checks/NonConstantResourceId.md.html @@ -54,8 +54,6 @@ case R.id.text: someValue = 3; break; --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NonResizeableActivity.md.html b/docs/checks/NonResizeableActivity.md.html index 386cdfde..8ac4aefa 100644 --- a/docs/checks/NonResizeableActivity.md.html +++ b/docs/checks/NonResizeableActivity.md.html @@ -53,8 +53,6 @@ <activity android:name=".MainActivity" android:resizeableActivity="false"/> ---------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotConstructor.md.html b/docs/checks/NotConstructor.md.html index d2856cc0..b41be27d 100644 --- a/docs/checks/NotConstructor.md.html +++ b/docs/checks/NotConstructor.md.html @@ -43,8 +43,6 @@ public PnrUtils PnrUtils() { ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotInterpolated.md.html b/docs/checks/NotInterpolated.md.html index d32c3432..5ab2da0f 100644 --- a/docs/checks/NotInterpolated.md.html +++ b/docs/checks/NotInterpolated.md.html @@ -47,8 +47,6 @@ compile 'com.android.support:design:${supportLibVersion}' --------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotSibling.md.html b/docs/checks/NotSibling.md.html index 06b360b1..157ed5dd 100644 --- a/docs/checks/NotSibling.md.html +++ b/docs/checks/NotSibling.md.html @@ -44,8 +44,6 @@ android:layout_alignTop="@id/my_id1" ------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotificationIconCompatibility.md.html b/docs/checks/NotificationIconCompatibility.md.html index c3bf3e67..9755b493 100644 --- a/docs/checks/NotificationIconCompatibility.md.html +++ b/docs/checks/NotificationIconCompatibility.md.html @@ -33,7 +33,7 @@ versions below 5.0 (API 21). Note that the way Lint decides whether an icon is a notification icon is based on the filename prefix `ic_stat_`. This corresponds to the naming convention documented in -https://material.io/design/iconography/ +https://d.android.com/r/studio-ui/designer/material/iconography. (##) Example @@ -44,9 +44,6 @@ [NotificationIconCompatibility] 0 errors, 1 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotificationId0.md.html b/docs/checks/NotificationId0.md.html index 399a94fb..650b950a 100644 --- a/docs/checks/NotificationId0.md.html +++ b/docs/checks/NotificationId0.md.html @@ -48,8 +48,6 @@ service.startForeground(MY_ID, notification, 1) // ERROR 2: cannot be zero ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotificationPermission.md.html b/docs/checks/NotificationPermission.md.html index dc16cb01..3d4dfab0 100644 --- a/docs/checks/NotificationPermission.md.html +++ b/docs/checks/NotificationPermission.md.html @@ -42,8 +42,6 @@ notificationManager.notify(id, notification); -------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/NotificationTrampoline.md.html b/docs/checks/NotificationTrampoline.md.html index b1737e4c..f07258cf 100644 --- a/docs/checks/NotificationTrampoline.md.html +++ b/docs/checks/NotificationTrampoline.md.html @@ -56,8 +56,6 @@ .addAction(android.R.drawable.ic_dialog_email, "Launch Receiver From Action", ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NotifyDataSetChanged.md.html b/docs/checks/NotifyDataSetChanged.md.html index 856b2693..27e37ada 100644 --- a/docs/checks/NotifyDataSetChanged.md.html +++ b/docs/checks/NotifyDataSetChanged.md.html @@ -45,8 +45,6 @@ notifyDataSetChanged(); ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/NullSafeMutableLiveData.md.html b/docs/checks/NullSafeMutableLiveData.md.html index 0d00822a..f880f3fd 100644 --- a/docs/checks/NullSafeMutableLiveData.md.html +++ b/docs/checks/NullSafeMutableLiveData.md.html @@ -22,12 +22,21 @@ : androidx.lifecycle Feedback : https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt) Copyright Year : 2019 @@ -42,6 +51,39 @@ reading a null LiveData value that is assumed to be non-nullable. +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-livedata-core-ktx) + +# libs.versions.toml +[versions] +lifecycle-livedata-core-ktx = "2.6.1" +[libraries] +lifecycle-livedata-core-ktx = { + module = "androidx.lifecycle:lifecycle-livedata-core-ktx", + version.ref = "lifecycle-livedata-core-ktx" +} +``` + +2.6.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ObjectAnimatorBinding.md.html b/docs/checks/ObjectAnimatorBinding.md.html index 9ad1f460..897b7719 100644 --- a/docs/checks/ObjectAnimatorBinding.md.html +++ b/docs/checks/ObjectAnimatorBinding.md.html @@ -68,8 +68,6 @@ ObjectAnimator.ofArgb(button, "alpha2", 1, 5); // Missing -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ObsoleteLayoutParam.md.html b/docs/checks/ObsoleteLayoutParam.md.html index 806dbb4b..0d6b5430 100644 --- a/docs/checks/ObsoleteLayoutParam.md.html +++ b/docs/checks/ObsoleteLayoutParam.md.html @@ -89,8 +89,6 @@ android:layout_below="@+id/button1" ----------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ObsoleteSdkInt.md.html b/docs/checks/ObsoleteSdkInt.md.html index 694c4b84..2e0c738f 100644 --- a/docs/checks/ObsoleteSdkInt.md.html +++ b/docs/checks/ObsoleteSdkInt.md.html @@ -57,8 +57,6 @@ if (Build.VERSION.SDK_INT < 21) { // UNNECESSARY, never true -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/OldTargetApi.md.html b/docs/checks/OldTargetApi.md.html index 05e7ab7d..7a85b12e 100644 --- a/docs/checks/OldTargetApi.md.html +++ b/docs/checks/OldTargetApi.md.html @@ -62,8 +62,6 @@ <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14" /> ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/OnClick.md.html b/docs/checks/OnClick.md.html index e1fc089e..60d3066d 100644 --- a/docs/checks/OnClick.md.html +++ b/docs/checks/OnClick.md.html @@ -103,8 +103,6 @@ android:onClick="new" --- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/OpaqueUnitKey.md.html b/docs/checks/OpaqueUnitKey.md.html new file mode 100644 index 00000000..1b05b2fc --- /dev/null +++ b/docs/checks/OpaqueUnitKey.md.html @@ -0,0 +1,189 @@ + +(#) Passing an expression which always returns `Unit` as a key argument + +!!! WARNING: Passing an expression which always returns `Unit` as a key argument + This is a warning. + +Id +: `OpaqueUnitKey` +Summary +: Passing an expression which always returns `Unit` as a key argument +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/OpaqueUnitKeyDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/OpaqueUnitKeyDetectorTest.kt) +Copyright Year +: 2023 + +Certain Compose functions including `remember`, `LaunchedEffect`, and +`DisposableEffect` declare (and sometimes require) one or more key +parameters. When a key parameter changes, it is a signal that the +previous invocation is now invalid. In certain cases, it may be required +to pass `Unit` as a key to one of these functions, indicating that the +invocation never becomes invalid. Using `Unit` as a key should be done +infrequently, and should always be done explicitly by passing the `Unit` +literal. This inspection checks for invocations where `Unit` is being +passed as a key argument in any form other than the `Unit` literal. This +is usually done by mistake, and can harm readability. If a Unit +expression is being passed as a key, it is always equivalent to move the +expression before the function invocation and pass the `Unit` literal +instead. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/test.kt:10:Warning: Implicitly passing Unit as argument to key1 +[OpaqueUnitKey] + + val x = remember(unitProperty) { listOf(1, 2, 3) } + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import androidx.compose.runtime.* + +val unitProperty = Unit + +@Composable +fun Test() { + val x = remember(unitProperty) { listOf(1, 2, 3) } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/OpaqueUnitKeyDetectorTest.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, `OpaqueUnitKeyDetector.remember_withUnitPropertyRead_reportsError`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("OpaqueUnitKey") + fun method() { + remember(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("OpaqueUnitKey") + void method() { + remember(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection OpaqueUnitKey + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="OpaqueUnitKey" severity="ignore" /> + </lint> + ``` + 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 'OpaqueUnitKey' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore OpaqueUnitKey ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/OpenForTesting.md.html b/docs/checks/OpenForTesting.md.html index 1f0825ed..f3d7426a 100644 --- a/docs/checks/OpenForTesting.md.html +++ b/docs/checks/OpenForTesting.md.html @@ -55,8 +55,6 @@ class MyBuilder3 extends Builder1 { // ERROR 3 -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/Orientation.md.html b/docs/checks/Orientation.md.html index 51a1220a..416c171b 100644 --- a/docs/checks/Orientation.md.html +++ b/docs/checks/Orientation.md.html @@ -55,8 +55,6 @@ <LinearLayout ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/OutdatedLibrary.md.html b/docs/checks/OutdatedLibrary.md.html index ce46a31a..235ade98 100644 --- a/docs/checks/OutdatedLibrary.md.html +++ b/docs/checks/OutdatedLibrary.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor See @@ -66,8 +66,6 @@ compile 'com.example.ads.third.party:example:7.2.0' // Outdated & Non compliant & Critical ------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Overdraw.md.html b/docs/checks/Overdraw.md.html index d0de354f..4866d040 100644 --- a/docs/checks/Overdraw.md.html +++ b/docs/checks/Overdraw.md.html @@ -60,8 +60,6 @@ android:background="@drawable/custombg" --------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Override.md.html b/docs/checks/Override.md.html index a1c7895b..55e3dc09 100644 --- a/docs/checks/Override.md.html +++ b/docs/checks/Override.md.html @@ -1,214 +1,8 @@ -(#) Method conflicts with new inherited method +(#) Override -!!! ERROR: Method conflicts with new inherited method - This is an error. - -Id -: `Override` -Summary -: Method conflicts with new inherited method -Severity -: Error -Category -: Correctness -Platform -: Android -Vendor -: Android Open Source Project -Feedback -: https://issuetracker.google.com/issues/new?component=192708 -Affects -: Kotlin and Java 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/ApiDetector.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/ApiDetectorTest.java) -Copyright Year -: 2012 - -Suppose you are building against Android API 8, and you've subclassed -Activity. In your subclass you add a new method called `isDestroyed`(). -At some later point, a method of the same name and signature is added to -Android. Your method will now override the Android method, and possibly -break its contract. Your method is not calling `super.isDestroyed()`, -since your compilation target doesn't know about the method. - -The above scenario is what this lint detector looks for. The above -example is real, since `isDestroyed()` was added in API 17, but it will -be true for **any** method you have added to a subclass of an Android -class where your build target is lower than the version the method was -introduced in. - -To fix this, either rename your method, or if you are really trying to -augment the builtin method if available, switch to a higher build target -where you can deliberately add `@Override` on your overriding method, -and call `super` if appropriate etc. - -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/ApiCallTest11.java:13:Error: This method is not overriding -anything with the current build target, but will in API level 11 -(current target is 3): test.pkg.ApiCallTest11#getActionBar [Override] - - public ActionBar getActionBar() { - ------------ - - -src/test/pkg/ApiCallTest11.java:17:Error: This method is not overriding -anything with the current build target, but will in API level 17 -(current target is 3): test.pkg.ApiCallTest11#isDestroyed [Override] - - public boolean isDestroyed() { - ----------- - - -src/test/pkg/ApiCallTest11.java:39:Error: This method is not overriding -anything with the current build target, but will in API level 11 -(current target is 3): -test.pkg.ApiCallTest11.MyLinear#setDividerDrawable [Override] - - public void setDividerDrawable(Drawable dividerDrawable) { - ------------------ - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/test/pkg/ApiCallTest11.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package test.pkg; - -import android.annotation.SuppressLint; -import android.app.ActionBar; -import android.app.Activity; -import android.content.Context; -import android.graphics.drawable.Drawable; -import android.widget.LinearLayout; - -public class ApiCallTest11 extends Activity { - MyActivity mActionBarHost; - - public ActionBar getActionBar() { - return mActionBarHost.getActionBar(); - } - - public boolean isDestroyed() { - return true; - } - - @SuppressLint("Override") - public void finishAffinity() { - } - - private class MyLinear extends LinearLayout { - private Drawable mDividerDrawable; - - public MyLinear(Context context) { - super(context); - } - - /** - * Javadoc here - * - * - * - * - */ - public void setDividerDrawable(Drawable dividerDrawable) { - mDividerDrawable = dividerDrawable; - } - } - - private class MyActivity { - public ActionBar getActionBar() { - return null; - } - } -} - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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/ApiDetectorTest.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, `ApiDetector.testOverride`. -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: - -* Using a suppression annotation like this on the enclosing - element: - - ```kt - // Kotlin - @Suppress("Override") - fun method() { - problematicStatement() - } - ``` - - or - - ```java - // Java - @SuppressWarnings("Override") - void method() { - problematicStatement(); - } - ``` - -* Using a suppression comment like this on the line above: - - ```kt - //noinspection Override - 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 - <?xml version="1.0" encoding="UTF-8"?> - <lint> - <issue id="Override" severity="ignore" /> - </lint> - ``` - 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 'Override' - } - ``` - In Android projects this should be nested inside an `android { }` - block. - -* For manual invocations of `lint`, using the `--ignore` flag: - ``` - $ lint --ignore Override ...` - ``` - -* Last, but not least, using baselines, as discussed - [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). +The issue for this id has been deleted or marked obsolete and can now be +ignored. +(Additional metadata not available.) \ No newline at end of file diff --git a/docs/checks/OverrideAbstract.md.html b/docs/checks/OverrideAbstract.md.html index ee2f3498..5a60e2f6 100644 --- a/docs/checks/OverrideAbstract.md.html +++ b/docs/checks/OverrideAbstract.md.html @@ -77,8 +77,6 @@ private static class MyNotificationListenerService7 extends MyNotificationListenerService3 { ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PackageManagerGetSignatures.md.html b/docs/checks/PackageManagerGetSignatures.md.html index 16a21e72..2fb0e9a1 100644 --- a/docs/checks/PackageManagerGetSignatures.md.html +++ b/docs/checks/PackageManagerGetSignatures.md.html @@ -1,147 +1,8 @@ -(#) Potential Multiple Certificate Exploit +(#) PackageManagerGetSignatures -!!! WARNING: Potential Multiple Certificate Exploit - This is a warning. - -Id -: `PackageManagerGetSignatures` -Summary -: Potential Multiple Certificate Exploit -Severity -: Warning -Category -: Security -Platform -: Android -Vendor -: Android Open Source Project -Feedback -: https://issuetracker.google.com/issues/new?component=192708 -Affects -: Kotlin and Java files -Editing -: This check runs on the fly in the IDE editor -See -: https://bluebox.com/technical/android-fake-id-vulnerability/ -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/GetSignaturesDetector.java) -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/GetSignaturesDetectorTest.java) -Copyright Year -: 2014 - -Improper validation of app signatures could lead to issues where a -malicious app submits itself to the Play Store with both its real -certificate and a fake certificate and gains access to functionality or -information it shouldn't have due to another application only checking -for the fake certificate and ignoring the rest. Please make sure to -validate all signatures returned by this method. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/GetSignaturesSingleFlagTest.java:9:Warning: Reading app -signatures from getPackageInfo: The app signatures could be exploited if -not validated properly; see issue explanation for details -[PackageManagerGetSignatures] - - .getPackageInfo("some.pkg", PackageManager.GET_SIGNATURES); - ----------------------------- - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/test/pkg/GetSignaturesSingleFlagTest.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package test.pkg; - -import android.app.Activity; -import android.content.pm.PackageManager; - -public class GetSignaturesSingleFlagTest extends Activity { - public void failLintCheck() throws Exception { - getPackageManager() - .getPackageInfo("some.pkg", PackageManager.GET_SIGNATURES); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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/GetSignaturesDetectorTest.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, `GetSignaturesDetector.testLintWarningOnSingleGetSignaturesFlag`. -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: - -* Using a suppression annotation like this on the enclosing - element: - - ```kt - // Kotlin - @Suppress("PackageManagerGetSignatures") - fun method() { - getPackageInfo(...) - } - ``` - - or - - ```java - // Java - @SuppressWarnings("PackageManagerGetSignatures") - void method() { - getPackageInfo(...); - } - ``` - -* Using a suppression comment like this on the line above: - - ```kt - //noinspection PackageManagerGetSignatures - 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 - <?xml version="1.0" encoding="UTF-8"?> - <lint> - <issue id="PackageManagerGetSignatures" severity="ignore" /> - </lint> - ``` - 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 'PackageManagerGetSignatures' - } - ``` - In Android projects this should be nested inside an `android { }` - block. - -* For manual invocations of `lint`, using the `--ignore` flag: - ``` - $ lint --ignore PackageManagerGetSignatures ...` - ``` - -* Last, but not least, using baselines, as discussed - [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). +The issue for this id has been deleted or marked obsolete and can now be +ignored. +(Additional metadata not available.) \ No newline at end of file diff --git a/docs/checks/PackagedPrivateKey.md.html b/docs/checks/PackagedPrivateKey.md.html index cdaf89c4..db24232f 100644 --- a/docs/checks/PackagedPrivateKey.md.html +++ b/docs/checks/PackagedPrivateKey.md.html @@ -22,6 +22,8 @@ : https://issuetracker.google.com/issues/new?component=192708 Editing : This check can *not* run live in the IDE editor +See +: https://goo.gle/PackagedPrivateKey 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/PrivateKeyDetector.java) Tests @@ -40,9 +42,6 @@ [PackagedPrivateKey] 1 errors, 0 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ParcelClassLoader.md.html b/docs/checks/ParcelClassLoader.md.html index 9b36ab5d..90c55d68 100644 --- a/docs/checks/ParcelClassLoader.md.html +++ b/docs/checks/ParcelClassLoader.md.html @@ -127,8 +127,6 @@ Parcelable error9 = in.readPersistableBundle(); ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ParcelCreator.md.html b/docs/checks/ParcelCreator.md.html index 6788d31b..f5bd2071 100644 --- a/docs/checks/ParcelCreator.md.html +++ b/docs/checks/ParcelCreator.md.html @@ -48,8 +48,6 @@ public class MyParcelable1 implements Parcelable { ------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ParcelizeFunctionProperty.md.html b/docs/checks/ParcelizeFunctionProperty.md.html new file mode 100644 index 00000000..823ea78d --- /dev/null +++ b/docs/checks/ParcelizeFunctionProperty.md.html @@ -0,0 +1,244 @@ + +(#) Function type properties should not be used in Parcelize classes + +!!! ERROR: Function type properties should not be used in Parcelize classes + This is an error. + +Id +: `ParcelizeFunctionProperty` +Summary +: Function type properties should not be used in Parcelize classes +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/parcel/ParcelizeFunctionPropertyDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/parcel/ParcelizeFunctionPropertyDetectorTest.kt) +Copyright Year +: 2023 + +While technically (and surprisingly) supported by Parcelize, function +types should not be used in Parcelize classes. There are only limited +conditions where it will work and it's usually a sign that you're +modeling your data wrong. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/Example1.kt:12:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val functionType1: () -> String, + ------------ + + +src/test/pkg/Example1.kt:13:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val functionType2: (String) -> String, + ------------------ + + +src/test/pkg/Example1.kt:14:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val functionType3: String.() -> String, + ------------------- + + +src/test/pkg/Example1.kt:15:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val functionType4: () -> Unit, + ---------- + + +src/test/pkg/Example1.kt:16:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val functionType5: suspend () -> Unit, + ------------------ + + +src/test/pkg/Example1.kt:17:Error: While technically (and surprisingly) +supported by Parcelize, function types should not be used in Parcelize +classes. There are only limited conditions where it will work and it's +usually a sign that you're modeling your data wrong. +[ParcelizeFunctionProperty] + + val aliasedFunction: FunctionType, + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/Example1.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.os.Parcelable +import kotlinx.parcelize.Parcelize +import kotlinx.parcelize.IgnoredOnParcel + +typealias FunctionType = () -> String + +@Parcelize +class Example1( + val foo: String, + val functionType1: () -> String, + val functionType2: (String) -> String, + val functionType3: String.() -> String, + val functionType4: () -> Unit, + val functionType5: suspend () -> Unit, + val aliasedFunction: FunctionType, + val functionClass: FunctionClass, + @IgnoredOnParcel + val ignoredFunction: () -> Unit = {}, // This is allowed +) : Parcelable +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/parcel/ParcelizeFunctionPropertyDetectorTest.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, `ParcelizeFunctionPropertyDetector.simple`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ParcelizeFunctionProperty") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ParcelizeFunctionProperty") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ParcelizeFunctionProperty + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ParcelizeFunctionProperty" severity="ignore" /> + </lint> + ``` + 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 'ParcelizeFunctionProperty' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ParcelizeFunctionProperty ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/PendingBindings.md.html b/docs/checks/PendingBindings.md.html index 0e17f6e8..1541ff0f 100644 --- a/docs/checks/PendingBindings.md.html +++ b/docs/checks/PendingBindings.md.html @@ -87,8 +87,6 @@ holder.dataBinder.someMethod(); // ERROR: no fallthrough ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PermissionImpliesUnsupportedChromeOsHardware.md.html b/docs/checks/PermissionImpliesUnsupportedChromeOsHardware.md.html index d65f8095..baa02e89 100644 --- a/docs/checks/PermissionImpliesUnsupportedChromeOsHardware.md.html +++ b/docs/checks/PermissionImpliesUnsupportedChromeOsHardware.md.html @@ -8,8 +8,6 @@ : `PermissionImpliesUnsupportedChromeOsHardware` Summary : Permission Implies Unsupported Chrome OS Hardware -Note -: **This issue is disabled by default**; use `--enable PermissionImpliesUnsupportedChromeOsHardware` Severity : Error Category @@ -34,11 +32,11 @@ : 2016 The `` element should not require a permission that -implies an unsupported Chrome OS hardware feature. Google Play assumes -that certain hardware related permissions indicate that the underlying -hardware features are required by default. To fix the issue, consider -declaring the corresponding uses-feature element with `required="false"` -attribute. +implies an unsupported large screen hardware feature. Google Play +assumes that certain hardware related permissions indicate that the +underlying hardware features are required by default. To fix the issue, +consider declaring the corresponding element with +`required="false"` attribute. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -53,8 +51,6 @@ <uses-permission android:name="android.permission.CALL_PHONE"/> --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PermissionImpliesUnsupportedHardware.md.html b/docs/checks/PermissionImpliesUnsupportedHardware.md.html index ea03844e..c69404a2 100644 --- a/docs/checks/PermissionImpliesUnsupportedHardware.md.html +++ b/docs/checks/PermissionImpliesUnsupportedHardware.md.html @@ -51,8 +51,6 @@ <uses-permission android:name="android.permission.CALL_PHONE"/> --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PermissionNamingConvention.md.html b/docs/checks/PermissionNamingConvention.md.html index 1ad87750..23881b7e 100644 --- a/docs/checks/PermissionNamingConvention.md.html +++ b/docs/checks/PermissionNamingConvention.md.html @@ -79,8 +79,6 @@ <permission android:name="FOO_BAR" /> ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PinSetExpiry.md.html b/docs/checks/PinSetExpiry.md.html index fc8e3e8f..a4251feb 100644 --- a/docs/checks/PinSetExpiry.md.html +++ b/docs/checks/PinSetExpiry.md.html @@ -43,8 +43,6 @@ <pin-set expiration="%1$s"> ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PlaySdkIndexNonCompliant.md.html b/docs/checks/PlaySdkIndexNonCompliant.md.html index 9062273d..c6d1673b 100644 --- a/docs/checks/PlaySdkIndexNonCompliant.md.html +++ b/docs/checks/PlaySdkIndexNonCompliant.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor See diff --git a/docs/checks/PluralsCandidate.md.html b/docs/checks/PluralsCandidate.md.html index e83468a9..35c51f06 100644 --- a/docs/checks/PluralsCandidate.md.html +++ b/docs/checks/PluralsCandidate.md.html @@ -25,7 +25,7 @@ See : https://developer.android.com/guide/topics/resources/string-resource.html#Plurals 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/StringFormatDetector.java) +: [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/StringFormatDetector.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/StringFormatDetectorTest.java) Copyright Year @@ -63,8 +63,6 @@ <string name="lockscreen_too_many_failed_attempts_dialog_message1"> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PrivateApi.md.html b/docs/checks/PrivateApi.md.html index 8e65fe77..f8468564 100644 --- a/docs/checks/PrivateApi.md.html +++ b/docs/checks/PrivateApi.md.html @@ -62,8 +62,6 @@ Class SystemProperties = cl.loadClass("android.os.SystemProperties"); ------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PrivateResource.md.html b/docs/checks/PrivateResource.md.html index 9bd3bdd7..1f532954 100644 --- a/docs/checks/PrivateResource.md.html +++ b/docs/checks/PrivateResource.md.html @@ -44,8 +44,6 @@ android:text="@string/my_private_string" /> ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ProduceStateDoesNotAssignValue.md.html b/docs/checks/ProduceStateDoesNotAssignValue.md.html index 05fd5072..c2a21d3e 100644 --- a/docs/checks/ProduceStateDoesNotAssignValue.md.html +++ b/docs/checks/ProduceStateDoesNotAssignValue.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -71,8 +78,6 @@ produceState(true, true) { ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -118,6 +123,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/Proguard.md.html b/docs/checks/Proguard.md.html index 188c9742..cfb7f4a7 100644 --- a/docs/checks/Proguard.md.html +++ b/docs/checks/Proguard.md.html @@ -52,8 +52,6 @@ -keepclasseswithmembernames class * { ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ProguardSplit.md.html b/docs/checks/ProguardSplit.md.html index 262488c0..8fa2708d 100644 --- a/docs/checks/ProguardSplit.md.html +++ b/docs/checks/ProguardSplit.md.html @@ -68,8 +68,6 @@ -keep public class * extends android.app.Activity ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PropertyEscape.md.html b/docs/checks/PropertyEscape.md.html index ef536790..e246acfe 100644 --- a/docs/checks/PropertyEscape.md.html +++ b/docs/checks/PropertyEscape.md.html @@ -56,8 +56,6 @@ ok.sdk.dir=C:\\Documents and Settings\\UserName\\Local Settings\\Application Data\\Android\\android-studio\\sdk - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ProtectedPermissions.md.html b/docs/checks/ProtectedPermissions.md.html index 4b6f5cc4..7338eb96 100644 --- a/docs/checks/ProtectedPermissions.md.html +++ b/docs/checks/ProtectedPermissions.md.html @@ -637,8 +637,6 @@ <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /> ------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ProviderReadPermissionOnly.md.html b/docs/checks/ProviderReadPermissionOnly.md.html new file mode 100644 index 00000000..89888f00 --- /dev/null +++ b/docs/checks/ProviderReadPermissionOnly.md.html @@ -0,0 +1,210 @@ + +(#) Provider with readPermission only and implemented write APIs + +!!! WARNING: Provider with readPermission only and implemented write APIs + This is a warning. + +Id +: `ProviderReadPermissionOnly` +Summary +: Provider with readPermission only and implemented write APIs +Severity +: Warning +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/ProviderPermissionDetector.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/ProviderPermissionDetectorTest.kt) +Copyright Year +: 2022 + +This check looks for Content Providers that only have the +`readPermission` attribute but implement write APIs. + +If `android:readPermission` is specified and both `android:permission` +and `android:writePermission` are omitted, other apps can access any +write operations that this provider exposes with no permission check. +For a quick fix, changing the existing `android:readPermission` to +`android:permission` will protect both read and write access with the +same permission. Alternatively, declaring a separate +`android:writePermission` can protect write access with a different +permission. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:5:Warning: test.pkg.JavaTestContentProvider +implements {insert} write APIs but does not protect them with a +permission. Update the tag to use android:permission or +android:writePermission [ProviderReadPermissionOnly] + + <provider android:name="test.pkg.JavaTestContentProvider" android:readPermission="android.permission.READ_DATA"/> + ---------------------- + + +AndroidManifest.xml:6:Warning: test.pkg.KotlinTestContentProvider +implements {insert} write APIs but does not protect them with a +permission. Update the tag to use android:permission or +android:writePermission [ProviderReadPermissionOnly] + + <provider android:name="test.pkg.KotlinTestContentProvider" android:readPermission="android.permission.READ_DATA"/> + ---------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + package="test.pkg"> + <application> + <provider android:name="test.pkg.JavaTestContentProvider" android:readPermission="android.permission.READ_DATA"/> + <provider android:name="test.pkg.KotlinTestContentProvider" android:readPermission="android.permission.READ_DATA"/> + </application> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/test/pkg/JavaTestContentProvider.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import android.content.ContentProvider; +import android.net.Uri; +import android.os.Bundle; + +public class JavaTestContentProvider extends ContentProvider { + @Override + public Uri insert(Uri uri, ContentValues values) { + return insert(uri, values, null); + } + + @Override + public int delete(Uri uri, String selection, String[] selectionArgs) { + throw new UnsupportedOperationException(""); + } + + @Override + public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { + return 0; + } + + private Uri insert(Uri uri, ContentValues values, Bundle extras) { + System.out.println(uri); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/KotlinTestContentProvider.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.content.ContentProvider +import android.net.Uri + +class KotlinTestContentProvider : ContentProvider() { + override fun insert(uri: Uri, values: ContentValues?): Uri? = insert(uri, values, null) ?: null + + override fun delete(uri: Uri, selection: String?, selectionArgs: Array?): Int { + throw UnsupportedOperationException() + } + + override fun update( + uri: Uri, + values: ContentValues?, + selection: String?, + selectionArgs: Array? + ): Int = 0 + + private fun insert(uri: Uri, values: ContentValues?, extras: Bundle?): Int? { + println(uri) + return null + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/ProviderPermissionDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProviderReadPermissionOnly") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProviderReadPermissionOnly") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProviderReadPermissionOnly + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProviderReadPermissionOnly" severity="ignore" /> + </lint> + ``` + 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 'ProviderReadPermissionOnly' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProviderReadPermissionOnly ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProxyPassword.md.html b/docs/checks/ProxyPassword.md.html index c2c65442..63471b99 100644 --- a/docs/checks/ProxyPassword.md.html +++ b/docs/checks/ProxyPassword.md.html @@ -43,8 +43,6 @@ systemProp.http.proxyPassword=something --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/PxUsage.md.html b/docs/checks/PxUsage.md.html index 79137396..193e6334 100644 --- a/docs/checks/PxUsage.md.html +++ b/docs/checks/PxUsage.md.html @@ -54,8 +54,6 @@ android:layout_width="2px" -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/QueryAllPackagesPermission.md.html b/docs/checks/QueryAllPackagesPermission.md.html index fb3534ed..b192e16e 100644 --- a/docs/checks/QueryAllPackagesPermission.md.html +++ b/docs/checks/QueryAllPackagesPermission.md.html @@ -48,8 +48,6 @@ <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/><!-- ERROR --> ---------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/QueryPermissionsNeeded.md.html b/docs/checks/QueryPermissionsNeeded.md.html index 59a7aacb..cdb6bf86 100644 --- a/docs/checks/QueryPermissionsNeeded.md.html +++ b/docs/checks/QueryPermissionsNeeded.md.html @@ -108,8 +108,6 @@ Intent().resolveActivityInfo(pm, 0) // ERROR ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Range.md.html b/docs/checks/Range.md.html index 425eab6d..6eeda1c2 100644 --- a/docs/checks/Range.md.html +++ b/docs/checks/Range.md.html @@ -309,8 +309,6 @@ printIndirectSize("1234567"); // ERROR --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RawColor.md.html b/docs/checks/RawColor.md.html new file mode 100644 index 00000000..dfb07f69 --- /dev/null +++ b/docs/checks/RawColor.md.html @@ -0,0 +1,144 @@ + +(#) Flags color that are not defined as resource. + +!!! WARNING: Flags color that are not defined as resource. + This is a warning. + +Id +: `RawColor` +Summary +: Flags color that are not defined as resource. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/RawColorDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawColorDetectorTest.kt) + +Color value should all be defined as color resources. This has the +benefit that you can easily see all of your colors in one file. One +benefit is an easier addition to Dark Theme for instance. This check +will run on layouts as well as xml drawables. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/layout.xml:2:Warning: Should be using a color resource +instead. [RawColor] + + app:someCustomColor="#fff"/> + ---- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/layout.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView xmlns:app="http://schemas.android.com/apk/res-auto" + app:someCustomColor="#fff"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawColorDetectorTest.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, `RawColorDetector.appCustomColor`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="RawColor"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RawColor" severity="ignore" /> + </lint> + ``` + 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 'RawColor' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RawColor ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RawDimen.md.html b/docs/checks/RawDimen.md.html new file mode 100644 index 00000000..3ae84813 --- /dev/null +++ b/docs/checks/RawDimen.md.html @@ -0,0 +1,144 @@ + +(#) Flags dimensions that are not defined as resource. + +!!! WARNING: Flags dimensions that are not defined as resource. + This is a warning. + +Id +: `RawDimen` +Summary +: Flags dimensions that are not defined as resource. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/RawDimenDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawDimenDetectorTest.kt) + +Dimensions should all be defined as dimension resources. This has the +benefit that you can easily see all of your dimensions in one file. One +benefit is that when designers change the outline across the entire app +you only have to adjust it in one place. This check will run on layouts +as well as xml drawables. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:1:Warning: Should be using a dimension resource +instead. [RawDimen] + +<TextView xmlns:app="http://schemas.android.com/apk/res-auto" app:someCustomAttribute="16dp"/> + ---- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView xmlns:app="http://schemas.android.com/apk/res-auto" app:someCustomAttribute="16dp"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawDimenDetectorTest.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, `RawDimenDetector.appCustom`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="RawDimen"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RawDimen" severity="ignore" /> + </lint> + ``` + 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 'RawDimen' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RawDimen ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RawDispatchersUse.md.html b/docs/checks/RawDispatchersUse.md.html new file mode 100644 index 00000000..eedf9add --- /dev/null +++ b/docs/checks/RawDispatchersUse.md.html @@ -0,0 +1,228 @@ + +(#) Use SlackDispatchers. + +!!! ERROR: Use SlackDispatchers. + This is an error. + +Id +: `RawDispatchersUse` +Summary +: Use SlackDispatchers. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/RawDispatchersUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RawDispatchersUsageDetectorTest.kt) +Copyright Year +: 2021 + +Direct use of `Dispatchers.*` APIs are discouraged as they are difficult +to test. Prefer using `SlackDispatchers`. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/test.kt:6:Error: Use SlackDispatchers. [RawDispatchersUse] + + Dispatchers.IO + -------------- + + +src/test/pkg/test.kt:7:Error: Use SlackDispatchers. [RawDispatchersUse] + + Dispatchers.Default + ------------------- + + +src/test/pkg/test.kt:8:Error: Use SlackDispatchers. [RawDispatchersUse] + + Dispatchers.Unconfined + ---------------------- + + +src/test/pkg/test.kt:9:Error: Use SlackDispatchers. [RawDispatchersUse] + + Dispatchers.Main + ---------------- + + +src/test/pkg/test.kt:11:Error: Use SlackDispatchers. +[RawDispatchersUse] + + Dispatchers::IO + --------------- + + +src/test/pkg/test.kt:12:Error: Use SlackDispatchers. +[RawDispatchersUse] + + Dispatchers::Default + -------------------- + + +src/test/pkg/test.kt:13:Error: Use SlackDispatchers. +[RawDispatchersUse] + + Dispatchers::Unconfined + ----------------------- + + +src/test/pkg/test.kt:14:Error: Use SlackDispatchers. +[RawDispatchersUse] + + Dispatchers::Main + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import kotlinx.coroutines.Dispatchers + +fun example() { + Dispatchers.IO + Dispatchers.Default + Dispatchers.Unconfined + Dispatchers.Main + Dispatchers.someExtension() + Dispatchers::IO + Dispatchers::Default + Dispatchers::Unconfined + Dispatchers::Main +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RawDispatchersUsageDetectorTest.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, `RawDispatchersUsageDetector.simple`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RawDispatchersUse") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RawDispatchersUse") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RawDispatchersUse + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RawDispatchersUse" severity="ignore" /> + </lint> + ``` + 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 'RawDispatchersUse' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RawDispatchersUse ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/Recycle.md.html b/docs/checks/Recycle.md.html index 922a153e..8dc580ff 100644 --- a/docs/checks/Recycle.md.html +++ b/docs/checks/Recycle.md.html @@ -98,8 +98,6 @@ final TypedArray a = getContext().obtainStyledAttributes(attrs, // Not recycled ---------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RecyclerView.md.html b/docs/checks/RecyclerView.md.html index 4e74f5c5..655a48a0 100644 --- a/docs/checks/RecyclerView.md.html +++ b/docs/checks/RecyclerView.md.html @@ -75,8 +75,6 @@ public void onBindViewHolder(ViewHolder holder, final int position, List<Object> payloads) { ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RedactedInJavaUsage.md.html b/docs/checks/RedactedInJavaUsage.md.html new file mode 100644 index 00000000..fe33acd1 --- /dev/null +++ b/docs/checks/RedactedInJavaUsage.md.html @@ -0,0 +1,208 @@ + +(#) @Redacted is only supported in Kotlin classes! + +!!! ERROR: @Redacted is only supported in Kotlin classes! + This is an error. + +Id +: `RedactedInJavaUsage` +Summary +: @Redacted is only supported in Kotlin classes! +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/RedactedUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RedactedUsageDetectorTest.kt) +Copyright Year +: 2021 + +@Redacted is only supported in Kotlin classes! + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/RedactedClass.java:6:Error: @Redacted is only supported in +Kotlin classes! [RedactedInJavaUsage] + +@Redacted +--------- + + +src/test/pkg/RedactedClass.java:8:Error: @Redacted is only supported in +Kotlin classes! [RedactedInJavaUsage] + + @Redacted + --------- + + +src/test/pkg/RedactedClass.java:13:Error: @Redacted is only supported in +Kotlin classes! [RedactedInJavaUsage] + + @Redacted + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/RedactedClass.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import slack.annotations.Redacted; +import slack.annotations.AnotherAnnotation; + +@Redacted +class RedactedClass { + @Redacted + int value; + @AnotherAnnotation + int value2; + + @Redacted + public int getValue() { + return value; + } + + @AnotherAnnotation + public int getValue2() { + return value2; + } + + @AnotherAnnotation + static class AnotherInner { + + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RedactedUsageDetectorTest.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, `RedactedUsageDetector.smokeTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RedactedInJavaUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RedactedInJavaUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RedactedInJavaUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RedactedInJavaUsage" severity="ignore" /> + </lint> + ``` + 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 'RedactedInJavaUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RedactedInJavaUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RedundantLabel.md.html b/docs/checks/RedundantLabel.md.html index 9288caf8..b8043265 100644 --- a/docs/checks/RedundantLabel.md.html +++ b/docs/checks/RedundantLabel.md.html @@ -42,8 +42,6 @@ <activity android:name=".MainActivity" android:label="@string/app_name"> -------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RedundantNamespace.md.html b/docs/checks/RedundantNamespace.md.html index 791abdab..0519e6ed 100644 --- a/docs/checks/RedundantNamespace.md.html +++ b/docs/checks/RedundantNamespace.md.html @@ -46,8 +46,6 @@ xmlns:android="http://schemas.android.com/apk/res/android" ---------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -62,7 +60,6 @@ android:orientation="vertical" > <foo.bar.Baz xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://something/else" xmlns:unrelated="http://un/related" android:id="@+id/button1" android:layout_width="wrap_content" diff --git a/docs/checks/ReferenceType.md.html b/docs/checks/ReferenceType.md.html index 7700d7e2..dc4368d4 100644 --- a/docs/checks/ReferenceType.md.html +++ b/docs/checks/ReferenceType.md.html @@ -67,8 +67,6 @@ <item name="drawableAsColor" type="color">@drawable/my_drawable</item> --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RelativeOverlap.md.html b/docs/checks/RelativeOverlap.md.html index 061cf9d0..d1559fc0 100644 --- a/docs/checks/RelativeOverlap.md.html +++ b/docs/checks/RelativeOverlap.md.html @@ -43,8 +43,6 @@ <TextView -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RememberReturnType.md.html b/docs/checks/RememberReturnType.md.html index 86755060..eb8b5e44 100644 --- a/docs/checks/RememberReturnType.md.html +++ b/docs/checks/RememberReturnType.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -58,62 +65,130 @@ -------- -src/androidx/compose/runtime/foo/FooState.kt:25:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:21:Error: remember calls must not return Unit [RememberReturnType] - remember(number) { + remember(unitLambda) -------- +src/androidx/compose/runtime/foo/FooState.kt:22:Error: remember calls +must not return Unit [RememberReturnType] + + val unit2 = remember(unitLambda) + -------- + + src/androidx/compose/runtime/foo/FooState.kt:28:Error: remember calls +must not return Unit [RememberReturnType] + + remember(number) { + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:31:Error: remember calls must not return Unit [RememberReturnType] val unit = remember(number) { -------- +src/androidx/compose/runtime/foo/FooState.kt:35:Error: remember calls +must not return Unit [RememberReturnType] + + remember(number, unitLambda) + -------- + + src/androidx/compose/runtime/foo/FooState.kt:36:Error: remember calls +must not return Unit [RememberReturnType] + + val unit2 = remember(number, unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:42:Error: remember calls must not return Unit [RememberReturnType] remember(number1, number2) { -------- -src/androidx/compose/runtime/foo/FooState.kt:40:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:46:Error: remember calls must not return Unit [RememberReturnType] val unit = remember(number1, number2) { -------- -src/androidx/compose/runtime/foo/FooState.kt:49:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:51:Error: remember calls +must not return Unit [RememberReturnType] + + remember(number1, number2, unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:52:Error: remember calls +must not return Unit [RememberReturnType] + + val unit2 = remember(number1, number2, unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:58:Error: remember calls must not return Unit [RememberReturnType] remember(number1, number2, number3) { -------- -src/androidx/compose/runtime/foo/FooState.kt:54:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:63:Error: remember calls must not return Unit [RememberReturnType] val unit = remember(number1, number2, number3) { -------- -src/androidx/compose/runtime/foo/FooState.kt:64:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:69:Error: remember calls +must not return Unit [RememberReturnType] + + remember(number1, number2, number3, unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:70:Error: remember calls +must not return Unit [RememberReturnType] + + val unit2 = remember(number1, number2, number3, unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:76:Error: remember calls must not return Unit [RememberReturnType] remember(number1, number2, number3, flag) { -------- -src/androidx/compose/runtime/foo/FooState.kt:69:Error: remember calls +src/androidx/compose/runtime/foo/FooState.kt:81:Error: remember calls must not return Unit [RememberReturnType] val unit = remember(number1, number2, number3, flag) { -------- +src/androidx/compose/runtime/foo/FooState.kt:87:Error: remember calls +must not return Unit [RememberReturnType] + + remember(number1, number2, number3, flag, calculation = unitLambda) + -------- + + +src/androidx/compose/runtime/foo/FooState.kt:88:Error: remember calls +must not return Unit [RememberReturnType] + + val unit2 = remember(number1, number2, number3, flag, calculation = unitLambda) + -------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -138,6 +213,9 @@ val unit = remember { state.update(5) } + val unitLambda: () -> Unit = {} + remember(unitLambda) + val unit2 = remember(unitLambda) } @Composable @@ -149,6 +227,9 @@ val unit = remember(number) { state.update(number) } + val unitLambda: () -> Unit = {} + remember(number, unitLambda) + val unit2 = remember(number, unitLambda) } @Composable @@ -162,6 +243,9 @@ state.update(number1) state.update(number2) } + val unitLambda: () -> Unit = {} + remember(number1, number2, unitLambda) + val unit2 = remember(number1, number2, unitLambda) } @Composable @@ -177,6 +261,9 @@ state.update(number2) state.update(number3) } + val unitLambda: () -> Unit = {} + remember(number1, number2, number3, unitLambda) + val unit2 = remember(number1, number2, number3, unitLambda) } @Composable @@ -192,6 +279,9 @@ state.update(number2) state.update(number3) } + val unitLambda: () -> Unit = {} + remember(number1, number2, number3, flag, calculation = unitLambda) + val unit2 = remember(number1, number2, number3, flag, calculation = unitLambda) } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -204,6 +294,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RememberSaveableSaverParameter.md.html b/docs/checks/RememberSaveableSaverParameter.md.html index 23c6563f..49647938 100644 --- a/docs/checks/RememberSaveableSaverParameter.md.html +++ b/docs/checks/RememberSaveableSaverParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime.saveable Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -98,8 +105,6 @@ val mutableStateFoo4 = rememberSaveable(fooSaver4) { mutableStateOf(Foo()) } --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -139,6 +144,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime-saveable:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime-saveable:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime-saveable) + +# libs.versions.toml +[versions] +runtime-saveable = "1.5.0-beta02" +[libraries] +runtime-saveable = { + module = "androidx.compose.runtime:runtime-saveable", + version.ref = "runtime-saveable" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RemoteViewLayout.md.html b/docs/checks/RemoteViewLayout.md.html index 982e9bb3..9cf1a0fc 100644 --- a/docs/checks/RemoteViewLayout.md.html +++ b/docs/checks/RemoteViewLayout.md.html @@ -43,8 +43,6 @@ val remoteView = RemoteViews(packageName, R.layout.test) --------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RemoveWorkManagerInitializer.md.html b/docs/checks/RemoveWorkManagerInitializer.md.html index c759c54c..ea60d82c 100644 --- a/docs/checks/RemoveWorkManagerInitializer.md.html +++ b/docs/checks/RemoveWorkManagerInitializer.md.html @@ -22,6 +22,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files and manifest files Editing @@ -43,14 +50,12 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:8:Error: Remove androidx.work.WorkManagerInitializer +AndroidManifest.xml:4:Error: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization. [RemoveWorkManagerInitializer] - <meta-data - ^ - - + <application /> + --------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -60,15 +65,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example"> - <application> - <provider - android:name="androidx.startup.InitializationProvider" - android:authorities="com.example.workmanager-init"> - <meta-data - android:name="androidx.work.WorkManagerInitializer" - android:value="@string/androidx_startup" /> - </provider> - </application> + <application /> </manifest> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -77,10 +74,40 @@ 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, `RemoveWorkManagerInitializerDetector.failWhenManifestHasDefaultInitializer`. +found for this lint check, `RemoveWorkManagerInitializerDetector.failWhenUsingDefaultManifestMergeStrategy`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=409906. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RepeatOnLifecycleWrongUsage.md.html b/docs/checks/RepeatOnLifecycleWrongUsage.md.html index c05dc9af..94177390 100644 --- a/docs/checks/RepeatOnLifecycleWrongUsage.md.html +++ b/docs/checks/RepeatOnLifecycleWrongUsage.md.html @@ -20,12 +20,21 @@ : androidx.lifecycle Feedback : https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/RepeatOnLifecycleDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/RepeatOnLifecycleDetectorTest.kt) Copyright Year : 2021 @@ -33,6 +42,36 @@ that is in the `onCreate` lifecycle method for Activities, or `onViewCreated` in case you're using Fragments. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-ktx) + +# libs.versions.toml +[versions] +lifecycle-runtime-ktx = "2.6.1" +[libraries] +lifecycle-runtime-ktx = { + module = "androidx.lifecycle:lifecycle-runtime-ktx", + version.ref = "lifecycle-runtime-ktx" +} +``` + +2.6.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ReportShortcutUsage.md.html b/docs/checks/ReportShortcutUsage.md.html new file mode 100644 index 00000000..40725e89 --- /dev/null +++ b/docs/checks/ReportShortcutUsage.md.html @@ -0,0 +1,119 @@ + +(#) Report shortcut usage + +!!! Tip: Report shortcut usage + Advice from this check is just a tip. + +Id +: `ReportShortcutUsage` +Summary +: Report shortcut usage +Severity +: Information +Category +: Usability +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files +Editing +: This check can *not* run live in the IDE editor +See +: https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts +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/ShortcutUsageDetector.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/ShortcutUsageDetectorTest.kt) +Copyright Year +: 2022 + +Reporting shortcut usage is important to improving the ranking of +shortcuts. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestDocumentationExample.java:16:Information: Calling this +method indicates use of dynamic shortcuts, but there are no calls to +methods that track shortcut usage, such as pushDynamicShortcut or +reportShortcutUsed. Calling these methods is recommended, as they track +shortcut usage and allow launchers to adjust which shortcuts appear +based on activation history. Please see +https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts#track-usage + [ReportShortcutUsage] + + ShortcutManagerCompat.setDynamicShortcuts(context, shortcuts); + ------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/TestDocumentationExample.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import android.app.Activity; +import android.content.Context; +import androidx.core.content.pm.ShortcutManagerCompat; +import androidx.core.content.pm.ShortcutInfoCompat; +import java.util.ArrayList; + +@SuppressWarnings("unused") +public class TestDocumentationExample extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + ShortcutInfoCompat shortuctInfoCompat = new ShortcutInfoCompat.Builder(context, "id").build(); + ArrayList shortcuts = new ArrayList(); + shortcuts.add(shortcutInfoCompat); + ShortcutManagerCompat.setDynamicShortcuts(context, shortcuts); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/ShortcutUsageDetectorTest.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 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ReportShortcutUsage" severity="ignore" /> + </lint> + ``` + 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 'ReportShortcutUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ReportShortcutUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RequiredSize.md.html b/docs/checks/RequiredSize.md.html index 317a92ed..8d44b2c0 100644 --- a/docs/checks/RequiredSize.md.html +++ b/docs/checks/RequiredSize.md.html @@ -61,8 +61,6 @@ <EditText -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RequiresFeature.md.html b/docs/checks/RequiresFeature.md.html index 55383dd5..0522441c 100644 --- a/docs/checks/RequiresFeature.md.html +++ b/docs/checks/RequiresFeature.md.html @@ -106,8 +106,6 @@ api.someMethod(); // 17 - ERROR ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ResAuto.md.html b/docs/checks/ResAuto.md.html index 35eef754..19227371 100644 --- a/docs/checks/ResAuto.md.html +++ b/docs/checks/ResAuto.md.html @@ -51,8 +51,6 @@ xmlns:foo="http://schemas.android.com/apk/res/foo" -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ReservedSystemPermission.md.html b/docs/checks/ReservedSystemPermission.md.html index c51c9cba..a3f42cc4 100644 --- a/docs/checks/ReservedSystemPermission.md.html +++ b/docs/checks/ReservedSystemPermission.md.html @@ -30,10 +30,13 @@ : 2022 This check looks for custom permission declarations whose names are -reserved values for system or Android SDK permissions. +reserved values for system or Android SDK permissions, or begin with the +reserved string `android.` Please double check the permission name you have supplied. Attempting to -redeclare a system or Android SDK permission will be ignored. +redeclare a system or Android SDK permission will be ignored. Using the +prefix `android.` is a violation of the Android Compatibility Definition +Document. (##) Example @@ -46,6 +49,11 @@ --------------------------------- +AndroidManifest.xml:5:Error: android.permission.FOOBAR is using the +reserved system prefix android. [ReservedSystemPermission] + + <permission android:name="android.permission.FOOBAR" /> + ------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -56,6 +64,7 @@ xmlns:tools="http://schemas.android.com/tools" package="com.example.helloworld"> <permission android:name="android.permission.BIND_APPWIDGET" /> + <permission android:name="android.permission.FOOBAR" /> <application> <service android:permission="android.permission.BIND_APPWIDGET" /> </application> diff --git a/docs/checks/ResourceAsColor.md.html b/docs/checks/ResourceAsColor.md.html index b9f88c93..97a7a60e 100644 --- a/docs/checks/ResourceAsColor.md.html +++ b/docs/checks/ResourceAsColor.md.html @@ -79,8 +79,6 @@ foo2(R.color.blue); ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ResourceCycle.md.html b/docs/checks/ResourceCycle.md.html index fb44961d..55936818 100644 --- a/docs/checks/ResourceCycle.md.html +++ b/docs/checks/ResourceCycle.md.html @@ -43,8 +43,6 @@ <style name="DetailsPage_EditorialBuyButton" parent="@style/DetailsPage_EditorialBuyButton" /> ---------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ResourceType.md.html b/docs/checks/ResourceType.md.html index 03d6ea5e..fa3c29a1 100644 --- a/docs/checks/ResourceType.md.html +++ b/docs/checks/ResourceType.md.html @@ -40,8 +40,6 @@ setLabels(iconId) // bug: should have passed descId. Both are ints but of wrong type. ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ResourcesGetColorCall.md.html b/docs/checks/ResourcesGetColorCall.md.html new file mode 100644 index 00000000..a4014efa --- /dev/null +++ b/docs/checks/ResourcesGetColorCall.md.html @@ -0,0 +1,170 @@ + +(#) Marks usage of deprecated getColor() on Resources. + +!!! WARNING: Marks usage of deprecated getColor() on Resources. + This is a warning. + +Id +: `ResourcesGetColorCall` +Summary +: Marks usage of deprecated getColor() on Resources. +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) + +Instead of getColor(), ContextCompat or the method with the Theme +Overload should be used instead. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Calling deprecated getColor +[ResourcesGetColorCall] + + resources.getColor(0); + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import android.content.res.Resources; +class Example { + public void foo() { + Resources resources = null; + resources.getColor(0); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetColor`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ResourcesGetColorCall") + fun method() { + getColor(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ResourcesGetColorCall") + void method() { + getColor(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ResourcesGetColorCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ResourcesGetColorCall" severity="ignore" /> + </lint> + ``` + 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 'ResourcesGetColorCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ResourcesGetColorCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ResourcesGetColorStateListCall.md.html b/docs/checks/ResourcesGetColorStateListCall.md.html new file mode 100644 index 00000000..db8cecb7 --- /dev/null +++ b/docs/checks/ResourcesGetColorStateListCall.md.html @@ -0,0 +1,170 @@ + +(#) Marks usage of deprecated getColorStateList() on Resources. + +!!! WARNING: Marks usage of deprecated getColorStateList() on Resources. + This is a warning. + +Id +: `ResourcesGetColorStateListCall` +Summary +: Marks usage of deprecated getColorStateList() on Resources. +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) + +Instead of getColorStateList(), ContextCompat or the method with the +Theme Overload should be used instead. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Calling deprecated getColorStateList +[ResourcesGetColorStateListCall] + + resources.getColorStateList(0); + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import android.content.res.Resources; +class Example { + public void foo() { + Resources resources = null; + resources.getColorStateList(0); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetColorStateList`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ResourcesGetColorStateListCall") + fun method() { + getColor(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ResourcesGetColorStateListCall") + void method() { + getColor(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ResourcesGetColorStateListCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ResourcesGetColorStateListCall" severity="ignore" /> + </lint> + ``` + 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 'ResourcesGetColorStateListCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ResourcesGetColorStateListCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ResourcesGetDrawableCall.md.html b/docs/checks/ResourcesGetDrawableCall.md.html new file mode 100644 index 00000000..aa8561e2 --- /dev/null +++ b/docs/checks/ResourcesGetDrawableCall.md.html @@ -0,0 +1,170 @@ + +(#) Marks usage of deprecated getDrawable() on Resources. + +!!! WARNING: Marks usage of deprecated getDrawable() on Resources. + This is a warning. + +Id +: `ResourcesGetDrawableCall` +Summary +: Marks usage of deprecated getDrawable() on Resources. +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) + +Instead of getDrawable(), ContextCompat or the method with the Theme +Overload should be used instead. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Calling deprecated getDrawable +[ResourcesGetDrawableCall] + + resources.getDrawable(0); + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import android.content.res.Resources; +class Example { + public void foo() { + Resources resources = null; + resources.getDrawable(0); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetDrawable`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ResourcesGetDrawableCall") + fun method() { + getColor(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ResourcesGetDrawableCall") + void method() { + getColor(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ResourcesGetDrawableCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ResourcesGetDrawableCall" severity="ignore" /> + </lint> + ``` + 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 'ResourcesGetDrawableCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ResourcesGetDrawableCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RestrictCallsTo.md.html b/docs/checks/RestrictCallsTo.md.html new file mode 100644 index 00000000..ac5c11a2 --- /dev/null +++ b/docs/checks/RestrictCallsTo.md.html @@ -0,0 +1,214 @@ + +(#) Methods annotated with @RestrictedCallsTo should only be called from the specified scope. + +!!! ERROR: Methods annotated with @RestrictedCallsTo should only be called from the specified scope. + This is an error. + +Id +: `RestrictCallsTo` +Summary +: Methods annotated with @RestrictedCallsTo should only be called from the specified scope. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/RestrictCallsToDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RestrictCallsToDetectorTest.kt) +Copyright Year +: 2021 + +This method is intended to only be called from the specified scope +despite it being public. This could be due to its use in an interface or +similar. Overrides are still ok. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/DifferentFile.kt:8:Error: Methods annotated with +@RestrictedCallsTo should only be called from the specified scope. +[RestrictCallsTo] + + api.annotatedExample() + ---------------------- + + +src/foo/DifferentFile.kt:15:Error: Methods annotated with +@RestrictedCallsTo should only be called from the specified scope. +[RestrictCallsTo] + + annotatedExample() + ------------------ + + +src/foo/DifferentFile.kt:26:Error: Methods annotated with +@RestrictedCallsTo should only be called from the specified scope. +[RestrictCallsTo] + + MyApiImpl().annotatedExample() + ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/DifferentFile.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +class DifferentFile { + fun doStuffWith(api: MyApi) { + // This is ok + api.example() + // This is not + api.annotatedExample() + } +} + +class MyApiImpl2 : MyApi { + override fun example() { + // Not ok + annotatedExample() + } + + // Still ok + override fun annotatedExample() { + println("Hello") + } + + fun backdoor() { + // Backdoors don't work either! This isn't annotated on the impl but we check the + // original overridden type. + MyApiImpl().annotatedExample() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/RestrictCallsToDetectorTest.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, `RestrictCallsToDetector.smokeTest`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RestrictCallsTo") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RestrictCallsTo") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RestrictCallsTo + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RestrictCallsTo" severity="ignore" /> + </lint> + ``` + 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 'RestrictCallsTo' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RestrictCallsTo ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RestrictedApi.md.html b/docs/checks/RestrictedApi.md.html index 2c4ab3ed..c9ebb954 100644 --- a/docs/checks/RestrictedApi.md.html +++ b/docs/checks/RestrictedApi.md.html @@ -56,8 +56,6 @@ int counter = cls.counter; // ERROR: Not from subclass ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RetrofitUsage.md.html b/docs/checks/RetrofitUsage.md.html new file mode 100644 index 00000000..32a74751 --- /dev/null +++ b/docs/checks/RetrofitUsage.md.html @@ -0,0 +1,207 @@ + +(#) This is replaced by the caller. + +!!! ERROR: This is replaced by the caller. + This is an error. + +Id +: `RetrofitUsage` +Summary +: This is replaced by the caller. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/retrofit/RetrofitUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/retrofit/RetrofitUsageDetectorTest.kt) +Copyright Year +: 2021 + +This linter reports various common configuration issues with Retrofit. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/Example.kt:11:Error: @FormUrlEncoded requires @PUT, @POST, or +@PATCH. [RetrofitUsage] + + fun wrongMethod(): String + ----------- + + +src/test/Example.kt:14:Error: @FormUrlEncoded but has no @Field(Map) +parameters. [RetrofitUsage] + + @FormUrlEncoded + --------------- + + +src/test/Example.kt:18:Error: @Field(Map) param requires +@FormUrlEncoded. [RetrofitUsage] + + fun missingAnnotation(@Field("hi") input: String): String + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/Example.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import retrofit2.http.Field +import retrofit2.http.FormUrlEncoded +import retrofit2.http.GET +import retrofit2.http.POST + +interface Example { + @GET("/") + @FormUrlEncoded + fun wrongMethod(): String + + @POST("/") + @FormUrlEncoded + fun missingFieldParams(): String + + @POST("/") + fun missingAnnotation(@Field("hi") input: String): String + + @FormUrlEncoded + @POST("/") + fun correct(@Field("hi") input: String): String +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/retrofit/RetrofitUsageDetectorTest.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, `RetrofitUsageDetector.formEncoding`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RetrofitUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RetrofitUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RetrofitUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RetrofitUsage" severity="ignore" /> + </lint> + ``` + 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 'RetrofitUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RetrofitUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ReturnFromAwaitPointerEventScope.md.html b/docs/checks/ReturnFromAwaitPointerEventScope.md.html index 2ff67cc5..06e5fde1 100644 --- a/docs/checks/ReturnFromAwaitPointerEventScope.md.html +++ b/docs/checks/ReturnFromAwaitPointerEventScope.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -37,6 +44,36 @@ guarantee that the events will persist between those calls. In this case you should keep all events inside the awaitPointerEventScope block. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ReturnThis.md.html b/docs/checks/ReturnThis.md.html index 2651bb6c..287555d3 100644 --- a/docs/checks/ReturnThis.md.html +++ b/docs/checks/ReturnThis.md.html @@ -41,8 +41,6 @@ return MyClass() ---------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RiskyLibrary.md.html b/docs/checks/RiskyLibrary.md.html index 00b09596..e273bc4c 100644 --- a/docs/checks/RiskyLibrary.md.html +++ b/docs/checks/RiskyLibrary.md.html @@ -19,11 +19,13 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and TOML files Editing : This check runs on the fly in the IDE editor See : https://play.google.com/sdks +See +: https://goo.gle/RiskyLibrary 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/GradleDetector.kt) Tests @@ -56,8 +58,6 @@ compile 'log4j:log4j:1.2.13' // Critical BLOCKING -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RtlCompat.md.html b/docs/checks/RtlCompat.md.html index a4020d01..7d0eeb2b 100644 --- a/docs/checks/RtlCompat.md.html +++ b/docs/checks/RtlCompat.md.html @@ -111,8 +111,6 @@ android:layout_alignEnd="@id/cancel" ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RtlEnabled.md.html b/docs/checks/RtlEnabled.md.html index 84162740..e5aca1ec 100644 --- a/docs/checks/RtlEnabled.md.html +++ b/docs/checks/RtlEnabled.md.html @@ -46,9 +46,6 @@ android:supportsRtl in the manifest [RtlEnabled] 0 errors, 4 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RtlHardcoded.md.html b/docs/checks/RtlHardcoded.md.html index 278d79d8..7fdaa0e8 100644 --- a/docs/checks/RtlHardcoded.md.html +++ b/docs/checks/RtlHardcoded.md.html @@ -74,8 +74,6 @@ android:gravity="right" ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RtlSymmetry.md.html b/docs/checks/RtlSymmetry.md.html index 4a6e70a4..64b56a6c 100644 --- a/docs/checks/RtlSymmetry.md.html +++ b/docs/checks/RtlSymmetry.md.html @@ -43,8 +43,6 @@ android:paddingRight="120dip" -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/RxJava2DefaultScheduler.md.html b/docs/checks/RxJava2DefaultScheduler.md.html new file mode 100644 index 00000000..2f63456d --- /dev/null +++ b/docs/checks/RxJava2DefaultScheduler.md.html @@ -0,0 +1,173 @@ + +(#) Pass a scheduler instead of relying on the default Scheduler. + +!!! WARNING: Pass a scheduler instead of relying on the default Scheduler. + This is a warning. + +Id +: `RxJava2DefaultScheduler` +Summary +: Pass a scheduler instead of relying on the default Scheduler. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetectorTest.kt) + +Calling this method will rely on a default scheduler. This is not +necessary the best default. Being explicit and taking the overload for +passing one is preferred. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:8:Warning: interval() is using its default +scheduler [RxJava2DefaultScheduler] + + Observable.interval(5, TimeUnit.SECONDS); + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import java.util.concurrent.TimeUnit; +import io.reactivex.Observable; + +class Example { + public void foo() { + Observable.interval(5, TimeUnit.SECONDS); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetectorTest.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, `RxJava2DefaultSchedulerDetector.schedulerSupportComputation`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2DefaultScheduler") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2DefaultScheduler") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2DefaultScheduler + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2DefaultScheduler" severity="ignore" /> + </lint> + ``` + 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 'RxJava2DefaultScheduler' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2DefaultScheduler ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2DisposableAddAllCall.md.html b/docs/checks/RxJava2DisposableAddAllCall.md.html new file mode 100644 index 00000000..75ed0b79 --- /dev/null +++ b/docs/checks/RxJava2DisposableAddAllCall.md.html @@ -0,0 +1,170 @@ + +(#) Marks usage of addAll() on CompositeDisposable. + +!!! WARNING: Marks usage of addAll() on CompositeDisposable. + This is a warning. + +Id +: `RxJava2DisposableAddAllCall` +Summary +: Marks usage of addAll() on CompositeDisposable. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetectorTest.kt) + +Instead of using addAll(), add() should be used separately for each +Disposable. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Calling addAll instead of add separately +[RxJava2DisposableAddAllCall] + + cd.addAll(); + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import io.reactivex.disposables.CompositeDisposable; +class Example { + public void foo() { + CompositeDisposable cd = null; + cd.addAll(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetectorTest.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, `RxJava2DisposableAddAllCallDetector.callingCompositeDisposableAddAll`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2DisposableAddAllCall") + fun method() { + addAll(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2DisposableAddAllCall") + void method() { + addAll(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2DisposableAddAllCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2DisposableAddAllCall" severity="ignore" /> + </lint> + ``` + 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 'RxJava2DisposableAddAllCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2DisposableAddAllCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2DisposableDisposeCall.md.html b/docs/checks/RxJava2DisposableDisposeCall.md.html new file mode 100644 index 00000000..5d267ac1 --- /dev/null +++ b/docs/checks/RxJava2DisposableDisposeCall.md.html @@ -0,0 +1,176 @@ + +(#) Marks usage of dispose() on CompositeDisposable. + +!!! WARNING: Marks usage of dispose() on CompositeDisposable. + This is a warning. + +Id +: `RxJava2DisposableDisposeCall` +Summary +: Marks usage of dispose() on CompositeDisposable. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetectorTest.kt) + +Instead of using dispose(), clear() should be used. Calling clear will +result in a CompositeDisposable that can be used further to add more +Disposables. When using dispose() this is not the case. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:8:Warning: Calling dispose instead of clear +[RxJava2DisposableDisposeCall] + + cd.dispose(); + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import io.reactivex.disposables.CompositeDisposable; + +class Example { + public void foo() { + CompositeDisposable cd = null; + cd.dispose(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetectorTest.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, `RxJava2DisposableDisposeCallDetector.callingCompositeDisposableDispose`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2DisposableDisposeCall") + fun method() { + dispose(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2DisposableDisposeCall") + void method() { + dispose(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2DisposableDisposeCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2DisposableDisposeCall" severity="ignore" /> + </lint> + ``` + 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 'RxJava2DisposableDisposeCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2DisposableDisposeCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html b/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html new file mode 100644 index 00000000..17a59842 --- /dev/null +++ b/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html @@ -0,0 +1,296 @@ + +(#) Method is missing the @CheckReturnValue annotation. + +!!! WARNING: Method is missing the @CheckReturnValue annotation. + This is a warning. + +Id +: `RxJava2MethodMissingCheckReturnValue` +Summary +: Method is missing the @CheckReturnValue annotation. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetectorTest.kt) + +Methods returning RxJava Reactive Types should be annotated with the +@CheckReturnValue annotation. Static analyze tools such as Lint or +ErrorProne can detect when the return value of a method is not used. +This is usually an indication of a bug. If this is done on purpose (e.g. +fire & forget) it should be stated explicitly. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:15:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + private Observable<Object> observable() { + ---------- + + +src/foo/Example.java:19:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + protected Flowable<Object> flowable() { + -------- + + +src/foo/Example.java:23:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + protected Single<Object> single() { + ------ + + +src/foo/Example.java:27:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + protected Maybe<Object> single() { + ------ + + +src/foo/Example.java:31:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public Completable completable() { + ----------- + + +src/foo/Example.java:35:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public Disposable disposable() { + ---------- + + +src/foo/Example.java:39:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public CompositeDisposable compositeDisposable() { + ------------------- + + +src/foo/Example.java:43:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public TestObserver testObserver() { + ------------ + + +src/foo/Example.java:47:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public TestSubscriber testSubscriber() { + -------------- + + +src/foo/Example.java:51:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + public Scheduler scheduler() { + --------- + + +src/foo/Example.java:55:Warning: Method should have @CheckReturnValue +annotation [RxJava2MethodMissingCheckReturnValue] + + private Observable<List<Object>> observableList() { + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import io.reactivex.Observable; +import io.reactivex.Flowable; +import io.reactivex.Single; +import io.reactivex.Maybe; +import io.reactivex.Completable; +import io.reactivex.disposables.Disposable; +import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subscribers.TestSubscriber; +import io.reactivex.Scheduler; + +class Example { + private Observable observable() { + return null; + } + + protected Flowable flowable() { + return null; + } + + protected Single single() { + return null; + } + + protected Maybe single() { + return null; + } + + public Completable completable() { + return null; + } + + public Disposable disposable() { + return null; + } + + public CompositeDisposable compositeDisposable() { + return null; + } + + public TestObserver testObserver() { + return null; + } + + public TestSubscriber testSubscriber() { + return null; + } + + public Scheduler scheduler() { + return null; + } + + private Observable> observableList() { + return null; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetectorTest.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, `RxJava2MethodMissingCheckReturnValueDetector.methodMissingCheckReturnValue`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2MethodMissingCheckReturnValue") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2MethodMissingCheckReturnValue") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2MethodMissingCheckReturnValue + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2MethodMissingCheckReturnValue" severity="ignore" /> + </lint> + ``` + 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 'RxJava2MethodMissingCheckReturnValue' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2MethodMissingCheckReturnValue ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2MissingCompositeDisposableClear.md.html b/docs/checks/RxJava2MissingCompositeDisposableClear.md.html new file mode 100644 index 00000000..675da259 --- /dev/null +++ b/docs/checks/RxJava2MissingCompositeDisposableClear.md.html @@ -0,0 +1,171 @@ + +(#) Marks CompositeDisposables that are not being cleared. + +!!! ERROR: Marks CompositeDisposables that are not being cleared. + This is an error. + +Id +: `RxJava2MissingCompositeDisposableClear` +Summary +: Marks CompositeDisposables that are not being cleared. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetectorTest.kt) + +A class is using CompositeDisposable and not calling clear(). This can +leave operations running and even cause memory leaks. It's best to +always call clear() once you're done. e.g. in onDestroy() for +Activitys. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Error: clear() is not called +[RxJava2MissingCompositeDisposableClear] + + CompositeDisposable cd; + ----------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import io.reactivex.disposables.CompositeDisposable; + +class Example { + CompositeDisposable cd; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetectorTest.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, `RxJava2MissingCompositeDisposableClearDetector.compositeDisposableMissingClear`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2MissingCompositeDisposableClear") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2MissingCompositeDisposableClear") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2MissingCompositeDisposableClear + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2MissingCompositeDisposableClear" severity="ignore" /> + </lint> + ``` + 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 'RxJava2MissingCompositeDisposableClear' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2MissingCompositeDisposableClear ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2SchedulersFactoryCall.md.html b/docs/checks/RxJava2SchedulersFactoryCall.md.html new file mode 100644 index 00000000..37d4ec67 --- /dev/null +++ b/docs/checks/RxJava2SchedulersFactoryCall.md.html @@ -0,0 +1,175 @@ + +(#) Instead of calling the Schedulers factory methods directly inject the Schedulers. + +!!! WARNING: Instead of calling the Schedulers factory methods directly inject the Schedulers. + This is a warning. + +Id +: `RxJava2SchedulersFactoryCall` +Summary +: Instead of calling the Schedulers factory methods directly inject the Schedulers. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetectorTest.kt) + +Injecting the Schedulers instead of accessing them via the factory +methods has the benefit that unit testing is way easier. Instead of +overriding them via the Plugin mechanism we can just pass a custom +Scheduler. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:9:Warning: Inject this Scheduler instead of calling +it directly [RxJava2SchedulersFactoryCall] + + return Schedulers.io(); + -- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import io.reactivex.annotations.CheckReturnValue; +import io.reactivex.Scheduler; +import io.reactivex.schedulers.Schedulers; + +class Example { + @CheckReturnValue Scheduler provideSchedulerIo() { + return Schedulers.io(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetectorTest.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, `RxJava2SchedulersFactoryCallDetector.ioCallInsideCheckReturnValueMethod`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2SchedulersFactoryCall") + fun method() { + io(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2SchedulersFactoryCall") + void method() { + io(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2SchedulersFactoryCall + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2SchedulersFactoryCall" severity="ignore" /> + </lint> + ``` + 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 'RxJava2SchedulersFactoryCall' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2SchedulersFactoryCall ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RxJava2SubscribeMissingOnError.md.html b/docs/checks/RxJava2SubscribeMissingOnError.md.html new file mode 100644 index 00000000..3b7d1080 --- /dev/null +++ b/docs/checks/RxJava2SubscribeMissingOnError.md.html @@ -0,0 +1,173 @@ + +(#) Flags a version of the subscribe() method without an error Consumer. + +!!! ERROR: Flags a version of the subscribe() method without an error Consumer. + This is an error. + +Id +: `RxJava2SubscribeMissingOnError` +Summary +: Flags a version of the subscribe() method without an error Consumer. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetectorTest.kt) + +When calling the subscribe() method an error Consumer should always be +used. Otherwise errors might be thrown and may crash the application or +get forwarded to the Plugin Error handler. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:8:Error: Using a version of subscribe() without an +error Consumer [RxJava2SubscribeMissingOnError] + + o.subscribe(); + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import io.reactivex.Observable; + +class Example { + public void foo() { + Observable o = null; + o.subscribe(); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetectorTest.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, `RxJava2SubscribeMissingOnErrorDetector.callingObservableSubscribe`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RxJava2SubscribeMissingOnError") + fun method() { + subscribe(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RxJava2SubscribeMissingOnError") + void method() { + subscribe(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RxJava2SubscribeMissingOnError + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RxJava2SubscribeMissingOnError" severity="ignore" /> + </lint> + ``` + 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 'RxJava2SubscribeMissingOnError' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RxJava2SubscribeMissingOnError ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SQLiteString.md.html b/docs/checks/SQLiteString.md.html index 5647fedc..51ef003f 100644 --- a/docs/checks/SQLiteString.md.html +++ b/docs/checks/SQLiteString.md.html @@ -71,8 +71,6 @@ db.execSQL(TracksColumns.CREATE_TABLE); // ERROR -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SSLCertificateSocketFactoryCreateSocket.md.html b/docs/checks/SSLCertificateSocketFactoryCreateSocket.md.html index ec8d4720..b5948201 100644 --- a/docs/checks/SSLCertificateSocketFactoryCreateSocket.md.html +++ b/docs/checks/SSLCertificateSocketFactoryCreateSocket.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/SSLCertificateSocketFactoryCreateSocket 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/SslCertificateSocketFactoryDetector.java) Tests @@ -100,8 +102,6 @@ sf.createSocket(inet6, 80, inet, 2000); -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SSLCertificateSocketFactoryGetInsecure.md.html b/docs/checks/SSLCertificateSocketFactoryGetInsecure.md.html index ead014b3..3f86cd7b 100644 --- a/docs/checks/SSLCertificateSocketFactoryGetInsecure.md.html +++ b/docs/checks/SSLCertificateSocketFactoryGetInsecure.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/SSLCertificateSocketFactoryGetInsecure 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/SslCertificateSocketFactoryDetector.java) Tests @@ -47,8 +49,6 @@ SSLCertificateSocketFactory.getInsecure(-1,null)); ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ScheduleExactAlarm.md.html b/docs/checks/ScheduleExactAlarm.md.html new file mode 100644 index 00000000..80379da3 --- /dev/null +++ b/docs/checks/ScheduleExactAlarm.md.html @@ -0,0 +1,162 @@ + +(#) Scheduling Exact Alarms Without Required Permission + +!!! ERROR: Scheduling Exact Alarms Without Required Permission + This is an error. + +Id +: `ScheduleExactAlarm` +Summary +: Scheduling Exact Alarms Without Required Permission +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/training/scheduling/alarms#exact +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/AlarmDetector.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/AlarmDetectorTest.kt) +Copyright Year +: 2015 + +Applications looking to schedule exact alarms should ensure that the +`SCHEDULE_EXACT_ALARM` permission is granted by calling the +`AlarmManager#canScheduleExactAlarms` API before attempting to set an +exact alarm. If the permission is not granted to your application, +please consider requesting it from the user by starting the +`ACTION_REQUEST_SCHEDULE_EXACT_ALARM` intent or gracefully falling back +to another option. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/AlarmTest.kt:7:Error: When scheduling exact alarms, apps +should explicitly call AlarmManager#canScheduleExactAlarms or handle +`SecurityException`s [ScheduleExactAlarm] + + alarmManager.setExact(AlarmManager.ELAPSED_REALTIME, 5000, null) + ---------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/AlarmTest.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg; + +import android.app.AlarmManager; +@SuppressWarnings("ClassNameDiffersFromFileName") +class AlarmTest { + fun test(alarmManager: AlarmManager) { + alarmManager.setExact(AlarmManager.ELAPSED_REALTIME, 5000, null) + + try { + alarmManager.setExact(AlarmManager.ELAPSED_REALTIME, 5000, null) + } catch (e: SecurityException) {} + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/AlarmDetectorTest.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, `AlarmDetector.testScheduleExactAlarmBasic`. +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: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ScheduleExactAlarm") + fun method() { + setRepeating(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ScheduleExactAlarm") + void method() { + setRepeating(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ScheduleExactAlarm + problematicStatement() + ``` + +* Adding the suppression attribute `tools:ignore="ScheduleExactAlarm"` + 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <uses-permission tools:ignore="ScheduleExactAlarm" .../> + ... + </manifest> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ScheduleExactAlarm" severity="ignore" /> + </lint> + ``` + 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 'ScheduleExactAlarm' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ScheduleExactAlarm ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ScopedStorage.md.html b/docs/checks/ScopedStorage.md.html index b9dea4a3..df6f1514 100644 --- a/docs/checks/ScopedStorage.md.html +++ b/docs/checks/ScopedStorage.md.html @@ -36,6 +36,17 @@ will no longer provide write access to all files; it will provide the equivalent of `READ_EXTERNAL_STORAGE` instead. +As of Android 13, if you need to query or interact with MediaStore or +media files on the shared storage, you should be using instead one or +more new storage permissions: +* `android.permission.READ_MEDIA_IMAGES` +* `android.permission.READ_MEDIA_VIDEO` +* `android.permission.READ_MEDIA_AUDIO` + +and then add `maxSdkVersion="33"` to the older permission. See the +developer guide for how to do this: +https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions + The `MANAGE_EXTERNAL_STORAGE` permission can be used to manage all files, but it is rarely necessary and most apps on Google Play are not allowed to use it. Most apps should instead migrate to use scoped @@ -57,8 +68,6 @@ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><!-- ERROR --> ----------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -69,6 +78,7 @@ <uses-sdk android:targetSdkVersion="29"/> <uses-permission/><!-- Test for NPEs --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><!-- ERROR --> + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/><!-- OK --> </manifest> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/ScrollViewCount.md.html b/docs/checks/ScrollViewCount.md.html index 0eaee2d7..4b5a15e6 100644 --- a/docs/checks/ScrollViewCount.md.html +++ b/docs/checks/ScrollViewCount.md.html @@ -41,8 +41,6 @@ <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ScrollViewSize.md.html b/docs/checks/ScrollViewSize.md.html index 0ea2fab3..5fac6071 100644 --- a/docs/checks/ScrollViewSize.md.html +++ b/docs/checks/ScrollViewSize.md.html @@ -45,8 +45,6 @@ android:layout_width="match_parent" ----------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SdCardPath.md.html b/docs/checks/SdCardPath.md.html index f641cac8..3d5a8ca0 100644 --- a/docs/checks/SdCardPath.md.html +++ b/docs/checks/SdCardPath.md.html @@ -142,8 +142,6 @@ String s = "file://sdcard/foo"; ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SecureRandom.md.html b/docs/checks/SecureRandom.md.html index d307b3fd..1409a3e7 100644 --- a/docs/checks/SecureRandom.md.html +++ b/docs/checks/SecureRandom.md.html @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://goo.gle/SecureRandom +See : https://developer.android.com/reference/java/security/SecureRandom.html 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/SecureRandomDetector.kt) @@ -125,8 +127,6 @@ random2.setSeed(fixedSeed); // Wrong -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SelectableText.md.html b/docs/checks/SelectableText.md.html index e21d71e2..a990ac76 100644 --- a/docs/checks/SelectableText.md.html +++ b/docs/checks/SelectableText.md.html @@ -51,8 +51,6 @@ <TextView -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SerializableUsage.md.html b/docs/checks/SerializableUsage.md.html new file mode 100644 index 00000000..b9a7a6b6 --- /dev/null +++ b/docs/checks/SerializableUsage.md.html @@ -0,0 +1,176 @@ + +(#) Don't use Serializable. + +!!! ERROR: Don't use Serializable. + This is an error. + +Id +: `SerializableUsage` +Summary +: Don't use Serializable. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/SerializableDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/SerializableDetectorTest.kt) +Copyright Year +: 2021 + +Don't use Serializable. It's brittle, requires reflection, does not work +well with Kotlin, and prevents us from using Core Library Desugaring. +Either implement Parcelable too or use another safer serialization +mechanism. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/ImplementsExplicitly.kt:6:Error: Don't use Serializable. +[SerializableUsage] + +class ImplementsExplicitly : RuntimeException, Serializable + -------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/ImplementsExplicitly.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack + +import java.io.Serializable +import kotlin.RuntimeException + +class ImplementsExplicitly : RuntimeException, Serializable +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/SerializableDetectorTest.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, `SerializableDetector.kotlin_explicitPlatformType_isNotIgnored`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("SerializableUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("SerializableUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SerializableUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SerializableUsage" severity="ignore" /> + </lint> + ``` + 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 'SerializableUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SerializableUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ServiceCast.md.html b/docs/checks/ServiceCast.md.html index f2a3209a..2e435594 100644 --- a/docs/checks/ServiceCast.md.html +++ b/docs/checks/ServiceCast.md.html @@ -59,8 +59,6 @@ DisplayManager displayServiceWrong = (DisplayManager) context ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SetAndClearCommunicationDevice.md.html b/docs/checks/SetAndClearCommunicationDevice.md.html new file mode 100644 index 00000000..8ce296b4 --- /dev/null +++ b/docs/checks/SetAndClearCommunicationDevice.md.html @@ -0,0 +1,124 @@ + +(#) Clearing communication device + +!!! WARNING: Clearing communication device + This is a warning. + +Id +: `SetAndClearCommunicationDevice` +Summary +: Clearing communication device +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files +Editing +: This check can *not* run live 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/CommunicationDeviceDetector.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/CommunicationDeviceDetectorTest.kt) +Copyright Year +: 2022 + +After selecting the audio device for communication use cases using +`setCommunicationDevice(AudioDeviceInfo device)`, the selection is +active as long as the requesting application process lives, until +`clearCommunicationDevice()` is called or until the device is +disconnected. It is therefore important to clear the request when a call +ends or the requesting activity or service is stopped or destroyed. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/Test.kt:9:Warning: Must call clearCommunicationDevice() +after setCommunicationDevice() [SetAndClearCommunicationDevice] + + manager.setCommunicationDevice(AudioDeviceInfo()) + ------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`src/test/pkg/Test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.media.AudioDeviceInfo +import android.media.AudioManager + +class Test { + fun test() { + val manager = AudioManager() + manager.setCommunicationDevice(AudioDeviceInfo()) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/AudioManager.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package android.media; + +public class AudioManager { + public boolean setCommunicationDevice(@NonNull AudioDeviceInfo device) {} + public void clearCommunicationDevice() {} +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/AudioDeviceInfo.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package android.media; +public class AudioDeviceInfo {} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/CommunicationDeviceDetectorTest.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 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SetAndClearCommunicationDevice" severity="ignore" /> + </lint> + ``` + 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 'SetAndClearCommunicationDevice' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SetAndClearCommunicationDevice ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SetJavaScriptEnabled.md.html b/docs/checks/SetJavaScriptEnabled.md.html index db6ceb4e..13ac6e18 100644 --- a/docs/checks/SetJavaScriptEnabled.md.html +++ b/docs/checks/SetJavaScriptEnabled.md.html @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://goo.gle/SetJavaScriptEnabled +See : https://developer.android.com/training/articles/security-tips 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/SetJavaScriptEnabledDetector.java) @@ -44,8 +46,6 @@ webView.getSettings().setJavaScriptEnabled(true); // bad ------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SetTextI18n.md.html b/docs/checks/SetTextI18n.md.html index c983bb51..771595d3 100644 --- a/docs/checks/SetTextI18n.md.html +++ b/docs/checks/SetTextI18n.md.html @@ -74,8 +74,6 @@ btn.setText("User " + getUserName()); ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SetWorldReadable.md.html b/docs/checks/SetWorldReadable.md.html index 1365a82b..77890912 100644 --- a/docs/checks/SetWorldReadable.md.html +++ b/docs/checks/SetWorldReadable.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/SetWorldReadable 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/SecurityDetector.java) Tests @@ -44,8 +46,6 @@ mFile.setReadable(true, false); ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SetWorldWritable.md.html b/docs/checks/SetWorldWritable.md.html index 2fb8e3e9..b3333757 100644 --- a/docs/checks/SetWorldWritable.md.html +++ b/docs/checks/SetWorldWritable.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/SetWorldWritable 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/SecurityDetector.java) Tests @@ -44,8 +46,6 @@ mFile.setWritable(true, false); ------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ShiftFlags.md.html b/docs/checks/ShiftFlags.md.html index d97b65e2..080cdbf6 100644 --- a/docs/checks/ShiftFlags.md.html +++ b/docs/checks/ShiftFlags.md.html @@ -66,8 +66,6 @@ public static final int FLAG12 = 0x10; ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ShortAlarm.md.html b/docs/checks/ShortAlarm.md.html index a8bfe56f..c34a674a 100644 --- a/docs/checks/ShortAlarm.md.html +++ b/docs/checks/ShortAlarm.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Kotlin and Java files +: Kotlin and Java files and manifest files Editing : This check runs on the fly in the IDE editor Implementation @@ -60,8 +60,6 @@ alarmManager.setRepeating(AlarmManager.ELAPSED_REALTIME, 5000, interval2, null); // ERROR --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -133,6 +131,21 @@ problematicStatement() ``` +* Adding the suppression attribute `tools:ignore="ShortAlarm"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <uses-permission tools:ignore="ShortAlarm" .../> + ... + </manifest> + ``` + * 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: diff --git a/docs/checks/ShouldUseStaticImport.md.html b/docs/checks/ShouldUseStaticImport.md.html new file mode 100644 index 00000000..5e83f749 --- /dev/null +++ b/docs/checks/ShouldUseStaticImport.md.html @@ -0,0 +1,169 @@ + +(#) Flags declarations that should be statically imported. + +!!! WARNING: Flags declarations that should be statically imported. + This is a warning. + +Id +: `ShouldUseStaticImport` +Summary +: Flags declarations that should be statically imported. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetectorTest.kt) + +Certain declarations like TimeUnit.SECONDS should be statically imported +to increase the readability. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Warning: Should statically import SECONDS +[ShouldUseStaticImport] + + TimeUnit.SECONDS.toDays(1); + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import java.util.concurrent.TimeUnit; +class Example { + public void foo() { + TimeUnit.SECONDS.toDays(1); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetectorTest.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, `ShouldUseStaticImportDetector.timeUnitSeconds`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ShouldUseStaticImport") + fun method() { + asList(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ShouldUseStaticImport") + void method() { + asList(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ShouldUseStaticImport + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ShouldUseStaticImport" severity="ignore" /> + </lint> + ``` + 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 'ShouldUseStaticImport' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ShouldUseStaticImport ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ShowToast.md.html b/docs/checks/ShowToast.md.html index 2cd6951c..3659f0d2 100644 --- a/docs/checks/ShowToast.md.html +++ b/docs/checks/ShowToast.md.html @@ -66,8 +66,6 @@ Toast toast2 = Toast.makeText(context, "foo", Toast.LENGTH_LONG); // not shown -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SignatureOrSystemPermissions.md.html b/docs/checks/SignatureOrSystemPermissions.md.html index ed9e9c31..21b309f7 100644 --- a/docs/checks/SignatureOrSystemPermissions.md.html +++ b/docs/checks/SignatureOrSystemPermissions.md.html @@ -47,8 +47,6 @@ android:protectionLevel="signatureOrSystem"/> ------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SimpleDateFormat.md.html b/docs/checks/SimpleDateFormat.md.html index 7fc1adad..d8b44460 100644 --- a/docs/checks/SimpleDateFormat.md.html +++ b/docs/checks/SimpleDateFormat.md.html @@ -73,8 +73,6 @@ new SimpleDateFormat("yyyy-MM-dd", DateFormatSymbols.getInstance()); // WRONG ------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Slices.md.html b/docs/checks/Slices.md.html index d61e2548..eea0bbb3 100644 --- a/docs/checks/Slices.md.html +++ b/docs/checks/Slices.md.html @@ -48,8 +48,6 @@ ListBuilder lb2 = new ListBuilder(context, uri, ttl); // missing on this one ---------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SmallSp.md.html b/docs/checks/SmallSp.md.html index 9c983f96..eb75590a 100644 --- a/docs/checks/SmallSp.md.html +++ b/docs/checks/SmallSp.md.html @@ -47,8 +47,6 @@ android:layout_height="6.5sp" /> ----------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SoonBlockedPrivateApi.md.html b/docs/checks/SoonBlockedPrivateApi.md.html index ffcf86de..c5dbd733 100644 --- a/docs/checks/SoonBlockedPrivateApi.md.html +++ b/docs/checks/SoonBlockedPrivateApi.md.html @@ -46,8 +46,6 @@ Field maybeField = TelephonyManager.class.getDeclaredField("OTASP_NEEDED"); // ERROR 2 ------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SourceLockedOrientationActivity.md.html b/docs/checks/SourceLockedOrientationActivity.md.html index 478a6687..4eb5984a 100644 --- a/docs/checks/SourceLockedOrientationActivity.md.html +++ b/docs/checks/SourceLockedOrientationActivity.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://developer.android.com/guide/topics/large-screens/large-screen-cookbook#restricted_app_orientation 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/ChromeOsSourceDetector.kt) Tests @@ -31,8 +33,9 @@ The `Activity` should not be locked to a portrait orientation so that users can take advantage of the multi-window environments and larger -landscape-first screens that Android runs on such as Chrome OS. To fix -the issue, consider calling `setRequestedOrientation` with the +landscape-first screens that Android runs on such as ChromeOS, tablets, +and foldables. To fix the issue, consider calling +`setRequestedOrientation` with the `ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR` or `ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED` options or removing the call all together. @@ -51,8 +54,6 @@ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); ----------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SpUsage.md.html b/docs/checks/SpUsage.md.html index 0f80ccb4..bff859f9 100644 --- a/docs/checks/SpUsage.md.html +++ b/docs/checks/SpUsage.md.html @@ -62,8 +62,6 @@ android:textSize="14dip" /> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SpanMarkPointMissingMask.md.html b/docs/checks/SpanMarkPointMissingMask.md.html new file mode 100644 index 00000000..4e8e99d2 --- /dev/null +++ b/docs/checks/SpanMarkPointMissingMask.md.html @@ -0,0 +1,182 @@ + +(#) Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. + +!!! ERROR: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. + This is an error. + +Id +: `SpanMarkPointMissingMask` +Summary +: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/text/SpanMarkPointMissingMaskDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/text/SpanMarkPointMissingMaskDetectorTest.kt) +Copyright Year +: 2021 + +Spans flags can have priority or other bits set. Ensure that Span flags +are checked using `currentFlag and Spanned.SPAN_POINT_MARK_MASK == +desiredFlag` rather than just `currentFlag == desiredFlag` + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/text/MyClass.kt:7:Error: Do not check against directly. +Instead mask flag with Spanned.SPAN_POINT_MARK_MASK to only check +MARK_POINT flags. [SpanMarkPointMissingMask] + + return spanned.getSpanFlags(Object()) == || Spanned.x() + ------------------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/text/MyClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.text + +import android.text.Spanned + +class MyClass { + fun doCheckIncorrectly(spanned: Spanned): Boolean { + return spanned.getSpanFlags(Object()) == || Spanned.x() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/text/SpanMarkPointMissingMaskDetectorTest.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, `SpanMarkPointMissingMaskDetector.testViolatingExpressionLeft`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("SpanMarkPointMissingMask") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("SpanMarkPointMissingMask") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SpanMarkPointMissingMask + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SpanMarkPointMissingMask" severity="ignore" /> + </lint> + ``` + 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 'SpanMarkPointMissingMask' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SpanMarkPointMissingMask ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SpecifyForegroundServiceType.md.html b/docs/checks/SpecifyForegroundServiceType.md.html index 14783c54..c09aabd1 100644 --- a/docs/checks/SpecifyForegroundServiceType.md.html +++ b/docs/checks/SpecifyForegroundServiceType.md.html @@ -22,6 +22,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files and manifest files Editing @@ -37,6 +44,36 @@ entry for `SystemForegroundService` to include the foreground service type in the `AndroidManifest.xml` file. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/SpecifyJobSchedulerIdRange.md.html b/docs/checks/SpecifyJobSchedulerIdRange.md.html index 9e640edb..bc40b7db 100644 --- a/docs/checks/SpecifyJobSchedulerIdRange.md.html +++ b/docs/checks/SpecifyJobSchedulerIdRange.md.html @@ -20,6 +20,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -38,6 +45,36 @@ `androidx.work.Configuration.Builder.setJobSchedulerJobIdRange(int, int)`. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/SquareAndRoundTilePreviews.md.html b/docs/checks/SquareAndRoundTilePreviews.md.html index 1d93669f..3d8bb039 100644 --- a/docs/checks/SquareAndRoundTilePreviews.md.html +++ b/docs/checks/SquareAndRoundTilePreviews.md.html @@ -43,8 +43,6 @@ <service ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StateFlowValueCalledInComposition.md.html b/docs/checks/StateFlowValueCalledInComposition.md.html index cd9db7bd..971bee79 100644 --- a/docs/checks/StateFlowValueCalledInComposition.md.html +++ b/docs/checks/StateFlowValueCalledInComposition.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -40,115 +47,18 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/androidx/compose/runtime/foo/TestFlow.kt:20:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:24:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - stateFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:25:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:29:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - stateFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:30:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:39:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - stateFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:40:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:43:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - stateFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:44:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:50:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - stateFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:51:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:55:Error: StateFlow.value + +src/androidx/compose/runtime/foo/TestFlow.kt:19:Error: StateFlow.value should not be called within composition [StateFlowValueCalledInComposition] stateFlow.value ----- - - -src/androidx/compose/runtime/foo/TestFlow.kt:56:Error: StateFlow.value -should not be called within composition -[StateFlowValueCalledInComposition] - - testFlow.value - ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: -`src/androidx/compose/runtime/foo/TestFlow.kt`: +` src/androidx/compose/runtime/foo/TestFlow.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers package androidx.compose.runtime.foo @@ -218,6 +128,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/StateListReachable.md.html b/docs/checks/StateListReachable.md.html index 20a282ca..b237f8dc 100644 --- a/docs/checks/StateListReachable.md.html +++ b/docs/checks/StateListReachable.md.html @@ -43,8 +43,6 @@ <item android:state_pressed="true" ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StaticFieldLeak.md.html b/docs/checks/StaticFieldLeak.md.html index 7f9d0692..134d4997 100644 --- a/docs/checks/StaticFieldLeak.md.html +++ b/docs/checks/StaticFieldLeak.md.html @@ -82,8 +82,6 @@ private static Activity sAppContext1; // LEAK ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StopShip.md.html b/docs/checks/StopShip.md.html index 879ce981..82a0a101 100644 --- a/docs/checks/StopShip.md.html +++ b/docs/checks/StopShip.md.html @@ -63,8 +63,6 @@ /* We must STOPSHIP! */ -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StringEscaping.md.html b/docs/checks/StringEscaping.md.html index ea8bf73f..5623b6ec 100644 --- a/docs/checks/StringEscaping.md.html +++ b/docs/checks/StringEscaping.md.html @@ -72,8 +72,6 @@ <item quantity="few">%d piose'nki.</item> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StringFormatCount.md.html b/docs/checks/StringFormatCount.md.html index fa85099f..6b07d1c2 100644 --- a/docs/checks/StringFormatCount.md.html +++ b/docs/checks/StringFormatCount.md.html @@ -23,7 +23,7 @@ Editing : This check can *not* run live 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/StringFormatDetector.java) +: [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/StringFormatDetector.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/StringFormatDetectorTest.java) Copyright Year @@ -47,8 +47,6 @@ <string name="hello">%3$d: %1$s, %2$s?</string> ----------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/StringFormatInTimber.md.html b/docs/checks/StringFormatInTimber.md.html new file mode 100644 index 00000000..6528bee4 --- /dev/null +++ b/docs/checks/StringFormatInTimber.md.html @@ -0,0 +1,171 @@ + +(#) Logging call with Timber contains String#format() + +!!! WARNING: Logging call with Timber contains String#format() + This is a warning. + +Id +: `StringFormatInTimber` +Summary +: Logging call with Timber contains String#format() +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +Since Timber handles String.format automatically, you may not use +String#format(). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Warning: Using 'String#format' inside of 'Timber' +[StringFormatInTimber] + + Timber.d(String.format("%s", "arg1")); + --------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Timber.d(String.format("%s", "arg1")); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.innerStringFormat`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("StringFormatInTimber") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("StringFormatInTimber") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection StringFormatInTimber + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="StringFormatInTimber" severity="ignore" /> + </lint> + ``` + 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 'StringFormatInTimber' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore StringFormatInTimber ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/StringFormatInvalid.md.html b/docs/checks/StringFormatInvalid.md.html index 7975bd2a..cc473de7 100644 --- a/docs/checks/StringFormatInvalid.md.html +++ b/docs/checks/StringFormatInvalid.md.html @@ -23,7 +23,7 @@ Editing : This check can *not* run live 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/StringFormatDetector.java) +: [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/StringFormatDetector.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/StringFormatDetectorTest.java) Copyright Year @@ -58,8 +58,6 @@ context.getString(R.string.no_args, "first"); // ERROR -------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/StringFormatMatches.md.html b/docs/checks/StringFormatMatches.md.html index 96f62be0..d3a227a8 100644 --- a/docs/checks/StringFormatMatches.md.html +++ b/docs/checks/StringFormatMatches.md.html @@ -23,7 +23,7 @@ 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/StringFormatDetector.java) +: [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/StringFormatDetector.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/StringFormatDetectorTest.java) Copyright Year @@ -47,8 +47,6 @@ String output4 = String.format(score, true); // wrong ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/StringFormatTrivial.md.html b/docs/checks/StringFormatTrivial.md.html index 3b7f461e..c0f82b0e 100644 --- a/docs/checks/StringFormatTrivial.md.html +++ b/docs/checks/StringFormatTrivial.md.html @@ -25,7 +25,7 @@ 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/StringFormatDetector.java) +: [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/StringFormatDetector.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/StringFormatDetectorTest.java) Copyright Year @@ -63,8 +63,6 @@ String output3a = String.format("%s %c %b", "Hello world", '!', true); ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/StringNotCapitalized.md.html b/docs/checks/StringNotCapitalized.md.html new file mode 100644 index 00000000..228400ea --- /dev/null +++ b/docs/checks/StringNotCapitalized.md.html @@ -0,0 +1,155 @@ + +(#) Marks strings which are not capitalized. + +!!! WARNING: Marks strings which are not capitalized. + This is a warning. + +Id +: `StringNotCapitalized` +Summary +: Marks strings which are not capitalized. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetectorTest.kt) + +Every string should be capitalized. If not, it is flagged. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/strings.xml:2:Warning: String is not capitalized +[StringNotCapitalized] + + <string name="my_string">my string</string> + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/values/strings.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<resources> + <string name="my_string">my string</string> +</resources> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetectorTest.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, `StringNotCapitalizedDetector.lowercase`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="StringNotCapitalized"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <resources xmlns:tools="http://schemas.android.com/tools"> + ... + <string tools:ignore="StringNotCapitalized" .../> + ... + </resources> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="StringNotCapitalized" severity="ignore" /> + </lint> + ``` + 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 'StringNotCapitalized' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore StringNotCapitalized ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/StringShouldBeInt.md.html b/docs/checks/StringShouldBeInt.md.html index 1a46dae5..15af4f69 100644 --- a/docs/checks/StringShouldBeInt.md.html +++ b/docs/checks/StringShouldBeInt.md.html @@ -71,8 +71,6 @@ compileSdk '19' --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SubscribeOnMain.md.html b/docs/checks/SubscribeOnMain.md.html new file mode 100644 index 00000000..5778f706 --- /dev/null +++ b/docs/checks/SubscribeOnMain.md.html @@ -0,0 +1,188 @@ + +(#) subscribeOn called with the main thread scheduler. + +!!! ERROR: subscribeOn called with the main thread scheduler. + This is an error. + +Id +: `SubscribeOnMain` +Summary +: subscribeOn called with the main thread scheduler. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/rx/RxSubscribeOnMainDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/rx/RxSubscribeOnMainDetectorTest.kt) +Copyright Year +: 2021 + +Calling `subscribeOn(AndroidSchedulers.mainThread())` will cause the +code ran at subscription time to be executed on the main thread - that +is, code above this line. +Typically this is not actually desired, and instead you want to use +observeOn(AndroidSchedulers.mainThread()) which will cause the code +below this line to be run on the main thread (eg the code inside your +subscribe() block). + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/com/slack/lint/Foo.java:8:Error: This will make the code for the +initial subscription (above this line) run on the main thread. You +probably want observeOn(AndroidSchedulers.mainThread()). +[SubscribeOnMain] + + obs.subscribeOn(AndroidSchedulers.mainThread()); + ------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/com/slack/lint/Foo.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package com.slack.lint; + +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; + +public class Foo { + public void bar(Observable obs) { + obs.subscribeOn(AndroidSchedulers.mainThread()); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/rx/RxSubscribeOnMainDetectorTest.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, `RxSubscribeOnMainDetector.subscribeOnMain_fullyQualified_fails_java`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("SubscribeOnMain") + fun method() { + subscribeOn(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("SubscribeOnMain") + void method() { + subscribeOn(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SubscribeOnMain + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SubscribeOnMain" severity="ignore" /> + </lint> + ``` + 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 'SubscribeOnMain' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SubscribeOnMain ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SuperfluousMarginDeclaration.md.html b/docs/checks/SuperfluousMarginDeclaration.md.html new file mode 100644 index 00000000..db075fec --- /dev/null +++ b/docs/checks/SuperfluousMarginDeclaration.md.html @@ -0,0 +1,150 @@ + +(#) Flags margin declarations that can be simplified. + +!!! WARNING: Flags margin declarations that can be simplified. + This is a warning. + +Id +: `SuperfluousMarginDeclaration` +Summary +: Flags margin declarations that can be simplified. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetectorTest.kt) + +Instead of using start-, end-, bottom- and top margins, layout_margin +can be used. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:1:Warning: Should be using layout_margin instead. +[SuperfluousMarginDeclaration] + +<TextView +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetectorTest.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, `SuperfluousMarginDeclarationDetector.androidMarginSame`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="SuperfluousMarginDeclaration"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SuperfluousMarginDeclaration" severity="ignore" /> + </lint> + ``` + 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 'SuperfluousMarginDeclaration' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SuperfluousMarginDeclaration ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SuperfluousNameSpace.md.html b/docs/checks/SuperfluousNameSpace.md.html new file mode 100644 index 00000000..694b47db --- /dev/null +++ b/docs/checks/SuperfluousNameSpace.md.html @@ -0,0 +1,148 @@ + +(#) Flags namespaces that are already declared. + +!!! WARNING: Flags namespaces that are already declared. + This is a warning. + +Id +: `SuperfluousNameSpace` +Summary +: Flags namespaces that are already declared. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetectorTest.kt) + +Re-declaring a namespace is unnecessary and hence can be just removed. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/activity_home.xml:3:Warning: This name space is already +declared and hence not needed [SuperfluousNameSpace] + + xmlns:android="http://schemas.android.com/apk/res/android" + ---------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/activity_home.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> + <TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content"/> +</LinearLayout> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetectorTest.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, `SuperfluousNameSpaceDetector.androidNamespaceOnChild`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="SuperfluousNameSpace"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SuperfluousNameSpace" severity="ignore" /> + </lint> + ``` + 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 'SuperfluousNameSpace' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SuperfluousNameSpace ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SuperfluousPaddingDeclaration.md.html b/docs/checks/SuperfluousPaddingDeclaration.md.html new file mode 100644 index 00000000..d73447e1 --- /dev/null +++ b/docs/checks/SuperfluousPaddingDeclaration.md.html @@ -0,0 +1,150 @@ + +(#) Flags padding declarations that can be simplified. + +!!! WARNING: Flags padding declarations that can be simplified. + This is a warning. + +Id +: `SuperfluousPaddingDeclaration` +Summary +: Flags padding declarations that can be simplified. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetectorTest.kt) + +Instead of using start-, end-, bottom- and top paddings, padding can be +used. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:1:Warning: Should be using padding instead. +[SuperfluousPaddingDeclaration] + +<TextView +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:paddingStart="16dp" + android:paddingEnd="16dp"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetectorTest.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, `SuperfluousPaddingDeclarationDetector.androidPaddingSame`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="SuperfluousPaddingDeclaration"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SuperfluousPaddingDeclaration" severity="ignore" /> + </lint> + ``` + 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 'SuperfluousPaddingDeclaration' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SuperfluousPaddingDeclaration ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SupportAnnotationUsage.md.html b/docs/checks/SupportAnnotationUsage.md.html index a9edbff7..55a0a097 100644 --- a/docs/checks/SupportAnnotationUsage.md.html +++ b/docs/checks/SupportAnnotationUsage.md.html @@ -53,8 +53,6 @@ @java.lang.annotation.Target(ElementType.PARAMETER) // ERROR 2 ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Suspicious0dp.md.html b/docs/checks/Suspicious0dp.md.html index bd49c157..00ff84ed 100644 --- a/docs/checks/Suspicious0dp.md.html +++ b/docs/checks/Suspicious0dp.md.html @@ -74,8 +74,6 @@ android:layout_height="0dp" --------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SuspiciousCompositionLocalModifierRead.md.html b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html new file mode 100644 index 00000000..176edcdb --- /dev/null +++ b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html @@ -0,0 +1,210 @@ + +(#) CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() + +!!! ERROR: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() + This is an error. + +Id +: `SuspiciousCompositionLocalModifierRead` +Summary +: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/SuspiciousCompositionLocalModifierReadDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/SuspiciousCompositionLocalModifierReadDetectorTest.kt) +Copyright Year +: 2023 + +Jetpack Compose is unable to send updated values of a CompositionLocal +when it's read in a Modifier.Node's initializer and onAttach() or +onDetach() callbacks. Modifier.Node's callbacks are not aware of +snapshot reads, and their lifecycle callbacks are not invoked on every +recomposition. If you read a CompositionLocal in onAttach() or +onDetach(), you will only get the CompositionLocal's value once at the +moment of the read, which may lead to unexpected behaviors. We recommend +instead reading CompositionLocals at time-of-use in callbacks that apply +your Modifier's behavior, like measure() for LayoutModifierNode, draw() +for DrawModifierNode, and so on. To observe the value of the +CompositionLocal manually, extend from the ObserverNode interface and +place the read inside an observeReads {} block within the +onObservedReadsChanged() callback. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/NodeUnderTest.kt:16:Error: Reading localInt in onAttach will +only access the CompositionLocal's value when the modifier is attached. +To be notified of the latest value of the CompositionLocal, read the +value in one of the modifier's other callbacks. +[SuspiciousCompositionLocalModifierRead] + + val readValue = currentValueOf(localInt) + ------------------------ + + +src/test/NodeUnderTest.kt:20:Error: Reading staticLocalInt in onDetach +will only access the CompositionLocal's value when the modifier is +detached. To be notified of the latest value of the CompositionLocal, +read the value in one of the modifier's other callbacks. +[SuspiciousCompositionLocalModifierRead] + + val readValue = currentValueOf(staticLocalInt) + ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/NodeUnderTest.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import androidx.compose.ui.Modifier +import androidx.compose.ui.node.CompositionLocalConsumerModifierNode +import androidx.compose.ui.node.currentValueOf +import androidx.compose.runtime.CompositionLocal +import androidx.compose.runtime.compositionLocalOf +import androidx.compose.runtime.staticCompositionLocalOf + +val staticLocalInt = staticCompositionLocalOf { 0 } +val localInt = compositionLocalOf { 0 } + +class NodeUnderTest : Modifier.Node(), CompositionLocalConsumerModifierNode { + override fun onAttach() { + val readValue = currentValueOf(localInt) + } + + override fun onDetach() { + val readValue = currentValueOf(staticLocalInt) + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/SuspiciousCompositionLocalModifierReadDetectorTest.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, `SuspiciousCompositionLocalModifierReadDetector.testCompositionLocalReadInModifierAttachAndDetach`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("SuspiciousCompositionLocalModifierRead") + fun method() { + currentValueOf(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("SuspiciousCompositionLocalModifierRead") + void method() { + currentValueOf(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SuspiciousCompositionLocalModifierRead + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SuspiciousCompositionLocalModifierRead" severity="ignore" /> + </lint> + ``` + 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 'SuspiciousCompositionLocalModifierRead' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SuspiciousCompositionLocalModifierRead ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SuspiciousImport.md.html b/docs/checks/SuspiciousImport.md.html index 77bb219e..902741d0 100644 --- a/docs/checks/SuspiciousImport.md.html +++ b/docs/checks/SuspiciousImport.md.html @@ -46,8 +46,6 @@ import android.R; ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SuspiciousIndentation.md.html b/docs/checks/SuspiciousIndentation.md.html index c54c98d5..f8e5ab96 100644 --- a/docs/checks/SuspiciousIndentation.md.html +++ b/docs/checks/SuspiciousIndentation.md.html @@ -150,8 +150,6 @@ line++ // WARN 11 ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/SwitchIntDef.md.html b/docs/checks/SwitchIntDef.md.html index e824b901..8e0f1ad4 100644 --- a/docs/checks/SwitchIntDef.md.html +++ b/docs/checks/SwitchIntDef.md.html @@ -87,15 +87,6 @@ switch (X.getDuration()) { ------ - - -src/test/pkg/X.java:104:Warning: Switch statement on an int with known -associated constant missing case LENGTH_INDEFINITE [SwitchIntDef] - - switch (duration) { - ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -205,7 +196,7 @@ } public static void testMissingWithDefault(@Duration int duration) { - switch (duration) { + switch (duration) { // OK case LENGTH_SHORT: case LENGTH_LONG: default: @@ -215,7 +206,7 @@ @SuppressLint("SwitchIntDef") public static void testSuppressAnnotation(@Duration int duration) { - switch (duration) { + switch (duration) { // OK case LENGTH_SHORT: case LENGTH_INDEFINITE: break; @@ -224,7 +215,7 @@ public static void testSuppressComment(@Duration int duration) { //noinspection AndroidLintSwitchIntDef - switch (duration) { + switch (duration) { // OK case LENGTH_SHORT: case LENGTH_INDEFINITE: break; diff --git a/docs/checks/SyntheticAccessor.md.html b/docs/checks/SyntheticAccessor.md.html index f0218c42..614b9985 100644 --- a/docs/checks/SyntheticAccessor.md.html +++ b/docs/checks/SyntheticAccessor.md.html @@ -106,8 +106,6 @@ method1(); // ERROR ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SystemPermissionTypo.md.html b/docs/checks/SystemPermissionTypo.md.html index 903b7f63..b2bcc498 100644 --- a/docs/checks/SystemPermissionTypo.md.html +++ b/docs/checks/SystemPermissionTypo.md.html @@ -86,8 +86,6 @@ <provider android:permission="android.permission.BIND_NCF_SERVICE" /> ----------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TestAppLink.md.html b/docs/checks/TestAppLink.md.html index 8d412a7d..d17c7fba 100644 --- a/docs/checks/TestAppLink.md.html +++ b/docs/checks/TestAppLink.md.html @@ -45,8 +45,6 @@ <validation /> ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TestManifestGradleConfiguration.md.html b/docs/checks/TestManifestGradleConfiguration.md.html index b8ee2604..87059248 100644 --- a/docs/checks/TestManifestGradleConfiguration.md.html +++ b/docs/checks/TestManifestGradleConfiguration.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui.test.manifest Feedback : https://issuetracker.google.com/issues/new?component=741505 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html) + Affects : Gradle build files Editing @@ -28,6 +35,8 @@ : https://developer.android.com/jetpack/compose/testing#setup Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-test-manifest-lint/src/main/java/androidx/compose/ui/test/manifest/lint/GradleDebugConfigurationDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-test-manifest-lint/src/test/java/androix/compose/ui/test/manifest/lint/GradleDebugConfigurationDetectorTest.kt) Copyright Year : 2022 @@ -36,6 +45,113 @@ only needs to be present in testing configurations therefore use this dependency with the debugImplementation configuration. +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:2:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + implementation("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + ------------------------------------------------------------------- + + +build.gradle:3:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + api("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + -------------------------------------------------------- + + +build.gradle:4:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + compileOnly("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + ---------------------------------------------------------------- + + +build.gradle:5:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + runtimeOnly("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + ---------------------------------------------------------------- + + +build.gradle:6:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + annotationProcessor("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + ------------------------------------------------------------------------ + + +build.gradle:7:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + lintChecks("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + --------------------------------------------------------------- + + +build.gradle:8:Warning: Please use debugImplementation. +[TestManifestGradleConfiguration] + + lintPublish("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + ---------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + implementation("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + api("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + compileOnly("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + runtimeOnly("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + annotationProcessor("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + lintChecks("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") + lintPublish("androidx.compose.ui:ui-test-manifest:1.2.0-beta02") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-test-manifest-lint/src/test/java/androix/compose/ui/test/manifest/lint/GradleDebugConfigurationDetectorTest.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, `GradleDebugConfigurationDetector.kotlin_manifestDependencyInBlockedConfigs_shouldRaiseIssue`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=741505. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-test-manifest:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui-test-manifest:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-test-manifest) + +# libs.versions.toml +[versions] +ui-test-manifest = "1.5.0-beta02" +[libraries] +ui-test-manifest = { + module = "androidx.compose.ui:ui-test-manifest", + version.ref = "ui-test-manifest" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/TextFields.md.html b/docs/checks/TextFields.md.html index 64ba6d30..62a3dd04 100644 --- a/docs/checks/TextFields.md.html +++ b/docs/checks/TextFields.md.html @@ -61,8 +61,6 @@ <EditText -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TextViewEdits.md.html b/docs/checks/TextViewEdits.md.html index a9f50278..1a0f7d7f 100644 --- a/docs/checks/TextViewEdits.md.html +++ b/docs/checks/TextViewEdits.md.html @@ -210,8 +210,6 @@ android:cursorVisible="true" /> ---------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ThrowableNotAtBeginning.md.html b/docs/checks/ThrowableNotAtBeginning.md.html new file mode 100644 index 00000000..6f14e06e --- /dev/null +++ b/docs/checks/ThrowableNotAtBeginning.md.html @@ -0,0 +1,171 @@ + +(#) Exception in Timber not at the beginning + +!!! WARNING: Exception in Timber not at the beginning + This is a warning. + +Id +: `ThrowableNotAtBeginning` +Summary +: Exception in Timber not at the beginning +Severity +: Warning +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +In Timber you have to pass a Throwable at the beginning of the call. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Throwable should be first argument +[ThrowableNotAtBeginning] + + Timber.d("%s", e); + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Exception e = new Exception(); + Timber.d("%s", e); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.throwableNotAtBeginning`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ThrowableNotAtBeginning") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ThrowableNotAtBeginning") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ThrowableNotAtBeginning + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ThrowableNotAtBeginning" severity="ignore" /> + </lint> + ``` + 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 'ThrowableNotAtBeginning' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ThrowableNotAtBeginning ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TileProviderPermissions.md.html b/docs/checks/TileProviderPermissions.md.html index 3336e9bc..ff1cf74b 100644 --- a/docs/checks/TileProviderPermissions.md.html +++ b/docs/checks/TileProviderPermissions.md.html @@ -45,8 +45,6 @@ <service ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TimberArgCount.md.html b/docs/checks/TimberArgCount.md.html new file mode 100644 index 00000000..27198301 --- /dev/null +++ b/docs/checks/TimberArgCount.md.html @@ -0,0 +1,171 @@ + +(#) Formatting argument types incomplete or inconsistent + +!!! ERROR: Formatting argument types incomplete or inconsistent + This is an error. + +Id +: `TimberArgCount` +Summary +: Formatting argument types incomplete or inconsistent +Severity +: Error +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +When a formatted string takes arguments, you need to pass at least that +amount of arguments to the formatting call. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Error: Wrong argument count, format string %s %s +requires 2 but format call supplies 1 [TimberArgCount] + + Timber.d("%s %s", "arg1"); + ------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Timber.d("%s %s", "arg1"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.tooManyFormatArgs`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("TimberArgCount") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("TimberArgCount") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection TimberArgCount + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TimberArgCount" severity="ignore" /> + </lint> + ``` + 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 'TimberArgCount' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TimberArgCount ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TimberArgTypes.md.html b/docs/checks/TimberArgTypes.md.html new file mode 100644 index 00000000..a0b27986 --- /dev/null +++ b/docs/checks/TimberArgTypes.md.html @@ -0,0 +1,173 @@ + +(#) Formatting string doesn't match passed arguments + +!!! ERROR: Formatting string doesn't match passed arguments + This is an error. + +Id +: `TimberArgTypes` +Summary +: Formatting string doesn't match passed arguments +Severity +: Error +Category +: Correctness: Messages +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +The argument types that you specified in your formatting string does not +match the types of the arguments that you passed to your formatting +call. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Error: Wrong argument type for formatting +argument '#1' in %d: conversion is 'd', received String (argument #2 in +method call) [TimberArgTypes] + + Timber.d("%d", "arg1"); + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Timber.d("%d", "arg1"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.wrongArgTypes`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("TimberArgTypes") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("TimberArgTypes") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection TimberArgTypes + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TimberArgTypes" severity="ignore" /> + </lint> + ``` + 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 'TimberArgTypes' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TimberArgTypes ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TimberExceptionLogging.md.html b/docs/checks/TimberExceptionLogging.md.html new file mode 100644 index 00000000..34451ac5 --- /dev/null +++ b/docs/checks/TimberExceptionLogging.md.html @@ -0,0 +1,172 @@ + +(#) Exception Logging + +!!! WARNING: Exception Logging + This is a warning. + +Id +: `TimberExceptionLogging` +Summary +: Exception Logging +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +Explicitly including the exception message is redundant when supplying +an exception to log. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:6:Warning: Explicitly logging exception message is +redundant [TimberExceptionLogging] + + Timber.d(e.getMessage()); + ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Exception e = new Exception(); + Timber.d(e.getMessage()); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.exceptionLoggingUsingExceptionMessage`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("TimberExceptionLogging") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("TimberExceptionLogging") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection TimberExceptionLogging + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TimberExceptionLogging" severity="ignore" /> + </lint> + ``` + 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 'TimberExceptionLogging' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TimberExceptionLogging ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TimberTagLength.md.html b/docs/checks/TimberTagLength.md.html new file mode 100644 index 00000000..1cd4215d --- /dev/null +++ b/docs/checks/TimberTagLength.md.html @@ -0,0 +1,170 @@ + +(#) Too Long Log Tags + +!!! ERROR: Too Long Log Tags + This is an error. + +Id +: `TimberTagLength` +Summary +: Too Long Log Tags +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/main/java/timber/lint/WrongTimberUsageDetector.kt) +Tests +: [Source Code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.kt) + +Log tags are only allowed to be at most 23 tag characters long. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:5:Error: The logging tag can be at most 23 +characters, was 24 (abcdefghijklmnopqrstuvwx) [TimberTagLength] + + Timber.tag("abcdefghijklmnopqrstuvwx"); + -------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; +import timber.log.Timber; +public class Example { + public void log() { + Timber.tag("abcdefghijklmnopqrstuvwx"); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/JakeWharton/timber/tree/trunk/timber-lint/src/test/java/timber/lint/WrongTimberUsageDetectorTest.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, `WrongTimberUsageDetector.tagTooLongLiteralOnly`. +To report a problem with this extracted sample, visit +https://github.com/JakeWharton/timber/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("TimberTagLength") + fun method() { + tag(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("TimberTagLength") + void method() { + tag(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection TimberTagLength + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TimberTagLength" severity="ignore" /> + </lint> + ``` + 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 'TimberTagLength' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TimberTagLength ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/Todo.md.html b/docs/checks/Todo.md.html new file mode 100644 index 00000000..6eccbf31 --- /dev/null +++ b/docs/checks/Todo.md.html @@ -0,0 +1,173 @@ + +(#) Marks todos in any given file. + +!!! ERROR: Marks todos in any given file. + This is an error, and is also enforced at build time when + supported by the build system. For Android this means it will + run during release builds. + +Id +: `Todo` +Summary +: Marks todos in any given file. +Severity +: Fatal +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Gradle build files, Kotlin and Java files, manifest files, resource files and shrinking configuration files +Editing +: This check can *not* run live in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/TodoDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/TodoDetectorTest.kt) + +Marks todo in any given file since they should be resolved. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/Example.java:4:Error: Contains todo [Todo] + + // TODO something + ---- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/Example.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +class Example { + // TODO something +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/TodoDetectorTest.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, `TodoDetector.javaFile`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("Todo") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("Todo") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection Todo + problematicStatement() + ``` + +* Adding the suppression attribute `tools:ignore="Todo"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="Todo" severity="ignore" /> + </lint> + ``` + 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 'Todo' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore Todo ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TranslucentOrientation.md.html b/docs/checks/TranslucentOrientation.md.html index 0c9b19ce..33f8b0af 100644 --- a/docs/checks/TranslucentOrientation.md.html +++ b/docs/checks/TranslucentOrientation.md.html @@ -52,8 +52,6 @@ <item name="android:windowIsFloating">true</item> ------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TrulyRandom.md.html b/docs/checks/TrulyRandom.md.html index d7da0285..8e50ab62 100644 --- a/docs/checks/TrulyRandom.md.html +++ b/docs/checks/TrulyRandom.md.html @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://goo.gle/TrulyRandom +See : https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html 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/SecureRandomGeneratorDetector.java) @@ -56,8 +58,6 @@ KeyGenerator generator = KeyGenerator.getInstance("AES", "BC"); ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TrustAllX509TrustManager.md.html b/docs/checks/TrustAllX509TrustManager.md.html index ebf04817..f4b6a092 100644 --- a/docs/checks/TrustAllX509TrustManager.md.html +++ b/docs/checks/TrustAllX509TrustManager.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files and library bytecode Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/TrustAllX509TrustManager 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/X509TrustManagerDetector.java) Tests @@ -55,8 +57,6 @@ public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) throws CertificateException { ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/TypographyDashes.md.html b/docs/checks/TypographyDashes.md.html index 6c9b603d..e860c47c 100644 --- a/docs/checks/TypographyDashes.md.html +++ b/docs/checks/TypographyDashes.md.html @@ -69,8 +69,6 @@ <item>Ages 3-5</item> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -114,11 +112,6 @@ [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/TypographyDetectorTest.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, `TypographyDetector.test`. -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: diff --git a/docs/checks/TypographyEllipsis.md.html b/docs/checks/TypographyEllipsis.md.html index 0fa8f49d..84514afa 100644 --- a/docs/checks/TypographyEllipsis.md.html +++ b/docs/checks/TypographyEllipsis.md.html @@ -47,8 +47,6 @@ <string name="ellipsis">40 times...</string> ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -92,11 +90,6 @@ [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/TypographyDetectorTest.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, `TypographyDetector.test`. -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: diff --git a/docs/checks/TypographyFractions.md.html b/docs/checks/TypographyFractions.md.html index d209d6db..dfd14c3a 100644 --- a/docs/checks/TypographyFractions.md.html +++ b/docs/checks/TypographyFractions.md.html @@ -61,8 +61,6 @@ <item>Age 5 1/2</item> --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -106,11 +104,6 @@ [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/TypographyDetectorTest.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, `TypographyDetector.test`. -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: diff --git a/docs/checks/TypographyOther.md.html b/docs/checks/TypographyOther.md.html index 2dcf01cc..0b2a22da 100644 --- a/docs/checks/TypographyOther.md.html +++ b/docs/checks/TypographyOther.md.html @@ -45,8 +45,6 @@ <string name="copyright">(c) 2011</string> -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -90,11 +88,6 @@ [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/TypographyDetectorTest.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, `TypographyDetector.test`. -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: diff --git a/docs/checks/TypographyQuotes.md.html b/docs/checks/TypographyQuotes.md.html index 53fa2416..1574bb8a 100644 --- a/docs/checks/TypographyQuotes.md.html +++ b/docs/checks/TypographyQuotes.md.html @@ -94,8 +94,6 @@ <string name="notbadquotes">Type Option-` then 'Escape'</string> --------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -139,11 +137,6 @@ [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/TypographyDetectorTest.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, `TypographyDetector.test`. -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: diff --git a/docs/checks/Typos.md.html b/docs/checks/Typos.md.html index 426d091a..2d98701a 100644 --- a/docs/checks/Typos.md.html +++ b/docs/checks/Typos.md.html @@ -79,8 +79,6 @@ <string name="dlg_button_ok">Ok</string> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UastImplementation.md.html b/docs/checks/UastImplementation.md.html index 77c53963..abfcea18 100644 --- a/docs/checks/UastImplementation.md.html +++ b/docs/checks/UastImplementation.md.html @@ -68,13 +68,22 @@ ----------------------------------------------------------------- +src/test/pkg/UastImplementationDetectorTestInput.kt:22:Warning: +org.jetbrains.uast.kotlin.UnknownKotlinExpression is UAST +implementation. Consider using one of its corresponding UAST interfaces: +UExpression, UAnnotated, UUnknownExpression [UastImplementation] + +import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 4 +------------------------------------------------------------------- + + src/test/pkg/UastImplementationDetectorTestInput.kt:45:Warning: org.jetbrains.uast.kotlin.KotlinUField is UAST implementation. Consider using one of its corresponding UAST interfaces: UVariableEx, UVariable, UDeclaration, UAnnotated, UDeclarationEx, UAnchorOwner, UFieldEx, UField [UastImplementation] - val delegateType = (field as? KotlinUField)?.type // ERROR 4 + val delegateType = (field as? KotlinUField)?.type // ERROR 5 ------------ @@ -83,7 +92,7 @@ Consider using one of its corresponding UAST interfaces: UImportStatement, UResolvable [UastImplementation] - val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 5 + val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 6 ---------------------- @@ -93,7 +102,7 @@ UAnnotated, UThisExpression, UInstanceExpression, ULabeled, UResolvable [UastImplementation] - class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 6 + class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 7 ---------------------------- @@ -103,10 +112,17 @@ UAnnotated, UThisExpression, UInstanceExpression, ULabeled, UResolvable [UastImplementation] - firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 7 + firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 8 --------------------- +src/test/pkg/UastImplementationDetectorTestInput.kt:93:Warning: +org.jetbrains.uast.kotlin.UnknownKotlinExpression is UAST +implementation. Consider using one of its corresponding UAST interfaces: +UExpression, UAnnotated, UUnknownExpression [UastImplementation] + + return if (this !is UnknownKotlinExpression) this else null // ERROR 9 + ----------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -134,7 +150,7 @@ import org.jetbrains.uast.kotlin.KotlinUImportStatement // ERROR 2 import org.jetbrains.uast.kotlin.KotlinUThisExpression // ERROR 3 import org.jetbrains.uast.kotlin.KotlinUastResolveProviderService -import org.jetbrains.uast.kotlin.UnknownKotlinExpression +import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 4 class UastImplementationDetectorTestInput { @@ -148,7 +164,7 @@ ) : this(listOf(uastNode, *moreUastNodes)) } - class MockSafetyDetector() : AbstractDetector(UClass::class) { + class MockSafetyDetector : AbstractDetector(UClass::class) { override fun createUastHandler(context: JavaContext): UElementHandler? { return object : UElementHandler() { override fun visitClass(node: UClass) { @@ -157,7 +173,7 @@ private fun checkFieldSafety(field: UField) { if (field.name.endsWith("delegate")) { - val delegateType = (field as? KotlinUField)?.type // ERROR 4 + val delegateType = (field as? KotlinUField)?.type // ERROR 5 assert (delegateType != null) } } @@ -169,13 +185,13 @@ override fun createUastHandler(context: JavaContext): UElementHandler? { return object : UElementHandler() { override fun visitImportStatement(node: UImportStatement) { - val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 5 + val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 6 } } } } - class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 6 + class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 7 override fun createUastHandler(context: JavaContext): UElementHandler? { return object : UElementHandler() { override fun visitElement(node: UElement) { @@ -188,7 +204,7 @@ var firstElement = expr return when { - firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 7 + firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 8 expr } firstElement is UThisExpression -> null @@ -197,7 +213,7 @@ } fun KtElement.getBindingContext(): BindingContext { - // OK to retrieve a service + // OK for now to retrieve a service. Won't be allowed after switching to K2 UAST val service = ServiceManager.getService(this.project, KotlinUastResolveProviderService::class.java) // OK 1 return service?.getBindingContext(this) ?: BindingContext.EMPTY @@ -205,8 +221,7 @@ internal val UElement.realUastParent: UElement? get() { - // OK for now? Introduce a common interface? - return if (this !is UnknownKotlinExpression) this else null // OK 2 + return if (this !is UnknownKotlinExpression) this else null // ERROR 9 } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/UniqueConstants.md.html b/docs/checks/UniqueConstants.md.html index 3be8c50b..3e0a54e4 100644 --- a/docs/checks/UniqueConstants.md.html +++ b/docs/checks/UniqueConstants.md.html @@ -65,8 +65,6 @@ @IntDef({FLAG1, FLAG2, FLAG1}) ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UniquePermission.md.html b/docs/checks/UniquePermission.md.html index 56d5b29c..c93208d0 100644 --- a/docs/checks/UniquePermission.md.html +++ b/docs/checks/UniquePermission.md.html @@ -50,8 +50,6 @@ <permission android:name="bar.permission.SEND_SMS" -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnknownId.md.html b/docs/checks/UnknownId.md.html index 7effdc16..22885a63 100644 --- a/docs/checks/UnknownId.md.html +++ b/docs/checks/UnknownId.md.html @@ -55,8 +55,6 @@ android:layout_alignRight="@+id/my_id3" --------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnknownIdInLayout.md.html b/docs/checks/UnknownIdInLayout.md.html index f8332892..eb85ca3a 100644 --- a/docs/checks/UnknownIdInLayout.md.html +++ b/docs/checks/UnknownIdInLayout.md.html @@ -48,8 +48,6 @@ android:layout_alignLeft="@+id/my_id2" -------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnknownNullness.md.html b/docs/checks/UnknownNullness.md.html index 459ab6d9..6eb611c1 100644 --- a/docs/checks/UnknownNullness.md.html +++ b/docs/checks/UnknownNullness.md.html @@ -116,8 +116,6 @@ public Float error8; ----- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnlocalizedSms.md.html b/docs/checks/UnlocalizedSms.md.html index d3b91d66..5f6ac8c2 100644 --- a/docs/checks/UnlocalizedSms.md.html +++ b/docs/checks/UnlocalizedSms.md.html @@ -44,8 +44,6 @@ sms.sendMultipartTextMessage("001234567890", null, null, null, null); -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnnecessaryComposedModifier.md.html b/docs/checks/UnnecessaryComposedModifier.md.html index 945f4c1a..05a0f1da 100644 --- a/docs/checks/UnnecessaryComposedModifier.md.html +++ b/docs/checks/UnnecessaryComposedModifier.md.html @@ -20,6 +20,13 @@ : androidx.compose.ui Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -69,8 +76,6 @@ fun Modifier.test4(): Modifier = composed({}, { this@test4}) -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -109,6 +114,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnprotectedSMSBroadcastReceiver.md.html b/docs/checks/UnprotectedSMSBroadcastReceiver.md.html index 0fd67907..64f2ffc7 100644 --- a/docs/checks/UnprotectedSMSBroadcastReceiver.md.html +++ b/docs/checks/UnprotectedSMSBroadcastReceiver.md.html @@ -22,6 +22,8 @@ : Manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/UnprotectedSMSBroadcastReceiver 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/UnsafeBroadcastReceiverDetector.java) Tests @@ -48,8 +50,6 @@ <receiver -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnrememberedAnimatable.md.html b/docs/checks/UnrememberedAnimatable.md.html index 8b31dd58..19333a83 100644 --- a/docs/checks/UnrememberedAnimatable.md.html +++ b/docs/checks/UnrememberedAnimatable.md.html @@ -20,6 +20,13 @@ : androidx.compose.animation.core Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -206,8 +213,6 @@ val animatable3 = Animatable(Color.Red) ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -306,6 +311,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-core:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-core) + +# libs.versions.toml +[versions] +animation-core = "1.5.0-beta02" +[libraries] +animation-core = { + module = "androidx.compose.animation:animation-core", + version.ref = "animation-core" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnrememberedGetBackStackEntry.md.html b/docs/checks/UnrememberedGetBackStackEntry.md.html index 430f37a7..f7f5ceb6 100644 --- a/docs/checks/UnrememberedGetBackStackEntry.md.html +++ b/docs/checks/UnrememberedGetBackStackEntry.md.html @@ -18,6 +18,13 @@ : Jetpack Navigation Compose Identifier : androidx.navigation.compose +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -104,8 +111,6 @@ val entry = navController.getBackStackEntry("test") ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -178,6 +183,36 @@ To report a problem with this extracted sample, contact Jetpack Navigation Compose. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-compose:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-compose) + +# libs.versions.toml +[versions] +navigation-compose = "2.7.0-beta01" +[libraries] +navigation-compose = { + module = "androidx.navigation:navigation-compose", + version.ref = "navigation-compose" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnrememberedMutableState.md.html b/docs/checks/UnrememberedMutableState.md.html index 5c4b95b8..e8dd0fa2 100644 --- a/docs/checks/UnrememberedMutableState.md.html +++ b/docs/checks/UnrememberedMutableState.md.html @@ -20,6 +20,13 @@ : androidx.compose.runtime Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -262,8 +269,6 @@ val derived = derivedStateOf { foo.value } -------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -351,6 +356,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: @@ -362,7 +397,7 @@ // Kotlin @Suppress("UnrememberedMutableState") fun method() { - derivedStateOf(...) + problematicStatement() } ``` @@ -372,7 +407,7 @@ // Java @SuppressWarnings("UnrememberedMutableState") void method() { - derivedStateOf(...); + problematicStatement(); } ``` diff --git a/docs/checks/UnsafeDynamicallyLoadedCode.md.html b/docs/checks/UnsafeDynamicallyLoadedCode.md.html index d8dda269..b127ba68 100644 --- a/docs/checks/UnsafeDynamicallyLoadedCode.md.html +++ b/docs/checks/UnsafeDynamicallyLoadedCode.md.html @@ -56,8 +56,6 @@ System.load("/data/data/test.pkg/files/libhello.so"); ---------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnsafeImplicitIntentLaunch.md.html b/docs/checks/UnsafeImplicitIntentLaunch.md.html new file mode 100644 index 00000000..f0f6c504 --- /dev/null +++ b/docs/checks/UnsafeImplicitIntentLaunch.md.html @@ -0,0 +1,160 @@ + +(#) Implicit intent matches an internal non-exported component + +!!! ERROR: Implicit intent matches an internal non-exported component + This is an error. + +Id +: `UnsafeImplicitIntentLaunch` +Summary +: Implicit intent matches an internal non-exported component +Severity +: Error +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/UnsafeImplicitIntentDetector.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/UnsafeImplicitIntentDetectorTest.kt) +Copyright Year +: 2022 + +This intent matches a non-exported component within the same app. In +many cases, the app developer could instead use an explicit Intent to +send messages to their internal components, ensuring that the messages +are safely delivered without exposure to malicious apps on the device. +Using such implicit intents will result in a crash in an upcoming +version of Android. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestActivity.java:10:Error: The intent action +some.fake.action.LAUNCH (used to start an activity) matches the intent +filter of a non-exported component test.pkg.TestActivity from a +manifest. If you are trying to invoke this specific component via the +action then you should make the intent explicit by calling +Intent.set{Component,Class,ClassName}. [UnsafeImplicitIntentLaunch] + + Intent intent = new Intent("some.fake.action.LAUNCH"); + ------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`src/test/pkg/TestActivity.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import android.content.Intent; +import android.app.Activity; + +public class TestActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + Intent intent = new Intent("some.fake.action.LAUNCH"); + startActivity(intent); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="test.pkg"> + <application> + <activity android:name=".TestActivity" android:exported="false"> + <intent-filter> + <action android:name="some.fake.action.LAUNCH" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/UnsafeImplicitIntentDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnsafeImplicitIntentLaunch") + fun method() { + registerReceiver(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnsafeImplicitIntentLaunch") + void method() { + registerReceiver(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnsafeImplicitIntentLaunch + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnsafeImplicitIntentLaunch" severity="ignore" /> + </lint> + ``` + 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 'UnsafeImplicitIntentLaunch' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnsafeImplicitIntentLaunch ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnsafeIntentLaunch.md.html b/docs/checks/UnsafeIntentLaunch.md.html new file mode 100644 index 00000000..6ed7bf98 --- /dev/null +++ b/docs/checks/UnsafeIntentLaunch.md.html @@ -0,0 +1,159 @@ + +(#) Launched Unsafe Intent + +!!! WARNING: Launched Unsafe Intent + This is a warning. + +Id +: `UnsafeIntentLaunch` +Summary +: Launched Unsafe Intent +Severity +: Warning +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest 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/UnsafeIntentLaunchDetector.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/UnsafeIntentLaunchDetectorTest.kt) +Copyright Year +: 2022 + +Intent that potentially could come from an untrusted source should not +be launched from an unprotected component without first being sanitized. +See this support FAQ for details: +https://support.google.com/faqs/answer/9267555 + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestActivity.java:10:Warning: This intent could be coming +from an untrusted source. It is later launched by an unprotected +component test.pkg.TestActivity. You could either make the component +test.pkg.TestActivity protected; or sanitize this intent using +androidx.core.content.IntentSanitizer. [UnsafeIntentLaunch] + + Intent intent = getIntent().getParcelableExtra(Intent.EXTRA_INTENT); + --------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/TestActivity.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import android.app.Activity; +import android.content.Intent; + +public class TestActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + Intent intent = getIntent().getParcelableExtra(Intent.EXTRA_INTENT); + startActivity(intent); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/UnsafeIntentLaunchDetectorTest.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, `UnsafeIntentLaunchDetector.testDocumentationExampleUnparceledIntentLaunchFromExportedComponents`. +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: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnsafeIntentLaunch") + fun method() { + getParcelableExtra(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnsafeIntentLaunch") + void method() { + getParcelableExtra(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnsafeIntentLaunch + problematicStatement() + ``` + +* Adding the suppression attribute `tools:ignore="UnsafeIntentLaunch"` + 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <activity tools:ignore="UnsafeIntentLaunch" .../> + ... + </manifest> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnsafeIntentLaunch" severity="ignore" /> + </lint> + ``` + 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 'UnsafeIntentLaunch' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnsafeIntentLaunch ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnsafeLifecycleWhenUsage.md.html b/docs/checks/UnsafeLifecycleWhenUsage.md.html index 3b17f011..50ae7751 100644 --- a/docs/checks/UnsafeLifecycleWhenUsage.md.html +++ b/docs/checks/UnsafeLifecycleWhenUsage.md.html @@ -20,12 +20,21 @@ : androidx.lifecycle Feedback : https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleWhenChecks.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/LifecycleWhenChecksTest.kt) Copyright Year : 2019 @@ -42,6 +51,36 @@ check the `Lifecycle.isAtLeast` before accessing the UI. See documentation of `Lifecycle.whenStateAtLeast` for more details. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-ktx) + +# libs.versions.toml +[versions] +lifecycle-runtime-ktx = "2.6.1" +[libraries] +lifecycle-runtime-ktx = { + module = "androidx.lifecycle:lifecycle-runtime-ktx", + version.ref = "lifecycle-runtime-ktx" +} +``` + +2.6.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnsafeOptInUsageError.md.html b/docs/checks/UnsafeOptInUsageError.md.html index 53ac0b31..7db9f117 100644 --- a/docs/checks/UnsafeOptInUsageError.md.html +++ b/docs/checks/UnsafeOptInUsageError.md.html @@ -20,6 +20,13 @@ : androidx.annotation.experimental Feedback : https://issuetracker.google.com/issues/new?component=459778 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) + Affects : Kotlin and Java files Editing @@ -55,6 +62,36 @@ ``` +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") + +// build.gradle +implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' + +// build.gradle.kts with version catalogs: +implementation(libs.annotation-experimental) + +# libs.versions.toml +[versions] +annotation-experimental = "1.4.0-dev01" +[libraries] +annotation-experimental = { + module = "androidx.annotation:annotation-experimental", + version.ref = "annotation-experimental" +} +``` + +1.4.0-dev01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnsafeOptInUsageWarning.md.html b/docs/checks/UnsafeOptInUsageWarning.md.html index d937a9fc..c81ef2bf 100644 --- a/docs/checks/UnsafeOptInUsageWarning.md.html +++ b/docs/checks/UnsafeOptInUsageWarning.md.html @@ -20,6 +20,13 @@ : androidx.annotation.experimental Feedback : https://issuetracker.google.com/issues/new?component=459778 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) + Affects : Kotlin and Java files Editing @@ -55,6 +62,36 @@ ``` +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") + +// build.gradle +implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' + +// build.gradle.kts with version catalogs: +implementation(libs.annotation-experimental) + +# libs.versions.toml +[versions] +annotation-experimental = "1.4.0-dev01" +[libraries] +annotation-experimental = { + module = "androidx.annotation:annotation-experimental", + version.ref = "annotation-experimental" +} +``` + +1.4.0-dev01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnsafeProtectedBroadcastReceiver.md.html b/docs/checks/UnsafeProtectedBroadcastReceiver.md.html index 4bfad874..0a1d1206 100644 --- a/docs/checks/UnsafeProtectedBroadcastReceiver.md.html +++ b/docs/checks/UnsafeProtectedBroadcastReceiver.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files and manifest files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/UnsafeProtectedBroadcastReceiver 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/UnsafeBroadcastReceiverDetector.java) Tests @@ -49,8 +51,6 @@ public void onReceive(Context context, Intent intent) { --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html index b70a9307..9b6b748d 100644 --- a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html +++ b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing @@ -34,6 +41,36 @@ The repeatOnLifecycle APIs should be used with the viewLifecycleOwner in Fragments as opposed to lifecycleOwner. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnspecifiedImmutableFlag.md.html b/docs/checks/UnspecifiedImmutableFlag.md.html index e3b8ba6c..f94151be 100644 --- a/docs/checks/UnspecifiedImmutableFlag.md.html +++ b/docs/checks/UnspecifiedImmutableFlag.md.html @@ -1,19 +1,21 @@ (#) Missing `PendingIntent` mutability flag -!!! WARNING: Missing `PendingIntent` mutability flag - This is a warning. +!!! ERROR: Missing `PendingIntent` mutability flag + This is an error, and is also enforced at build time when + supported by the build system. For Android this means it will + run during release builds. Id : `UnspecifiedImmutableFlag` Summary : Missing `PendingIntent` mutability flag Severity -: Warning +: Fatal Category : Security Platform -: Any +: Android Vendor : Android Open Source Project Feedback @@ -24,6 +26,8 @@ : This check runs on the fly in the IDE editor See : https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability +See +: https://goo.gle/UnspecifiedImmutableFlag 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/PendingIntentMutableFlagDetector.kt) Tests @@ -34,51 +38,13 @@ Apps targeting Android 12 and higher must specify either `FLAG_IMMUTABLE` or `FLAG_MUTABLE` when constructing a `PendingIntent`. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/PendingIntentTest.java:7:Warning: Missing PendingIntent -mutability flag [UnspecifiedImmutableFlag] - - PendingIntent.getActivity(null, 0, null, 0); - - - - -src/test/pkg/PendingIntentTest.java:8:Warning: Missing PendingIntent -mutability flag [UnspecifiedImmutableFlag] - - PendingIntent.getActivities(null, 0, null, 0); - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/test/pkg/PendingIntentTest.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package test.pkg; - -import android.app.PendingIntent; - -public class PendingIntentTest { - protected void test() { - PendingIntent.getActivity(null, 0, null, 0); - PendingIntent.getActivities(null, 0, null, 0); - } -} - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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/PendingIntentMutableFlagDetectorTest.kt) -for the unit tests for this check to see additional scenarios. +`FLAG_IMMUTABLE` is available since target SDK 23, and is almost always +the best choice. See +https://developer.android.com/guide/components/intents-filters#CreateImmutablePendingIntents + for a list of common exceptions to this rule. -The above example was automatically extracted from the first unit test -found for this lint check, `PendingIntentMutableFlagDetector.testNoFlag`. -To report a problem with this extracted sample, visit -https://issuetracker.google.com/issues/new?component=192708. +!!! Tip + This lint check has an associated quickfix available in the IDE. (##) Suppressing diff --git a/docs/checks/UnspecifiedRegisterReceiverFlag.md.html b/docs/checks/UnspecifiedRegisterReceiverFlag.md.html new file mode 100644 index 00000000..6205c2ff --- /dev/null +++ b/docs/checks/UnspecifiedRegisterReceiverFlag.md.html @@ -0,0 +1,155 @@ + +(#) Missing `registerReceiver()` exported flag + +!!! ERROR: Missing `registerReceiver()` exported flag + This is an error. + +Id +: `UnspecifiedRegisterReceiverFlag` +Summary +: Missing `registerReceiver()` exported flag +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/reference/androidx/core/content/ContextCompat#registerReceiver(android.content.Context,android.content.BroadcastReceiver,android.content.IntentFilter,int) +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/RegisterReceiverFlagDetector.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/RegisterReceiverFlagDetectorTest.kt) +Copyright Year +: 2022 + +In Android U, all receivers registering for non-system broadcasts are +required to include a flag indicating the receiver's exported state. +Apps registering for non-system broadcasts should use the +`ContextCompat#registerReceiver` APIs with flags set to either +`RECEIVER_EXPORTED` or `RECEIVER_NOT_EXPORTED`. + +If you are not expecting broadcasts from other apps on the device, +register your receiver with `RECEIVER_NOT_EXPORTED` to protect your +receiver on all platform releases. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestClass1.java:17:Warning: receiver is missing +RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED flag for unprotected +broadcasts registered for an IntentFilter that cannot be inspected by +lint [UnspecifiedRegisterReceiverFlag] + + mContext.registerReceiver(receiver, myIntentFilter); + --------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/TestClass1.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +public class TestClass1 { + private Context mContext; + IntentFilter myIntentFilter; + private TestClass1(Context context) { + mContext = context; + myIntentFilter = new IntentFilter(); + myIntentFilter.addAction(Intent.ACTION_BATTERY_LOW); + myIntentFilter.addAction(Intent.ACTION_BATTERY_OKAY); + } + public void testMethod(BroadcastReceiver receiver) { + mContext.registerReceiver(receiver, myIntentFilter); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/RegisterReceiverFlagDetectorTest.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, `RegisterReceiverFlagDetector.testIntentFilterIsFieldWithProtectedActions_nonPrivate`. +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: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnspecifiedRegisterReceiverFlag") + fun method() { + registerReceiver(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnspecifiedRegisterReceiverFlag") + void method() { + registerReceiver(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnspecifiedRegisterReceiverFlag + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnspecifiedRegisterReceiverFlag" severity="ignore" /> + </lint> + ``` + 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 'UnspecifiedRegisterReceiverFlag' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnspecifiedRegisterReceiverFlag ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnsupportedChromeOsCameraSystemFeature.md.html b/docs/checks/UnsupportedChromeOsCameraSystemFeature.md.html index 08264d3d..bbac476b 100644 --- a/docs/checks/UnsupportedChromeOsCameraSystemFeature.md.html +++ b/docs/checks/UnsupportedChromeOsCameraSystemFeature.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://developer.android.com/guide/topics/large-screens/large-screen-cookbook#chromebook_camera_support 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/ChromeOsSourceDetector.kt) Tests @@ -31,10 +33,10 @@ You should look for the `FEATURE_CAMERA_ANY` features to include all possible cameras that may be on the device. Looking for `FEATURE_CAMERA` -only looks for a rear facing camera, which certain tablets or Chrome OS -devices don't have, as well as newer device configurations and modes may -place the device in a state where the rear camera is not available. To -fix the issue, look for `FEATURE_CAMERA_ANY` instead. +only looks for a rear facing camera, which certain large screen devices +don't have, as well as newer device configurations and modes may place +the device in a state where the rear camera is not available. To fix the +issue, look for `FEATURE_CAMERA_ANY` instead. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -49,8 +51,6 @@ getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA); ------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnsupportedChromeOsHardware.md.html b/docs/checks/UnsupportedChromeOsHardware.md.html index f30434e4..fd20f665 100644 --- a/docs/checks/UnsupportedChromeOsHardware.md.html +++ b/docs/checks/UnsupportedChromeOsHardware.md.html @@ -33,11 +33,12 @@ Copyright Year : 2016 -The `` element should not require this unsupported Chrome -OS hardware feature. Any uses-feature not explicitly marked with +The `` element should not require this unsupported large +screen hardware feature. Any not explicitly marked with `required="false"` is necessary on the device to be installed on. Ensure -that any features that might prevent it from being installed on a Chrome -OS device are reviewed and marked as not required in the manifest. +that any features that might prevent it from being installed on a +ChromeOS, large screen, or foldable device are reviewed and marked as +not required in the manifest. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -52,8 +53,6 @@ android:name="android.hardware.touchscreen" android:required="true"/> ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnsupportedLayoutAttribute.md.html b/docs/checks/UnsupportedLayoutAttribute.md.html new file mode 100644 index 00000000..cfefda44 --- /dev/null +++ b/docs/checks/UnsupportedLayoutAttribute.md.html @@ -0,0 +1,149 @@ + +(#) Marks layout attributes which are not supported. + +!!! ERROR: Marks layout attributes which are not supported. + This is an error. + +Id +: `UnsupportedLayoutAttribute` +Summary +: Marks layout attributes which are not supported. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetectorTest.kt) + +Some layout attributes are not supported. Your app will still compile +but it makes no sense to have them around. This can happen when +refactoring a LinearLayout to a ScrollView. The orientation is no longer +needed and can be removed. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/activity_home.xml:3:Error: orientation is not allowed in +RelativeLayout [UnsupportedLayoutAttribute] + + android:orientation="vertical"/> + ------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/activity_home.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetectorTest.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, `UnsupportedLayoutAttributeDetector.orientationInRelativeLayout`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="UnsupportedLayoutAttribute"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnsupportedLayoutAttribute" severity="ignore" /> + </lint> + ``` + 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 'UnsupportedLayoutAttribute' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnsupportedLayoutAttribute ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnsupportedTvHardware.md.html b/docs/checks/UnsupportedTvHardware.md.html index 3e426a5e..0d59183b 100644 --- a/docs/checks/UnsupportedTvHardware.md.html +++ b/docs/checks/UnsupportedTvHardware.md.html @@ -50,8 +50,6 @@ android:name="android.hardware.touchscreen" android:required="true"/> ----------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Untranslatable.md.html b/docs/checks/Untranslatable.md.html index f0f9ea3f..e918cc8d 100644 --- a/docs/checks/Untranslatable.md.html +++ b/docs/checks/Untranslatable.md.html @@ -52,8 +52,6 @@ <string name="sample">Ignore Me</string> ------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnusedAttribute.md.html b/docs/checks/UnusedAttribute.md.html index 70910200..f7b6aaf9 100644 --- a/docs/checks/UnusedAttribute.md.html +++ b/docs/checks/UnusedAttribute.md.html @@ -58,8 +58,6 @@ android:theme="@android:style/Theme.Holo" /> ----------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/UnusedContentLambdaTargetStateParameter.md.html b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html new file mode 100644 index 00000000..c8d4ea3c --- /dev/null +++ b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html @@ -0,0 +1,269 @@ + +(#) AnimatedContent calls should use the provided `T` parameter in the content lambda + +!!! ERROR: AnimatedContent calls should use the provided `T` parameter in the content lambda + This is an error. + +Id +: `UnusedContentLambdaTargetStateParameter` +Summary +: AnimatedContent calls should use the provided `T` parameter in the content lambda +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-lint/src/main/java/androidx/compose/animation/lint/AnimatedContentDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-lint/src/test/java/androidx/compose/animation/lint/AnimatedContentDetectorTest.kt) +Copyright Year +: 2023 + +`content` lambda in AnimatedContent works as a lookup function that +returns the corresponding content based on the parameter (a state of +type `T`). It is important for this lambda to return content *specific* +to the input parameter, so that the different contents can be properly +animated. Not using the input parameter to the content lambda will +result in the same content for different input (i.e. target state) and +therefore an erroneous transition between the exact same content.` + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/test.kt:11:Error: Target state parameter it is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo) { if (foo) { /**/ } else { /**/ } } + ----------------------------------- + + +src/foo/test.kt:12:Error: Target state parameter it is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo, content = { if (foo) { /**/ } else { /**/ } }) + ----------------------------------- + + +src/foo/test.kt:13:Error: Target state parameter param is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo) { param -> if (foo) { /**/ } else { /**/ } } + ----- + + +src/foo/test.kt:14:Error: Target state parameter param is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo, content = { param -> if (foo) { /**/ } else { /**/ } }) + ----- + + +src/foo/test.kt:15:Error: Target state parameter _ is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo) { _ -> if (foo) { /**/ } else { /**/ } } + - + + +src/foo/test.kt:16:Error: Target state parameter _ is not used +[UnusedContentLambdaTargetStateParameter] + + AnimatedContent(foo, content = { _ -> if (foo) { /**/ } else { /**/ } }) + - + + +src/foo/test.kt:17:Error: Target state parameter it is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent { if (foo) { /**/ } else { /**/ } } + ----------------------------------- + + +src/foo/test.kt:18:Error: Target state parameter it is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent(content = { if (foo) { /**/ } else { /**/ } }) + ----------------------------------- + + +src/foo/test.kt:19:Error: Target state parameter param is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent { param -> if (foo) { /**/ } else { /**/ } } + ----- + + +src/foo/test.kt:20:Error: Target state parameter param is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent(content = { param -> if (foo) { /**/ } else { /**/ } }) + ----- + + +src/foo/test.kt:21:Error: Target state parameter _ is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent { _ -> if (foo) { /**/ } else { /**/ } } + - + + +src/foo/test.kt:22:Error: Target state parameter _ is not used +[UnusedContentLambdaTargetStateParameter] + + Transition(foo).AnimatedContent(content = { _ -> if (foo) { /**/ } else { /**/ } }) + - +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import androidx.compose.animation.* +import androidx.compose.runtime.* + +val foo = false + +@Composable +fun Test() { + AnimatedContent(foo) { if (foo) { /**/ } else { /**/ } } + AnimatedContent(foo, content = { if (foo) { /**/ } else { /**/ } }) + AnimatedContent(foo) { param -> if (foo) { /**/ } else { /**/ } } + AnimatedContent(foo, content = { param -> if (foo) { /**/ } else { /**/ } }) + AnimatedContent(foo) { _ -> if (foo) { /**/ } else { /**/ } } + AnimatedContent(foo, content = { _ -> if (foo) { /**/ } else { /**/ } }) + Transition(foo).AnimatedContent { if (foo) { /**/ } else { /**/ } } + Transition(foo).AnimatedContent(content = { if (foo) { /**/ } else { /**/ } }) + Transition(foo).AnimatedContent { param -> if (foo) { /**/ } else { /**/ } } + Transition(foo).AnimatedContent(content = { param -> if (foo) { /**/ } else { /**/ } }) + Transition(foo).AnimatedContent { _ -> if (foo) { /**/ } else { /**/ } } + Transition(foo).AnimatedContent(content = { _ -> if (foo) { /**/ } else { /**/ } }) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-lint/src/test/java/androidx/compose/animation/lint/AnimatedContentDetectorTest.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, `AnimatedContentDetector.unreferencedParameters`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation) + +# libs.versions.toml +[versions] +animation = "1.5.0-beta02" +[libraries] +animation = { + module = "androidx.compose.animation:animation", + version.ref = "animation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.animation:animation](androidx_compose_animation_animation.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnusedContentLambdaTargetStateParameter") + fun method() { + AnimatedContent(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnusedContentLambdaTargetStateParameter") + void method() { + AnimatedContent(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnusedContentLambdaTargetStateParameter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnusedContentLambdaTargetStateParameter" severity="ignore" /> + </lint> + ``` + 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 'UnusedContentLambdaTargetStateParameter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnusedContentLambdaTargetStateParameter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html index 50009355..930fcec6 100644 --- a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html +++ b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.animation Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -83,8 +90,6 @@ Crossfade(foo, content = { _ -> if (foo) { /**/ } else { /**/ } }) - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -118,6 +123,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation) + +# libs.versions.toml +[versions] +animation = "1.5.0-beta02" +[libraries] +animation = { + module = "androidx.compose.animation:animation", + version.ref = "animation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.animation:animation](androidx_compose_animation_animation.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedIds.md.html b/docs/checks/UnusedIds.md.html index 80e4d375..75cba949 100644 --- a/docs/checks/UnusedIds.md.html +++ b/docs/checks/UnusedIds.md.html @@ -66,8 +66,6 @@ android:id="@+id/button1" ------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html index b8a6bf29..7860b961 100644 --- a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.material3 Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.material3:material3](androidx_compose_material3_material3.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -80,8 +87,6 @@ Scaffold(Modifier, topBar = {}, bottomBar = {}) { innerPadding -> /**/ } ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -114,6 +119,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material3:material3:1.2.0-alpha02") + +// build.gradle +implementation 'androidx.compose.material3:material3:1.2.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.material3) + +# libs.versions.toml +[versions] +material3 = "1.2.0-alpha02" +[libraries] +material3 = { + module = "androidx.compose.material3:material3", + version.ref = "material3" +} +``` + +1.2.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.material3:material3](androidx_compose_material3_material3.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html index b8d51404..ae6028b3 100644 --- a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.material Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.material:material](androidx_compose_material_material.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -80,8 +87,6 @@ Scaffold(Modifier, topBar = {}, bottomBar = {}) { innerPadding -> /**/ } ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -114,6 +119,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material:material:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.material:material:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.material) + +# libs.versions.toml +[versions] +material = "1.5.0-beta02" +[libraries] +material = { + module = "androidx.compose.material:material", + version.ref = "material" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.material:material](androidx_compose_material_material.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedMergeAttributes.md.html b/docs/checks/UnusedMergeAttributes.md.html new file mode 100644 index 00000000..c5c56c87 --- /dev/null +++ b/docs/checks/UnusedMergeAttributes.md.html @@ -0,0 +1,158 @@ + +(#) Flags android and app attributes that are used on a attribute for custom Views. + +!!! WARNING: Flags android and app attributes that are used on a attribute for custom Views. + This is a warning. + +Id +: `UnusedMergeAttributes` +Summary +: Flags android and app attributes that are used on a attribute for custom Views. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetectorTest.kt) + +Adding android, app and other attributes to won't be used by the +system for custom views and hence can lead to errors. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/view_custom.xml:4:Warning: Attribute won't be used +[UnusedMergeAttributes] + + android:layout_marginTop="64dp" + ------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/view_custom.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<merge + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_marginTop="64dp" + tools:parentTag="LinearLayout" + /> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetectorTest.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, `UnusedMergeAttributesDetector.androidAttribute`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="UnusedMergeAttributes"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <merge xmlns:tools="http://schemas.android.com/tools" + tools:ignore="UnusedMergeAttributes" ...> + ... + </merge> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnusedMergeAttributes" severity="ignore" /> + </lint> + ``` + 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 'UnusedMergeAttributes' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnusedMergeAttributes ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnusedNamespace.md.html b/docs/checks/UnusedNamespace.md.html index e69c72d8..87d343fe 100644 --- a/docs/checks/UnusedNamespace.md.html +++ b/docs/checks/UnusedNamespace.md.html @@ -48,8 +48,6 @@ xmlns:unused2="http://schemas.android.com/apk/res/unused1" ---------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnusedQuantity.md.html b/docs/checks/UnusedQuantity.md.html index 3df70541..b286c964 100644 --- a/docs/checks/UnusedQuantity.md.html +++ b/docs/checks/UnusedQuantity.md.html @@ -61,8 +61,6 @@ <plurals name="title_day_dialog_content"> ^ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnusedResources.md.html b/docs/checks/UnusedResources.md.html index 0ecfa6b1..81840ebe 100644 --- a/docs/checks/UnusedResources.md.html +++ b/docs/checks/UnusedResources.md.html @@ -54,8 +54,6 @@ <string name="some_string">Some String</string> ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/UnusedTransitionTargetStateParameter.md.html b/docs/checks/UnusedTransitionTargetStateParameter.md.html index a263a2cd..f4b66334 100644 --- a/docs/checks/UnusedTransitionTargetStateParameter.md.html +++ b/docs/checks/UnusedTransitionTargetStateParameter.md.html @@ -20,6 +20,13 @@ : androidx.compose.animation.core Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -84,8 +91,6 @@ transition.animateFloat(targetValueByState = { _ -> if (foo) 1f else 0f }) - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -121,6 +126,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-core:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-core) + +# libs.versions.toml +[versions] +animation-core = "1.5.0-beta02" +[libraries] +animation-core = { + module = "androidx.compose.animation:animation-core", + version.ref = "animation-core" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedTranslation.md.html b/docs/checks/UnusedTranslation.md.html index f7ac0bde..254df499 100644 --- a/docs/checks/UnusedTranslation.md.html +++ b/docs/checks/UnusedTranslation.md.html @@ -50,8 +50,6 @@ <application android:localeConfig="@xml/locale_config"/> ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/UsableSpace.md.html b/docs/checks/UsableSpace.md.html index 4b0f6b79..cad9e86d 100644 --- a/docs/checks/UsableSpace.md.html +++ b/docs/checks/UsableSpace.md.html @@ -56,8 +56,6 @@ return file.usableSpace ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UseAlpha2.md.html b/docs/checks/UseAlpha2.md.html index d6233ce0..3e4b858f 100644 --- a/docs/checks/UseAlpha2.md.html +++ b/docs/checks/UseAlpha2.md.html @@ -42,16 +42,13 @@ 2-letter region codes when available; use NO instead of nor [UseAlpha2] 0 errors, 2 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/values-b+nor+NOR/strings.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources></resources> +<resources>null</resources> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/UseAndroidAlpha.md.html b/docs/checks/UseAndroidAlpha.md.html index 3d39d3af..f5926613 100644 --- a/docs/checks/UseAndroidAlpha.md.html +++ b/docs/checks/UseAndroidAlpha.md.html @@ -20,17 +20,59 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Resource files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/res/ColorStateListAlphaDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/res/ColorStateListAlphaDetectorTest.kt) Copyright Year : 2019 `ColorStateList` uses app:alpha without `android:alpha` +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseAppTint.md.html b/docs/checks/UseAppTint.md.html index bee3558d..33381987 100644 --- a/docs/checks/UseAppTint.md.html +++ b/docs/checks/UseAppTint.md.html @@ -20,17 +20,59 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Resource files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/res/ImageViewTintDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/res/ImageViewTintDetectorTest.kt) Copyright Year : 2020 `ImageView` or `ImageButton` uses `android:tint` instead of `app:tint` +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseCheckPermission.md.html b/docs/checks/UseCheckPermission.md.html index 062ad1ee..772cdc30 100644 --- a/docs/checks/UseCheckPermission.md.html +++ b/docs/checks/UseCheckPermission.md.html @@ -57,8 +57,6 @@ context.checkPermission(Manifest.permission.INTERNET, 1, 1); ----------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UseCompatLoadingForColorStateLists.md.html b/docs/checks/UseCompatLoadingForColorStateLists.md.html index 4fcc2acd..8f36d9fa 100644 --- a/docs/checks/UseCompatLoadingForColorStateLists.md.html +++ b/docs/checks/UseCompatLoadingForColorStateLists.md.html @@ -20,17 +20,56 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/res/ColorStateListLoadingDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/res/ColorStateListLoadingDetectorTest.kt) Copyright Year : 2020 Use Compat loading of color state lists. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseCompatLoadingForDrawables.md.html b/docs/checks/UseCompatLoadingForDrawables.md.html index ac1f12b5..1903b418 100644 --- a/docs/checks/UseCompatLoadingForDrawables.md.html +++ b/docs/checks/UseCompatLoadingForDrawables.md.html @@ -20,17 +20,56 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/res/DrawableLoadingDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/res/DrawableLoadingDetectorTest.kt) Copyright Year : 2020 Use Compat loading of drawables. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseCompatTextViewDrawableApis.md.html b/docs/checks/UseCompatTextViewDrawableApis.md.html index 9e80ff9c..75ebc490 100644 --- a/docs/checks/UseCompatTextViewDrawableApis.md.html +++ b/docs/checks/UseCompatTextViewDrawableApis.md.html @@ -20,17 +20,56 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/widget/TextViewCompoundDrawablesApiDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/widget/TextViewCompoundDrawablesApiDetectorTest.kt) Copyright Year : 2020 Use Compat loading of compound text view drawables. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseCompatTextViewDrawableXml.md.html b/docs/checks/UseCompatTextViewDrawableXml.md.html index 99f1e9e9..af34b36e 100644 --- a/docs/checks/UseCompatTextViewDrawableXml.md.html +++ b/docs/checks/UseCompatTextViewDrawableXml.md.html @@ -20,18 +20,60 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Resource files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/widget/TextViewCompoundDrawablesXmlDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/widget/TextViewCompoundDrawablesXmlDetectorTest.kt) Copyright Year : 2020 `TextView` uses `android:` compound drawable attributes instead of `app:` ones. +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseCompoundDrawables.md.html b/docs/checks/UseCompoundDrawables.md.html index 4319902a..9eebf558 100644 --- a/docs/checks/UseCompoundDrawables.md.html +++ b/docs/checks/UseCompoundDrawables.md.html @@ -51,8 +51,6 @@ <LinearLayout ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UseGetLayoutInflater.md.html b/docs/checks/UseGetLayoutInflater.md.html index 1f40490f..3227d0b8 100644 --- a/docs/checks/UseGetLayoutInflater.md.html +++ b/docs/checks/UseGetLayoutInflater.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing @@ -47,8 +54,6 @@ LayoutInflater li = LayoutInflater.from(requireContext()); ------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -87,6 +92,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=460964. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseOfBundledGooglePlayServices.md.html b/docs/checks/UseOfBundledGooglePlayServices.md.html index 050d4957..8a85305f 100644 --- a/docs/checks/UseOfBundledGooglePlayServices.md.html +++ b/docs/checks/UseOfBundledGooglePlayServices.md.html @@ -47,8 +47,6 @@ compile 'com.google.android.gms:play-services:8.5.6' -------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UseOfNonLambdaOffsetOverload.md.html b/docs/checks/UseOfNonLambdaOffsetOverload.md.html index 97c2098e..b8c1d245 100644 --- a/docs/checks/UseOfNonLambdaOffsetOverload.md.html +++ b/docs/checks/UseOfNonLambdaOffsetOverload.md.html @@ -20,6 +20,13 @@ : androidx.compose.foundation Feedback : https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) + Affects : Kotlin and Java files and test sources Editing @@ -35,6 +42,36 @@ to avoid unnecessary recompositions. `Modifier.offset{ }` is preferred in the cases where the arguments are backed by a `State`. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation) + +# libs.versions.toml +[versions] +foundation = "1.5.0-beta02" +[libraries] +foundation = { + module = "androidx.compose.foundation:foundation", + version.ref = "foundation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseRequireInsteadOfGet.md.html b/docs/checks/UseRequireInsteadOfGet.md.html index 838f179a..f23e2b35 100644 --- a/docs/checks/UseRequireInsteadOfGet.md.html +++ b/docs/checks/UseRequireInsteadOfGet.md.html @@ -20,6 +20,13 @@ : androidx.fragment Feedback : https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.fragment:fragment](androidx_fragment_fragment.md.html) + Affects : Kotlin and Java files Editing @@ -92,8 +99,6 @@ checkNotNull(fragment.getView()); -------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -156,6 +161,36 @@ To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=460964. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseRxSetProgress2.md.html b/docs/checks/UseRxSetProgress2.md.html index d97e49fd..45234c0d 100644 --- a/docs/checks/UseRxSetProgress2.md.html +++ b/docs/checks/UseRxSetProgress2.md.html @@ -22,6 +22,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -39,6 +46,36 @@ !!! Tip This lint check has an associated quickfix available in the IDE. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseSparseArrays.md.html b/docs/checks/UseSparseArrays.md.html index f2d5233e..fd2d91d3 100644 --- a/docs/checks/UseSparseArrays.md.html +++ b/docs/checks/UseSparseArrays.md.html @@ -59,8 +59,6 @@ new SparseArray<Boolean>(); // Use SparseBooleanArray instead -------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UseSupportActionBar.md.html b/docs/checks/UseSupportActionBar.md.html index 3d42b90d..9dcd71e7 100644 --- a/docs/checks/UseSupportActionBar.md.html +++ b/docs/checks/UseSupportActionBar.md.html @@ -20,17 +20,56 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/app/SetActionBarDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/app/SetActionBarDetectorTest.kt) Copyright Year : 2020 Use `AppCompatActivity.setSupportActionBar` +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseSwitchCompatOrMaterialCode.md.html b/docs/checks/UseSwitchCompatOrMaterialCode.md.html index 13235507..6e28f6d4 100644 --- a/docs/checks/UseSwitchCompatOrMaterialCode.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialCode.md.html @@ -20,18 +20,57 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Kotlin and Java files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/widget/SwitchUsageCodeDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/widget/SwitchUsageCodeDetectorTest.kt) Copyright Year : 2020 Use `SwitchCompat` from AppCompat or `SwitchMaterial` from Material library. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseSwitchCompatOrMaterialXml.md.html b/docs/checks/UseSwitchCompatOrMaterialXml.md.html index f5d96bb6..b7105be0 100644 --- a/docs/checks/UseSwitchCompatOrMaterialXml.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialXml.md.html @@ -20,18 +20,57 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Resource files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/widget/SwitchUsageXmlDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/widget/SwitchUsageXmlDetectorTest.kt) Copyright Year : 2020 Use `SwitchCompat` from AppCompat or `SwitchMaterial` from Material library. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseTomlInstead.md.html b/docs/checks/UseTomlInstead.md.html new file mode 100644 index 00000000..498a0bbd --- /dev/null +++ b/docs/checks/UseTomlInstead.md.html @@ -0,0 +1,112 @@ + +(#) Use TOML Version Catalog Instead + +!!! WARNING: Use TOML Version Catalog Instead + This is a warning. + +Id +: `UseTomlInstead` +Summary +: Use TOML Version Catalog Instead +Severity +: Warning +Category +: Productivity +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Gradle build files and TOML 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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +If your project is using a `libs.versions.toml` file, you should place +all Gradle dependencies in the TOML file. This lint check looks for +version declarations outside of the TOML file and suggests moving them +(and in the IDE, provides a quickfix to performing the operation +automatically). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:3:Warning: Use the existing version catalog reference +(libs.androidx.appCompat) instead [UseTomlInstead] + + implementation 'androidx.appcompat:appcompat:1.5.1' + ------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + implementation(libs.androidx.appCompat) // OK + implementation 'androidx.appcompat:appcompat:1.5.1' +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testSwitchToExistingTomlLibrary`. +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: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UseTomlInstead + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UseTomlInstead" severity="ignore" /> + </lint> + ``` + 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 'UseTomlInstead' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UseTomlInstead ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UseValueOf.md.html b/docs/checks/UseValueOf.md.html index 766027c4..1d766d5a 100644 --- a/docs/checks/UseValueOf.md.html +++ b/docs/checks/UseValueOf.md.html @@ -88,8 +88,6 @@ Double d1 = new Double(1.0); --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UselessLeaf.md.html b/docs/checks/UselessLeaf.md.html index bcc58271..f008c883 100644 --- a/docs/checks/UselessLeaf.md.html +++ b/docs/checks/UselessLeaf.md.html @@ -45,8 +45,6 @@ <FrameLayout ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UselessParent.md.html b/docs/checks/UselessParent.md.html index bdce7b55..1a41e74b 100644 --- a/docs/checks/UselessParent.md.html +++ b/docs/checks/UselessParent.md.html @@ -59,8 +59,6 @@ <LinearLayout ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UsesMinSdkAttributes.md.html b/docs/checks/UsesMinSdkAttributes.md.html index 5a1be490..5bc899d6 100644 --- a/docs/checks/UsesMinSdkAttributes.md.html +++ b/docs/checks/UsesMinSdkAttributes.md.html @@ -1,140 +1,8 @@ -(#) Minimum SDK and target SDK attributes not defined +(#) UsesMinSdkAttributes -!!! WARNING: Minimum SDK and target SDK attributes not defined - This is a warning. - -Id -: `UsesMinSdkAttributes` -Summary -: Minimum SDK and target SDK attributes not defined -Severity -: Warning -Category -: Correctness -Platform -: Android -Vendor -: Android Open Source Project -Feedback -: https://issuetracker.google.com/issues/new?component=192708 -Affects -: Manifest files -Editing -: This check runs on the fly in the IDE editor -See -: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html -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/ManifestDetector.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/ManifestDetectorTest.kt) -Copyright Year -: 2011 - -The manifest should contain a `` element which defines the -minimum API Level required for the application to run, as well as the -target version (the highest API level you have tested the version for). - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:Warning: Manifest should specify a minimum API level -with ; if it really supports all -versions of Android set it to 1 [UsesMinSdkAttributes] - -0 errors, 1 warnings - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`AndroidManifest.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="test.bytecode" - android:versionCode="1" - android:versionName="1.0" > - - <application - android:icon="@drawable/ic_launcher" - android:label="@string/app_name" > - <activity - android:name=".BytecodeTestsActivity" - android:label="@string/app_name" > - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> - -</manifest> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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/ManifestDetectorTest.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, `ManifestDetector.testMissingUsesSdk`. -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="UsesMinSdkAttributes"` 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"`. - - ```xml - <?xml version="1.0" encoding="UTF-8"?> - <manifest xmlns:tools="http://schemas.android.com/tools"> - ... - <application tools:ignore="UsesMinSdkAttributes" .../> - ... - </manifest> - ``` - -* 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 - <?xml version="1.0" encoding="UTF-8"?> - <lint> - <issue id="UsesMinSdkAttributes" severity="ignore" /> - </lint> - ``` - 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 'UsesMinSdkAttributes' - } - ``` - In Android projects this should be nested inside an `android { }` - block. - -* For manual invocations of `lint`, using the `--ignore` flag: - ``` - $ lint --ignore UsesMinSdkAttributes ...` - ``` - -* Last, but not least, using baselines, as discussed - [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). +The issue for this id has been deleted or marked obsolete and can now be +ignored. +(Additional metadata not available.) \ No newline at end of file diff --git a/docs/checks/UsingC2DM.md.html b/docs/checks/UsingC2DM.md.html index 9d1e1c07..870707d2 100644 --- a/docs/checks/UsingC2DM.md.html +++ b/docs/checks/UsingC2DM.md.html @@ -45,8 +45,6 @@ <receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"> --------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UsingHttp.md.html b/docs/checks/UsingHttp.md.html index a6dde470..eeeb184a 100644 --- a/docs/checks/UsingHttp.md.html +++ b/docs/checks/UsingHttp.md.html @@ -22,6 +22,8 @@ : Property files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/UsingHttp 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/PropertyFileDetector.kt) Tests @@ -48,8 +50,6 @@ distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip ---- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UsingOnClickInXml.md.html b/docs/checks/UsingOnClickInXml.md.html index d3f9d46f..2a2f02c1 100644 --- a/docs/checks/UsingOnClickInXml.md.html +++ b/docs/checks/UsingOnClickInXml.md.html @@ -20,18 +20,57 @@ : androidx.appcompat Feedback : https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) + Affects : Resource files Editing : This check runs on the fly in the IDE editor Implementation : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/view/OnClickXmlDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/appcompat/appcompat-lint/src/test/kotlin/androidx/appcompat/lint/view/OnClickXmlDetectorTest.kt) Copyright Year : 2020 Old versions of the platform do not properly support resolving `android:onClick` +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ValidActionsXml.md.html b/docs/checks/ValidActionsXml.md.html index 77a1d3c9..bd9c015d 100644 --- a/docs/checks/ValidActionsXml.md.html +++ b/docs/checks/ValidActionsXml.md.html @@ -49,8 +49,6 @@ <actions> ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ValidFragment.md.html b/docs/checks/ValidFragment.md.html index 1a47eceb..8cbd9f68 100644 --- a/docs/checks/ValidFragment.md.html +++ b/docs/checks/ValidFragment.md.html @@ -91,8 +91,6 @@ public Fragment5(int sample) { --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ValidRestrictions.md.html b/docs/checks/ValidRestrictions.md.html index 37d57217..f01318a2 100644 --- a/docs/checks/ValidRestrictions.md.html +++ b/docs/checks/ValidRestrictions.md.html @@ -44,8 +44,6 @@ <restriction /> --------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/VectorPath.md.html b/docs/checks/VectorPath.md.html index ff08cbde..5be613b9 100644 --- a/docs/checks/VectorPath.md.html +++ b/docs/checks/VectorPath.md.html @@ -54,8 +54,6 @@ android:pathData="M 37.8337860107,-40.3974914551 c 0,0 -35.8077850342,31.5523681641 -35.8077850342,31.5523681641 c 0,0 40.9884796143,40.9278411865 40.9884796143,40.9278411865 c 0,0 -2.61700439453,2.093… ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------… - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/VectorRaster.md.html b/docs/checks/VectorRaster.md.html index a10b4c5e..902bf36d 100644 --- a/docs/checks/VectorRaster.md.html +++ b/docs/checks/VectorRaster.md.html @@ -99,8 +99,6 @@ android:trimPathStart="0" /> --------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ViewBindingType.md.html b/docs/checks/ViewBindingType.md.html index 4b33cb6f..c1573e79 100644 --- a/docs/checks/ViewBindingType.md.html +++ b/docs/checks/ViewBindingType.md.html @@ -64,8 +64,6 @@ <EditText android:id="@+id/inconsistent" tools:viewBindingType="TextView" /> ---------------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/ViewConstructor.md.html b/docs/checks/ViewConstructor.md.html index 9eaf5cd2..f5c0ce24 100644 --- a/docs/checks/ViewConstructor.md.html +++ b/docs/checks/ViewConstructor.md.html @@ -50,8 +50,6 @@ public class CustomView1 extends View { ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/ViewHolder.md.html b/docs/checks/ViewHolder.md.html index 1bd70e42..ab2e18ac 100644 --- a/docs/checks/ViewHolder.md.html +++ b/docs/checks/ViewHolder.md.html @@ -47,8 +47,6 @@ convertView = mInflater.inflate(R.layout.your_layout, null); --------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/VisibleForTests.md.html b/docs/checks/VisibleForTests.md.html index c37223c5..9f3d0f27 100644 --- a/docs/checks/VisibleForTests.md.html +++ b/docs/checks/VisibleForTests.md.html @@ -46,8 +46,6 @@ ProductionCode().initialize() // Not allowed; this method is intended to be private ---------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/VulnerableCordovaVersion.md.html b/docs/checks/VulnerableCordovaVersion.md.html index cc11febe..2875f1fc 100644 --- a/docs/checks/VulnerableCordovaVersion.md.html +++ b/docs/checks/VulnerableCordovaVersion.md.html @@ -44,9 +44,6 @@ Cordova: 3.7.1 [VulnerableCordovaVersion] 0 errors, 1 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/Wakelock.md.html b/docs/checks/Wakelock.md.html index 23916d31..affa48d6 100644 --- a/docs/checks/Wakelock.md.html +++ b/docs/checks/Wakelock.md.html @@ -50,8 +50,6 @@ mWakeLock.acquire(); // Never released ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WakelockTimeout.md.html b/docs/checks/WakelockTimeout.md.html index ca73381b..41c1923a 100644 --- a/docs/checks/WakelockTimeout.md.html +++ b/docs/checks/WakelockTimeout.md.html @@ -50,8 +50,6 @@ wakeLock.acquire(); // ERROR ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WatchFaceEditor.md.html b/docs/checks/WatchFaceEditor.md.html index 1791720f..07505214 100644 --- a/docs/checks/WatchFaceEditor.md.html +++ b/docs/checks/WatchFaceEditor.md.html @@ -29,8 +29,8 @@ Copyright Year : 2021 -Watch face editor activities must be able to launch in the Wear OS app -activity task in order to work correctly. Thus only +Watch face editor activities must be able to launch in the Wear OS +companion app activity task in order to work correctly. Thus only `launchMode="standard"` is allowed. The watch face will not be shown on the watch if it does not satisfy this requirement. @@ -46,8 +46,6 @@ android:launchMode="singleTask"> ------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WatchFaceForAndroidX.md.html b/docs/checks/WatchFaceForAndroidX.md.html index fec4676e..a3105cf9 100644 --- a/docs/checks/WatchFaceForAndroidX.md.html +++ b/docs/checks/WatchFaceForAndroidX.md.html @@ -49,8 +49,6 @@ android:value="androidx.wear.watchface.editor.action.SOME_OTHER_EDITOR" ------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/WearBackNavigation.md.html b/docs/checks/WearBackNavigation.md.html new file mode 100644 index 00000000..10de2c0c --- /dev/null +++ b/docs/checks/WearBackNavigation.md.html @@ -0,0 +1,130 @@ + +(#) Wear: Disabling Back navigation + +!!! WARNING: Wear: Disabling Back navigation + This is a warning. + +Id +: `WearBackNavigation` +Summary +: Wear: Disabling Back navigation +Severity +: Warning +Category +: Usability +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Resource files +Editing +: This check can *not* run live in the IDE editor +See +: https://developer.android.com/training/wearables/views/exit#disabling-swipe-to-dismiss +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/WearBackNavigationDetector.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/WearBackNavigationDetectorTest.kt) +Copyright Year +: 2023 + +Disabling swipe-to-dismiss is generally not recommended for Wear +applications because the user expects to dismiss any screen with a +swipe. If your activity does not require swipe-to-dismiss to be +disabled, the recommendation is to remove the +`android:windowSwipeToDismiss` attribute from your theme declaration. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/values/styles.xml:10:Warning: Disabling swipe-to-dismiss is +generally not recommended for Wear applications [WearBackNavigation] + + <item name="android:windowSwipeToDismiss">false</item> + ------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`src/AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="test.pkg"> + <uses-sdk android:minSdkVersion="30" /> + <uses-feature android:name="android.hardware.type.watch" /> + <application + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name"> + <activity android:name=".MainActivity" + android:theme="@style/AppTheme" /> + </application> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`res/values/styles.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers + <resources> + + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> + <item name="colorPrimary">@color/colorPrimary</item> + <item name="colorAccent">@color/colorAccent</item> + <item name="android:windowSwipeToDismiss">true</item> + </style> + + <style name="SubTheme" parent="AppTheme"> + <item name="android:windowSwipeToDismiss">false</item> + </style> + +</resources> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WearBackNavigationDetectorTest.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 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WearBackNavigation" severity="ignore" /> + </lint> + ``` + 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 'WearBackNavigation' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WearBackNavigation ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WearPasswordInput.md.html b/docs/checks/WearPasswordInput.md.html new file mode 100644 index 00000000..246820d3 --- /dev/null +++ b/docs/checks/WearPasswordInput.md.html @@ -0,0 +1,153 @@ + +(#) Wear: Using password input + +!!! ERROR: Wear: Using password input + This is an error. + +Id +: `WearPasswordInput` +Summary +: Wear: Using password input +Severity +: Error +Category +: Usability +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and resource files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/training/wearables/apps/auth-wear#auth-methods +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/WearPasswordInputDetector.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/WearPasswordInputDetectorTest.kt) +Copyright Year +: 2023 + +Your app must not ask the user to input password directly on the Wear +device. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/main.xml:10:Error: Don't ask Wear OS users for a password +[WearPasswordInput] + + android:inputType="textPassword" + -------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`res/layout/main.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + <EditText + android:layout_width="match_parent" + android:layout_height="match_parent" + android:autofillHints="" + android:inputType="textPassword" + tools:ignore="LabelFor" /> +</LinearLayout> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.helloworld" + android:versionCode="1" + android:versionName="1.0"> + <uses-sdk android:minSdkVersion="30" /> + <uses-feature android:name="android.hardware.type.watch" /> + <application android:icon="@drawable/icon" android:label="@string/app_name" /> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WearPasswordInputDetectorTest.kt) +for the unit tests for this check to see additional scenarios. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WearPasswordInput"` + 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 suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WearPasswordInput") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WearPasswordInput") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WearPasswordInput + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WearPasswordInput" severity="ignore" /> + </lint> + ``` + 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 'WearPasswordInput' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WearPasswordInput ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WearStandaloneAppFlag.md.html b/docs/checks/WearStandaloneAppFlag.md.html index f7043f6b..da41385f 100644 --- a/docs/checks/WearStandaloneAppFlag.md.html +++ b/docs/checks/WearStandaloneAppFlag.md.html @@ -1,15 +1,15 @@ (#) Invalid or missing Wear standalone app flag -!!! WARNING: Invalid or missing Wear standalone app flag - This is a warning. +!!! ERROR: Invalid or missing Wear standalone app flag + This is an error. Id : `WearStandaloneAppFlag` Summary : Invalid or missing Wear standalone app flag Severity -: Warning +: Error Category : Correctness Platform @@ -47,14 +47,12 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:5:Warning: Missing element [WearStandaloneAppFlag] <application> ----------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WearableActionDuplicate.md.html b/docs/checks/WearableActionDuplicate.md.html index 3e7ab1c2..efd7fecd 100644 --- a/docs/checks/WearableActionDuplicate.md.html +++ b/docs/checks/WearableActionDuplicate.md.html @@ -47,8 +47,6 @@ <action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" /> --------------------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WearableBindListener.md.html b/docs/checks/WearableBindListener.md.html index 7f19371d..2ea7f780 100644 --- a/docs/checks/WearableBindListener.md.html +++ b/docs/checks/WearableBindListener.md.html @@ -50,8 +50,6 @@ <action android:name="com.google.android.gms.wearable.BIND_LISTENER" /> ------------------------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WearableConfigurationAction.md.html b/docs/checks/WearableConfigurationAction.md.html index 6eabf47a..39a10d65 100644 --- a/docs/checks/WearableConfigurationAction.md.html +++ b/docs/checks/WearableConfigurationAction.md.html @@ -47,8 +47,6 @@ <action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" /> --------------------------------------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here are the relevant source files: diff --git a/docs/checks/WebViewApiAvailability.md.html b/docs/checks/WebViewApiAvailability.md.html index e65cc2e4..c648a537 100644 --- a/docs/checks/WebViewApiAvailability.md.html +++ b/docs/checks/WebViewApiAvailability.md.html @@ -109,8 +109,6 @@ WebView.startSafeBrowsing(this, null); ------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WebViewClientOnReceivedSslError.md.html b/docs/checks/WebViewClientOnReceivedSslError.md.html index c68fae8b..2b0db6a7 100644 --- a/docs/checks/WebViewClientOnReceivedSslError.md.html +++ b/docs/checks/WebViewClientOnReceivedSslError.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/WebViewClientOnReceivedSslError 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/WebViewClientDetector.kt) Tests @@ -44,8 +46,6 @@ handler.proceed(); ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WebViewLayout.md.html b/docs/checks/WebViewLayout.md.html index 8c8a1853..c4274bc8 100644 --- a/docs/checks/WebViewLayout.md.html +++ b/docs/checks/WebViewLayout.md.html @@ -43,8 +43,6 @@ <WebView ------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WebpUnsupported.md.html b/docs/checks/WebpUnsupported.md.html index 2831b880..36d00557 100644 --- a/docs/checks/WebpUnsupported.md.html +++ b/docs/checks/WebpUnsupported.md.html @@ -44,9 +44,6 @@ 15); current minSdkVersion is 10 [WebpUnsupported] 4 errors, 0 warnings - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WeekBasedYear.md.html b/docs/checks/WeekBasedYear.md.html index 77aff4fe..e4082413 100644 --- a/docs/checks/WeekBasedYear.md.html +++ b/docs/checks/WeekBasedYear.md.html @@ -96,8 +96,6 @@ val s7 = DateTimeFormatter.ofPattern("""dd-YY-MM""") // ERROR -- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WifiManagerLeak.md.html b/docs/checks/WifiManagerLeak.md.html index 8d6e5163..605ea5f9 100644 --- a/docs/checks/WifiManagerLeak.md.html +++ b/docs/checks/WifiManagerLeak.md.html @@ -129,8 +129,6 @@ getContext().getSystemService(Context.WIFI_SERVICE); // ERROR: View context --------------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WifiManagerPotentialLeak.md.html b/docs/checks/WifiManagerPotentialLeak.md.html index bbdbe48f..a0ae7bc0 100644 --- a/docs/checks/WifiManagerPotentialLeak.md.html +++ b/docs/checks/WifiManagerPotentialLeak.md.html @@ -72,8 +72,6 @@ ctx.getSystemService(Context.WIFI_SERVICE); // UNKNOWN (though likely) ------------------------------------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WorkerHasAPublicModifier.md.html b/docs/checks/WorkerHasAPublicModifier.md.html index a8dfc045..7b3e66ef 100644 --- a/docs/checks/WorkerHasAPublicModifier.md.html +++ b/docs/checks/WorkerHasAPublicModifier.md.html @@ -22,6 +22,13 @@ : androidx.work Feedback : https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.work:work-runtime](androidx_work_work-runtime.md.html) + Affects : Kotlin and Java files Editing @@ -37,6 +44,36 @@ default WorkerFactory, the ListenableWorker sub-type needs to be public. +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/WorldReadableFiles.md.html b/docs/checks/WorldReadableFiles.md.html index 687065bd..b877403c 100644 --- a/docs/checks/WorldReadableFiles.md.html +++ b/docs/checks/WorldReadableFiles.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/WorldReadableFiles 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/SecurityDetector.java) Tests @@ -59,8 +61,6 @@ dir = getDir(mFile.getName(), MODE_WORLD_READABLE); ------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WorldWriteableFiles.md.html b/docs/checks/WorldWriteableFiles.md.html index 868a3b82..0f26bd97 100644 --- a/docs/checks/WorldWriteableFiles.md.html +++ b/docs/checks/WorldWriteableFiles.md.html @@ -22,6 +22,8 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor +See +: https://goo.gle/WorldWriteableFiles 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/SecurityDetector.java) Tests @@ -60,8 +62,6 @@ dir = getDir(mFile.getName(), MODE_WORLD_WRITEABLE); -------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongAnnotationOrder.md.html b/docs/checks/WrongAnnotationOrder.md.html new file mode 100644 index 00000000..37c3b1a3 --- /dev/null +++ b/docs/checks/WrongAnnotationOrder.md.html @@ -0,0 +1,172 @@ + +(#) Checks that Annotations comply with a certain order. + +!!! WARNING: Checks that Annotations comply with a certain order. + This is a warning. + +Id +: `WrongAnnotationOrder` +Summary +: Checks that Annotations comply with a certain order. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AnnotationOrderDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AnnotationOrderDetectorTest.kt) + +Annotations should always be applied with the same order to have +consistency across the code base. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyTest.java:5:Warning: Annotations are in wrong order. Should be +@Override @Test [WrongAnnotationOrder] + + @Test @Override int something; + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyTest.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +public class MyTest { + void something() { + @Test @Override int something; + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AnnotationOrderDetectorTest.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, `AnnotationOrderDetector.overrideComesFirstOnVariables`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WrongAnnotationOrder") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WrongAnnotationOrder") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WrongAnnotationOrder + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongAnnotationOrder" severity="ignore" /> + </lint> + ``` + 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 'WrongAnnotationOrder' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongAnnotationOrder ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongCall.md.html b/docs/checks/WrongCall.md.html index bf4fc07d..2af4779c 100644 --- a/docs/checks/WrongCall.md.html +++ b/docs/checks/WrongCall.md.html @@ -79,8 +79,6 @@ child.onDraw(canvas); // Not OK ------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongCase.md.html b/docs/checks/WrongCase.md.html index a1d824de..499b5001 100644 --- a/docs/checks/WrongCase.md.html +++ b/docs/checks/WrongCase.md.html @@ -71,8 +71,6 @@ <RequestFocus /> ------------ - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongConstant.md.html b/docs/checks/WrongConstant.md.html index 40e1ac4c..51da38e2 100644 --- a/docs/checks/WrongConstant.md.html +++ b/docs/checks/WrongConstant.md.html @@ -49,8 +49,6 @@ test(UNRELATED) // ERROR - not part of the @DetailsInfoTab list --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongConstraintLayoutUsage.md.html b/docs/checks/WrongConstraintLayoutUsage.md.html new file mode 100644 index 00000000..e8800447 --- /dev/null +++ b/docs/checks/WrongConstraintLayoutUsage.md.html @@ -0,0 +1,150 @@ + +(#) Marks a wrong usage of the Constraint Layout. + +!!! ERROR: Marks a wrong usage of the Constraint Layout. + This is an error. + +Id +: `WrongConstraintLayoutUsage` +Summary +: Marks a wrong usage of the Constraint Layout. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetectorTest.kt) + +Instead of using left & right constraints start & end should be used. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:6:Error: This attribute won't work with RTL. Please +use layout_constraintStart_toStartOf instead. +[WrongConstraintLayoutUsage] + + app:layout_constraintLeft_toLeftOf="parent"/> + ---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintLeft_toLeftOf="parent"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetectorTest.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, `WrongConstraintLayoutUsageDetector.constraintLeftToLeftOf`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="WrongConstraintLayoutUsage"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongConstraintLayoutUsage" severity="ignore" /> + </lint> + ``` + 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 'WrongConstraintLayoutUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongConstraintLayoutUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongDrawableName.md.html b/docs/checks/WrongDrawableName.md.html new file mode 100644 index 00000000..6fa18ef2 --- /dev/null +++ b/docs/checks/WrongDrawableName.md.html @@ -0,0 +1,145 @@ + +(#) Drawable names should be prefixed accordingly. + +!!! WARNING: Drawable names should be prefixed accordingly. + This is a warning. + +Id +: `WrongDrawableName` +Summary +: Drawable names should be prefixed accordingly. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongDrawableNameDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongDrawableNameDetectorTest.kt) + +The drawable file name should be prefixed with one of the following: +animated_selector, animated_vector_, background_, ic_, img_, +notification_icon_, ripple_, selector_, shape_, vector_. This will +improve consistency in your code base as well as enforce a certain +structure. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/drawable/random.xml:Warning: Drawable does not start with one of the +following prefixes: animated_selector, animated_vector_, background_, +ic_, img_, notification_icon_, ripple_, selector_, shape_, vector_ +[WrongDrawableName] + +0 errors, 1 warnings +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/drawable/random.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<merge/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongDrawableNameDetectorTest.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, `WrongDrawableNameDetector.randomDrawableFile`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WrongDrawableName"` + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongDrawableName" severity="ignore" /> + </lint> + ``` + 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 'WrongDrawableName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongDrawableName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongFolder.md.html b/docs/checks/WrongFolder.md.html index fcfffb27..c10a7b66 100644 --- a/docs/checks/WrongFolder.md.html +++ b/docs/checks/WrongFolder.md.html @@ -46,8 +46,6 @@ <resources> --------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongGlobalIconColor.md.html b/docs/checks/WrongGlobalIconColor.md.html new file mode 100644 index 00000000..6af7803e --- /dev/null +++ b/docs/checks/WrongGlobalIconColor.md.html @@ -0,0 +1,155 @@ + +(#) Each icon should have the same global color defined. + +!!! WARNING: Each icon should have the same global color defined. + This is a warning. + +Id +: `WrongGlobalIconColor` +Summary +: Each icon should have the same global color defined. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetectorTest.kt) + +In order to reuse icons, it's best if all icons share the same color and +can be used at every position in the app. On the target side, tinting +can be applied. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/drawable/ic_drawable.xml:7:Warning: Should use global tint color +[WrongGlobalIconColor] + + android:fillColor="#FF0000" + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/drawable/ic_drawable.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="24dp" + android:viewportHeight="24" + android:viewportWidth="24" + android:width="24dp"> + <path + android:fillColor="#FF0000" + android:fillType="evenOdd" + android:pathData="M18.364,5.636C18.7545,6.0266 18.7545,6.6597 18.364,7.0503L13.4135,11.9993L18.364,16.9497C18.7545,17.3403 18.7545,17.9734 18.364,18.364C17.9734,18.7545 17.3403,18.7545 16.9497,18.364L11.9993,13.4135L7.0503,18.364C6.6597,18.7545 6.0266,18.7545 5.636,18.364C5.2455,17.9734 5.2455,17.3403 5.636,16.9497L10.5858,11.9986L5.636,7.0503C5.2455,6.6597 5.2455,6.0266 5.636,5.636C6.0266,5.2455 6.6597,5.2455 7.0503,5.636L12,10.5844L16.9497,5.636C17.3403,5.2455 17.9734,5.2455 18.364,5.636Z" /> +</vector> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetectorTest.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, `WrongGlobalIconColorDetector.flagsIcDrawable`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="WrongGlobalIconColor"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongGlobalIconColor" severity="ignore" /> + </lint> + ``` + 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 'WrongGlobalIconColor' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongGlobalIconColor ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongLayoutName.md.html b/docs/checks/WrongLayoutName.md.html new file mode 100644 index 00000000..1ddd6f0e --- /dev/null +++ b/docs/checks/WrongLayoutName.md.html @@ -0,0 +1,143 @@ + +(#) Layout names should be prefixed accordingly. + +!!! WARNING: Layout names should be prefixed accordingly. + This is a warning. + +Id +: `WrongLayoutName` +Summary +: Layout names should be prefixed accordingly. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongLayoutNameDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongLayoutNameDetectorTest.kt) + +The layout file name should be prefixed with one of the following: +activity_, view_, fragment_, dialog_, bottom_sheet_, adapter_item_, +divider_, space_, popup_window_. This will improve consistency in your +code base as well as enforce a certain structure. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/random.xml:Warning: Layout does not start with one of the +following prefixes: activity_, view_, fragment_, dialog_, bottom_sheet_, +adapter_item_, divider_, space_, popup_window_ [WrongLayoutName] + +0 errors, 1 warnings +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/random.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<merge/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongLayoutNameDetectorTest.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, `WrongLayoutNameDetector.randomLayoutFile`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WrongLayoutName"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongLayoutName" severity="ignore" /> + </lint> + ``` + 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 'WrongLayoutName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongLayoutName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongManifestParent.md.html b/docs/checks/WrongManifestParent.md.html index ed680511..1ead6941 100644 --- a/docs/checks/WrongManifestParent.md.html +++ b/docs/checks/WrongManifestParent.md.html @@ -132,8 +132,6 @@ <activity android:name=".HelloWorld" -------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongMenuIdFormat.md.html b/docs/checks/WrongMenuIdFormat.md.html new file mode 100644 index 00000000..22664cdf --- /dev/null +++ b/docs/checks/WrongMenuIdFormat.md.html @@ -0,0 +1,146 @@ + +(#) Flag menu ids that are not in lowerCamelCase Format. + +!!! WARNING: Flag menu ids that are not in lowerCamelCase Format. + This is a warning. + +Id +: `WrongMenuIdFormat` +Summary +: Flag menu ids that are not in lowerCamelCase Format. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetectorTest.kt) + +Menu ids should be in lowerCamelCase format. This has the benefit of +saving an unnecessary underscore and also just looks nicer. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/menu/ids.xml:2:Warning: Id is not in lowerCamelCaseFormat +[WrongMenuIdFormat] + + <item android:id="@+id/CamelCase"/> + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/menu/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:id="@+id/CamelCase"/> +</menu> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetectorTest.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, `WrongMenuIdFormatDetector.idCamelCase`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WrongMenuIdFormat"` + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongMenuIdFormat" severity="ignore" /> + </lint> + ``` + 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 'WrongMenuIdFormat' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongMenuIdFormat ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongRegion.md.html b/docs/checks/WrongRegion.md.html index e3964c0c..22a9f074 100644 --- a/docs/checks/WrongRegion.md.html +++ b/docs/checks/WrongRegion.md.html @@ -56,16 +56,13 @@ combination nb (Norwegian Bokmål) with SE (Sweden): language nb is usually paired with: NO (Norway), SJ (Svalbard & Jan Mayen) [WrongRegion] - - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `res/values-nb-rSE/strings.xml`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources></resources> +<resources>null</resources> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/WrongRequiresOptIn.md.html b/docs/checks/WrongRequiresOptIn.md.html new file mode 100644 index 00000000..35475a06 --- /dev/null +++ b/docs/checks/WrongRequiresOptIn.md.html @@ -0,0 +1,142 @@ + +(#) Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn + +!!! ERROR: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn + This is an error. + +Id +: `WrongRequiresOptIn` +Summary +: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Identifier +: androidx.annotation.experimental +Feedback +: https://issuetracker.google.com/issues/new?component=459778 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/annotation/annotation-experimental-lint/src/main/java/androidx/annotation/experimental/lint/AnnotationRetentionDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/annotation/annotation-experimental-lint/src/test/kotlin/androidx/annotation/experimental/lint/AnnotationRetentionDetectorTest.kt) +Copyright Year +: 2021 + +Experimental features defined in Kotlin source code must be annotated +with the Kotlin +`@RequiresOptIn` annotation. Using `androidx.annotation.RequiresOptIn` +will prevent the +Kotlin compiler from enforcing its opt-in policies. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") + +// build.gradle +implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' + +// build.gradle.kts with version catalogs: +implementation(libs.annotation-experimental) + +# libs.versions.toml +[versions] +annotation-experimental = "1.4.0-dev01" +[libraries] +annotation-experimental = { + module = "androidx.annotation:annotation-experimental", + version.ref = "annotation-experimental" +} +``` + +1.4.0-dev01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WrongRequiresOptIn") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WrongRequiresOptIn") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WrongRequiresOptIn + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongRequiresOptIn" severity="ignore" /> + </lint> + ``` + 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 'WrongRequiresOptIn' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongRequiresOptIn ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongResourceImportAlias.md.html b/docs/checks/WrongResourceImportAlias.md.html new file mode 100644 index 00000000..90dfd3f2 --- /dev/null +++ b/docs/checks/WrongResourceImportAlias.md.html @@ -0,0 +1,198 @@ + +(#) Wrong import alias for this R class. + +!!! ERROR: Wrong import alias for this R class. + This is an error. + +Id +: `WrongResourceImportAlias` +Summary +: Wrong import alias for this R class. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/resources/WrongResourceImportAliasDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/WrongResourceImportAliasDetectorTest.kt) +Copyright Year +: 2022 + +R class import aliases should be consistent across the codebase. For +example: +import slack.l10n.R as L10nR +import slack.uikit.R as UiKitR. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Options + +You can configure this lint checks using the following options: + +(###) import-aliases + +A comma-separated list of package name and their import aliases.. +This property should define a comma-separated list of package name and their import aliases in the format: packageName as importAlias + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="WrongResourceImportAlias"> + <option name="import-aliases" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/slack/pkg/subpackage/MyClass.kt:3:Error: Use L10nR as an import +alias here [WrongResourceImportAlias] + +import slack.l10n.R as L10R +--------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/slack/pkg/subpackage/MyClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package slack.pkg.subpackage + +import slack.l10n.R as L10R + +class MyClass +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/resources/WrongResourceImportAliasDetectorTest.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, `WrongResourceImportAliasDetector.test failure no references`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WrongResourceImportAlias") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WrongResourceImportAlias") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WrongResourceImportAlias + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongResourceImportAlias" severity="ignore" /> + </lint> + ``` + 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 'WrongResourceImportAlias' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongResourceImportAlias ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongTestMethodName.md.html b/docs/checks/WrongTestMethodName.md.html new file mode 100644 index 00000000..a90c036e --- /dev/null +++ b/docs/checks/WrongTestMethodName.md.html @@ -0,0 +1,172 @@ + +(#) Flags test methods that start with test. + +!!! WARNING: Flags test methods that start with test. + This is a warning. + +Id +: `WrongTestMethodName` +Summary +: Flags test methods that start with test. +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetectorTest.kt) + +The @Test annotation already states that this is a test hence the test +prefix is not necessary. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyTest.java:6:Warning: Test method starts with test +[WrongTestMethodName] + + @Test public void testSomething() { } + ------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyTest.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package foo; + +import org.junit.Test; + +public class MyTest { + @Test public void testSomething() { } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetectorTest.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, `WrongTestMethodNameDetector.methodStartingWithTestAndJUnitTestAnnotation`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WrongTestMethodName") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WrongTestMethodName") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WrongTestMethodName + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongTestMethodName" severity="ignore" /> + </lint> + ``` + 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 'WrongTestMethodName' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongTestMethodName ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongThread.md.html b/docs/checks/WrongThread.md.html index 6ff4517f..12e34911 100644 --- a/docs/checks/WrongThread.md.html +++ b/docs/checks/WrongThread.md.html @@ -60,8 +60,6 @@ publishProgress(); // ERROR ----------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongThreadInterprocedural.md.html b/docs/checks/WrongThreadInterprocedural.md.html index 78c7f5ea..e538d8d3 100644 --- a/docs/checks/WrongThreadInterprocedural.md.html +++ b/docs/checks/WrongThreadInterprocedural.md.html @@ -37,6 +37,164 @@ in the program. Tracks the flow of instantiated types and lambda expressions to increase accuracy across method boundaries. +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/Runnable.java:14:Error: Interprocedural thread annotation +violation (UiThread to WorkerThread): +Test#uiThreadStatic -> Test#unannotatedStatic -> Test#workerThreadStatic +[WrongThreadInterprocedural] + + @UiThread static void uiThreadStatic() { unannotatedStatic(); } + ------------------- + + +src/test/pkg/Runnable.java:18:Error: Interprocedural thread annotation +violation (UiThread to WorkerThread): +Test#uiThread -> Test#unannotated -> Test#workerThread +[WrongThreadInterprocedural] + + @UiThread void uiThread() { unannotated(); } + ------------- + + +src/test/pkg/Runnable.java:25:Error: Interprocedural thread annotation +violation (WorkerThread to UiThread): +Test#callRunIt -> Test#runIt -> Test#callRunIt#lambda -> Test#runUi +[WrongThreadInterprocedural] + + runIt(() -> runUi()); + -------------------- + + +src/test/pkg/Runnable.java:39:Error: Interprocedural thread annotation +violation (UiThread to WorkerThread): +A#run -> Test#b [WrongThreadInterprocedural] + + public void run(Runnable r) { r.run(); } + ----- + + +src/test/pkg/Runnable.java:44:Error: Interprocedural thread annotation +violation (WorkerThread to UiThread): +B#run -> Test#a [WrongThreadInterprocedural] + + public void run(Runnable r) { r.run(); } + ----- + + +src/test/pkg/Runnable.java:71:Error: Interprocedural thread annotation +violation (UiThread to WorkerThread): +Test#callInvokeLater#lambda -> Test#c [WrongThreadInterprocedural] + + invokeLater(() -> c()); + --- + + +src/test/pkg/Runnable.java:76:Error: Interprocedural thread annotation +violation (WorkerThread to UiThread): +Test#callInvokeInBackground#lambda -> Test#d +[WrongThreadInterprocedural] + + invokeInBackground(() -> d()); + --- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/Runnable.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import androidx.annotation.UiThread; +import androidx.annotation.WorkerThread; + +@SuppressWarnings({"UnnecessaryInterfaceModifier", "ClassNameDiffersFromFileName"}) +@FunctionalInterface +public interface Runnable { + public abstract void run(); +} + +@SuppressWarnings({"Convert2MethodRef", "MethodMayBeStatic", "override", "ClassNameDiffersFromFileName", "InnerClassMayBeStatic"}) +class Test { + @UiThread static void uiThreadStatic() { unannotatedStatic(); } + static void unannotatedStatic() { workerThreadStatic(); } + @WorkerThread static void workerThreadStatic() {} + + @UiThread void uiThread() { unannotated(); } + void unannotated() { workerThread(); } + @WorkerThread void workerThread() {} + + @UiThread void runUi() {} + void runIt(Runnable r) { r.run(); } + @WorkerThread void callRunIt() { + runIt(() -> runUi()); + } + + public static void main(String[] args) { + Test instance = new Test(); + instance.uiThread(); + } + + interface It { + void run(Runnable r); + } + + class A implements It { + @UiThread + public void run(Runnable r) { r.run(); } + } + + class B implements It { + @WorkerThread + public void run(Runnable r) { r.run(); } + } + + @UiThread + void a() {} + + @WorkerThread + void b() {} + + void runWithIt(It it, Runnable r) { it.run(r); } + + void f() { + runWithIt(new A(), this::b); + runWithIt(new B(), this::a); + } + + public static void invokeLater(@UiThread Runnable runnable) { /* place on queue to invoke on UiThread */ } + + public static void invokeInBackground(@WorkerThread Runnable runnable) { /* place on queue to invoke on background thread */ } + + @WorkerThread + void c() {} + + @UiThread + void d() {} + + void callInvokeLater() { + invokeLater(() -> c()); + invokeLater(() -> d()); // Ok. + } + + void callInvokeInBackground() { + invokeInBackground(() -> d()); + invokeInBackground(() -> c()); // Ok. + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WrongThreadInterproceduralDetectorTest.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, `WrongThreadInterproceduralDetector.testThreadingFromJava`. +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: diff --git a/docs/checks/WrongViewCast.md.html b/docs/checks/WrongViewCast.md.html index 2a7976aa..4711324b 100644 --- a/docs/checks/WrongViewCast.md.html +++ b/docs/checks/WrongViewCast.md.html @@ -45,8 +45,6 @@ ToggleButton toggleButton = (ToggleButton) findViewById(R.id.button); ---------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/WrongViewIdFormat.md.html b/docs/checks/WrongViewIdFormat.md.html new file mode 100644 index 00000000..2b79e7ea --- /dev/null +++ b/docs/checks/WrongViewIdFormat.md.html @@ -0,0 +1,145 @@ + +(#) Flag view ids that are not in lowerCamelCase Format. + +!!! WARNING: Flag view ids that are not in lowerCamelCase Format. + This is a warning. + +Id +: `WrongViewIdFormat` +Summary +: Flag view ids that are not in lowerCamelCase Format. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetectorTest.kt) + +View ids should be in lowerCamelCase format. This has the benefit of +saving an unnecessary underscore and also just looks nicer. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/ids.xml:2:Warning: Id is not in lowerCamelCaseFormat +[WrongViewIdFormat] + + android:id="@+id/CamelCase"/> + -------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/ids.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/CamelCase"/> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetectorTest.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, `WrongViewIdFormatDetector.idCamelCase`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WrongViewIdFormat"` + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongViewIdFormat" severity="ignore" /> + </lint> + ``` + 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 'WrongViewIdFormat' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongViewIdFormat ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/XmlEscapeNeeded.md.html b/docs/checks/XmlEscapeNeeded.md.html index 3b0afbfb..3323b591 100644 --- a/docs/checks/XmlEscapeNeeded.md.html +++ b/docs/checks/XmlEscapeNeeded.md.html @@ -51,8 +51,6 @@ android:text="@{calc.a < calc.b ? calc.textA : calc.textB}"/> ---------------------------------------------- - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/XmlSpacing.md.html b/docs/checks/XmlSpacing.md.html new file mode 100644 index 00000000..1ac0ccdf --- /dev/null +++ b/docs/checks/XmlSpacing.md.html @@ -0,0 +1,174 @@ + +(#) XML files should not contain any new lines. + +!!! WARNING: XML files should not contain any new lines. + This is a warning. + +Id +: `XmlSpacing` +Summary +: XML files should not contain any new lines. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) + +Affects +: Resource files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/XmlSpacingDetector.kt) +Tests +: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/XmlSpacingDetectorTest.kt) + +Having newlines in xml files just adds noise and should be avoided. The +only exception is the new lint at the end of the file. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +res/layout/activity_home.xml:1:Warning: Unnecessary new line at line 1 +[XmlSpacing] + + +^ + + +res/layout/activity_home.xml:3:Warning: Unnecessary new line at line 3 +[XmlSpacing] + + +^ + + +res/layout/activity_home.xml:7:Warning: Unnecessary new line at line 7 +[XmlSpacing] + + +^ + + +res/layout/activity_home.xml:9:Warning: Unnecessary new line at line 9 +[XmlSpacing] + + +^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`res/layout/activity_home.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers + +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> + + <TextView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" + + /> + +</LinearLayout> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/XmlSpacingDetectorTest.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, `XmlSpacingDetector.layoutXmlFileWithNewLines`. +To report a problem with this extracted sample, visit +https://github.com/vanniktech/lint-rules/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="XmlSpacing"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="XmlSpacing" severity="ignore" /> + </lint> + ``` + 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 'XmlSpacing' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore XmlSpacing ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/alphabetical.md.html b/docs/checks/alphabetical.md.html deleted file mode 100644 index e3342ffb..00000000 --- a/docs/checks/alphabetical.md.html +++ /dev/null @@ -1,473 +0,0 @@ - -(#) Lint Issue Index - -Order: Alphabetical | [By category](index.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) - - - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) - - [AllCaps: Combining textAllCaps and markup](AllCaps.md.html) - - [AllowAllHostnameVerifier: Insecure `HostnameVerifier`](AllowAllHostnameVerifier.md.html) - - [AllowBackup: AllowBackup/FullBackupContent Problems](AllowBackup.md.html) - - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) - - [AndroidGradlePluginVersion: Obsolete Android Gradle Plugin Version](AndroidGradlePluginVersion.md.html) - - [AnimatorKeep: Missing @Keep for Animated Properties](AnimatorKeep.md.html) - - [AnnotateVersionCheck: Annotate SDK_INT checks](AnnotateVersionCheck.md.html) - - [AnnotationProcessorOnCompilePath: Annotation Processor on Compile Classpath](AnnotationProcessorOnCompilePath.md.html) - - [AppCompatCustomView: Appcompat Custom Widgets](AppCompatCustomView.md.html) - - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) - - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) - - [AuthLeak: Code might contain an auth leak](AuthLeak.md.html) - - [Autofill: Use Autofill](Autofill.md.html) - - [BackButton: Back button](BackButton.md.html) - - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) - - [BadHostnameVerifier: Insecure HostnameVerifier](BadHostnameVerifier.md.html) - - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - - [BatteryLife: Battery Life Issues](BatteryLife.md.html) - - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) - - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - - [ButtonOrder: Button order](ButtonOrder.md.html) - - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) - - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) - - [CheckResult: Ignoring results](CheckResult.md.html) - - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) - - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - - [CommitPrefEdits: Missing `commit()` on `SharedPreference` editor](CommitPrefEdits.md.html) - - [CommitTransaction: Missing `commit()` calls](CommitTransaction.md.html) - - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - - [ConstantLocale: Constant Locale](ConstantLocale.md.html) - - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) - - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) - - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) - - [CustomX509TrustManager: Implements custom TLS trust manager](CustomX509TrustManager.md.html) - - [CutPasteId: Likely cut & paste mistakes](CutPasteId.md.html) - - [DalvikOverride: Method considered overridden by Dalvik](DalvikOverride.md.html) - - [DataBindingWithoutKapt: Data Binding without Annotation Processing](DataBindingWithoutKapt.md.html) - - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) - - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) - - [Deprecated: Using deprecated resources](Deprecated.md.html) - - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) - - [DevModeObsolete: Dev Mode Obsolete](DevModeObsolete.md.html) - - [DeviceAdmin: Malformed Device Admin](DeviceAdmin.md.html) - - [DialogFragmentCallbacksDetector: Use onCancel() and onDismiss() instead of calling setOnCancelListener() and setOnDismissListener() from onCreateDialog()](DialogFragmentCallbacksDetector.md.html) - - [DiffUtilEquals: Suspicious DiffUtil Equality](DiffUtilEquals.md.html) - - [DisableBaselineAlignment: Missing `baselineAligned` attribute](DisableBaselineAlignment.md.html) - - [DiscouragedPrivateApi: Using Discouraged Private API](DiscouragedPrivateApi.md.html) - - [DrawAllocation: Memory allocations within drawing code](DrawAllocation.md.html) - - [DuplicateActivity: Activity registered more than once](DuplicateActivity.md.html) - - [DuplicateDefinition: Duplicate definitions of resources](DuplicateDefinition.md.html) - - [DuplicateDivider: Unnecessary Divider Copy](DuplicateDivider.md.html) - - [DuplicateIds: Duplicate ids within a single layout](DuplicateIds.md.html) - - [DuplicateIncludedIds: Duplicate ids across layouts combined with include tags](DuplicateIncludedIds.md.html) - - [DuplicatePlatformClasses: Duplicate Platform Classes](DuplicatePlatformClasses.md.html) - - [DuplicateStrings: Duplicate Strings](DuplicateStrings.md.html) - - [DuplicateUsesFeature: Feature declared more than once](DuplicateUsesFeature.md.html) - - [EasterEgg: Code contains easter egg](EasterEgg.md.html) - - [EllipsizeMaxLines: Combining Ellipsize and Maxlines](EllipsizeMaxLines.md.html) - - [EnforceUTF8: Encoding used in resource files is not UTF-8](EnforceUTF8.md.html) - - [EnqueueWork: WorkManager Enqueue](EnqueueWork.md.html) - - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) - - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - - [ExpiredTargetSdkVersion: TargetSdkVersion No Longer Supported](ExpiredTargetSdkVersion.md.html) - - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) - - [ExportedContentProvider: Content provider does not require permission](ExportedContentProvider.md.html) - - [ExportedPreferenceActivity: PreferenceActivity should not be exported](ExportedPreferenceActivity.md.html) - - [ExportedReceiver: Receiver does not require permission](ExportedReceiver.md.html) - - [ExportedService: Exported service does not require permission](ExportedService.md.html) - - [ExtraText: Extraneous text in resource files](ExtraText.md.html) - - [ExtraTranslation: Extra translation](ExtraTranslation.md.html) - - [FindViewByIdCast: Add Explicit Cast](FindViewByIdCast.md.html) - - [FontValidation: Validation of font files](FontValidation.md.html) - - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) - - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) - - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - - [FullBackupContent: Valid Full Backup Content File](FullBackupContent.md.html) - - [GetContentDescriptionOverride: Overriding `getContentDescription()` on a View](GetContentDescriptionOverride.md.html) - - [GetInstance: Cipher.getInstance with ECB](GetInstance.md.html) - - [GetLocales: Locale crash](GetLocales.md.html) - - [GifUsage: Using `.gif` format for bitmaps is discouraged](GifUsage.md.html) - - [GradleCompatible: Incompatible Gradle Versions](GradleCompatible.md.html) - - [GradleDependency: Obsolete Gradle Dependency](GradleDependency.md.html) - - [GradleDeprecated: Deprecated Gradle Construct](GradleDeprecated.md.html) - - [GradleDeprecatedConfiguration: Deprecated Gradle Configuration](GradleDeprecatedConfiguration.md.html) - - [GradleDynamicVersion: Gradle Dynamic Version](GradleDynamicVersion.md.html) - - [GradleGetter: Gradle Implicit Getter Call](GradleGetter.md.html) - - [GradleIdeError: Gradle IDE Support Issues](GradleIdeError.md.html) - - [GradleOverrides: Value overridden by Gradle build script](GradleOverrides.md.html) - - [GradlePath: Gradle Path Issues](GradlePath.md.html) - - [GradlePluginVersion: Incompatible Android Gradle Plugin](GradlePluginVersion.md.html) - - [GrantAllUris: Content provider shares everything](GrantAllUris.md.html) - - [GridLayout: GridLayout validation](GridLayout.md.html) - - [HalfFloat: Incorrect Half Float](HalfFloat.md.html) - - [HandlerLeak: Handler reference leaks](HandlerLeak.md.html) - - [HardcodedDebugMode: Hardcoded value of `android:debuggable` in the manifest](HardcodedDebugMode.md.html) - - [HardcodedText: Hardcoded text](HardcodedText.md.html) - - [HardwareIds: Hardware Id Usage](HardwareIds.md.html) - - [HighAppVersionCode: VersionCode too high](HighAppVersionCode.md.html) - - [HighSamplingRate: High sensor sampling rate](HighSamplingRate.md.html) - - [IconColors: Icon colors do not follow the recommended visual style](IconColors.md.html) - - [IconDensities: Icon densities validation](IconDensities.md.html) - - [IconDipSize: Icon density-independent size validation](IconDipSize.md.html) - - [IconDuplicates: Duplicated icons under different names](IconDuplicates.md.html) - - [IconDuplicatesConfig: Identical bitmaps across various configurations](IconDuplicatesConfig.md.html) - - [IconExpectedSize: Icon has incorrect size](IconExpectedSize.md.html) - - [IconExtension: Icon format does not match the file extension](IconExtension.md.html) - - [IconLauncherShape: The launcher icon shape should use a distinct silhouette](IconLauncherShape.md.html) - - [IconLocation: Image defined in density-independent drawable folder](IconLocation.md.html) - - [IconMissingDensityFolder: Missing density folder](IconMissingDensityFolder.md.html) - - [IconMixedNinePatch: Clashing PNG and 9-PNG files](IconMixedNinePatch.md.html) - - [IconNoDpi: Icon appears in both `-nodpi` and dpi folders](IconNoDpi.md.html) - - [IconXmlAndPng: Icon is specified both as `.xml` file and as a bitmap](IconXmlAndPng.md.html) - - [IdleBatteryChargingConstraints: Constraints may not be met for some devices](IdleBatteryChargingConstraints.md.html) - - [IgnoreWithoutReason: @Ignore without Reason](IgnoreWithoutReason.md.html) - - [IllegalResourceRef: Name and version must be integer or string, not resource](IllegalResourceRef.md.html) - - [ImplicitSamInstance: Implicit SAM Instances](ImplicitSamInstance.md.html) - - [ImpliedQuantity: Implied Quantities](ImpliedQuantity.md.html) - - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) - - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) - - [InefficientWeight: Inefficient layout weight](InefficientWeight.md.html) - - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) - - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) - - [InnerclassSeparator: Inner classes should use `$` rather than `.`](InnerclassSeparator.md.html) - - [InsecureBaseConfiguration: Insecure Base Configuration](InsecureBaseConfiguration.md.html) - - [InstantApps: Instant App Issues](InstantApps.md.html) - - [Instantiatable: Registered class is not instantiatable](Instantiatable.md.html) - - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) - - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) - - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) - - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) - - [InvalidId: Invalid ID declaration](InvalidId.md.html) - - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) - - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) - - [InvalidPermission: Invalid Permission Attribute](InvalidPermission.md.html) - - [InvalidResourceFolder: Invalid Resource Folder](InvalidResourceFolder.md.html) - - [InvalidSetHasFixedSize: When using `setHasFixedSize() in an `RecyclerView`, `wrap_content` cannot be used as \ -a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) - - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) - - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) - - [InvalidWearFeatureAttribute: Invalid attribute for Wear uses-feature](InvalidWearFeatureAttribute.md.html) - - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) - - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) - - [JobSchedulerService: JobScheduler problems](JobSchedulerService.md.html) - - [KeyboardInaccessibleWidget: Keyboard inaccessible widget](KeyboardInaccessibleWidget.md.html) - - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) - - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - - [LabelFor: Missing accessibility label](LabelFor.md.html) - - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) - - [LaunchActivityFromNotification: Notification Launches Services or BroadcastReceivers](LaunchActivityFromNotification.md.html) - - [LeanbackUsesWifi: Using android.hardware.wifi on TV](LeanbackUsesWifi.md.html) - - [LibraryCustomView: Custom views in libraries should use res-auto-namespace](LibraryCustomView.md.html) - - [LifecycleAnnotationProcessorWithJava8: Lifecycle Annotation Processor with Java 8 Compile Option](LifecycleAnnotationProcessorWithJava8.md.html) - - [LintImplBadUrl: Bad More Info Link](LintImplBadUrl.md.html) - - [LintImplDollarEscapes: Using Dollar Escapes](LintImplDollarEscapes.md.html) - - [LintImplIdFormat: Lint ID Format](LintImplIdFormat.md.html) - - [LintImplPsiEquals: Comparing PsiElements with Equals](LintImplPsiEquals.md.html) - - [LintImplTextFormat: Lint Text Format](LintImplTextFormat.md.html) - - [LintImplTrimIndent: Calling `.trimIndent` on Lint Strings](LintImplTrimIndent.md.html) - - [LintImplUnexpectedDomain: Unexpected URL Domain](LintImplUnexpectedDomain.md.html) - - [LintImplUseKotlin: Non-Kotlin Lint Detectors](LintImplUseKotlin.md.html) - - [LintImplUseUast: Using Wrong UAST Method](LintImplUseUast.md.html) - - [LocalSuppress: @SuppressLint on invalid element](LocalSuppress.md.html) - - [LocaleFolder: Wrong locale name](LocaleFolder.md.html) - - [LockedOrientationActivity: Incompatible screenOrientation value](LockedOrientationActivity.md.html) - - [LogConditional: Unconditional Logging Calls](LogConditional.md.html) - - [LogTagMismatch: Mismatched Log Tags](LogTagMismatch.md.html) - - [LongLogTag: Too Long Log Tags](LongLogTag.md.html) - - [MangledCRLF: Mangled file line endings](MangledCRLF.md.html) - - [ManifestOrder: Incorrect order of elements in manifest](ManifestOrder.md.html) - - [ManifestResource: Manifest Resource References](ManifestResource.md.html) - - [ManifestTypo: Typos in manifest tags](ManifestTypo.md.html) - - [MediaCapabilities: Media Capabilities property not specified](MediaCapabilities.md.html) - - [MenuTitle: Missing menu title](MenuTitle.md.html) - - [MergeMarker: Code contains merge marker](MergeMarker.md.html) - - [MergeRootFrame: FrameLayout can be replaced with `` tag](MergeRootFrame.md.html) - - [MinSdkTooLow: API Version Too Low](MinSdkTooLow.md.html) - - [MipmapIcons: Use Mipmap Launcher Icons](MipmapIcons.md.html) - - [MissingApplicationIcon: Missing application icon](MissingApplicationIcon.md.html) - - [MissingBackupPin: Missing Backup Pin](MissingBackupPin.md.html) - - [MissingClass: Missing registered class](MissingClass.md.html) - - [MissingColorAlphaChannel: Missing Color alpha channel](MissingColorAlphaChannel.md.html) - - [MissingConstraints: Missing Constraints in ConstraintLayout](MissingConstraints.md.html) - - [MissingDefaultResource: Missing Default](MissingDefaultResource.md.html) - - [MissingFirebaseInstanceTokenRefresh: Missing Firebase Messaging Callback](MissingFirebaseInstanceTokenRefresh.md.html) - - [MissingId: Fragments should specify an `id` or `tag`](MissingId.md.html) - - [MissingIntentFilterForMediaSearch: Missing MEDIA_PLAY_FROM_SEARCH intent-filter](MissingIntentFilterForMediaSearch.md.html) - - [MissingLeanbackLauncher: Missing Leanback Launcher Intent Filter](MissingLeanbackLauncher.md.html) - - [MissingLeanbackSupport: Missing Leanback Support](MissingLeanbackSupport.md.html) - - [MissingMediaBrowserServiceIntentFilter: Missing MediaBrowserService intent-filter](MissingMediaBrowserServiceIntentFilter.md.html) - - [MissingOnPlayFromSearch: Missing `onPlayFromSearch`](MissingOnPlayFromSearch.md.html) - - [MissingPermission: Missing Permissions](MissingPermission.md.html) - - [MissingPrefix: Missing Android XML namespace](MissingPrefix.md.html) - - [MissingQuantity: Missing quantity translation](MissingQuantity.md.html) - - [MissingSuperCall: Missing Super Call](MissingSuperCall.md.html) - - [MissingTranslation: Incomplete translation](MissingTranslation.md.html) - - [MissingTvBanner: TV Missing Banner](MissingTvBanner.md.html) - - [MissingVersion: Missing application name/version](MissingVersion.md.html) - - [MockLocation: Using mock location provider in production](MockLocation.md.html) - - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) - - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) - - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) - - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) - - [NegativeMargin: Negative Margins](NegativeMargin.md.html) - - [NestedScrolling: Nested scrolling widgets](NestedScrolling.md.html) - - [NestedWeights: Nested layout weights](NestedWeights.md.html) - - [NetworkSecurityConfig: Valid Network Security Config File](NetworkSecurityConfig.md.html) - - [NewApi: Calling new methods on older versions](NewApi.md.html) - - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) - - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) - - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) - - [NotInterpolated: Incorrect Interpolation](NotInterpolated.md.html) - - [NotSibling: Invalid Constraints](NotSibling.md.html) - - [NotificationIconCompatibility: Notification Icon Compatibility](NotificationIconCompatibility.md.html) - - [NotificationTrampoline: Notification Trampolines](NotificationTrampoline.md.html) - - [NotifyDataSetChanged: Invalidating All RecyclerView Data](NotifyDataSetChanged.md.html) - - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - - [ObjectAnimatorBinding: Incorrect ObjectAnimator Property](ObjectAnimatorBinding.md.html) - - [ObsoleteLayoutParam: Obsolete layout params](ObsoleteLayoutParam.md.html) - - [ObsoleteSdkInt: Obsolete SDK_INT Version Check](ObsoleteSdkInt.md.html) - - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) - - [OnClick: `onClick` method does not exist](OnClick.md.html) - - [Orientation: Missing explicit orientation](Orientation.md.html) - - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - - [Overdraw: Overdraw: Painting regions more than once](Overdraw.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) - - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) - - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) - - [PrivateApi: Using Private APIs](PrivateApi.md.html) - - [PrivateResource: Using private resources](PrivateResource.md.html) - - [Proguard: Using obsolete ProGuard configuration](Proguard.md.html) - - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) - - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - - [PxUsage: Using 'px' dimension](PxUsage.md.html) - - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) - - [Range: Outside Range](Range.md.html) - - [Recycle: Missing `recycle()` calls](Recycle.md.html) - - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - - [RedundantNamespace: Redundant namespace](RedundantNamespace.md.html) - - [ReferenceType: Incorrect reference types](ReferenceType.md.html) - - [Registered: Class is not registered in the manifest](Registered.md.html) - - [RelativeOverlap: Overlapping items in RelativeLayout](RelativeOverlap.md.html) - - [RememberReturnType: `remember` calls must not return `Unit`](RememberReturnType.md.html) - - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) - - [RemoveWorkManagerInitializer: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.](RemoveWorkManagerInitializer.md.html) - - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - - [RequiresFeature: Requires Feature](RequiresFeature.md.html) - - [ResAuto: Hardcoded Package in Namespace](ResAuto.md.html) - - [ResourceAsColor: Should pass resolved color instead of resource id](ResourceAsColor.md.html) - - [ResourceCycle: Cycle in resource definitions](ResourceCycle.md.html) - - [ResourceName: Resource with Wrong Prefix](ResourceName.md.html) - - [ResourceType: Wrong Resource Type](ResourceType.md.html) - - [RestrictedApi: Restricted API](RestrictedApi.md.html) - - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) - - [RtlCompat: Right-to-left text compatibility issues](RtlCompat.md.html) - - [RtlEnabled: Using RTL attributes without enabling RTL support](RtlEnabled.md.html) - - [RtlHardcoded: Using left/right instead of start/end attributes](RtlHardcoded.md.html) - - [RtlSymmetry: Padding and margin symmetry](RtlSymmetry.md.html) - - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) - - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) - - [ScopedStorage: Affected by scoped storage](ScopedStorage.md.html) - - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) - - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) - - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) - - [SetWorldReadable: `File.setReadable()` used to make file world-readable](SetWorldReadable.md.html) - - [SetWorldWritable: `File.setWritable()` used to make file world-writable](SetWorldWritable.md.html) - - [ShiftFlags: Dangerous Flag Constant Declaration](ShiftFlags.md.html) - - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) - - [ShowToast: Toast created but not shown](ShowToast.md.html) - - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) - - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - - [Slices: Slices](Slices.md.html) - - [SmallSp: Text size is too small](SmallSp.md.html) - - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) - - [SourceLockedOrientationActivity: Incompatible setRequestedOrientation value](SourceLockedOrientationActivity.md.html) - - [SpUsage: Using `dp` instead of `sp` for text sizes](SpUsage.md.html) - - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - - [SpecifyJobSchedulerIdRange: Specify a range of JobScheduler ids](SpecifyJobSchedulerIdRange.md.html) - - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - - [StaticFieldLeak: Static Field Leaks](StaticFieldLeak.md.html) - - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) - - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - - [StringFormatCount: Formatting argument types incomplete or inconsistent](StringFormatCount.md.html) - - [StringFormatInvalid: Invalid format string](StringFormatInvalid.md.html) - - [StringFormatMatches: `String.format` string doesn't match the XML format string](StringFormatMatches.md.html) - - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) - - [SupportAnnotationUsage: Incorrect support annotation usage](SupportAnnotationUsage.md.html) - - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) - - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - - [SyntheticAccessor: Synthetic Accessor](SyntheticAccessor.md.html) - - [TestAppLink: Unmatched URLs](TestAppLink.md.html) - - [TextFields: Missing `inputType`](TextFields.md.html) - - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) - - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) - - [TooDeepLayout: Layout hierarchy is too deep](TooDeepLayout.md.html) - - [TooManyViews: Layout has too many views](TooManyViews.md.html) - - [TranslucentOrientation: Mixing screenOrientation and translucency](TranslucentOrientation.md.html) - - [TrulyRandom: Weak RNG](TrulyRandom.md.html) - - [TrustAllX509TrustManager: Insecure TLS/SSL trust manager](TrustAllX509TrustManager.md.html) - - [TypographyDashes: Hyphen can be replaced with dash](TypographyDashes.md.html) - - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) - - [Typos: Spelling error](Typos.md.html) - - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - - [UnknownId: Reference to an unknown id](UnknownId.md.html) - - [UnknownIdInLayout: Reference to an id that is not in the current layout](UnknownIdInLayout.md.html) - - [UnknownNullness: Unknown nullness](UnknownNullness.md.html) - - [UnlocalizedSms: SMS phone number missing country code](UnlocalizedSms.md.html) - - [UnpackedNativeCode: Missing `android:extractNativeLibs=false`](UnpackedNativeCode.md.html) - - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) - - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) - - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) - - [UnsafeProtectedBroadcastReceiver: Unsafe Protected `BroadcastReceiver`](UnsafeProtectedBroadcastReceiver.md.html) - - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) - - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) - - [UnsupportedChromeOsCameraSystemFeature: Looking for Rear Camera only feature](UnsupportedChromeOsCameraSystemFeature.md.html) - - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) - - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) - - [Untranslatable: Translated Untranslatable](Untranslatable.md.html) - - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) - - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - - [UnusedIds: Unused id](UnusedIds.md.html) - - [UnusedNamespace: Unused namespace](UnusedNamespace.md.html) - - [UnusedQuantity: Unused quantity translations](UnusedQuantity.md.html) - - [UnusedResources: Unused resources](UnusedResources.md.html) - - [UnusedTransitionTargetStateParameter: Transition.animate* calls should use the provided targetState when defining values](UnusedTransitionTargetStateParameter.md.html) - - [UsableSpace: Using getUsableSpace()](UsableSpace.md.html) - - [UseAlpha2: Using 3-letter Codes](UseAlpha2.md.html) - - [UseAndroidAlpha: `android:alpha` attribute missing on `ColorStateList`](UseAndroidAlpha.md.html) - - [UseAppTint: `app:tint` attribute should be used on `ImageView` and `ImageButton`](UseAppTint.md.html) - - [UseCheckPermission: Using the result of check permission calls](UseCheckPermission.md.html) - - [UseCompatLoadingForColorStateLists: Should not call `Resources.getColorStateList` directly](UseCompatLoadingForColorStateLists.md.html) - - [UseCompatLoadingForDrawables: Should not call `Context.getDrawable` or `Resources.getDrawable` directly](UseCompatLoadingForDrawables.md.html) - - [UseCompatTextViewDrawableApis: Should not call `TextView.setCompoundDrawableTintList` or `TextView.setCompoundDrawableTintMode` directly](UseCompatTextViewDrawableApis.md.html) - - [UseCompatTextViewDrawableXml: Compat compound drawable attributes should be used on `TextView`](UseCompatTextViewDrawableXml.md.html) - - [UseCompoundDrawables: Node can be replaced by a `TextView` with compound drawables](UseCompoundDrawables.md.html) - - [UseGetLayoutInflater: Use getLayoutInflater() to get the LayoutInflater instead of calling LayoutInflater.from(Context).](UseGetLayoutInflater.md.html) - - [UseOfBundledGooglePlayServices: Use of bundled version of Google Play services](UseOfBundledGooglePlayServices.md.html) - - [UseRequireInsteadOfGet: Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null.](UseRequireInsteadOfGet.md.html) - - [UseRxSetProgress2: `setProgress` is deprecated. Use `setCompletableProgress` instead.](UseRxSetProgress2.md.html) - - [UseSparseArrays: HashMap can be replaced with SparseArray](UseSparseArrays.md.html) - - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) - - [UseSwitchCompatOrMaterialXml: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialXml.md.html) - - [UseValueOf: Should use `valueOf` instead of `new`](UseValueOf.md.html) - - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - - [UsingC2DM: Using C2DM](UsingC2DM.md.html) - - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) - - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) - - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) - - [ValidRestrictions: Invalid Restrictions Descriptor](ValidRestrictions.md.html) - - [VectorDrawableCompat: Using VectorDrawableCompat](VectorDrawableCompat.md.html) - - [VectorPath: Long vector paths](VectorPath.md.html) - - [VectorRaster: Vector Image Generation](VectorRaster.md.html) - - [ViewConstructor: Missing View constructors for XML inflation](ViewConstructor.md.html) - - [ViewHolder: View Holder Candidates](ViewHolder.md.html) - - [VisibleForTests: Visible Only For Tests](VisibleForTests.md.html) - - [VulnerableCordovaVersion: Vulnerable Cordova Version](VulnerableCordovaVersion.md.html) - - [Wakelock: Incorrect `WakeLock` usage](Wakelock.md.html) - - [WakelockTimeout: Using wakeLock without timeout](WakelockTimeout.md.html) - - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) - - [WebViewApiAvailability: WebView API Availability](WebViewApiAvailability.md.html) - - [WebViewClientOnReceivedSslError: Proceeds with the HTTPS connection despite SSL errors](WebViewClientOnReceivedSslError.md.html) - - [WebViewLayout: WebViews in wrap_content parents](WebViewLayout.md.html) - - [WebpUnsupported: WebP Unsupported](WebpUnsupported.md.html) - - [WeekBasedYear: Week Based Year](WeekBasedYear.md.html) - - [WifiManagerLeak: WifiManager Leak](WifiManagerLeak.md.html) - - [WifiManagerPotentialLeak: WifiManager Potential Leak](WifiManagerPotentialLeak.md.html) - - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) - - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) - - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) - - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - - [WrongCase: Wrong case for view tag](WrongCase.md.html) - - [WrongConstant: Incorrect constant](WrongConstant.md.html) - - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) - - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) - - [WrongRegion: Suspicious Language/Region Combination](WrongRegion.md.html) - - [WrongThread: Wrong Thread](WrongThread.md.html) - - [WrongThreadInterprocedural: Wrong Thread (Interprocedural)](WrongThreadInterprocedural.md.html) - - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) - - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) - -* Deleted or Obsolete Issues (11) - - - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) - - [IconLauncherFormat](IconLauncherFormat.md.html) - - [ViewTag](ViewTag.md.html) - - [FieldGetter](FieldGetter.md.html) - - [MissingRegistered](MissingRegistered.md.html) - - [FontValidationWarning](FontValidationWarning.md.html) - - [FontValidationError](FontValidationError.md.html) - - [AppLinksAutoVerifyError](AppLinksAutoVerifyError.md.html) - - [AppLinksAutoVerifyWarning](AppLinksAutoVerifyWarning.md.html) - - [Assert](Assert.md.html) - \ No newline at end of file diff --git a/docs/checks/androidx_activity_activity-compose.md.html b/docs/checks/androidx_activity_activity-compose.md.html new file mode 100644 index 00000000..5cd310b9 --- /dev/null +++ b/docs/checks/androidx_activity_activity-compose.md.html @@ -0,0 +1,81 @@ +(#) androidx.activity:activity-compose + +Name +: Activity Compose +Description +: Compose integration with Activity +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Activity Compose +Identifier +: androidx.activity.compose +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.activity:activity-compose:1.8.0-alpha05 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------|---------------------------------------------------------------------------------| +|[LaunchDuringComposition](LaunchDuringComposition.md.html)|Calls to `launch` should happen inside of a SideEffect and not during composition| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity-compose:1.8.0-alpha05") + +// build.gradle +implementation 'androidx.activity:activity-compose:1.8.0-alpha05' + +// build.gradle.kts with version catalogs: +implementation(libs.activity-compose) + +# libs.versions.toml +[versions] +activity-compose = "1.8.0-alpha05" +[libraries] +activity-compose = { + module = "androidx.activity:activity-compose", + version.ref = "activity-compose" +} +``` + +1.8.0-alpha05 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.4.0: First version includes LaunchDuringComposition. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.8.0-alpha05|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha03|2023/04/12| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha02|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| +| 1.8.0-alpha01|2023/02/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.7.2|2023/05/24| 1| Yes| 8.0 and 8.1| 7.0| +| 1.7.1|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| +| 1.7.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.6.1|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.6.0|2022/09/21| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.0|2022/06/29| 1| Yes| 7.3 and 7.4| 7.0| +| 1.4.0|2021/10/27| 1| Yes| 7.1| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_activity_activity.md.html b/docs/checks/androidx_activity_activity.md.html new file mode 100644 index 00000000..8980c631 --- /dev/null +++ b/docs/checks/androidx_activity_activity.md.html @@ -0,0 +1,90 @@ +(#) androidx.activity:activity + +Name +: Activity +Description +: Provides the base Activity subclass and the relevant hooks to build a +: composable structure on top. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.activity +Feedback +: https://issuetracker.google.com/issues/new?component=527362 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.activity:activity:1.8.0-alpha05 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|---------------------------------------------------| +|[InvalidFragmentVersionForActivityResult](InvalidFragmentVersionForActivityResult.md.html)|Update to Fragment 1.3.0 to use ActivityResult APIs| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity:1.8.0-alpha05") + +// build.gradle +implementation 'androidx.activity:activity:1.8.0-alpha05' + +// build.gradle.kts with version catalogs: +implementation(libs.activity) + +# libs.versions.toml +[versions] +activity = "1.8.0-alpha05" +[libraries] +activity = { + module = "androidx.activity:activity", + version.ref = "activity" +} +``` + +1.8.0-alpha05 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes + InvalidFragmentVersionForActivityResult. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.8.0-alpha05|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha03|2023/04/12| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha02|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| +| 1.8.0-alpha01|2023/02/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.7.2|2023/05/24| 1| Yes| 8.0 and 8.1| 7.0| +| 1.7.1|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| +| 1.7.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.6.1|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.6.0|2022/09/21| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.0|2022/06/29| 1| Yes| 7.3 and 7.4| 7.0| +| 1.4.0|2021/10/27| 1| Yes| 7.1| 4.1| +| 1.3.1|2021/08/04| 1| Yes| 7.0| 3.3| +| 1.3.0|2021/07/28| 1| Yes| 7.0| 3.3| +| 1.2.4|2021/07/21| 1| Yes| 4.1| 3.3| +| 1.2.3|2021/05/05| 1| Yes| 4.1| 3.3| +| 1.2.2|2021/03/24| 1| Yes| 4.1| 3.3| +| 1.2.1|2021/03/10| 1| Yes| 4.1| 3.3| +| 1.2.0|2021/02/10| 1| Yes| 4.1| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_annotation_annotation-experimental.md.html b/docs/checks/androidx_annotation_annotation-experimental.md.html new file mode 100644 index 00000000..e26aca30 --- /dev/null +++ b/docs/checks/androidx_annotation_annotation-experimental.md.html @@ -0,0 +1,88 @@ +(#) androidx.annotation:annotation-experimental + +Name +: Experimental annotation +Description +: Java annotation for use on unstable Android API surfaces. When used in +: conjunction with the Experimental annotation lint checks, this +: annotation provides functional parity with Kotlin's Experimental +: annotation. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.annotation.experimental +Feedback +: https://issuetracker.google.com/issues/new?component=459778 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: androidx.annotation:annotation-experimental:1.4.0-dev01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------|------------------------------------------------------------------------| +|[UnsafeOptInUsageError](UnsafeOptInUsageError.md.html) |Unsafe opt-in usage intended to be error-level severity | +|[UnsafeOptInUsageWarning](UnsafeOptInUsageWarning.md.html) |Unsafe opt-in usage intended to be warning-level severity | +|[ExperimentalAnnotationRetention](ExperimentalAnnotationRetention.md.html)|Experimental annotation with incorrect retention | +|[WrongRequiresOptIn](WrongRequiresOptIn.md.html) |Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") + +// build.gradle +implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' + +// build.gradle.kts with version catalogs: +implementation(libs.annotation-experimental) + +# libs.versions.toml +[versions] +annotation-experimental = "1.4.0-dev01" +[libraries] +annotation-experimental = { + module = "androidx.annotation:annotation-experimental", + version.ref = "annotation-experimental" +} +``` + +1.4.0-dev01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes UnsafeExperimentalUsageError, + UnsafeExperimentalUsageWarning. +* 1.1.0: Adds UnsafeOptInUsageError, UnsafeOptInUsageWarning. Removes + UnsafeExperimentalUsageError, UnsafeExperimentalUsageWarning. +* 1.2.0: Adds ExperimentalAnnotationRetention. +* 1.4.0-dev01: Adds WrongRequiresOptIn. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.4.0-dev01|2023/02/08| 4| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/09/07| 3| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2021/12/15| 3| No[^1]| 7.1| 4.1| +| 1.1.0|2021/04/07| 2| Yes| 4.1| 4.1| +| 1.0.0|2019/11/07| 2| Yes| Not specified|Not specified| + +Compatibility Problems: + +[^1]: com.android.tools.lint.client.api.AnnotationLookup: org.jetbrains.uast.UAnnotation findRealAnnotation(com.intellij.psi.PsiAnnotation,com.intellij.psi.PsiClass,org.jetbrains.uast.UElement) is not available + + \ No newline at end of file diff --git a/docs/checks/androidx_appcompat_appcompat.md.html b/docs/checks/androidx_appcompat_appcompat.md.html new file mode 100644 index 00000000..2cf867a8 --- /dev/null +++ b/docs/checks/androidx_appcompat_appcompat.md.html @@ -0,0 +1,96 @@ +(#) androidx.appcompat:appcompat + +Name +: Android AppCompat Library +Description +: The Support Library is a static library that you can add to your Android +: application in order to use APIs that are either not available for older +: platform versions or utility APIs that aren't a part of the framework +: APIs. Compatible on devices running API 14 or later. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.appcompat +Feedback +: https://issuetracker.google.com/issues/new?component=460343 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: androidx.appcompat:appcompat:1.7.0-alpha02 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| +|[UseSupportActionBar](UseSupportActionBar.md.html) |Should not call `Activity.setActionBar` if you extend `AppCompatActivity` | +|[UseAndroidAlpha](UseAndroidAlpha.md.html) |`android:alpha` attribute missing on `ColorStateList` | +|[UseCompatLoadingForColorStateLists](UseCompatLoadingForColorStateLists.md.html)|Should not call `Resources.getColorStateList` directly | +|[UseCompatLoadingForDrawables](UseCompatLoadingForDrawables.md.html) |Should not call `Context.getDrawable` or `Resources.getDrawable` directly | +|[UseAppTint](UseAppTint.md.html) |`app:tint` attribute should be used on `ImageView` and `ImageButton` | +|[UseSwitchCompatOrMaterialCode](UseSwitchCompatOrMaterialCode.md.html) |Replace usage of `Switch` widget | +|[UseSwitchCompatOrMaterialXml](UseSwitchCompatOrMaterialXml.md.html) |Replace usage of `Switch` widget | +|[UseCompatTextViewDrawableApis](UseCompatTextViewDrawableApis.md.html) |Should not call `TextView.setCompoundDrawableTintList` or `TextView.setCompoundDrawableTintMode` directly| +|[UseCompatTextViewDrawableXml](UseCompatTextViewDrawableXml.md.html) |Compat compound drawable attributes should be used on `TextView` | +|[UsingOnClickInXml](UsingOnClickInXml.md.html) |Using `android:onClick` on older version of the platform is broken | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.appcompat:appcompat:1.7.0-alpha02") + +// build.gradle +implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.appcompat) + +# libs.versions.toml +[versions] +appcompat = "1.7.0-alpha02" +[libraries] +appcompat = { + module = "androidx.appcompat:appcompat", + version.ref = "appcompat" +} +``` + +1.7.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes UseAndroidAlpha, UseAppTint, + UseCompatLoadingForColorStateLists, UseCompatLoadingForDrawables, + UseCompatTextViewDrawableApis, UseCompatTextViewDrawableXml, + UseSwitchCompatOrMaterialCode, UseSwitchCompatOrMaterialXml. +* 1.3.0: Adds UseSupportActionBar, UsingOnClickInXml. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha02|2023/02/08| 10| Yes| 7.3 and 7.4| 7.0| +| 1.7.0-alpha01|2022/10/05| 10| Yes| 7.3 and 7.4| 7.0| +| 1.6.1|2023/02/08| 10| Yes| 7.3 and 7.4| 7.0| +| 1.6.0|2023/01/11| 10| Yes| 7.3 and 7.4| 7.0| +| 1.5.1|2022/09/07| 10| Yes| 7.3 and 7.4| 7.0| +| 1.5.0|2022/08/10| 10| Yes| 7.3 and 7.4| 7.0| +| 1.4.2|2022/06/01| 10| Yes| 7.1| 7.0| +| 1.4.1|2022/01/12| 10| Yes| 7.1| 7.0| +| 1.4.0|2021/11/17| 10| Yes| 7.1| 7.0| +| 1.3.1|2021/07/21| 10| Yes| 4.1| 4.1| +| 1.3.0|2021/05/18| 10| Yes| 4.1| 4.1| +| 1.2.0|2020/08/05| 8| Yes| 4.0| 4.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_animation_animation-core.md.html b/docs/checks/androidx_compose_animation_animation-core.md.html new file mode 100644 index 00000000..1418d0dd --- /dev/null +++ b/docs/checks/androidx_compose_animation_animation-core.md.html @@ -0,0 +1,95 @@ +(#) androidx.compose.animation:animation-core + +Name +: Compose Animation Core +Description +: Animation engine and animation primitives that are the building blocks +: of the Compose animation library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation.core +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.animation:animation-core:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| +|[UnusedTransitionTargetStateParameter](UnusedTransitionTargetStateParameter.md.html)|Transition.animate* calls should use the provided targetState when defining values| +|[UnrememberedAnimatable](UnrememberedAnimatable.md.html) |Creating an Animatable during composition without using `remember` | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-core:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-core) + +# libs.versions.toml +[versions] +animation-core = "1.5.0-beta02" +[libraries] +animation-core = { + module = "androidx.compose.animation:animation-core", + version.ref = "animation-core" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes UnrememberedAnimatable, + UnusedTransitionTargetStateParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 2| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 2| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 2| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 2| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 2| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 2| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 2| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 2| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_animation_animation.md.html b/docs/checks/androidx_compose_animation_animation.md.html new file mode 100644 index 00000000..0840577f --- /dev/null +++ b/docs/checks/androidx_compose_animation_animation.md.html @@ -0,0 +1,94 @@ +(#) androidx.compose.animation:animation + +Name +: Compose Animation +Description +: Compose animation library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.animation:animation:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| +|[UnusedCrossfadeTargetStateParameter](UnusedCrossfadeTargetStateParameter.md.html) |Crossfade calls should use the provided `T` parameter in the content lambda | +|[UnusedContentLambdaTargetStateParameter](UnusedContentLambdaTargetStateParameter.md.html)|AnimatedContent calls should use the provided `T` parameter in the content lambda| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.animation:animation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.animation) + +# libs.versions.toml +[versions] +animation = "1.5.0-beta02" +[libraries] +animation = { + module = "androidx.compose.animation:animation", + version.ref = "animation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes UnusedCrossfadeTargetStateParameter. +* 1.5.0-alpha04: Adds UnusedContentLambdaTargetStateParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_foundation_foundation.md.html b/docs/checks/androidx_compose_foundation_foundation.md.html new file mode 100644 index 00000000..b5ad6c3d --- /dev/null +++ b/docs/checks/androidx_compose_foundation_foundation.md.html @@ -0,0 +1,87 @@ +(#) androidx.compose.foundation:foundation + +Name +: Compose Foundation +Description +: Higher level abstractions of the Compose UI primitives. This library is +: design system agnostic, providing the high-level building blocks for +: both application and design-system developers +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.foundation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.foundation:foundation:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| +|[FrequentlyChangedStateReadInComposition](FrequentlyChangedStateReadInComposition.md.html)|Frequently changing state should not be directly read in composable function | +|[UseOfNonLambdaOffsetOverload](UseOfNonLambdaOffsetOverload.md.html) |Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation) + +# libs.versions.toml +[versions] +foundation = "1.5.0-beta02" +[libraries] +foundation = { + module = "androidx.compose.foundation:foundation", + version.ref = "foundation" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes + FrequentlyChangedStateReadInComposition. +* 1.3.0: Adds UseOfNonLambdaOffsetOverload. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_material3_material3.md.html b/docs/checks/androidx_compose_material3_material3.md.html new file mode 100644 index 00000000..94539747 --- /dev/null +++ b/docs/checks/androidx_compose_material3_material3.md.html @@ -0,0 +1,74 @@ +(#) androidx.compose.material3:material3 + +Name +: Compose Material3 Components +Description +: Compose Material You Design Components library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.material3 +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.material3:material3:1.2.0-alpha02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|----------------------------------------------------------------------| +|[UnusedMaterial3ScaffoldPaddingParameter](UnusedMaterial3ScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material3:material3:1.2.0-alpha02") + +// build.gradle +implementation 'androidx.compose.material3:material3:1.2.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.material3) + +# libs.versions.toml +[versions] +material3 = "1.2.0-alpha02" +[libraries] +material3 = { + module = "androidx.compose.material3:material3", + version.ref = "material3" +} +``` + +1.2.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes + UnusedMaterial3ScaffoldPaddingParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.2.0-alpha02|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha01|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.0.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| +| 1.0.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_material_material.md.html b/docs/checks/androidx_compose_material_material.md.html new file mode 100644 index 00000000..fcab90a3 --- /dev/null +++ b/docs/checks/androidx_compose_material_material.md.html @@ -0,0 +1,92 @@ +(#) androidx.compose.material:material + +Name +: Compose Material Components +Description +: Compose Material Design Components library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.material +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.material:material:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|----------------------------------------------------------------------| +|[ConflictingOnColor](ConflictingOnColor.md.html) |Background colors with the same value should have the same 'on' color | +|[UnusedMaterialScaffoldPaddingParameter](UnusedMaterialScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material:material:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.material:material:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.material) + +# libs.versions.toml +[versions] +material = "1.5.0-beta02" +[libraries] +material = { + module = "androidx.compose.material:material", + version.ref = "material" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes ConflictingOnColor. +* 1.2.0: Adds UnusedMaterialScaffoldPaddingParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime-saveable.md.html b/docs/checks/androidx_compose_runtime_runtime-saveable.md.html new file mode 100644 index 00000000..7632523b --- /dev/null +++ b/docs/checks/androidx_compose_runtime_runtime-saveable.md.html @@ -0,0 +1,92 @@ +(#) androidx.compose.runtime:runtime-saveable + +Name +: Compose Saveable +Description +: Compose components that allow saving and restoring the local ui state +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime.saveable +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.runtime:runtime-saveable:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------|------------------------------------------------------------------------------------------| +|[RememberSaveableSaverParameter](RememberSaveableSaverParameter.md.html)|`Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime-saveable:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime-saveable:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime-saveable) + +# libs.versions.toml +[versions] +runtime-saveable = "1.5.0-beta02" +[libraries] +runtime-saveable = { + module = "androidx.compose.runtime:runtime-saveable", + version.ref = "runtime-saveable" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes RememberSaveableSaverParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime.md.html b/docs/checks/androidx_compose_runtime_runtime.md.html new file mode 100644 index 00000000..d0315578 --- /dev/null +++ b/docs/checks/androidx_compose_runtime_runtime.md.html @@ -0,0 +1,114 @@ +(#) androidx.compose.runtime:runtime + +Name +: Compose Runtime +Description +: Tree composition support for code generated by the Compose compiler +: plugin and corresponding public API +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.runtime:runtime:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| +|[AutoboxingStateValueProperty](AutoboxingStateValueProperty.md.html) |State access causes value to be autoboxed | +|[AutoboxingStateCreation](AutoboxingStateCreation.md.html) |`State` will autobox values assigned to this state. Use a specialized state type instead.| +|[CoroutineCreationDuringComposition](CoroutineCreationDuringComposition.md.html)|Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition | +|[FlowOperatorInvokedInComposition](FlowOperatorInvokedInComposition.md.html) |Flow operator functions should not be invoked within composition | +|[ComposableLambdaParameterNaming](ComposableLambdaParameterNaming.md.html) |Primary composable lambda parameter not named `content` | +|[ComposableLambdaParameterPosition](ComposableLambdaParameterPosition.md.html) |Non-trailing primary composable lambda parameter | +|[ComposableNaming](ComposableNaming.md.html) |Incorrect naming for @Composable functions | +|[StateFlowValueCalledInComposition](StateFlowValueCalledInComposition.md.html) |StateFlow.value should not be called within composition | +|[CompositionLocalNaming](CompositionLocalNaming.md.html) |CompositionLocal properties should be prefixed with `Local` | +|[MutableCollectionMutableState](MutableCollectionMutableState.md.html) |Creating a MutableState object with a mutable collection type | +|[ProduceStateDoesNotAssignValue](ProduceStateDoesNotAssignValue.md.html) |produceState calls should assign `value` inside the producer lambda | +|[RememberReturnType](RememberReturnType.md.html) |`remember` calls must not return `Unit` | +|[OpaqueUnitKey](OpaqueUnitKey.md.html) |Passing an expression which always returns `Unit` as a key argument | +|[UnrememberedMutableState](UnrememberedMutableState.md.html) |Creating a state object during composition without using `remember` | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime) + +# libs.versions.toml +[versions] +runtime = "1.5.0-beta02" +[libraries] +runtime = { + module = "androidx.compose.runtime:runtime", + version.ref = "runtime" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes ComposableLambdaParameterNaming, + ComposableLambdaParameterPosition, ComposableNaming, + CompositionLocalNaming, CoroutineCreationDuringComposition, + RememberReturnType, UnrememberedMutableState. +* 1.1.0: Adds FlowOperatorInvokedInComposition, + MutableCollectionMutableState, ProduceStateDoesNotAssignValue, + StateFlowValueCalledInComposition. +* 1.5.0-alpha04: Adds AutoboxingStateValueProperty. +* 1.5.0-beta01: Adds AutoboxingStateCreation, OpaqueUnitKey. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 12| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 11| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 11| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 11| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 11| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 11| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 11| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 11| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 11| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 11| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 11| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 11| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 11| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 11| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 11| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 11| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 7| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 7| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 7| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 7| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 7| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 7| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-graphics.md.html b/docs/checks/androidx_compose_ui_ui-graphics.md.html new file mode 100644 index 00000000..3b37b136 --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui-graphics.md.html @@ -0,0 +1,94 @@ +(#) androidx.compose.ui:ui-graphics + +Name +: Compose Graphics +Description +: Compose graphics +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui.graphics +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui-graphics:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------|---------------------------| +|[MissingColorAlphaChannel](MissingColorAlphaChannel.md.html)|Missing Color alpha channel| +|[InvalidColorHexValue](InvalidColorHexValue.md.html) |Invalid Color hex value | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-graphics) + +# libs.versions.toml +[versions] +ui-graphics = "1.5.0-beta02" +[libraries] +ui-graphics = { + module = "androidx.compose.ui:ui-graphics", + version.ref = "ui-graphics" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes InvalidColorHexValue, + MissingColorAlphaChannel. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 2| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 2| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 2| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 2| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 2| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 2| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 2| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 2| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-test-manifest.md.html b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html new file mode 100644 index 00000000..acbe2e83 --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html @@ -0,0 +1,86 @@ +(#) androidx.compose.ui:ui-test-manifest + +Name +: Compose Testing manifest dependency +Description +: Compose testing library that should be added as a debugImplementation +: dependency to add properties to the debug manifest necessary for testing +: an application +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.compose.ui.test.manifest +Feedback +: https://issuetracker.google.com/issues/new?component=741505 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui-test-manifest:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| +|[TestManifestGradleConfiguration](TestManifestGradleConfiguration.md.html)|The ui-test-manifest library should be included using the debugImplementation configuration.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-test-manifest:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui-test-manifest:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-test-manifest) + +# libs.versions.toml +[versions] +ui-test-manifest = "1.5.0-beta02" +[libraries] +ui-test-manifest = { + module = "androidx.compose.ui:ui-test-manifest", + version.ref = "ui-test-manifest" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes TestManifestGradleConfiguration. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui.md.html b/docs/checks/androidx_compose_ui_ui.md.html new file mode 100644 index 00000000..88db9302 --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui.md.html @@ -0,0 +1,109 @@ +(#) androidx.compose.ui:ui + +Name +: Compose UI +Description +: Compose UI primitives. This library contains the primitives that form +: the Compose UI Toolkit, such as drawing, measurement and layout. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui:1.5.0-beta02 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +|[UnnecessaryComposedModifier](UnnecessaryComposedModifier.md.html) |Modifier.composed should only be used for modifiers that invoke @Composable functions | +|[ComposableModifierFactory](ComposableModifierFactory.md.html) |Modifier factory functions should not be @Composable | +|[ModifierFactoryExtensionFunction](ModifierFactoryExtensionFunction.md.html) |Modifier factory functions should be extensions on Modifier | +|[ModifierFactoryReturnType](ModifierFactoryReturnType.md.html) |Modifier factory functions should return Modifier | +|[ModifierFactoryUnreferencedReceiver](ModifierFactoryUnreferencedReceiver.md.html) |Modifier factory functions must use the receiver Modifier instance | +|[ModifierNodeInspectableProperties](ModifierNodeInspectableProperties.md.html) |ModifierNodeElement missing inspectableProperties | +|[ModifierParameter](ModifierParameter.md.html) |Guidelines for Modifier parameters in a Composable function | +|[ReturnFromAwaitPointerEventScope](ReturnFromAwaitPointerEventScope.md.html) |Returning from awaitPointerEventScope may cause some input events to be dropped | +|[SuspiciousCompositionLocalModifierRead](SuspiciousCompositionLocalModifierRead.md.html)|CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() | +|[MultipleAwaitPointerEventScopes](MultipleAwaitPointerEventScopes.md.html) |Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui:1.5.0-beta02") + +// build.gradle +implementation 'androidx.compose.ui:ui:1.5.0-beta02' + +// build.gradle.kts with version catalogs: +implementation(libs.ui) + +# libs.versions.toml +[versions] +ui = "1.5.0-beta02" +[libraries] +ui = { + module = "androidx.compose.ui:ui", + version.ref = "ui" +} +``` + +1.5.0-beta02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes ComposableModifierFactory, + ModifierFactoryExtensionFunction, ModifierFactoryReturnType, + ModifierFactoryUnreferencedReceiver, ModifierParameter, + UnnecessaryComposedModifier. +* 1.3.0: Adds MultipleAwaitPointerEventScopes, + ReturnFromAwaitPointerEventScope. +* 1.4.0: Adds ModifierNodeInspectableProperties. +* 1.5.0-alpha01: Adds SuspiciousCompositionLocalModifierRead. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.5.0-beta02|2023/06/07| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-beta01|2023/05/24| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha04|2023/05/10| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha03|2023/04/19| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0-alpha02|2023/04/05| 10| Yes| 8.0 and 8.1| 7.0| +| 1.5.0-alpha01|2023/03/22| 10| Yes| 8.0 and 8.1| 7.0| +| 1.4.3|2023/05/03| 9| Yes| 8.0 and 8.1| 7.0| +| 1.4.2|2023/04/19| 9| Yes| 8.0 and 8.1| 7.0| +| 1.4.1|2023/04/05| 9| Yes| 8.0 and 8.1| 7.0| +| 1.4.0|2023/03/22| 9| Yes| 8.0 and 8.1| 7.0| +| 1.3.3|2023/01/11| 8| Yes| 7.3 and 7.4| 7.0| +| 1.3.2|2022/12/07| 8| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2022/11/09| 8| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2022/10/24| 8| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2022/08/10| 6| Yes| 7.3 and 7.4| 7.0| +| 1.2.0|2022/07/27| 6| Yes| 7.3 and 7.4| 7.0| +| 1.1.1|2022/02/23| 6| Yes| 7.1| 7.0| +| 1.1.0|2022/02/09| 6| Yes| 7.1| 7.0| +| 1.0.5|2021/11/03| 6| Yes| 7.0| 7.0| +| 1.0.4|2021/10/13| 6| Yes| 7.0| 7.0| +| 1.0.3|2021/09/29| 6| Yes| 7.0| 7.0| +| 1.0.2|2021/09/01| 6| Yes| 7.0| 7.0| +| 1.0.1|2021/08/04| 6| Yes| 7.0| 7.0| +| 1.0.0|2021/07/28| 6| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html b/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html new file mode 100644 index 00000000..030ad662 --- /dev/null +++ b/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html @@ -0,0 +1,82 @@ +(#) androidx.constraintlayout:constraintlayout-compose + +Name +: ConstraintLayout Compose +Description +: This library offers a flexible and adaptable way to position and animate +: widgets in Compose +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.constraintlayout.compose +Feedback +: https://issuetracker.google.com/issues/new?component=323867&template=1023345 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| +|[IncorrectReferencesDeclaration](IncorrectReferencesDeclaration.md.html)|`createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables| +|[IncorrectMatchParentUsage](IncorrectMatchParentUsage.md.html) |Prefer using `Dimension.percent(1f)` when defining custom constraints. | +|[IncorrectChainMarginsUsage](IncorrectChainMarginsUsage.md.html) |Use `LayoutReference.withChainParams()` to define margins for elements in a Chain. | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") + +// build.gradle +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' + +// build.gradle.kts with version catalogs: +implementation(libs.constraintlayout-compose) + +# libs.versions.toml +[versions] +constraintlayout-compose = "1.1.0-alpha10" +[libraries] +constraintlayout-compose = { + module = "androidx.constraintlayout:constraintlayout-compose", + version.ref = "constraintlayout-compose" +} +``` + +1.1.0-alpha10 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.1.0-alpha06: First version includes IncorrectReferencesDeclaration. +* 1.1.0-alpha08: Adds IncorrectChainMarginsUsage, + IncorrectMatchParentUsage. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.1.0-alpha10|2023/05/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-alpha09|2023/03/22| 3| No[^1]| 8.0 and 8.1| 7.0| +| 1.1.0-alpha08|2023/03/08| 3| No[^1]| 8.0 and 8.1| 7.0| +| 1.1.0-alpha07|2023/02/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.1.0-alpha06|2023/01/25| 1| Yes| 7.3 and 7.4| 7.0| + +Compatibility Problems: + +[^1]: org.jetbrains.uast.visitor.UastVisitor.DefaultImpls: boolean visitWhileExpression(org.jetbrains.uast.visitor.UastVisitor,org.jetbrains.uast.UWhileExpression) is not available + + \ No newline at end of file diff --git a/docs/checks/androidx_fragment_fragment-testing-manifest.md.html b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html new file mode 100644 index 00000000..4b836da1 --- /dev/null +++ b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html @@ -0,0 +1,72 @@ +(#) androidx.fragment:fragment-testing-manifest + +Name +: Fragment Testing Manifest dependency +Description +: Fragment testing library that should be added as a debugImplementation +: dependency to add properties to the debug manifest necessary for testing +: an application +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.fragment.testing.manifest +Feedback +: https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.fragment:fragment-testing-manifest:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------|------------------------------------------------------------------------------------------| +|[FragmentGradleConfiguration](FragmentGradleConfiguration-2.md.html)|Include the fragment-testing-manifest library using the debugImplementation configuration.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment-testing-manifest) + +# libs.versions.toml +[versions] +fragment-testing-manifest = "1.7.0-alpha01" +[libraries] +fragment-testing-manifest = { + module = "androidx.fragment:fragment-testing-manifest", + version.ref = "fragment-testing-manifest" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.6.0: First version includes FragmentGradleConfiguration. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_fragment_fragment-testing.md.html b/docs/checks/androidx_fragment_fragment-testing.md.html new file mode 100644 index 00000000..1e34d687 --- /dev/null +++ b/docs/checks/androidx_fragment_fragment-testing.md.html @@ -0,0 +1,91 @@ +(#) androidx.fragment:fragment-testing + +Name +: Fragment Testing Extensions +Description +: Extensions for testing 'fragment' artifact +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.fragment.testing +Feedback +: https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.fragment:fragment-testing:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------|---------------------------------------------------------------------------------| +|[FragmentGradleConfiguration](FragmentGradleConfiguration.md.html)|Include the fragment-testing library using the debugImplementation configuration.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment-testing:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment-testing:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment-testing) + +# libs.versions.toml +[versions] +fragment-testing = "1.7.0-alpha01" +[libraries] +fragment-testing = { + module = "androidx.fragment:fragment-testing", + version.ref = "fragment-testing" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.2: First version includes FragmentGradleConfiguration. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.7|2023/04/19| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.6|2023/03/22| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.5|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.4|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.3|2022/09/21| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.2|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 1.5.0|2022/06/29| 1| Yes| 7.3 and 7.4| 7.0| +| 1.4.1|2022/01/26| 1| Yes| 7.1| 4.1| +| 1.4.0|2021/11/17| 1| Yes| 7.1| 4.1| +| 1.3.6|2021/07/21| 1| Yes| 4.1| 3.3| +| 1.3.5|2021/06/16| 1| Yes| 4.1| 3.3| +| 1.3.4|2021/05/18| 1| Yes| 4.1| 3.3| +| 1.3.3|2021/04/21| 1| Yes| 4.1| 3.3| +| 1.3.2|2021/03/24| 1| Yes| 4.1| 3.3| +| 1.3.1|2021/03/10| 1| Yes| 4.1| 3.3| +| 1.3.0|2021/02/10| 1| Yes| 4.1| 3.3| +| 1.2.5|2020/06/10| 1| Yes| 3.6| 3.3| +| 1.2.4|2020/04/01| 1| Yes| 3.6| 3.3| +| 1.2.3|2020/03/18| 1| Yes| 3.6| 3.3| +| 1.2.2|2020/02/19| 1| Yes| 3.6| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_fragment_fragment.md.html b/docs/checks/androidx_fragment_fragment.md.html new file mode 100644 index 00000000..7943a657 --- /dev/null +++ b/docs/checks/androidx_fragment_fragment.md.html @@ -0,0 +1,113 @@ +(#) androidx.fragment:fragment + +Name +: fragment +Description +: The Support Library is a static library that you can add to your Android +: application in order to use APIs that are either not available for older +: platform versions or utility APIs that aren't a part of the framework +: APIs. Compatible on devices running API 14 or later. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.fragment +Feedback +: https://issuetracker.google.com/issues/new?component=460964 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.fragment:fragment:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| +|[FragmentTagUsage](FragmentTagUsage.md.html) |Use FragmentContainerView instead of the tag | +|[FragmentAddMenuProvider](FragmentAddMenuProvider.md.html) |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance. | +|[FragmentBackPressedCallback](FragmentBackPressedCallback.md.html) |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance. | +|[FragmentLiveDataObserve](FragmentLiveDataObserve.md.html) |Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object. | +|[UseRequireInsteadOfGet](UseRequireInsteadOfGet.md.html) |Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null. | +|[UseGetLayoutInflater](UseGetLayoutInflater.md.html) |Use getLayoutInflater() to get the LayoutInflater instead of calling LayoutInflater.from(Context). | +|[DialogFragmentCallbacksDetector](DialogFragmentCallbacksDetector.md.html)|Use onCancel() and onDismiss() instead of calling setOnCancelListener() and setOnDismissListener() from onCreateDialog()| +|[UnsafeRepeatOnLifecycleDetector](UnsafeRepeatOnLifecycleDetector.md.html)|RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments. | +|[DetachAndAttachSameFragment](DetachAndAttachSameFragment.md.html) |Separate attach() and detach() into separate FragmentTransactions | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.fragment:fragment:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.fragment:fragment:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.fragment) + +# libs.versions.toml +[versions] +fragment = "1.7.0-alpha01" +[libraries] +fragment = { + module = "androidx.fragment:fragment", + version.ref = "fragment" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes FragmentLiveDataObserve, + FragmentTagUsage. +* 1.2.2: Adds FragmentBackPressedCallback, UseRequireInsteadOfGet. +* 1.4.0: Adds DetachAndAttachSameFragment, + DialogFragmentCallbacksDetector, FragmentAddMenuProvider, + UnsafeRepeatOnLifecycleDetector, UseGetLayoutInflater. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.7|2023/04/19| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.6|2023/03/22| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.5|2022/12/07| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.4|2022/10/24| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.3|2022/09/21| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.2|2022/08/10| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.1|2022/07/27| 9| Yes| 7.3 and 7.4| 7.0| +| 1.5.0|2022/06/29| 9| No[^1]| 7.3 and 7.4| 7.0| +| 1.4.1|2022/01/26| 9| No[^1]| 7.1| 7.1| +| 1.4.0|2021/11/17| 9| No[^1]| 7.1| 7.1| +| 1.3.6|2021/07/21| 4| Yes| 4.1| 3.3| +| 1.3.5|2021/06/16| 4| Yes| 4.1| 3.3| +| 1.3.4|2021/05/18| 4| Yes| 4.1| 3.3| +| 1.3.3|2021/04/21| 4| Yes| 4.1| 3.3| +| 1.3.2|2021/03/24| 4| Yes| 4.1| 3.3| +| 1.3.1|2021/03/10| 4| Yes| 4.1| 3.3| +| 1.3.0|2021/02/10| 4| Yes| 4.1| 3.3| +| 1.2.5|2020/06/10| 4| Yes| 3.6| 3.3| +| 1.2.4|2020/04/01| 4| Yes| 3.6| 3.3| +| 1.2.3|2020/03/18| 4| Yes| 3.6| 3.3| +| 1.2.2|2020/02/19| 4| Yes| 3.6| 3.3| +| 1.2.1|2020/02/05| 2| Yes| 3.6| 3.3| +| 1.2.0|2020/01/22| 2| Yes| 3.6| 3.3| + +Compatibility Problems: + +[^1]: org.jetbrains.uast.kotlin.KotlinUClass: org.jetbrains.kotlin.psi.KtClassOrObject getKtClass() is not accessible + + \ No newline at end of file diff --git a/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html new file mode 100644 index 00000000..70565773 --- /dev/null +++ b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html @@ -0,0 +1,76 @@ +(#) androidx.lifecycle:lifecycle-livedata-core-ktx + +Name +: LiveData Core Kotlin Extensions +Description +: Kotlin extensions for 'livedata-core' artifact +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------|----------------------------------------------| +|[NullSafeMutableLiveData](NullSafeMutableLiveData.md.html)|LiveData value assignment nullability mismatch| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-livedata-core-ktx) + +# libs.versions.toml +[versions] +lifecycle-livedata-core-ktx = "2.6.1" +[libraries] +lifecycle-livedata-core-ktx = { + module = "androidx.lifecycle:lifecycle-livedata-core-ktx", + version.ref = "lifecycle-livedata-core-ktx" +} +``` + +2.6.1 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.3.0: First version includes NullSafeMutableLiveData. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.6.1|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 2.6.0|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| +| 2.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 2.5.0|2022/06/29| 1| Yes| 7.3 and 7.4| 7.0| +| 2.4.1|2022/02/09| 1| Yes| 7.1| 4.1| +| 2.4.0|2021/10/27| 1| Yes| 7.1| 4.1| +| 2.3.1|2021/03/24| 1| Yes| 4.1| 3.3| +| 2.3.0|2021/02/10| 1| Yes| 4.1| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html new file mode 100644 index 00000000..e7e6497c --- /dev/null +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html @@ -0,0 +1,79 @@ +(#) androidx.lifecycle:lifecycle-runtime-ktx + +Name +: Android Lifecycle Kotlin Extensions +Description +: Kotlin extensions for 'lifecycle' artifact +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.lifecycle:lifecycle-runtime-ktx:2.6.1 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------|-------------------------------------------------------------------------------| +|[UnsafeLifecycleWhenUsage](UnsafeLifecycleWhenUsage.md.html) |Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method| +|[RepeatOnLifecycleWrongUsage](RepeatOnLifecycleWrongUsage.md.html)|Wrong usage of repeatOnLifecycle. | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-ktx) + +# libs.versions.toml +[versions] +lifecycle-runtime-ktx = "2.6.1" +[libraries] +lifecycle-runtime-ktx = { + module = "androidx.lifecycle:lifecycle-runtime-ktx", + version.ref = "lifecycle-runtime-ktx" +} +``` + +2.6.1 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.2.0: First version includes UnsafeLifecycleWhenUsage. +* 2.4.0: Adds RepeatOnLifecycleWrongUsage. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.6.1|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| +| 2.6.0|2023/03/08| 2| Yes| 8.0 and 8.1| 7.0| +| 2.5.1|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| +| 2.5.0|2022/06/29| 2| Yes| 7.3 and 7.4| 7.0| +| 2.4.1|2022/02/09| 2| Yes| 7.1| 4.1| +| 2.4.0|2021/10/27| 2| Yes| 7.1| 4.1| +| 2.3.1|2021/03/24| 1| Yes| 4.1| 3.3| +| 2.3.0|2021/02/10| 1| Yes| 4.1| 3.3| +| 2.2.0|2020/01/22| 1| Yes| 3.6| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-common.md.html b/docs/checks/androidx_navigation_navigation-common.md.html new file mode 100644 index 00000000..4aeed813 --- /dev/null +++ b/docs/checks/androidx_navigation_navigation-common.md.html @@ -0,0 +1,71 @@ +(#) androidx.navigation:navigation-common + +Name +: Navigation Common +Description +: Android Navigation-Common +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.navigation.common +Feedback +: https://issuetracker.google.com/issues/new?component=409828 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.navigation:navigation-common:2.7.0-beta01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------|--------------------------------------------------------------------| +|[EmptyNavDeepLink](EmptyNavDeepLink.md.html)|NavDeepLink must define an uri, action, and/or mimetype to be valid.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-common:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-common:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-common) + +# libs.versions.toml +[versions] +navigation-common = "2.7.0-beta01" +[libraries] +navigation-common = { + module = "androidx.navigation:navigation-common", + version.ref = "navigation-common" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.6.0: First version includes EmptyNavDeepLink. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.7.0-beta01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0-alpha01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-compose.md.html b/docs/checks/androidx_navigation_navigation-compose.md.html new file mode 100644 index 00000000..6eb081f6 --- /dev/null +++ b/docs/checks/androidx_navigation_navigation-compose.md.html @@ -0,0 +1,79 @@ +(#) androidx.navigation:navigation-compose + +Name +: Compose Navigation +Description +: Compose integration with Navigation +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Navigation Compose +Identifier +: androidx.navigation.compose +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.navigation:navigation-compose:2.7.0-beta01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| +|[ComposableDestinationInComposeScope](ComposableDestinationInComposeScope.md.html)|Building composable destination in compose scope | +|[ComposableNavGraphInComposeScope](ComposableNavGraphInComposeScope.md.html) |Building navigation graph in compose scope | +|[UnrememberedGetBackStackEntry](UnrememberedGetBackStackEntry.md.html) |Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-compose:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-compose) + +# libs.versions.toml +[versions] +navigation-compose = "2.7.0-beta01" +[libraries] +navigation-compose = { + module = "androidx.navigation:navigation-compose", + version.ref = "navigation-compose" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.4.0: First version includes ComposableDestinationInComposeScope, + ComposableNavGraphInComposeScope, UnrememberedGetBackStackEntry. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.7.0-beta01|2023/06/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0-alpha01|2023/05/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.6.0|2023/06/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.5.3|2022/10/24| 3| Yes| 7.3 and 7.4| 7.0| +| 2.5.2|2022/09/07| 3| Yes| 7.3 and 7.4| 7.0| +| 2.5.1|2022/07/27| 3| Yes| 7.3 and 7.4| 7.0| +| 2.5.0|2022/06/29| 3| Yes| 7.3 and 7.4| 7.0| +| 2.4.2|2022/04/06| 3| Yes| 7.1| 7.0| +| 2.4.1|2022/02/09| 3| Yes| 7.1| 7.0| +| 2.4.0|2022/01/26| 3| Yes| 7.1| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-runtime.md.html b/docs/checks/androidx_navigation_navigation-runtime.md.html new file mode 100644 index 00000000..4eedd536 --- /dev/null +++ b/docs/checks/androidx_navigation_navigation-runtime.md.html @@ -0,0 +1,75 @@ +(#) androidx.navigation:navigation-runtime + +Name +: Navigation Runtime +Description +: Android Navigation-Runtime +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.navigation.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=409828 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.navigation:navigation-runtime:2.7.0-beta01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------|----------------------------------------------------------------| +|[DeepLinkInActivityDestination](DeepLinkInActivityDestination.md.html)|A should not be attached to an destination| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.navigation:navigation-runtime:2.7.0-beta01") + +// build.gradle +implementation 'androidx.navigation:navigation-runtime:2.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.navigation-runtime) + +# libs.versions.toml +[versions] +navigation-runtime = "2.7.0-beta01" +[libraries] +navigation-runtime = { + module = "androidx.navigation:navigation-runtime", + version.ref = "navigation-runtime" +} +``` + +2.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.5.0: First version includes DeepLinkInActivityDestination. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.7.0-beta01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0-alpha01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.5.3|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| +| 2.5.2|2022/09/07| 1| Yes| 7.3 and 7.4| 7.0| +| 2.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| +| 2.5.0|2022/06/29| 1| Yes| 7.3 and 7.4| 7.0| + + \ No newline at end of file diff --git a/docs/checks/androidx_recyclerview_recyclerview.md.html b/docs/checks/androidx_recyclerview_recyclerview.md.html new file mode 100644 index 00000000..05eb6757 --- /dev/null +++ b/docs/checks/androidx_recyclerview_recyclerview.md.html @@ -0,0 +1,73 @@ +(#) androidx.recyclerview:recyclerview + +Name +: Android Support RecyclerView +Description +: Android Support RecyclerView +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.recyclerview +Feedback +: https://issuetracker.google.com/issues/new?component=460887 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: androidx.recyclerview:recyclerview:1.3.1-rc01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------| +|[InvalidSetHasFixedSize](InvalidSetHasFixedSize.md.html)|When using `setHasFixedSize() in an `RecyclerView`, `wrap_content` cannot be used as \ +a value for `size` in the scrolling direction.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.recyclerview:recyclerview:1.3.1-rc01") + +// build.gradle +implementation 'androidx.recyclerview:recyclerview:1.3.1-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.recyclerview) + +# libs.versions.toml +[versions] +recyclerview = "1.3.1-rc01" +[libraries] +recyclerview = { + module = "androidx.recyclerview:recyclerview", + version.ref = "recyclerview" +} +``` + +1.3.1-rc01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0: First version includes InvalidSetHasFixedSize. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.3.1-rc01|2023/05/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.0|2023/03/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.2.1|2021/06/02| 1| Yes| 4.1| 3.3| +| 1.2.0|2021/04/07| 1| Yes| 4.1| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_startup_startup-runtime.md.html b/docs/checks/androidx_startup_startup-runtime.md.html new file mode 100644 index 00000000..ed974930 --- /dev/null +++ b/docs/checks/androidx_startup_startup-runtime.md.html @@ -0,0 +1,75 @@ +(#) androidx.startup:startup-runtime + +Name +: Android App Startup Runtime +Description +: Android App Startup Runtime +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.startup +Feedback +: https://issuetracker.google.com/issues/new?component=823348 +Min +: Lint 7.0 +Compiled +: Lint 7.3 and 7.4 +Artifact +: androidx.startup:startup-runtime:1.2.0-alpha02 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------| +|[EnsureInitializerNoArgConstr](EnsureInitializerNoArgConstr.md.html)|Missing Initializer no-arg constructor | +|[EnsureInitializerMetadata](EnsureInitializerMetadata.md.html) |Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.startup:startup-runtime:1.2.0-alpha02") + +// build.gradle +implementation 'androidx.startup:startup-runtime:1.2.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.startup-runtime) + +# libs.versions.toml +[versions] +startup-runtime = "1.2.0-alpha02" +[libraries] +startup-runtime = { + module = "androidx.startup:startup-runtime", + version.ref = "startup-runtime" +} +``` + +1.2.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes EnsureInitializerMetadata, + EnsureInitializerNoArgConstr. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.2.0-alpha02|2023/01/11| 2| Yes| 7.3 and 7.4| 7.0| +| 1.2.0-alpha01|2022/02/09| 2| Yes| 7.1| 7.0| +| 1.1.1|2022/02/09| 2| Yes| 7.1| 7.0| +| 1.1.0|2021/08/04| 2| Yes| 7.0| 4.1| +| 1.0.0|2020/10/28| 2| Yes| 4.1| 3.3| + + \ No newline at end of file diff --git a/docs/checks/androidx_work_work-runtime.md.html b/docs/checks/androidx_work_work-runtime.md.html new file mode 100644 index 00000000..da7ec829 --- /dev/null +++ b/docs/checks/androidx_work_work-runtime.md.html @@ -0,0 +1,95 @@ +(#) androidx.work:work-runtime + +Name +: WorkManager Runtime +Description +: Android WorkManager runtime library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.work +Feedback +: https://issuetracker.google.com/issues/new?component=409906 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.work:work-runtime:2.9.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| +|[BadConfigurationProvider](BadConfigurationProvider.md.html) |Invalid WorkManager Configuration Provider | +|[IdleBatteryChargingConstraints](IdleBatteryChargingConstraints.md.html) |Constraints may not be met for some devices | +|[InvalidPeriodicWorkRequestInterval](InvalidPeriodicWorkRequestInterval.md.html)|Invalid interval duration | +|[BadPeriodicWorkRequestEnqueue](BadPeriodicWorkRequestEnqueue.md.html) |Use `enqueueUniquePeriodicWork()` instead of `enqueue()` | +|[RemoveWorkManagerInitializer](RemoveWorkManagerInitializer.md.html) |Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.| +|[UseRxSetProgress2](UseRxSetProgress2.md.html) |`setProgress` is deprecated. Use `setCompletableProgress` instead. | +|[SpecifyForegroundServiceType](SpecifyForegroundServiceType.md.html) |Specify foreground service type | +|[SpecifyJobSchedulerIdRange](SpecifyJobSchedulerIdRange.md.html) |Specify a range of JobScheduler ids | +|[WorkerHasAPublicModifier](WorkerHasAPublicModifier.md.html) |ListenableWorkers constructed using the default WorkerFactories need to be public | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.work:work-runtime:2.9.0-alpha01") + +// build.gradle +implementation 'androidx.work:work-runtime:2.9.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.work-runtime) + +# libs.versions.toml +[versions] +work-runtime = "2.9.0-alpha01" +[libraries] +work-runtime = { + module = "androidx.work:work-runtime", + version.ref = "work-runtime" +} +``` + +2.9.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.3.0: First version includes BadConfigurationProvider, + BadPeriodicWorkRequestEnqueue, RemoveWorkManagerInitializer. +* 2.3.1: Adds SpecifyForegroundServiceType. +* 2.3.4: Adds InvalidPeriodicWorkRequestInterval, + SpecifyJobSchedulerIdRange. +* 2.4.0: Adds IdleBatteryChargingConstraints, UseRxSetProgress2, + WorkerHasAPublicModifier. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.9.0-alpha01|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.1|2023/03/22| 9| Yes| 7.3 and 7.4| 7.0| +| 2.8.0|2023/02/08| 9| Yes| 7.3 and 7.4| 7.0| +| 2.7.1|2021/11/17| 9| Yes| 7.1| 4.1| +| 2.7.0|2021/10/13| 9| Yes| 7.1| 4.1| +| 2.6.0|2021/09/01| 9| Yes| 7.0| 4.1| +| 2.5.0|2021/01/27| 9| Yes| 4.1| 3.3| +| 2.4.0|2020/07/22| 9| Yes| 3.3| 3.3| +| 2.3.4|2020/03/18| 6| Yes| 3.3| 3.3| +| 2.3.3|2020/03/04| 4| Yes| Not specified| 3.3| +| 2.3.2|2020/02/19| 4| Yes| Not specified| 3.3| +| 2.3.1|2020/02/05| 4| Yes| Not specified| 3.3| +| 2.3.0|2020/01/22| 3| Yes| Not specified| 3.3| + + \ No newline at end of file diff --git a/docs/checks/categories.md.html b/docs/checks/categories.md.html index 88d2f99b..76dd1adf 100644 --- a/docs/checks/categories.md.html +++ b/docs/checks/categories.md.html @@ -1,13 +1,14 @@ (#) Lint Issue Index -Order: [Alphabetical](index.md.html) | By category | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) +Order: [Alphabetical](index.md.html) | By category | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Correctness (312) +* Correctness (463) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) + - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) - [AndroidGradlePluginVersion: Obsolete Android Gradle Plugin Version](AndroidGradlePluginVersion.md.html) - [AnnotateVersionCheck: Annotate SDK_INT checks](AnnotateVersionCheck.md.html) - [AppBundleLocaleChanges: App Bundle handling of runtime locale changes](AppBundleLocaleChanges.md.html) @@ -17,15 +18,20 @@ - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) + - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) + - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) + - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) + - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) + - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) - [CommitPrefEdits: Missing `commit()` on `SharedPreference` editor](CommitPrefEdits.md.html) - [CommitTransaction: Missing `commit()` calls](CommitTransaction.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) @@ -34,8 +40,13 @@ - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) + - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) + - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) @@ -44,40 +55,64 @@ - [DataBindingWithoutKapt: Data Binding without Annotation Processing](DataBindingWithoutKapt.md.html) - [DeepLinkInActivityDestination: A should not be attached to an destination](DeepLinkInActivityDestination.md.html) - [DefaultEncoding: Using Default Character Encoding](DefaultEncoding.md.html) + - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) + - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) - [Deprecated: Using deprecated resources](Deprecated.md.html) + - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) + - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) - [DetachAndAttachSameFragment: Separate attach() and detach() into separate FragmentTransactions](DetachAndAttachSameFragment.md.html) - [DeviceAdmin: Malformed Device Admin](DeviceAdmin.md.html) - [DialogFragmentCallbacksDetector: Use onCancel() and onDismiss() instead of calling setOnCancelListener() and setOnDismissListener() from onCreateDialog()](DialogFragmentCallbacksDetector.md.html) - [DiffUtilEquals: Suspicious DiffUtil Equality](DiffUtilEquals.md.html) - [DiscouragedApi: Using discouraged APIs](DiscouragedApi.md.html) - [DiscouragedPrivateApi: Using Discouraged Private API](DiscouragedPrivateApi.md.html) + - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) + - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) + - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) + - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) + - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) + - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DuplicateActivity: Activity registered more than once](DuplicateActivity.md.html) - [DuplicateDefinition: Duplicate definitions of resources](DuplicateDefinition.md.html) - [DuplicateIds: Duplicate ids within a single layout](DuplicateIds.md.html) - [DuplicateIncludedIds: Duplicate ids across layouts combined with include tags](DuplicateIncludedIds.md.html) - [DuplicatePlatformClasses: Duplicate Platform Classes](DuplicatePlatformClasses.md.html) - [DuplicateUsesFeature: Feature declared more than once](DuplicateUsesFeature.md.html) + - [EditedTargetSdkVersion: Manually Edited TargetSdkVersion](EditedTargetSdkVersion.md.html) - [EllipsizeMaxLines: Combining Ellipsize and Maxlines](EllipsizeMaxLines.md.html) - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) - [EmptySuperCall: Calling an empty super method](EmptySuperCall.md.html) - [EnqueueWork: WorkManager Enqueue](EnqueueWork.md.html) - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) + - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) + - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) + - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) + - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) - [FileEndsWithExt: File endsWith on file extensions](FileEndsWithExt.md.html) - [FindViewByIdCast: Add Explicit Cast](FindViewByIdCast.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) - [FontValidation: Validation of font files](FontValidation.md.html) + - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) + - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) + - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) - [FragmentAddMenuProvider: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentAddMenuProvider.md.html) - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) + - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) + - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [FullBackupContent: Valid Full Backup Content File](FullBackupContent.md.html) + - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) - [GestureBackNavigation: Usage of KeyEvent.KEYCODE_BACK](GestureBackNavigation.md.html) - [GetLocales: Locale crash](GetLocales.md.html) - [GradleCompatible: Incompatible Gradle Versions](GradleCompatible.md.html) @@ -91,19 +126,30 @@ - [GradlePath: Gradle Path Issues](GradlePath.md.html) - [GradlePluginVersion: Incompatible Android Gradle Plugin](GradlePluginVersion.md.html) - [GridLayout: GridLayout validation](GridLayout.md.html) + - [GuavaChecksUsed: Use Slack's JavaPreconditions instead of Guava's Preconditions checks](GuavaChecksUsed.md.html) + - [GuavaPreconditionsUsedInKotlin: Kotlin precondition checks should use the Kotlin standard library checks](GuavaPreconditionsUsedInKotlin.md.html) - [HalfFloat: Incorrect Half Float](HalfFloat.md.html) - [HighAppVersionCode: VersionCode too high](HighAppVersionCode.md.html) - [HighSamplingRate: High sensor sampling rate](HighSamplingRate.md.html) - [IdleBatteryChargingConstraints: Constraints may not be met for some devices](IdleBatteryChargingConstraints.md.html) - [IllegalResourceRef: Name and version must be integer or string, not resource](IllegalResourceRef.md.html) - [ImplicitSamInstance: Implicit SAM Instances](ImplicitSamInstance.md.html) + - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) + - [IncorrectChainMarginsUsage: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain.](IncorrectChainMarginsUsage.md.html) + - [IncorrectMatchParentUsage: Prefer using `Dimension.percent(1f)` when defining custom constraints.](IncorrectMatchParentUsage.md.html) + - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) + - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) + - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) + - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) - [InnerclassSeparator: Inner classes should use `$` rather than `.`](InnerclassSeparator.md.html) - [InstantApps: Instant App Issues](InstantApps.md.html) @@ -111,25 +157,34 @@ - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) + - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) - [InvalidId: Invalid ID declaration](InvalidId.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) + - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) - [InvalidResourceFolder: Invalid Resource Folder](InvalidResourceFolder.md.html) - [InvalidSetHasFixedSize: When using `setHasFixedSize() in an `RecyclerView`, `wrap_content` cannot be used as \ a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) + - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) + - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) - [InvalidWearFeatureAttribute: Invalid attribute for Wear uses-feature](InvalidWearFeatureAttribute.md.html) + - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) - [JobSchedulerService: JobScheduler problems](JobSchedulerService.md.html) + - [JvmStaticProvidesInObjectDetector: @JvmStatic used for @Provides function in an object class](JvmStaticProvidesInObjectDetector.md.html) - [KotlinNullnessAnnotation: Kotlin nullability annotation](KotlinNullnessAnnotation.md.html) + - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) + - [KotlinRequireNotNullUseMessage: Marks usage of the requireNotNull method without lazy messages.](KotlinRequireNotNullUseMessage.md.html) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) + - [LayoutFileNameMatchesClass: Checks that the layout file matches the class name.](LayoutFileNameMatchesClass.md.html) - [LeanbackUsesWifi: Using android.hardware.wifi on TV](LeanbackUsesWifi.md.html) - [LibraryCustomView: Custom views in libraries should use res-auto-namespace](LibraryCustomView.md.html) - [LocalSuppress: @SuppressLint on invalid element](LocalSuppress.md.html) @@ -137,10 +192,13 @@ - [LockedOrientationActivity: Incompatible screenOrientation value](LockedOrientationActivity.md.html) - [LogTagMismatch: Mismatched Log Tags](LogTagMismatch.md.html) - [LongLogTag: Too Long Log Tags](LongLogTag.md.html) + - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) - [MangledCRLF: Mangled file line endings](MangledCRLF.md.html) - [ManifestOrder: Incorrect order of elements in manifest](ManifestOrder.md.html) - [ManifestResource: Manifest Resource References](ManifestResource.md.html) - [ManifestTypo: Typos in manifest tags](ManifestTypo.md.html) + - [MatchingMenuId: Flags menu ids that don't match with the file name.](MatchingMenuId.md.html) + - [MatchingViewId: Flags view ids that don't match with the file name.](MatchingViewId.md.html) - [MergeMarker: Code contains merge marker](MergeMarker.md.html) - [MinSdkTooLow: API Version Too Low](MinSdkTooLow.md.html) - [MissingBackupPin: Missing Backup Pin](MissingBackupPin.md.html) @@ -158,26 +216,77 @@ - [MissingOnPlayFromSearch: Missing `onPlayFromSearch`](MissingOnPlayFromSearch.md.html) - [MissingPermission: Missing Permissions](MissingPermission.md.html) - [MissingPrefix: Missing Android XML namespace](MissingPrefix.md.html) + - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) + - [MissingScrollbars: Scroll views should declare a scrollbar.](MissingScrollbars.md.html) - [MissingSuperCall: Missing Super Call](MissingSuperCall.md.html) - [MissingTvBanner: TV Missing Banner](MissingTvBanner.md.html) - [MissingVersion: Missing application name/version](MissingVersion.md.html) + - [MissingXmlHeader: Flags xml files that don't have a header.](MissingXmlHeader.md.html) - [MockLocation: Using mock location provider in production](MockLocation.md.html) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) + - [ModuleCompanionObjects: Module companion objects should not be annotated with @Module.](ModuleCompanionObjects.md.html) + - [ModuleCompanionObjectsNotInModuleParent: Companion objects should not be annotated with @Module.](ModuleCompanionObjectsNotInModuleParent.md.html) + - [MoshiUsageAdaptedByRequiresAdapter: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory.](MoshiUsageAdaptedByRequiresAdapter.md.html) + - [MoshiUsageAdaptedByRequiresKeep: Adapters targeted by @AdaptedBy must have @Keep.](MoshiUsageAdaptedByRequiresKeep.md.html) + - [MoshiUsageArray: Prefer List over Array.](MoshiUsageArray.md.html) + - [MoshiUsageBlankGenerator: Don't use blank JsonClass.generator values.](MoshiUsageBlankGenerator.md.html) + - [MoshiUsageBlankJsonName: Don't use blank names in `@Json`.](MoshiUsageBlankJsonName.md.html) + - [MoshiUsageBlankTypeLabel: Moshi-sealed requires a type label specified after the 'sealed:' prefix.](MoshiUsageBlankTypeLabel.md.html) + - [MoshiUsageClassVisibility: @JsonClass-annotated types must be public, package-private, or internal.](MoshiUsageClassVisibility.md.html) + - [MoshiUsageDoubleClassAnnotation: Only use one of @AdaptedBy or @JsonClass.](MoshiUsageDoubleClassAnnotation.md.html) + - [MoshiUsageDoubleTypeLabel: Only use one of @TypeLabel or @DefaultObject.](MoshiUsageDoubleTypeLabel.md.html) + - [MoshiUsageDuplicateJsonName: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects.](MoshiUsageDuplicateJsonName.md.html) + - [MoshiUsageEnumAnnotatedUnknown: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json](MoshiUsageEnumAnnotatedUnknown.md.html) + - [MoshiUsageEnumCasing: Consider using `@Json(name = ...)` rather than lower casing.](MoshiUsageEnumCasing.md.html) + - [MoshiUsageEnumJsonClassGenerated: Enums annotated with @JsonClass must not set `generateAdapter` to true.](MoshiUsageEnumJsonClassGenerated.md.html) + - [MoshiUsageEnumMissingJsonClass: Enums serialized with Moshi should be annotated with @JsonClass.](MoshiUsageEnumMissingJsonClass.md.html) + - [MoshiUsageEnumMissingUnknown: Enums serialized with Moshi must reserve the first member as UNKNOWN.](MoshiUsageEnumMissingUnknown.md.html) + - [MoshiUsageEnumPropertyCouldBeMoshi: Consider making enum properties also use Moshi.](MoshiUsageEnumPropertyCouldBeMoshi.md.html) + - [MoshiUsageEnumPropertyDefaultUnknown: Suspicious default value to 'UNKNOWN' for a Moshi enum.](MoshiUsageEnumPropertyDefaultUnknown.md.html) + - [MoshiUsageGenerateAdapterShouldBeTrue: JsonClass.generateAdapter must be true in order for Moshi code gen to run.](MoshiUsageGenerateAdapterShouldBeTrue.md.html) + - [MoshiUsageGenericSealedSubtype: Sealed subtypes used with moshi-sealed cannot be generic.](MoshiUsageGenericSealedSubtype.md.html) + - [MoshiUsageInappropriateTypeLabel: Inappropriate @TypeLabel or @DefaultObject annotation.](MoshiUsageInappropriateTypeLabel.md.html) + - [MoshiUsageMissingPrimary: @JsonClass-annotated types must have a primary constructor or be sealed.](MoshiUsageMissingPrimary.md.html) + - [MoshiUsageMissingTypeLabel: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject.](MoshiUsageMissingTypeLabel.md.html) + - [MoshiUsageMutableCollections: Use immutable collections rather than mutable versions.](MoshiUsageMutableCollections.md.html) + - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) + - [MoshiUsageNonMoshiClassExternal: External type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassExternal.md.html) + - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) + - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) + - [MoshiUsageNonMoshiClassPlatform: Platform type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassPlatform.md.html) + - [MoshiUsageObject: Object types cannot be annotated with @JsonClass.](MoshiUsageObject.md.html) + - [MoshiUsageParamNeedsInit: Constructor non-property parameters in Moshi classes must have default values.](MoshiUsageParamNeedsInit.md.html) + - [MoshiUsagePrivateConstructor: Constructors in Moshi classes cannot be private.](MoshiUsagePrivateConstructor.md.html) + - [MoshiUsagePrivateConstructorProperty: Constructor parameter properties in Moshi classes cannot be private.](MoshiUsagePrivateConstructorProperty.md.html) + - [MoshiUsageQualifierRetention: JsonQualifiers must have RUNTIME retention.](MoshiUsageQualifierRetention.md.html) + - [MoshiUsageQualifierTarget: JsonQualifiers must include FIELD targeting.](MoshiUsageQualifierTarget.md.html) + - [MoshiUsageRedundantJsonName: Json.name with the same value as the property/enum member name is redundant.](MoshiUsageRedundantJsonName.md.html) + - [MoshiUsageRedundantSiteTarget: Use of site-targets on @Json are redundant.](MoshiUsageRedundantSiteTarget.md.html) + - [MoshiUsageSealedMustBeSealed: Moshi-sealed can only be applied to 'sealed' types.](MoshiUsageSealedMustBeSealed.md.html) + - [MoshiUsageSerializedName: Use Moshi's @Json rather than Gson's @SerializedName.](MoshiUsageSerializedName.md.html) + - [MoshiUsageSnakeCase: Consider using `@Json(name = ...)` rather than direct snake casing.](MoshiUsageSnakeCase.md.html) + - [MoshiUsageTransientNeedsInit: Transient constructor properties must have default values.](MoshiUsageTransientNeedsInit.md.html) + - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) + - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) + - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) + - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) + - [NamingPattern: Names should be well named.](NamingPattern.md.html) - [NestedScrolling: Nested scrolling widgets](NestedScrolling.md.html) - [NetworkSecurityConfig: Valid Network Security Config File](NetworkSecurityConfig.md.html) - [NewApi: Calling new methods on older versions](NewApi.md.html) - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) + - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) @@ -189,12 +298,13 @@ - [ObjectAnimatorBinding: Incorrect ObjectAnimator Property](ObjectAnimatorBinding.md.html) - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) - [OnClick: `onClick` method does not exist](OnClick.md.html) + - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - [OpenForTesting: Extending API only allowed from tests](OpenForTesting.md.html) - [Orientation: Missing explicit orientation](Orientation.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) + - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) @@ -208,7 +318,11 @@ - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) - [Range: Outside Range](Range.md.html) + - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) + - [RawDimen: Flags dimensions that are not defined as resource.](RawDimen.md.html) + - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) + - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) - [Registered: Class is not registered in the manifest](Registered.md.html) @@ -224,37 +338,60 @@ - [ResourceCycle: Cycle in resource definitions](ResourceCycle.md.html) - [ResourceName: Resource with Wrong Prefix](ResourceName.md.html) - [ResourceType: Wrong Resource Type](ResourceType.md.html) + - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RestrictedApi: Restricted API](RestrictedApi.md.html) + - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [ReturnThis: Method must return `this`](ReturnThis.md.html) + - [RxJava2DefaultScheduler: Pass a scheduler instead of relying on the default Scheduler.](RxJava2DefaultScheduler.md.html) + - [RxJava2DisposableAddAllCall: Marks usage of addAll() on CompositeDisposable.](RxJava2DisposableAddAllCall.md.html) + - [RxJava2DisposableDisposeCall: Marks usage of dispose() on CompositeDisposable.](RxJava2DisposableDisposeCall.md.html) + - [RxJava2MethodMissingCheckReturnValue: Method is missing the @CheckReturnValue annotation.](RxJava2MethodMissingCheckReturnValue.md.html) + - [RxJava2MissingCompositeDisposableClear: Marks CompositeDisposables that are not being cleared.](RxJava2MissingCompositeDisposableClear.md.html) + - [RxJava2SchedulersFactoryCall: Instead of calling the Schedulers factory methods directly inject the Schedulers.](RxJava2SchedulersFactoryCall.md.html) + - [RxJava2SubscribeMissingOnError: Flags a version of the subscribe() method without an error Consumer.](RxJava2SubscribeMissingOnError.md.html) - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) + - [ScheduleExactAlarm: Scheduling Exact Alarms Without Required Permission](ScheduleExactAlarm.md.html) - [ScopedStorage: Affected by scoped storage](ScopedStorage.md.html) - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) + - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) + - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [ShiftFlags: Dangerous Flag Constant Declaration](ShiftFlags.md.html) - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) + - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - [Slices: Slices](Slices.md.html) - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) - [SourceLockedOrientationActivity: Incompatible setRequestedOrientation value](SourceLockedOrientationActivity.md.html) - [SpUsage: Using `dp` instead of `sp` for text sizes](SpUsage.md.html) + - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - [SpecifyJobSchedulerIdRange: Specify a range of JobScheduler ids](SpecifyJobSchedulerIdRange.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) + - [StringNotCapitalized: Marks strings which are not capitalized.](StringNotCapitalized.md.html) - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) + - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) + - [SuperfluousMarginDeclaration: Flags margin declarations that can be simplified.](SuperfluousMarginDeclaration.md.html) + - [SuperfluousNameSpace: Flags namespaces that are already declared.](SuperfluousNameSpace.md.html) + - [SuperfluousPaddingDeclaration: Flags padding declarations that can be simplified.](SuperfluousPaddingDeclaration.md.html) - [SupportAnnotationUsage: Incorrect support annotation usage](SupportAnnotationUsage.md.html) - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) + - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - [TestAppLink: Unmatched URLs](TestAppLink.md.html) - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) + - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) + - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) + - [Todo: Marks todos in any given file.](Todo.md.html) - [TranslucentOrientation: Mixing screenOrientation and translucency](TranslucentOrientation.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) @@ -269,12 +406,16 @@ - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) + - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) - [UnsupportedChromeOsCameraSystemFeature: Looking for Rear Camera only feature](UnsupportedChromeOsCameraSystemFeature.md.html) + - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) + - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) + - [UnusedMergeAttributes: Flags android and app attributes that are used on a attribute for custom Views.](UnusedMergeAttributes.md.html) - [UnusedTransitionTargetStateParameter: Transition.animate* calls should use the provided targetState when defining values](UnusedTransitionTargetStateParameter.md.html) - [UseAlpha2: Using 3-letter Codes](UseAlpha2.md.html) - [UseAndroidAlpha: `android:alpha` attribute missing on `ColorStateList`](UseAndroidAlpha.md.html) @@ -289,7 +430,6 @@ - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) - [UseSwitchCompatOrMaterialXml: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialXml.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) @@ -308,39 +448,61 @@ - [WifiManagerLeak: WifiManager Leak](WifiManagerLeak.md.html) - [WifiManagerPotentialLeak: WifiManager Potential Leak](WifiManagerPotentialLeak.md.html) - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) + - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) + - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) + - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) + - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) + - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) + - [WrongMenuIdFormat: Flag menu ids that are not in lowerCamelCase Format.](WrongMenuIdFormat.md.html) - [WrongRegion: Suspicious Language/Region Combination](WrongRegion.md.html) + - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) + - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) + - [WrongTestMethodName: Flags test methods that start with test.](WrongTestMethodName.md.html) - [WrongThread: Wrong Thread](WrongThread.md.html) - [WrongThreadInterprocedural: Wrong Thread (Interprocedural)](WrongThreadInterprocedural.md.html) - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) + - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) + - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) -* Correctness: Messages (13) +* Correctness: Messages (22) + - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) - [ExtraTranslation: Extra translation](ExtraTranslation.md.html) - [ImpliedQuantity: Implied Quantities](ImpliedQuantity.md.html) + - [LogNotTimber: Logging call to Log instead of Timber](LogNotTimber.md.html) - [MissingQuantity: Missing quantity translation](MissingQuantity.md.html) - [MissingTranslation: Incomplete translation](MissingTranslation.md.html) - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) + - [ResourcesGetColorCall: Marks usage of deprecated getColor() on Resources.](ResourcesGetColorCall.md.html) + - [ResourcesGetColorStateListCall: Marks usage of deprecated getColorStateList() on Resources.](ResourcesGetColorStateListCall.md.html) + - [ResourcesGetDrawableCall: Marks usage of deprecated getDrawable() on Resources.](ResourcesGetDrawableCall.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [StringFormatCount: Formatting argument types incomplete or inconsistent](StringFormatCount.md.html) + - [StringFormatInTimber: Logging call with Timber contains String#format()](StringFormatInTimber.md.html) - [StringFormatInvalid: Invalid format string](StringFormatInvalid.md.html) - [StringFormatMatches: `String.format` string doesn't match the XML format string](StringFormatMatches.md.html) + - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) + - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) + - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) - [Typos: Spelling error](Typos.md.html) - [Untranslatable: Translated Untranslatable](Untranslatable.md.html) - [UnusedQuantity: Unused quantity translations](UnusedQuantity.md.html) - [UnusedTranslation: Unused Translation](UnusedTranslation.md.html) -* Correctness: Chrome OS (2) +* Correctness: Chrome OS (4) + - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) + - [ChromeOsOnConfigurationChanged: Poor performance with APIs inside `onConfigurationChanged()`](ChromeOsOnConfigurationChanged.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) -* Security (54) +* Security (57) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) @@ -348,6 +510,7 @@ - [AuthLeak: Code might contain an auth leak](AuthLeak.md.html) - [BadHostnameVerifier: Insecure HostnameVerifier](BadHostnameVerifier.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) + - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [CustomX509TrustManager: Implements custom TLS trust manager](CustomX509TrustManager.md.html) - [DataExtractionRules: Missing data extraction rules](DataExtractionRules.md.html) @@ -367,9 +530,9 @@ - [InvalidPermission: Invalid Permission Attribute](InvalidPermission.md.html) - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) + - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [ReservedSystemPermission: Permission name is a reserved Android permission](ReservedSystemPermission.md.html) - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) @@ -386,6 +549,8 @@ - [TrustAllX509TrustManager: Insecure TLS/SSL trust manager](TrustAllX509TrustManager.md.html) - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) + - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) + - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - [UnsafeProtectedBroadcastReceiver: Unsafe Protected `BroadcastReceiver`](UnsafeProtectedBroadcastReceiver.md.html) - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) @@ -405,11 +570,13 @@ - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) -* Performance (44) +* Performance (47) - [AnimatorKeep: Missing @Keep for Animated Properties](AnimatorKeep.md.html) - [AnnotationProcessorOnCompilePath: Annotation Processor on Compile Classpath](AnnotationProcessorOnCompilePath.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) + - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [DevModeObsolete: Dev Mode Obsolete](DevModeObsolete.md.html) - [DisableBaselineAlignment: Missing `baselineAligned` attribute](DisableBaselineAlignment.md.html) - [DrawAllocation: Memory allocations within drawing code](DrawAllocation.md.html) @@ -418,6 +585,7 @@ - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) - [HandlerLeak: Handler reference leaks](HandlerLeak.md.html) - [InefficientWeight: Inefficient layout weight](InefficientWeight.md.html) + - [KaptUsageInsteadOfKsp: Kapt usage should be replaced with KSP](KaptUsageInsteadOfKsp.md.html) - [LaunchActivityFromNotification: Notification Launches Services or BroadcastReceivers](LaunchActivityFromNotification.md.html) - [LifecycleAnnotationProcessorWithJava8: Lifecycle Annotation Processor with Java 8 Compile Option](LifecycleAnnotationProcessorWithJava8.md.html) - [LogConditional: Unconditional Logging Calls](LogConditional.md.html) @@ -488,25 +656,45 @@ - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) - [WebpUnsupported: WebP Unsupported](WebpUnsupported.md.html) -* Usability (13) +* Usability (17) - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) - [Autofill: Use Autofill](Autofill.md.html) - [BackButton: Back button](BackButton.md.html) + - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) - [MenuTitle: Missing menu title](MenuTitle.md.html) - [NegativeMargin: Negative Margins](NegativeMargin.md.html) + - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) - [SmallSp: Text size is too small](SmallSp.md.html) - [TextFields: Missing `inputType`](TextFields.md.html) - [ViewConstructor: Missing View constructors for XML inflation](ViewConstructor.md.html) - -* Productivity (1) - + - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + +* Productivity (17) + + - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) + - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) + - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) + - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) + - [ComposeMultipleContentEmitters: Composables should only be emit from one source](ComposeMultipleContentEmitters.md.html) + - [ComposeMutableParameters: Mutable objects in Compose will break state](ComposeMutableParameters.md.html) + - [ComposeNamingLowercase: Value-returning Composables should be lowercase](ComposeNamingLowercase.md.html) + - [ComposeNamingUppercase: Unit Composables should be uppercase](ComposeNamingUppercase.md.html) + - [ComposeParameterOrder: Composable function parameters should be ordered](ComposeParameterOrder.md.html) + - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) + - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) + - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) + - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) + - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) + - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) * Accessibility (5) @@ -516,8 +704,9 @@ - [KeyboardInaccessibleWidget: Keyboard inaccessible widget](KeyboardInaccessibleWidget.md.html) - [LabelFor: Missing accessibility label](LabelFor.md.html) -* Internationalization (7) +* Internationalization (8) + - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [ConstantLocale: Constant Locale](ConstantLocale.md.html) - [EnforceUTF8: Encoding used in resource files is not UTF-8](EnforceUTF8.md.html) @@ -541,16 +730,18 @@ - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) -* Interoperability: Kotlin Interoperability (5) +* Interoperability: Kotlin Interoperability (6) + - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - [UnknownNullness: Unknown nullness](UnknownNullness.md.html) -* Lint Implementation Issues (11) +* Lint Implementation Issues (12) + - [KotlincFE10: Avoid using old K1 Kotlin compiler APIs](KotlincFE10.md.html) - [LintDocExample: Missing Documentation Example](LintDocExample.md.html) - [LintImplBadUrl: Bad More Info Link](LintImplBadUrl.md.html) - [LintImplDollarEscapes: Using Dollar Escapes](LintImplDollarEscapes.md.html) @@ -563,7 +754,7 @@ - [LintImplUseUast: Using Wrong UAST Method](LintImplUseUast.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) -* Withdrawn or Obsolete Issues (14) +* Withdrawn or Obsolete Issues (17) - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) @@ -579,4 +770,7 @@ - [MediaCapabilities](MediaCapabilities.md.html) - [UnpackedNativeCode](UnpackedNativeCode.md.html) - [Assert](Assert.md.html) + - [UsesMinSdkAttributes](UsesMinSdkAttributes.md.html) + - [Override](Override.md.html) + - [PackageManagerGetSignatures](PackageManagerGetSignatures.md.html) \ No newline at end of file diff --git a/docs/checks/com_google_dagger_dagger-lint.md.html b/docs/checks/com_google_dagger_dagger-lint.md.html new file mode 100644 index 00000000..e56d8e9f --- /dev/null +++ b/docs/checks/com_google_dagger_dagger-lint.md.html @@ -0,0 +1,101 @@ +(#) com.google.dagger:dagger-lint + +Name +: Dagger Lint Rules +Description +: A fast dependency injector for Android and Java. +Project +: https://github.com/google/dagger +License +: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Google +Identifier +: com.google.dagger:dagger-lint +Contact +: https://github.com/google/dagger +Feedback +: https://github.com/google/dagger/issues +Min +: Lint 7.1 +Compiled +: Lint 7.1 +Artifact +: com.google.dagger:dagger-lint:2.46.1 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|--------------------------------------------------------------| +|[JvmStaticProvidesInObjectDetector](JvmStaticProvidesInObjectDetector.md.html) |@JvmStatic used for @Provides function in an object class | +|[FieldSiteTargetOnQualifierAnnotation](FieldSiteTargetOnQualifierAnnotation.md.html) |Redundant 'field:' used for Dagger qualifier annotation. | +|[ModuleCompanionObjects](ModuleCompanionObjects.md.html) |Module companion objects should not be annotated with @Module.| +|[ModuleCompanionObjectsNotInModuleParent](ModuleCompanionObjectsNotInModuleParent.md.html)|Companion objects should not be annotated with @Module. | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("com.google.dagger:dagger-lint:2.46.1") + +// build.gradle +implementation 'com.google.dagger:dagger-lint:2.46.1' + +// build.gradle.kts with version catalogs: +implementation(libs.dagger-lint) + +# libs.versions.toml +[versions] +dagger-lint = "2.46.1" +[libraries] +dagger-lint = { + module = "com.google.dagger:dagger-lint", + version.ref = "dagger-lint" +} +``` + +2.46.1 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.38.1: First version includes FieldSiteTargetOnQualifierAnnotation, + JvmStaticProvidesInObjectDetector, ModuleCompanionObjects, + ModuleCompanionObjectsNotInModuleParent. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.46.1|2023/05/12| 4| Yes| 7.1| 7.1| +| 2.46|2023/04/28| 4| Yes| 7.1| 7.1| +| 2.45|2023/02/09| 4| Yes| 7.1| 7.1| +| 2.44.2|2022/11/14| 4| Yes| 7.1| 7.1| +| 2.44.1|2022/11/11| 4| Yes| 7.1| 7.1| +| 2.44|2022/09/21| 4| Yes| 7.1| 7.1| +| 2.43.2|2022/08/03| 4| Yes| 7.1| 7.1| +| 2.43.1|2022/07/29| 4| Yes| 7.1| 7.1| +| 2.43|2022/07/20| 4| Yes| 7.1| 7.1| +| 2.42|2022/05/09| 4| Yes| 7.1| 7.1| +| 2.41|2022/02/16| 4| Yes| 7.1| 7.1| +| 2.40.5|2021/12/06| 4| Yes| 4.1| 3.6| +| 2.40.4|2021/12/02| 4| Yes| 4.1| 3.6| +| 2.40.3|2021/11/29| 4| Yes| 4.1| 3.6| +| 2.40.2|2021/11/24| 4| Yes| 4.1| 3.6| +| 2.40.1|2021/11/11| 4| Yes| 4.1| 3.6| +| 2.40|2021/10/27| 4| Yes| 4.1| 3.6| +| 2.39.1|2021/10/01| 4| No[^1]| 4.1| 3.6| +| 2.39|2021/09/29| 4| No[^1]| 4.1| 3.6| +| 2.38.1|2021/07/27| 4| No[^1]| 4.1| 3.6| + +Compatibility Problems: + +[^1]: org.jetbrains.uast.kotlin.KotlinUClass: org.jetbrains.kotlin.psi.KtClassOrObject getKtClass() is not accessible + + \ No newline at end of file diff --git a/docs/checks/com_jakewharton_timber_timber.md.html b/docs/checks/com_jakewharton_timber_timber.md.html new file mode 100644 index 00000000..57d46c2c --- /dev/null +++ b/docs/checks/com_jakewharton_timber_timber.md.html @@ -0,0 +1,86 @@ +(#) com.jakewharton.timber:timber + +Name +: Timber +Description +: No-nonsense injectable logging. +Project +: https://github.com/JakeWharton/timber +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: JakeWharton/timber +Identifier +: com.jakewharton.timber:timber:{version} +Feedback +: https://github.com/JakeWharton/timber/issues +Min +: Lint 4.0 +Compiled +: Lint 7.0 +Artifact +: com.jakewharton.timber:timber:5.0.1 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------|----------------------------------------------------| +|[LogNotTimber](LogNotTimber.md.html) |Logging call to Log instead of Timber | +|[StringFormatInTimber](StringFormatInTimber.md.html) |Logging call with Timber contains String#format() | +|[ThrowableNotAtBeginning](ThrowableNotAtBeginning.md.html)|Exception in Timber not at the beginning | +|[BinaryOperationInTimber](BinaryOperationInTimber.md.html)|Use String#format() | +|[TimberArgCount](TimberArgCount.md.html) |Formatting argument types incomplete or inconsistent| +|[TimberArgTypes](TimberArgTypes.md.html) |Formatting string doesn't match passed arguments | +|[TimberTagLength](TimberTagLength.md.html) |Too Long Log Tags | +|[TimberExceptionLogging](TimberExceptionLogging.md.html) |Exception Logging | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +implementation("com.jakewharton.timber:timber:5.0.1") + +// build.gradle +implementation 'com.jakewharton.timber:timber:5.0.1' + +// build.gradle.kts with version catalogs: +implementation(libs.timber) + +# libs.versions.toml +[versions] +timber = "5.0.1" +[libraries] +timber = { + module = "com.jakewharton.timber:timber", + version.ref = "timber" +} +``` + +5.0.1 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 4.6.0: First version includes BinaryOperationInTimber, LogNotTimber, + StringFormatInTimber, ThrowableNotAtBeginning, TimberArgCount, + TimberArgTypes, TimberExceptionLogging, TimberTagLength. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 5.0.1|2021/08/13| 8| Yes| 7.0| 4.0| +| 5.0.0|2021/08/10| 8| Yes| 7.0| 4.0| +| 4.7.1|2018/06/28| 8| Yes| 3.1| 3.1| +| 4.7.0|2018/03/27| 8| Yes| 3.1| 3.1| +| 4.6.1|2018/02/12| 8| Yes| Not specified|Not specified| +| 4.6.0|2017/10/30| 8| Yes| Not specified|Not specified| + + \ No newline at end of file diff --git a/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html b/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html new file mode 100644 index 00000000..c639c39e --- /dev/null +++ b/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html @@ -0,0 +1,100 @@ +(#) com.slack.lint.compose:compose-lint-checks + +Name +: Compose Lint Checks +Description +: Compose Lint Checks +Project +: https://github.com/slackhq/compose-lints +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: com.slack.lint.compose:compose-lint-checks:1.2.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------| +|[ComposeNamingUppercase](ComposeNamingUppercase.md.html) |Unit Composables should be uppercase | +|[ComposeNamingLowercase](ComposeNamingLowercase.md.html) |Value-returning Composables should be lowercase | +|[ComposeCompositionLocalUsage](ComposeCompositionLocalUsage.md.html) |CompositionLocals are discouraged | +|[ComposeContentEmitterReturningValues](ComposeContentEmitterReturningValues.md.html)|Composable functions should emit XOR return | +|[ComposeComposableModifier](ComposeComposableModifier.md.html) |Using @Composable builder functions for modifiers is not recommended | +|[ComposeModifierMissing](ComposeModifierMissing.md.html) |Missing modifier parameter | +|[ComposeModifierReused](ComposeModifierReused.md.html) |Modifiers should only be used once | +|[ComposeModifierWithoutDefault](ComposeModifierWithoutDefault.md.html) |Missing Modifier default value | +|[ComposeM2Api](ComposeM2Api.md.html) |Using a Compose M2 API is not recommended | +|[ComposeMultipleContentEmitters](ComposeMultipleContentEmitters.md.html) |Composables should only be emit from one source | +|[ComposeMutableParameters](ComposeMutableParameters.md.html) |Mutable objects in Compose will break state | +|[ComposeParameterOrder](ComposeParameterOrder.md.html) |Composable function parameters should be ordered | +|[ComposePreviewNaming](ComposePreviewNaming.md.html) |Preview annotations require certain suffixes | +|[ComposePreviewPublic](ComposePreviewPublic.md.html) |Preview composables should be private | +|[ComposeRememberMissing](ComposeRememberMissing.md.html) |State values should be remembered | +|[ComposeUnstableCollections](ComposeUnstableCollections.md.html) |Immutable collections should ideally be used in Composables | +|[ComposeViewModelForwarding](ComposeViewModelForwarding.md.html) |Forwarding a ViewModel through multiple @Composable functions should be avoided| +|[ComposeViewModelInjection](ComposeViewModelInjection.md.html) |Implicit dependencies of composables should be made explicit | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.2.0" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.2.0 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.0.0: First version includes ComposeComposableModifier, + ComposeCompositionLocalUsage, ComposeContentEmitterReturningValues, + ComposeModifierMissing, ComposeModifierReused, + ComposeModifierWithoutDefault, ComposeMultipleContentEmitters, + ComposeMutableParameters, ComposeNamingLowercase, + ComposeNamingUppercase, ComposeParameterOrder, ComposePreviewNaming, + ComposePreviewPublic, ComposeRememberMissing, + ComposeUnstableCollections, ComposeViewModelForwarding, + ComposeViewModelInjection. +* 1.1.0: Adds ComposeM2Api. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.2.0|2023/04/19| 18| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.1|2023/03/08| 18| Yes| 7.3 and 7.4|7.3 and 7.4| +| 1.1.0|2023/03/07| 18| Yes| 7.3 and 7.4|7.3 and 7.4| +| 1.0.1|2023/02/15| 17| Yes| 7.3 and 7.4|7.3 and 7.4| +| 1.0.0|2023/02/09| 17| Yes| 7.3 and 7.4|7.3 and 7.4| + + \ No newline at end of file diff --git a/docs/checks/com_slack_lint_slack-lint-checks.md.html b/docs/checks/com_slack_lint_slack-lint-checks.md.html new file mode 100644 index 00000000..821f2bad --- /dev/null +++ b/docs/checks/com_slack_lint_slack-lint-checks.md.html @@ -0,0 +1,210 @@ +(#) com.slack.lint:slack-lint-checks + +Name +: Slack Lint Checks +Description +: Slack lint checks. +Project +: https://github.com/slackhq/slack-lints +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: com.slack.lint:slack-lint-checks:0.3.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| +|[CastingViewContextToActivity](CastingViewContextToActivity.md.html) |Unsafe cast of `Context` to `Activity` | +|[ArgInFormattedQuantityStringRes](ArgInFormattedQuantityStringRes.md.html) |Count value in formatted string resource. | +|[BindsCanBeExtensionFunction](BindsCanBeExtensionFunction.md.html) |@Binds-annotated functions can be extension functions. | +|[KotlinPairNotCreated](KotlinPairNotCreated.md.html) |Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons | +|[DoNotCallProviders](DoNotCallProviders.md.html) |Dagger provider methods should not be called directly by user code. | +|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | +|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | +|[DeprecatedCall](DeprecatedCall.md.html) |This class or method is deprecated; consider using an alternative. | +|[DeprecatedSqlUsage](DeprecatedSqlUsage.md.html) |Use SqlDelight! | +|[JavaOnlyDetector](JavaOnlyDetector.md.html) |Using @JavaOnly elements in Kotlin code. | +|[SerializableUsage](SerializableUsage.md.html) |Don't use Serializable. | +|[RawDispatchersUse](RawDispatchersUse.md.html) |Use SlackDispatchers. | +|[MainScopeUsage](MainScopeUsage.md.html) |Use slack.foundation.coroutines.android.MainScope. | +|[SubscribeOnMain](SubscribeOnMain.md.html) |subscribeOn called with the main thread scheduler. | +|[GuavaChecksUsed](GuavaChecksUsed.md.html) |Use Slack's JavaPreconditions instead of Guava's Preconditions checks | +|[GuavaPreconditionsUsedInKotlin](GuavaPreconditionsUsedInKotlin.md.html) |Kotlin precondition checks should use the Kotlin standard library checks | +|[DoNotMockDataClass](DoNotMockDataClass.md.html) |data classes represent pure data classes, so mocking them should not be necessary. | +|[DoNotMock](DoNotMock.md.html) | | +|[DoNotMockSealedClass](DoNotMockSealedClass.md.html) |sealed classes have a restricted type hierarchy, use a subtype instead | +|[DoNotMockAutoValue](DoNotMockAutoValue.md.html) |AutoValue classes represent pure data classes, so mocking them should not be necessary. | +|[DoNotMockObjectClass](DoNotMockObjectClass.md.html) |object classes are singletons, so mocking them should not be necessary | +|[DoNotMockRecordClass](DoNotMockRecordClass.md.html) |record classes represent pure data classes, so mocking them should not be necessary. | +|[ErrorProneDoNotMockUsage](ErrorProneDoNotMockUsage.md.html) |Use Slack's internal `@DoNotMock` annotation. | +|[MoshiUsageAdaptedByRequiresAdapter](MoshiUsageAdaptedByRequiresAdapter.md.html) |@AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. | +|[MoshiUsageAdaptedByRequiresKeep](MoshiUsageAdaptedByRequiresKeep.md.html) |Adapters targeted by @AdaptedBy must have @Keep. | +|[MoshiUsageArray](MoshiUsageArray.md.html) |Prefer List over Array. | +|[MoshiUsageBlankGenerator](MoshiUsageBlankGenerator.md.html) |Don't use blank JsonClass.generator values. | +|[MoshiUsageBlankJsonName](MoshiUsageBlankJsonName.md.html) |Don't use blank names in `@Json`. | +|[MoshiUsageBlankTypeLabel](MoshiUsageBlankTypeLabel.md.html) |Moshi-sealed requires a type label specified after the 'sealed:' prefix. | +|[MoshiUsageDoubleClassAnnotation](MoshiUsageDoubleClassAnnotation.md.html) |Only use one of @AdaptedBy or @JsonClass. | +|[MoshiUsageDoubleTypeLabel](MoshiUsageDoubleTypeLabel.md.html) |Only use one of @TypeLabel or @DefaultObject. | +|[MoshiUsageDuplicateJsonName](MoshiUsageDuplicateJsonName.md.html) |Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. | +|[MoshiUsageEnumAnnotatedUnknown](MoshiUsageEnumAnnotatedUnknown.md.html) |UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json | +|[MoshiUsageEnumCasing](MoshiUsageEnumCasing.md.html) |Consider using `@Json(name = ...)` rather than lower casing. | +|[MoshiUsageEnumJsonClassGenerated](MoshiUsageEnumJsonClassGenerated.md.html) |Enums annotated with @JsonClass must not set `generateAdapter` to true. | +|[MoshiUsageEnumMissingJsonClass](MoshiUsageEnumMissingJsonClass.md.html) |Enums serialized with Moshi should be annotated with @JsonClass. | +|[MoshiUsageEnumPropertyCouldBeMoshi](MoshiUsageEnumPropertyCouldBeMoshi.md.html) |Consider making enum properties also use Moshi. | +|[MoshiUsageEnumPropertyDefaultUnknown](MoshiUsageEnumPropertyDefaultUnknown.md.html) |Suspicious default value to 'UNKNOWN' for a Moshi enum. | +|[MoshiUsageEnumMissingUnknown](MoshiUsageEnumMissingUnknown.md.html) |Enums serialized with Moshi must reserve the first member as UNKNOWN. | +|[MoshiUsageGenerateAdapterShouldBeTrue](MoshiUsageGenerateAdapterShouldBeTrue.md.html) |JsonClass.generateAdapter must be true in order for Moshi code gen to run. | +|[MoshiUsageGenericSealedSubtype](MoshiUsageGenericSealedSubtype.md.html) |Sealed subtypes used with moshi-sealed cannot be generic. | +|[MoshiUsageInappropriateTypeLabel](MoshiUsageInappropriateTypeLabel.md.html) |Inappropriate @TypeLabel or @DefaultObject annotation. | +|[MoshiUsageRedundantSiteTarget](MoshiUsageRedundantSiteTarget.md.html) |Use of site-targets on @Json are redundant. | +|[MoshiUsageMissingPrimary](MoshiUsageMissingPrimary.md.html) |@JsonClass-annotated types must have a primary constructor or be sealed. | +|[MoshiUsageMissingTypeLabel](MoshiUsageMissingTypeLabel.md.html) |Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. | +|[MoshiUsageMutableCollections](MoshiUsageMutableCollections.md.html) |Use immutable collections rather than mutable versions. | +|[MoshiUsageQualifierRetention](MoshiUsageQualifierRetention.md.html) |JsonQualifiers must have RUNTIME retention. | +|[MoshiUsageQualifierTarget](MoshiUsageQualifierTarget.md.html) |JsonQualifiers must include FIELD targeting. | +|[MoshiUsageNonMoshiClassCollection](MoshiUsageNonMoshiClassCollection.md.html) |Concrete Collection type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassExternal](MoshiUsageNonMoshiClassExternal.md.html) |External type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassInternal](MoshiUsageNonMoshiClassInternal.md.html) |Non-Moshi internal type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassMap](MoshiUsageNonMoshiClassMap.md.html) |Concrete Map type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassPlatform](MoshiUsageNonMoshiClassPlatform.md.html) |Platform type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageObject](MoshiUsageObject.md.html) |Object types cannot be annotated with @JsonClass. | +|[MoshiUsageParamNeedsInit](MoshiUsageParamNeedsInit.md.html) |Constructor non-property parameters in Moshi classes must have default values. | +|[MoshiUsagePrivateConstructor](MoshiUsagePrivateConstructor.md.html) |Constructors in Moshi classes cannot be private. | +|[MoshiUsagePrivateConstructorProperty](MoshiUsagePrivateConstructorProperty.md.html) |Constructor parameter properties in Moshi classes cannot be private. | +|[MoshiUsageRedundantJsonName](MoshiUsageRedundantJsonName.md.html) |Json.name with the same value as the property/enum member name is redundant. | +|[MoshiUsageSealedMustBeSealed](MoshiUsageSealedMustBeSealed.md.html) |Moshi-sealed can only be applied to 'sealed' types. | +|[MoshiUsageSerializedName](MoshiUsageSerializedName.md.html) |Use Moshi's @Json rather than Gson's @SerializedName. | +|[MoshiUsageSnakeCase](MoshiUsageSnakeCase.md.html) |Consider using `@Json(name = ...)` rather than direct snake casing. | +|[MoshiUsageTransientNeedsInit](MoshiUsageTransientNeedsInit.md.html) |Transient constructor properties must have default values. | +|[MoshiUsageUnsupportedType](MoshiUsageUnsupportedType.md.html) |This type cannot be annotated with @JsonClass. | +|[MoshiUsageUseData](MoshiUsageUseData.md.html) |Model classes should be immutable data classes. | +|[MoshiUsageVarProperty](MoshiUsageVarProperty.md.html) |Moshi properties should be immutable. | +|[MoshiUsageClassVisibility](MoshiUsageClassVisibility.md.html) |@JsonClass-annotated types must be public, package-private, or internal. | +|[FragmentConstructorInjection](FragmentConstructorInjection.md.html) |Fragment dependencies should be injected using constructor injections only. | +|[FragmentFieldInjection](FragmentFieldInjection.md.html) |Fragment dependencies should be injected using the Fragment's constructor. | +|[InjectWithScopeRequiredLoggedInUserProvider](InjectWithScopeRequiredLoggedInUserProvider.md.html)|@InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.| +|[InjectWithTypeMustImplementAnvilInjectable](InjectWithTypeMustImplementAnvilInjectable.md.html) |@InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). | +|[RedactedInJavaUsage](RedactedInJavaUsage.md.html) |@Redacted is only supported in Kotlin classes! | +|[InjectInJava](InjectInJava.md.html) |Only Kotlin classes should be injected in order for Anvil to work. | +|[RetrofitUsage](RetrofitUsage.md.html) |This is replaced by the caller. | +|[RestrictCallsTo](RestrictCallsTo.md.html) |Methods annotated with @RestrictedCallsTo should only be called from the specified scope. | +|[SpanMarkPointMissingMask](SpanMarkPointMissingMask.md.html) |Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. | +|[DoNotExposeEitherNetInRepositories](DoNotExposeEitherNetInRepositories.md.html) |Repository APIs should not expose EitherNet types directly. | +|[FullyQualifiedResource](FullyQualifiedResource.md.html) |Resources should use an import alias instead of being fully qualified. | +|[MissingResourceImportAlias](MissingResourceImportAlias.md.html) |Missing import alias for R class. | +|[WrongResourceImportAlias](WrongResourceImportAlias.md.html) |Wrong import alias for this R class. | +|[DenyListedApi](DenyListedApi.md.html) |Deny-listed API | +|[ParcelizeFunctionProperty](ParcelizeFunctionProperty.md.html) |Function type properties should not be used in Parcelize classes | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.3.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.3.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.3.0 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 0.1.0: First version includes ArgInFormattedQuantityStringRes, + BindsCanBeExtensionFunction, CastingViewContextToActivity, + DenyListedApi, DeprecatedCall, DeprecatedSqlUsage, + DoNotCallProviders, DoNotExposeEitherNetInRepositories, DoNotMock, + DoNotMockAutoValue, DoNotMockDataClass, ErrorProneDoNotMockUsage, + FragmentConstructorInjection, FragmentFieldInjection, + FullyQualifiedResource, GuavaChecksUsed, + GuavaPreconditionsUsedInKotlin, InclusiveNaming, InclusiveNaming, + InjectInJava, InjectWithScopeRequiredLoggedInUserProvider, + InjectWithTypeMustImplementAnvilInjectable, JavaOnlyDetector, + KotlinPairNotCreated, MainScopeUsage, MissingResourceImportAlias, + MoshiUsageAdaptedByRequiresAdapter, MoshiUsageAdaptedByRequiresKeep, + MoshiUsageArray, MoshiUsageBlankGenerator, MoshiUsageBlankJsonName, + MoshiUsageBlankTypeLabel, MoshiUsageClassVisibility, + MoshiUsageDoubleClassAnnotation, MoshiUsageDoubleTypeLabel, + MoshiUsageDuplicateJsonName, MoshiUsageEnumAnnotatedUnknown, + MoshiUsageEnumCasing, MoshiUsageEnumJsonClassGenerated, + MoshiUsageEnumMissingJsonClass, MoshiUsageEnumMissingUnknown, + MoshiUsageEnumPropertyCouldBeMoshi, + MoshiUsageEnumPropertyDefaultUnknown, + MoshiUsageGenerateAdapterShouldBeTrue, + MoshiUsageGenericSealedSubtype, MoshiUsageInappropriateTypeLabel, + MoshiUsageMissingPrimary, MoshiUsageMissingTypeLabel, + MoshiUsageMutableCollections, MoshiUsageNonMoshiClassCollection, + MoshiUsageNonMoshiClassExternal, MoshiUsageNonMoshiClassInternal, + MoshiUsageNonMoshiClassMap, MoshiUsageNonMoshiClassPlatform, + MoshiUsageObject, MoshiUsageParamNeedsInit, + MoshiUsagePrivateConstructor, MoshiUsagePrivateConstructorProperty, + MoshiUsageQualifierRetention, MoshiUsageQualifierTarget, + MoshiUsageRedundantJsonName, MoshiUsageRedundantSiteTarget, + MoshiUsageSealedMustBeSealed, MoshiUsageSerializedName, + MoshiUsageSnakeCase, MoshiUsageTransientNeedsInit, + MoshiUsageUnsupportedType, MoshiUsageUseData, MoshiUsageVarProperty, + RawDispatchersUse, RedactedInJavaUsage, RestrictCallsTo, + RetrofitUsage, SerializableUsage, SpanMarkPointMissingMask, + SubscribeOnMain, WrongResourceImportAlias. +* 0.2.0: Adds ComposeCompositionLocalNaming, + ComposeCompositionLocalUsage, ComposeContentEmitterReturningValues, + ComposeModifierMissing, ComposeModifierMissing, + ComposeModifierReused, ComposeModifierWithoutDefault, + ComposeModifierWithoutDefault, ComposeModifierWithoutDefault, + ComposeMultipleContentEmitters, ComposeNaming, ComposeNaming, + ComposePreviewNaming, ComposePreviewPublic, ComposeRememberMissing. +* 0.2.2: Removes ComposeCompositionLocalNaming, + ComposeCompositionLocalUsage, ComposeContentEmitterReturningValues, + ComposeModifierMissing, ComposeModifierMissing, + ComposeModifierReused, ComposeModifierWithoutDefault, + ComposeModifierWithoutDefault, ComposeModifierWithoutDefault, + ComposeMultipleContentEmitters, ComposeNaming, ComposeNaming, + ComposePreviewNaming, ComposePreviewPublic, ComposeRememberMissing. +* 0.2.3: Adds ParcelizeFunctionProperty. +* 0.3.0: Adds DoNotMockObjectClass, DoNotMockRecordClass, + DoNotMockSealedClass. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.3.0|2023/05/31| 81| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.2.3|2023/02/22| 78| Yes| 8.0 and 8.1| 7.2| +| 0.2.2|2023/02/09| 77| Yes| 8.0 and 8.1| 7.2| +| 0.2.1|2023/01/26| 92| Yes| 8.0 and 8.1| 7.2| +| 0.2.0|2023/01/26| 92| Yes| 8.0 and 8.1| 7.2| +| 0.1.1|2022/11/30| 77| Yes| 7.3 and 7.4| 7.2| +| 0.1.0|2022/11/17| 77| Yes| 7.3 and 7.4| 7.2| + + \ No newline at end of file diff --git a/docs/checks/com_uber_autodispose2_autodispose-lint.md.html b/docs/checks/com_uber_autodispose2_autodispose-lint.md.html new file mode 100644 index 00000000..d77bf8b5 --- /dev/null +++ b/docs/checks/com_uber_autodispose2_autodispose-lint.md.html @@ -0,0 +1,73 @@ +(#) com.uber.autodispose2:autodispose-lint + +Name +: AutoDispose Lint Checks +Description +: Automatic binding+disposal of RxJava 2+ streams. +Project +: https://github.com/uber/AutoDispose +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Uber +Identifier +: AutoDispose +Feedback +: https://github.com/uber/AutoDispose/issues +Min +: Lint 7.0 +Compiled +: Lint 7.0 +Artifact +: com.uber.autodispose2:autodispose-lint:2.1.1 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------|-----------------------------------------------------------------------------------------------------------------| +|[AutoDispose](AutoDispose.md.html)|Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.uber.autodispose2:autodispose-lint:2.1.1") + +// build.gradle +lintChecks 'com.uber.autodispose2:autodispose-lint:2.1.1' + +// build.gradle.kts with version catalogs: +lintChecks(libs.autodispose-lint) + +# libs.versions.toml +[versions] +autodispose-lint = "2.1.1" +[libraries] +autodispose-lint = { + module = "com.uber.autodispose2:autodispose-lint", + version.ref = "autodispose-lint" +} +``` + +2.1.1 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.1.0: First version includes AutoDispose. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.1.1|2021/09/07| 1| Yes| 7.0| 7.0| +| 2.1.0|2021/08/09| 1| Yes| 7.0| 7.0| + + \ No newline at end of file diff --git a/docs/checks/com_vanniktech_lint-rules-android.md.html b/docs/checks/com_vanniktech_lint-rules-android.md.html new file mode 100644 index 00000000..528b0867 --- /dev/null +++ b/docs/checks/com_vanniktech_lint-rules-android.md.html @@ -0,0 +1,139 @@ +(#) com.vanniktech:lint-rules-android + +Name +: Lint Rules Android +Description +: Very opinionated Lint Checks +Project +: https://github.com/vanniktech/lint-rules +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: com.vanniktech:lint-rules-android:0.24.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------| +|[AlertDialogUsage](AlertDialogUsage.md.html) |Use the support library AlertDialog instead of android.app.AlertDialog. | +|[AssertjImport](AssertjImport.md.html) |Flags Java 6 incompatible imports. | +|[ColorCasing](ColorCasing.md.html) |Raw colors should be defined with uppercase letters. | +|[ConstraintLayoutToolsEditorAttribute](ConstraintLayoutToolsEditorAttribute.md.html)|Flags tools:layout_editor xml properties. | +|[DefaultLayoutAttribute](DefaultLayoutAttribute.md.html) |Flags default layout values. | +|[ErroneousLayoutAttribute](ErroneousLayoutAttribute.md.html) |Layout attribute that's not applicable to a particular view. | +|[FormalGerman](FormalGerman.md.html) |Marks strings which contain formal German words. | +|[ImplicitStringPlaceholder](ImplicitStringPlaceholder.md.html) |Marks implicit placeholders in strings without an index. | +|[InvalidAccessibility](InvalidAccessibility.md.html) |Marks invalid accessibility usages. | +|[InvalidImport](InvalidImport.md.html) |Flags invalid imports. | +|[InvalidSingleLineComment](InvalidSingleLineComment.md.html) |Marks single line comments that are not sentences. | +|[InvalidString](InvalidString.md.html) |Marks invalid translation strings. | +|[JCenter](JCenter.md.html) |Marks usage of the jcenter() repository. | +|[LayoutFileNameMatchesClass](LayoutFileNameMatchesClass.md.html) |Checks that the layout file matches the class name. | +|[MatchingMenuId](MatchingMenuId.md.html) |Flags menu ids that don't match with the file name. | +|[MatchingViewId](MatchingViewId.md.html) |Flags view ids that don't match with the file name. | +|[MissingScrollbars](MissingScrollbars.md.html) |Scroll views should declare a scrollbar. | +|[MissingXmlHeader](MissingXmlHeader.md.html) |Flags xml files that don't have a header. | +|[NamingPattern](NamingPattern.md.html) |Names should be well named. | +|[RawColor](RawColor.md.html) |Flags color that are not defined as resource. | +|[RawDimen](RawDimen.md.html) |Flags dimensions that are not defined as resource. | +|[ResourcesGetColorCall](ResourcesGetColorCall.md.html) |Marks usage of deprecated getColor() on Resources. | +|[ResourcesGetColorStateListCall](ResourcesGetColorStateListCall.md.html) |Marks usage of deprecated getColorStateList() on Resources. | +|[ResourcesGetDrawableCall](ResourcesGetDrawableCall.md.html) |Marks usage of deprecated getDrawable() on Resources. | +|[ShouldUseStaticImport](ShouldUseStaticImport.md.html) |Flags declarations that should be statically imported. | +|[StringNotCapitalized](StringNotCapitalized.md.html) |Marks strings which are not capitalized. | +|[SuperfluousMarginDeclaration](SuperfluousMarginDeclaration.md.html) |Flags margin declarations that can be simplified. | +|[SuperfluousNameSpace](SuperfluousNameSpace.md.html) |Flags namespaces that are already declared. | +|[SuperfluousPaddingDeclaration](SuperfluousPaddingDeclaration.md.html) |Flags padding declarations that can be simplified. | +|[Todo](Todo.md.html) |Marks todos in any given file. | +|[UnsupportedLayoutAttribute](UnsupportedLayoutAttribute.md.html) |Marks layout attributes which are not supported. | +|[UnusedMergeAttributes](UnusedMergeAttributes.md.html) |Flags android and app attributes that are used on a attribute for custom Views.| +|[WrongAnnotationOrder](WrongAnnotationOrder.md.html) |Checks that Annotations comply with a certain order. | +|[WrongConstraintLayoutUsage](WrongConstraintLayoutUsage.md.html) |Marks a wrong usage of the Constraint Layout. | +|[WrongDrawableName](WrongDrawableName.md.html) |Drawable names should be prefixed accordingly. | +|[WrongGlobalIconColor](WrongGlobalIconColor.md.html) |Each icon should have the same global color defined. | +|[WrongLayoutName](WrongLayoutName.md.html) |Layout names should be prefixed accordingly. | +|[WrongMenuIdFormat](WrongMenuIdFormat.md.html) |Flag menu ids that are not in lowerCamelCase Format. | +|[WrongTestMethodName](WrongTestMethodName.md.html) |Flags test methods that start with test. | +|[WrongViewIdFormat](WrongViewIdFormat.md.html) |Flag view ids that are not in lowerCamelCase Format. | +|[XmlSpacing](XmlSpacing.md.html) |XML files should not contain any new lines. | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-android:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-android:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-android) + +# libs.versions.toml +[versions] +lint-rules-android = "0.24.0" +[libraries] +lint-rules-android = { + module = "com.vanniktech:lint-rules-android", + version.ref = "lint-rules-android" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 0.6.0: First version includes ConstraintLayoutToolsEditorAttribute, + DefaultLayoutAttribute, InvalidImport, InvalidSingleLineComment, + InvalidString, MatchingMenuId, MatchingViewId, MissingXmlHeader, + NamingPattern, RawColor, RawDimen, ResourcesGetColorCall, + ResourcesGetColorStateListCall, ResourcesGetDrawableCall, + ShouldUseStaticImport, SuperfluousMarginDeclaration, + SuperfluousNameSpace, SuperfluousPaddingDeclaration, + UnsupportedLayoutAttribute, WrongAnnotationOrder, + WrongConstraintLayoutUsage, WrongLayoutName, WrongMenuIdFormat, + WrongTestMethodName, WrongViewIdFormat, XmlSpacing. +* 0.7.1: Adds LayoutFileNameMatchesClass, Todo, UnusedMergeAttributes. +* 0.8.0: Adds AssertjImport, ColorCasing, IgnoreWithoutReason, JCenter. +* 0.9.0: Adds AlertDialogUsage. +* 0.10.0: Removes IgnoreWithoutReason. +* 0.24.0: Adds ErroneousLayoutAttribute, FormalGerman, + ImplicitStringPlaceholder, InvalidAccessibility, MissingScrollbars, + StringNotCapitalized, WrongDrawableName, WrongGlobalIconColor. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.24.0|2023/02/21| 41| Yes| 7.3 and 7.4|7.3 and 7.4| +| 0.13.0|2020/03/22| 33| No[^1]| 3.6| 3.6| +| 0.12.0|2019/04/29| 33| No[^1]| 3.4| 3.4| +| 0.10.0|2019/02/19| 33| No[^1]| 3.3| 3.3| +| 0.9.0|2019/01/18| 34| No[^1]| 3.3| 3.3| +| 0.8.0|2018/09/25| 33| No[^1]| 3.2| 3.2| +| 0.7.1|2018/04/16| 29| No[^2]| 3.1| 3.1| +| 0.6.0|2018/02/04| 26| No[^3]| Not specified|Not specified| + +Compatibility Problems: + +[^1]: com.android.SdkConstants#CLASS_CONSTRAINT_LAYOUT is not available +[^2]: com.android.tools.lint.detector.api.LintUtils: java.lang.String computeResourcePrefix(com.android.builder.model.AndroidProject) is not available +[^3]: com.android.tools.lint.detector.api.LayoutDetector: com.android.tools.lint.detector.api.LintFix$Builder fix() is not available + + \ No newline at end of file diff --git a/docs/checks/com_vanniktech_lint-rules-kotlin.md.html b/docs/checks/com_vanniktech_lint-rules-kotlin.md.html new file mode 100644 index 00000000..ec57386d --- /dev/null +++ b/docs/checks/com_vanniktech_lint-rules-kotlin.md.html @@ -0,0 +1,72 @@ +(#) com.vanniktech:lint-rules-kotlin + +Name +: Lint Rules Kotlin +Description +: Very opinionated Lint Checks +Project +: https://github.com/vanniktech/lint-rules +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: com.vanniktech:lint-rules-kotlin:0.24.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------|---------------------------------------------------------------| +|[KotlinRequireNotNullUseMessage](KotlinRequireNotNullUseMessage.md.html)|Marks usage of the requireNotNull method without lazy messages.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-kotlin:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-kotlin:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-kotlin) + +# libs.versions.toml +[versions] +lint-rules-kotlin = "0.24.0" +[libraries] +lint-rules-kotlin = { + module = "com.vanniktech:lint-rules-kotlin", + version.ref = "lint-rules-kotlin" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 0.22.0: First version includes KotlinRequireNotNullUseMessage. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.24.0|2023/02/21| 1| Yes| 7.3 and 7.4|7.3 and 7.4| +| 0.23.0|2022/12/20| 1| Yes| 7.3 and 7.4| 7.0| +| 0.22.0|2022/08/05| 1| Yes| 7.2| 7.0| + + \ No newline at end of file diff --git a/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html b/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html new file mode 100644 index 00000000..52bc37b6 --- /dev/null +++ b/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html @@ -0,0 +1,102 @@ +(#) com.vanniktech:lint-rules-rxjava2 + +Name +: Lint Rules RxJava 2 +Description +: Very opinionated Lint Checks +Project +: https://github.com/vanniktech/lint-rules +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: vanniktech/lint-rules/ +Feedback +: https://github.com/vanniktech/lint-rules/issues +Min +: Lint 7.3 and 7.4 +Compiled +: Lint 7.3 and 7.4 +Artifact +: com.vanniktech:lint-rules-rxjava2:0.24.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| +|[RxJava2MethodMissingCheckReturnValue](RxJava2MethodMissingCheckReturnValue.md.html) |Method is missing the @CheckReturnValue annotation. | +|[RxJava2MissingCompositeDisposableClear](RxJava2MissingCompositeDisposableClear.md.html)|Marks CompositeDisposables that are not being cleared. | +|[RxJava2DisposableAddAllCall](RxJava2DisposableAddAllCall.md.html) |Marks usage of addAll() on CompositeDisposable. | +|[RxJava2DefaultScheduler](RxJava2DefaultScheduler.md.html) |Pass a scheduler instead of relying on the default Scheduler. | +|[RxJava2DisposableDisposeCall](RxJava2DisposableDisposeCall.md.html) |Marks usage of dispose() on CompositeDisposable. | +|[RxJava2SubscribeMissingOnError](RxJava2SubscribeMissingOnError.md.html) |Flags a version of the subscribe() method without an error Consumer. | +|[RxJava2SchedulersFactoryCall](RxJava2SchedulersFactoryCall.md.html) |Instead of calling the Schedulers factory methods directly inject the Schedulers.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") + +// build.gradle +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.lint-rules-rxjava2) + +# libs.versions.toml +[versions] +lint-rules-rxjava2 = "0.24.0" +[libraries] +lint-rules-rxjava2 = { + module = "com.vanniktech:lint-rules-rxjava2", + version.ref = "lint-rules-rxjava2" +} +``` + +0.24.0 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 0.6.0: First version includes RxJava2DefaultScheduler, + RxJava2DisposableAddAllCall, RxJava2DisposableDisposeCall, + RxJava2MethodMissingCheckReturnValue, + RxJava2MissingCompositeDisposableClear, + RxJava2SchedulersFactoryCall, RxJava2SubscribeMissingOnError. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.24.0|2023/02/21| 7| Yes| 7.3 and 7.4|7.3 and 7.4| +| 0.23.0|2022/12/20| 7| Yes| 7.3 and 7.4| 7.0| +| 0.22.0|2022/08/05| 7| Yes| 7.2| 7.0| +| 0.21.0|2022/05/21| 7| Yes| 7.2| 7.0| +| 0.20.0|2022/05/10| 7| Yes| 7.2| 7.2| +| 0.19.0|2022/03/10| 7| Yes| 7.1| 7.1| +| 0.18.0|2022/01/29| 7| No[^1]| 7.0| 7.0| +| 0.17.0|2021/08/22| 7| No[^1]| 7.0| 7.0| +| 0.16.0|2021/08/22| 7| No[^1]| 4.1| 4.1| +| 0.15.0|2021/06/27| 7| No[^1]| 4.1| 4.1| +| 0.14.0|2021/03/20| 7| No[^1]| 4.1| 4.1| +| 0.13.0|2020/03/22| 7| No[^1]| 3.6| 3.6| +| 0.12.0|2019/04/29| 7| No[^1]| 3.4| 3.4| +| 0.10.0|2019/02/19| 7| No[^1]| 3.3| 3.3| +| 0.9.0|2019/01/18| 7| No[^1]| 3.3| 3.3| +| 0.8.0|2018/09/25| 7| No[^1]| 3.2| 3.2| +| 0.7.1|2018/04/16| 7| No[^1]| 3.1| 3.1| +| 0.7.0|2018/04/16| 7| No[^1]| 3.1| 3.1| +| 0.6.0|2018/02/04| 7| Yes| Not specified|Not specified| + +Compatibility Problems: + +[^1]: org.jetbrains.uast.kotlin.declarations.KotlinUMethod: org.jetbrains.kotlin.psi.KtDeclaration getSourcePsi() is not available + + \ No newline at end of file diff --git a/docs/checks/index.md.html b/docs/checks/index.md.html index 45e44ac7..1c34194d 100644 --- a/docs/checks/index.md.html +++ b/docs/checks/index.md.html @@ -1,13 +1,14 @@ (#) Lint Issue Index -Order: Alphabetical | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) +Order: Alphabetical | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) + - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) - [AllCaps: Combining textAllCaps and markup](AllCaps.md.html) - [AllowAllHostnameVerifier: Insecure `HostnameVerifier`](AllowAllHostnameVerifier.md.html) - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) @@ -23,8 +24,13 @@ - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) + - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) + - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) - [AuthLeak: Code might contain an auth leak](AuthLeak.md.html) + - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) + - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [Autofill: Use Autofill](Autofill.md.html) - [BackButton: Back button](BackButton.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) @@ -32,7 +38,11 @@ - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) + - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) + - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) + - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) + - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) @@ -40,9 +50,13 @@ - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) + - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) + - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) + - [ChromeOsOnConfigurationChanged: Poor performance with APIs inside `onConfigurationChanged()`](ChromeOsOnConfigurationChanged.md.html) - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) + - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) - [CommitPrefEdits: Missing `commit()` on `SharedPreference` editor](CommitPrefEdits.md.html) - [CommitTransaction: Missing `commit()` calls](CommitTransaction.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) @@ -51,9 +65,28 @@ - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) + - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) + - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) + - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) + - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) + - [ComposeMultipleContentEmitters: Composables should only be emit from one source](ComposeMultipleContentEmitters.md.html) + - [ComposeMutableParameters: Mutable objects in Compose will break state](ComposeMutableParameters.md.html) + - [ComposeNamingLowercase: Value-returning Composables should be lowercase](ComposeNamingLowercase.md.html) + - [ComposeNamingUppercase: Unit Composables should be uppercase](ComposeNamingUppercase.md.html) + - [ComposeParameterOrder: Composable function parameters should be ordered](ComposeParameterOrder.md.html) + - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) + - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) + - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) + - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) + - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - [ConstantLocale: Constant Locale](ConstantLocale.md.html) + - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) @@ -67,11 +100,15 @@ - [DataExtractionRules: Missing data extraction rules](DataExtractionRules.md.html) - [DeepLinkInActivityDestination: A should not be attached to an destination](DeepLinkInActivityDestination.md.html) - [DefaultEncoding: Using Default Character Encoding](DefaultEncoding.md.html) + - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) + - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) - [Deprecated: Using deprecated resources](Deprecated.md.html) + - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) + - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) - [DetachAndAttachSameFragment: Separate attach() and detach() into separate FragmentTransactions](DetachAndAttachSameFragment.md.html) - [DevModeObsolete: Dev Mode Obsolete](DevModeObsolete.md.html) - [DeviceAdmin: Malformed Device Admin](DeviceAdmin.md.html) @@ -80,6 +117,14 @@ - [DisableBaselineAlignment: Missing `baselineAligned` attribute](DisableBaselineAlignment.md.html) - [DiscouragedApi: Using discouraged APIs](DiscouragedApi.md.html) - [DiscouragedPrivateApi: Using Discouraged Private API](DiscouragedPrivateApi.md.html) + - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) + - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) + - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) + - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) + - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) + - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DrawAllocation: Memory allocations within drawing code](DrawAllocation.md.html) - [DuplicateActivity: Activity registered more than once](DuplicateActivity.md.html) - [DuplicateDefinition: Duplicate definitions of resources](DuplicateDefinition.md.html) @@ -90,6 +135,7 @@ - [DuplicateStrings: Duplicate Strings](DuplicateStrings.md.html) - [DuplicateUsesFeature: Feature declared more than once](DuplicateUsesFeature.md.html) - [EasterEgg: Code contains easter egg](EasterEgg.md.html) + - [EditedTargetSdkVersion: Manually Edited TargetSdkVersion](EditedTargetSdkVersion.md.html) - [EllipsizeMaxLines: Combining Ellipsize and Maxlines](EllipsizeMaxLines.md.html) - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) - [EmptySuperCall: Calling an empty super method](EmptySuperCall.md.html) @@ -97,6 +143,9 @@ - [EnqueueWork: WorkManager Enqueue](EnqueueWork.md.html) - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) + - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) + - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) + - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) @@ -108,17 +157,25 @@ - [ExportedService: Exported service does not require permission](ExportedService.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) - [ExtraTranslation: Extra translation](ExtraTranslation.md.html) + - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) - [FileEndsWithExt: File endsWith on file extensions](FileEndsWithExt.md.html) - [FindViewByIdCast: Add Explicit Cast](FindViewByIdCast.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) - [FontValidation: Validation of font files](FontValidation.md.html) + - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) + - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) + - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) - [FragmentAddMenuProvider: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentAddMenuProvider.md.html) - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) - - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) + - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) + - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) + - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing:1.7.0-alpha01) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing-manifest:1.7.0-alpha01) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) - [FullBackupContent: Valid Full Backup Content File](FullBackupContent.md.html) + - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) - [GestureBackNavigation: Usage of KeyEvent.KEYCODE_BACK](GestureBackNavigation.md.html) - [GetContentDescriptionOverride: Overriding `getContentDescription()` on a View](GetContentDescriptionOverride.md.html) - [GetInstance: Cipher.getInstance with ECB](GetInstance.md.html) @@ -136,6 +193,8 @@ - [GradlePluginVersion: Incompatible Android Gradle Plugin](GradlePluginVersion.md.html) - [GrantAllUris: Content provider shares everything](GrantAllUris.md.html) - [GridLayout: GridLayout validation](GridLayout.md.html) + - [GuavaChecksUsed: Use Slack's JavaPreconditions instead of Guava's Preconditions checks](GuavaChecksUsed.md.html) + - [GuavaPreconditionsUsedInKotlin: Kotlin precondition checks should use the Kotlin standard library checks](GuavaPreconditionsUsedInKotlin.md.html) - [HalfFloat: Incorrect Half Float](HalfFloat.md.html) - [HandlerLeak: Handler reference leaks](HandlerLeak.md.html) - [HardcodedDebugMode: Hardcoded value of `android:debuggable` in the manifest](HardcodedDebugMode.md.html) @@ -160,15 +219,24 @@ - [IgnoreWithoutReason: @Ignore without Reason](IgnoreWithoutReason.md.html) - [IllegalResourceRef: Name and version must be integer or string, not resource](IllegalResourceRef.md.html) - [ImplicitSamInstance: Implicit SAM Instances](ImplicitSamInstance.md.html) + - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) - [ImpliedQuantity: Implied Quantities](ImpliedQuantity.md.html) - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.3.0) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.3.0) - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) + - [IncorrectChainMarginsUsage: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain.](IncorrectChainMarginsUsage.md.html) + - [IncorrectMatchParentUsage: Prefer using `Dimension.percent(1f)` when defining custom constraints.](IncorrectMatchParentUsage.md.html) + - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) - [InefficientWeight: Inefficient layout weight](InefficientWeight.md.html) - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) + - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) + - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) + - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) - [InnerclassSeparator: Inner classes should use `$` rather than `.`](InnerclassSeparator.md.html) - [InsecureBaseConfiguration: Insecure Base Configuration](InsecureBaseConfiguration.md.html) @@ -178,11 +246,13 @@ - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) + - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) - [InvalidId: Invalid ID declaration](InvalidId.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) + - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) @@ -190,23 +260,33 @@ - [InvalidResourceFolder: Invalid Resource Folder](InvalidResourceFolder.md.html) - [InvalidSetHasFixedSize: When using `setHasFixedSize() in an `RecyclerView`, `wrap_content` cannot be used as \ a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) + - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) + - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) - [InvalidWearFeatureAttribute: Invalid attribute for Wear uses-feature](InvalidWearFeatureAttribute.md.html) + - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) + - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) - [JobSchedulerService: JobScheduler problems](JobSchedulerService.md.html) + - [JvmStaticProvidesInObjectDetector: @JvmStatic used for @Provides function in an object class](JvmStaticProvidesInObjectDetector.md.html) + - [KaptUsageInsteadOfKsp: Kapt usage should be replaced with KSP](KaptUsageInsteadOfKsp.md.html) - [KeyboardInaccessibleWidget: Keyboard inaccessible widget](KeyboardInaccessibleWidget.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) - [KotlinNullnessAnnotation: Kotlin nullability annotation](KotlinNullnessAnnotation.md.html) + - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) + - [KotlinRequireNotNullUseMessage: Marks usage of the requireNotNull method without lazy messages.](KotlinRequireNotNullUseMessage.md.html) + - [KotlincFE10: Avoid using old K1 Kotlin compiler APIs](KotlincFE10.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - [LabelFor: Missing accessibility label](LabelFor.md.html) - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) - [LaunchActivityFromNotification: Notification Launches Services or BroadcastReceivers](LaunchActivityFromNotification.md.html) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) + - [LayoutFileNameMatchesClass: Checks that the layout file matches the class name.](LayoutFileNameMatchesClass.md.html) - [LeanbackUsesWifi: Using android.hardware.wifi on TV](LeanbackUsesWifi.md.html) - [LibraryCustomView: Custom views in libraries should use res-auto-namespace](LibraryCustomView.md.html) - [LifecycleAnnotationProcessorWithJava8: Lifecycle Annotation Processor with Java 8 Compile Option](LifecycleAnnotationProcessorWithJava8.md.html) @@ -224,12 +304,16 @@ - [LocaleFolder: Wrong locale name](LocaleFolder.md.html) - [LockedOrientationActivity: Incompatible screenOrientation value](LockedOrientationActivity.md.html) - [LogConditional: Unconditional Logging Calls](LogConditional.md.html) + - [LogNotTimber: Logging call to Log instead of Timber](LogNotTimber.md.html) - [LogTagMismatch: Mismatched Log Tags](LogTagMismatch.md.html) - [LongLogTag: Too Long Log Tags](LongLogTag.md.html) + - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) - [MangledCRLF: Mangled file line endings](MangledCRLF.md.html) - [ManifestOrder: Incorrect order of elements in manifest](ManifestOrder.md.html) - [ManifestResource: Manifest Resource References](ManifestResource.md.html) - [ManifestTypo: Typos in manifest tags](ManifestTypo.md.html) + - [MatchingMenuId: Flags menu ids that don't match with the file name.](MatchingMenuId.md.html) + - [MatchingViewId: Flags view ids that don't match with the file name.](MatchingViewId.md.html) - [MenuTitle: Missing menu title](MenuTitle.md.html) - [MergeMarker: Code contains merge marker](MergeMarker.md.html) - [MergeRootFrame: FrameLayout can be replaced with `` tag](MergeRootFrame.md.html) @@ -252,23 +336,74 @@ - [MissingPermission: Missing Permissions](MissingPermission.md.html) - [MissingPrefix: Missing Android XML namespace](MissingPrefix.md.html) - [MissingQuantity: Missing quantity translation](MissingQuantity.md.html) + - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) + - [MissingScrollbars: Scroll views should declare a scrollbar.](MissingScrollbars.md.html) - [MissingSuperCall: Missing Super Call](MissingSuperCall.md.html) - [MissingTranslation: Incomplete translation](MissingTranslation.md.html) - [MissingTvBanner: TV Missing Banner](MissingTvBanner.md.html) - [MissingVersion: Missing application name/version](MissingVersion.md.html) + - [MissingXmlHeader: Flags xml files that don't have a header.](MissingXmlHeader.md.html) - [MockLocation: Using mock location provider in production](MockLocation.md.html) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) + - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) + - [ModuleCompanionObjects: Module companion objects should not be annotated with @Module.](ModuleCompanionObjects.md.html) + - [ModuleCompanionObjectsNotInModuleParent: Companion objects should not be annotated with @Module.](ModuleCompanionObjectsNotInModuleParent.md.html) - [MonochromeLauncherIcon: Monochrome icon is not defined](MonochromeLauncherIcon.md.html) + - [MoshiUsageAdaptedByRequiresAdapter: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory.](MoshiUsageAdaptedByRequiresAdapter.md.html) + - [MoshiUsageAdaptedByRequiresKeep: Adapters targeted by @AdaptedBy must have @Keep.](MoshiUsageAdaptedByRequiresKeep.md.html) + - [MoshiUsageArray: Prefer List over Array.](MoshiUsageArray.md.html) + - [MoshiUsageBlankGenerator: Don't use blank JsonClass.generator values.](MoshiUsageBlankGenerator.md.html) + - [MoshiUsageBlankJsonName: Don't use blank names in `@Json`.](MoshiUsageBlankJsonName.md.html) + - [MoshiUsageBlankTypeLabel: Moshi-sealed requires a type label specified after the 'sealed:' prefix.](MoshiUsageBlankTypeLabel.md.html) + - [MoshiUsageClassVisibility: @JsonClass-annotated types must be public, package-private, or internal.](MoshiUsageClassVisibility.md.html) + - [MoshiUsageDoubleClassAnnotation: Only use one of @AdaptedBy or @JsonClass.](MoshiUsageDoubleClassAnnotation.md.html) + - [MoshiUsageDoubleTypeLabel: Only use one of @TypeLabel or @DefaultObject.](MoshiUsageDoubleTypeLabel.md.html) + - [MoshiUsageDuplicateJsonName: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects.](MoshiUsageDuplicateJsonName.md.html) + - [MoshiUsageEnumAnnotatedUnknown: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json](MoshiUsageEnumAnnotatedUnknown.md.html) + - [MoshiUsageEnumCasing: Consider using `@Json(name = ...)` rather than lower casing.](MoshiUsageEnumCasing.md.html) + - [MoshiUsageEnumJsonClassGenerated: Enums annotated with @JsonClass must not set `generateAdapter` to true.](MoshiUsageEnumJsonClassGenerated.md.html) + - [MoshiUsageEnumMissingJsonClass: Enums serialized with Moshi should be annotated with @JsonClass.](MoshiUsageEnumMissingJsonClass.md.html) + - [MoshiUsageEnumMissingUnknown: Enums serialized with Moshi must reserve the first member as UNKNOWN.](MoshiUsageEnumMissingUnknown.md.html) + - [MoshiUsageEnumPropertyCouldBeMoshi: Consider making enum properties also use Moshi.](MoshiUsageEnumPropertyCouldBeMoshi.md.html) + - [MoshiUsageEnumPropertyDefaultUnknown: Suspicious default value to 'UNKNOWN' for a Moshi enum.](MoshiUsageEnumPropertyDefaultUnknown.md.html) + - [MoshiUsageGenerateAdapterShouldBeTrue: JsonClass.generateAdapter must be true in order for Moshi code gen to run.](MoshiUsageGenerateAdapterShouldBeTrue.md.html) + - [MoshiUsageGenericSealedSubtype: Sealed subtypes used with moshi-sealed cannot be generic.](MoshiUsageGenericSealedSubtype.md.html) + - [MoshiUsageInappropriateTypeLabel: Inappropriate @TypeLabel or @DefaultObject annotation.](MoshiUsageInappropriateTypeLabel.md.html) + - [MoshiUsageMissingPrimary: @JsonClass-annotated types must have a primary constructor or be sealed.](MoshiUsageMissingPrimary.md.html) + - [MoshiUsageMissingTypeLabel: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject.](MoshiUsageMissingTypeLabel.md.html) + - [MoshiUsageMutableCollections: Use immutable collections rather than mutable versions.](MoshiUsageMutableCollections.md.html) + - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) + - [MoshiUsageNonMoshiClassExternal: External type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassExternal.md.html) + - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) + - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) + - [MoshiUsageNonMoshiClassPlatform: Platform type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassPlatform.md.html) + - [MoshiUsageObject: Object types cannot be annotated with @JsonClass.](MoshiUsageObject.md.html) + - [MoshiUsageParamNeedsInit: Constructor non-property parameters in Moshi classes must have default values.](MoshiUsageParamNeedsInit.md.html) + - [MoshiUsagePrivateConstructor: Constructors in Moshi classes cannot be private.](MoshiUsagePrivateConstructor.md.html) + - [MoshiUsagePrivateConstructorProperty: Constructor parameter properties in Moshi classes cannot be private.](MoshiUsagePrivateConstructorProperty.md.html) + - [MoshiUsageQualifierRetention: JsonQualifiers must have RUNTIME retention.](MoshiUsageQualifierRetention.md.html) + - [MoshiUsageQualifierTarget: JsonQualifiers must include FIELD targeting.](MoshiUsageQualifierTarget.md.html) + - [MoshiUsageRedundantJsonName: Json.name with the same value as the property/enum member name is redundant.](MoshiUsageRedundantJsonName.md.html) + - [MoshiUsageRedundantSiteTarget: Use of site-targets on @Json are redundant.](MoshiUsageRedundantSiteTarget.md.html) + - [MoshiUsageSealedMustBeSealed: Moshi-sealed can only be applied to 'sealed' types.](MoshiUsageSealedMustBeSealed.md.html) + - [MoshiUsageSerializedName: Use Moshi's @Json rather than Gson's @SerializedName.](MoshiUsageSerializedName.md.html) + - [MoshiUsageSnakeCase: Consider using `@Json(name = ...)` rather than direct snake casing.](MoshiUsageSnakeCase.md.html) + - [MoshiUsageTransientNeedsInit: Transient constructor properties must have default values.](MoshiUsageTransientNeedsInit.md.html) + - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) + - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) + - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) + - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) + - [NamingPattern: Names should be well named.](NamingPattern.md.html) - [NegativeMargin: Negative Margins](NegativeMargin.md.html) - [NestedScrolling: Nested scrolling widgets](NestedScrolling.md.html) - [NestedWeights: Nested layout weights](NestedWeights.md.html) @@ -277,6 +412,7 @@ - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) + - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) @@ -293,16 +429,16 @@ - [ObsoleteSdkInt: Obsolete SDK_INT Version Check](ObsoleteSdkInt.md.html) - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) - [OnClick: `onClick` method does not exist](OnClick.md.html) + - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - [OpenForTesting: Extending API only allowed from tests](OpenForTesting.md.html) - [Orientation: Missing explicit orientation](Orientation.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - [Overdraw: Overdraw: Painting regions more than once](Overdraw.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) + - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) @@ -317,13 +453,18 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) - [Range: Outside Range](Range.md.html) + - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) + - [RawDimen: Flags dimensions that are not defined as resource.](RawDimen.md.html) + - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [Recycle: Missing `recycle()` calls](Recycle.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) + - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [RedundantNamespace: Redundant namespace](RedundantNamespace.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) @@ -334,6 +475,7 @@ - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) - [RemoveWorkManagerInitializer: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.](RemoveWorkManagerInitializer.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - [RequiresFeature: Requires Feature](RequiresFeature.md.html) - [ResAuto: Hardcoded Package in Namespace](ResAuto.md.html) @@ -342,7 +484,12 @@ - [ResourceCycle: Cycle in resource definitions](ResourceCycle.md.html) - [ResourceName: Resource with Wrong Prefix](ResourceName.md.html) - [ResourceType: Wrong Resource Type](ResourceType.md.html) + - [ResourcesGetColorCall: Marks usage of deprecated getColor() on Resources.](ResourcesGetColorCall.md.html) + - [ResourcesGetColorStateListCall: Marks usage of deprecated getColorStateList() on Resources.](ResourcesGetColorStateListCall.md.html) + - [ResourcesGetDrawableCall: Marks usage of deprecated getDrawable() on Resources.](ResourcesGetDrawableCall.md.html) + - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RestrictedApi: Restricted API](RestrictedApi.md.html) + - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [ReturnThis: Method must return `this`](ReturnThis.md.html) - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) @@ -350,22 +497,33 @@ - [RtlEnabled: Using RTL attributes without enabling RTL support](RtlEnabled.md.html) - [RtlHardcoded: Using left/right instead of start/end attributes](RtlHardcoded.md.html) - [RtlSymmetry: Padding and margin symmetry](RtlSymmetry.md.html) + - [RxJava2DefaultScheduler: Pass a scheduler instead of relying on the default Scheduler.](RxJava2DefaultScheduler.md.html) + - [RxJava2DisposableAddAllCall: Marks usage of addAll() on CompositeDisposable.](RxJava2DisposableAddAllCall.md.html) + - [RxJava2DisposableDisposeCall: Marks usage of dispose() on CompositeDisposable.](RxJava2DisposableDisposeCall.md.html) + - [RxJava2MethodMissingCheckReturnValue: Method is missing the @CheckReturnValue annotation.](RxJava2MethodMissingCheckReturnValue.md.html) + - [RxJava2MissingCompositeDisposableClear: Marks CompositeDisposables that are not being cleared.](RxJava2MissingCompositeDisposableClear.md.html) + - [RxJava2SchedulersFactoryCall: Instead of calling the Schedulers factory methods directly inject the Schedulers.](RxJava2SchedulersFactoryCall.md.html) + - [RxJava2SubscribeMissingOnError: Flags a version of the subscribe() method without an error Consumer.](RxJava2SubscribeMissingOnError.md.html) - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) + - [ScheduleExactAlarm: Scheduling Exact Alarms Without Required Permission](ScheduleExactAlarm.md.html) - [ScopedStorage: Affected by scoped storage](ScopedStorage.md.html) - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) + - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) + - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) - [SetWorldReadable: `File.setReadable()` used to make file world-readable](SetWorldReadable.md.html) - [SetWorldWritable: `File.setWritable()` used to make file world-writable](SetWorldWritable.md.html) - [ShiftFlags: Dangerous Flag Constant Declaration](ShiftFlags.md.html) - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) + - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) @@ -374,6 +532,7 @@ - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) - [SourceLockedOrientationActivity: Incompatible setRequestedOrientation value](SourceLockedOrientationActivity.md.html) - [SpUsage: Using `dp` instead of `sp` for text sizes](SpUsage.md.html) + - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - [SpecifyJobSchedulerIdRange: Specify a range of JobScheduler ids](SpecifyJobSchedulerIdRange.md.html) - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) @@ -383,12 +542,19 @@ - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [StringFormatCount: Formatting argument types incomplete or inconsistent](StringFormatCount.md.html) + - [StringFormatInTimber: Logging call with Timber contains String#format()](StringFormatInTimber.md.html) - [StringFormatInvalid: Invalid format string](StringFormatInvalid.md.html) - [StringFormatMatches: `String.format` string doesn't match the XML format string](StringFormatMatches.md.html) - [StringFormatTrivial: `String.format` string only contains trivial conversions](StringFormatTrivial.md.html) + - [StringNotCapitalized: Marks strings which are not capitalized.](StringNotCapitalized.md.html) - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) + - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) + - [SuperfluousMarginDeclaration: Flags margin declarations that can be simplified.](SuperfluousMarginDeclaration.md.html) + - [SuperfluousNameSpace: Flags namespaces that are already declared.](SuperfluousNameSpace.md.html) + - [SuperfluousPaddingDeclaration: Flags padding declarations that can be simplified.](SuperfluousPaddingDeclaration.md.html) - [SupportAnnotationUsage: Incorrect support annotation usage](SupportAnnotationUsage.md.html) - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) + - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) @@ -398,7 +564,13 @@ - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) - [TextFields: Missing `inputType`](TextFields.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) + - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) + - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) + - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) + - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) + - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) + - [Todo: Marks todos in any given file.](Todo.md.html) - [TooDeepLayout: Layout hierarchy is too deep](TooDeepLayout.md.html) - [TooManyViews: Layout has too many views](TooManyViews.md.html) - [TranslucentOrientation: Mixing screenOrientation and translucency](TranslucentOrientation.md.html) @@ -423,6 +595,8 @@ - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) + - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) + - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) @@ -430,15 +604,19 @@ - [UnsafeProtectedBroadcastReceiver: Unsafe Protected `BroadcastReceiver`](UnsafeProtectedBroadcastReceiver.md.html) - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) + - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) - [UnsupportedChromeOsCameraSystemFeature: Looking for Rear Camera only feature](UnsupportedChromeOsCameraSystemFeature.md.html) - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) + - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) - [Untranslatable: Translated Untranslatable](Untranslatable.md.html) - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) + - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedIds: Unused id](UnusedIds.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) + - [UnusedMergeAttributes: Flags android and app attributes that are used on a attribute for custom Views.](UnusedMergeAttributes.md.html) - [UnusedNamespace: Unused namespace](UnusedNamespace.md.html) - [UnusedQuantity: Unused quantity translations](UnusedQuantity.md.html) - [UnusedResources: Unused resources](UnusedResources.md.html) @@ -463,10 +641,10 @@ - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) - [UseSwitchCompatOrMaterialXml: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialXml.md.html) + - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) - [UseValueOf: Should use `valueOf` instead of `new`](UseValueOf.md.html) - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - [UsingC2DM: Using C2DM](UsingC2DM.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) @@ -485,6 +663,8 @@ - [WakelockTimeout: Using wakeLock without timeout](WakelockTimeout.md.html) - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) + - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) @@ -499,18 +679,29 @@ - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) + - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) + - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) + - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) + - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) + - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) + - [WrongMenuIdFormat: Flag menu ids that are not in lowerCamelCase Format.](WrongMenuIdFormat.md.html) - [WrongRegion: Suspicious Language/Region Combination](WrongRegion.md.html) + - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) + - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) + - [WrongTestMethodName: Flags test methods that start with test.](WrongTestMethodName.md.html) - [WrongThread: Wrong Thread](WrongThread.md.html) - [WrongThreadInterprocedural: Wrong Thread (Interprocedural)](WrongThreadInterprocedural.md.html) - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) + - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) + - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) -* Withdrawn or Obsolete Issues (14) +* Withdrawn or Obsolete Issues (17) - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) @@ -526,4 +717,7 @@ - [MediaCapabilities](MediaCapabilities.md.html) - [UnpackedNativeCode](UnpackedNativeCode.md.html) - [Assert](Assert.md.html) + - [UsesMinSdkAttributes](UsesMinSdkAttributes.md.html) + - [Override](Override.md.html) + - [PackageManagerGetSignatures](PackageManagerGetSignatures.md.html) \ No newline at end of file diff --git a/docs/checks/libraries.md.html b/docs/checks/libraries.md.html new file mode 100644 index 00000000..08aced19 --- /dev/null +++ b/docs/checks/libraries.md.html @@ -0,0 +1,46 @@ + +(#) Lint Issue Index + +Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) | Libraries + +Lint-specific libraries: + +* [com.uber.autodispose2:autodispose-lint](com_uber_autodispose2_autodispose-lint.md.html) (1 checks) +* [com.google.dagger:dagger-lint](com_google_dagger_dagger-lint.md.html) (4 checks) +* [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) (7 checks) +* [com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html) (1 checks) +* [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) (41 checks) +* [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) (81 checks) +* [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) (18 checks) + +Android archive libraries which also contain bundled lint checks: + +* [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) (1 checks) +* [androidx.activity:activity](androidx_activity_activity.md.html) (1 checks) +* [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) (10 checks) +* [androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html) (1 checks) +* [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) (2 checks) +* [androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html) (1 checks) +* [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) (14 checks) +* [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) (2 checks) +* [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) (2 checks) +* [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) (2 checks) +* [androidx.compose.material3:material3](androidx_compose_material3_material3.md.html) (1 checks) +* [androidx.compose.material:material](androidx_compose_material_material.md.html) (2 checks) +* [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) (1 checks) +* [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) (2 checks) +* [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) (3 checks) +* [androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html) (1 checks) +* [androidx.navigation:navigation-common](androidx_navigation_navigation-common.md.html) (1 checks) +* [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) (4 checks) +* [androidx.fragment:fragment-testing](androidx_fragment_fragment-testing.md.html) (1 checks) +* [androidx.fragment:fragment-testing-manifest](androidx_fragment_fragment-testing-manifest.md.html) (1 checks) +* [androidx.fragment:fragment](androidx_fragment_fragment.md.html) (9 checks) +* [androidx.recyclerview:recyclerview](androidx_recyclerview_recyclerview.md.html) (1 checks) +* [androidx.work:work-runtime](androidx_work_work-runtime.md.html) (9 checks) +* [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) (10 checks) +* [androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html) (2 checks) +* [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) (3 checks) +* [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) (8 checks) + + \ No newline at end of file diff --git a/docs/checks/severity.md.html b/docs/checks/severity.md.html index 7523f0d6..2cea6925 100644 --- a/docs/checks/severity.md.html +++ b/docs/checks/severity.md.html @@ -1,10 +1,9 @@ (#) Lint Issue Index -Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | By severity | [By year](year.md.html) +Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | By severity | [By year](year.md.html) | [Libraries](libraries.md.html) - -* Fatal (51) +* Fatal (53) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) @@ -48,8 +47,10 @@ - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) - [TestAppLink: Unmatched URLs](TestAppLink.md.html) + - [Todo: Marks todos in any given file.](Todo.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - [UnknownId: Reference to an unknown id](UnknownId.md.html) + - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) - [UseRxSetProgress2: `setProgress` is deprecated. Use `setCompletableProgress` instead.](UseRxSetProgress2.md.html) - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) - [ValidRestrictions: Invalid Restrictions Descriptor](ValidRestrictions.md.html) @@ -59,47 +60,92 @@ - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) -* Error (154) +* Error (258) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - [AppCompatCustomView: Appcompat Custom Widgets](AppCompatCustomView.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) + - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) + - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) + - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) + - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) + - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) + - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) + - [ComposeMultipleContentEmitters: Composables should only be emit from one source](ComposeMultipleContentEmitters.md.html) + - [ComposeMutableParameters: Mutable objects in Compose will break state](ComposeMutableParameters.md.html) + - [ComposeNamingLowercase: Value-returning Composables should be lowercase](ComposeNamingLowercase.md.html) + - [ComposeNamingUppercase: Unit Composables should be uppercase](ComposeNamingUppercase.md.html) + - [ComposeParameterOrder: Composable function parameters should be ordered](ComposeParameterOrder.md.html) + - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) + - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) + - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) + - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) - [DalvikOverride: Method considered overridden by Dalvik](DalvikOverride.md.html) - [DefaultEncoding: Using Default Character Encoding](DefaultEncoding.md.html) - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) + - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) - [DiffUtilEquals: Suspicious DiffUtil Equality](DiffUtilEquals.md.html) + - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) + - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) + - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) + - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) + - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) + - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DuplicateDefinition: Duplicate definitions of resources](DuplicateDefinition.md.html) + - [EditedTargetSdkVersion: Manually Edited TargetSdkVersion](EditedTargetSdkVersion.md.html) - [EllipsizeMaxLines: Combining Ellipsize and Maxlines](EllipsizeMaxLines.md.html) - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) + - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) + - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) - [FontValidation: Validation of font files](FontValidation.md.html) + - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) + - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) - [FragmentAddMenuProvider: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentAddMenuProvider.md.html) - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) + - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) + - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) + - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) - [GetContentDescriptionOverride: Overriding `getContentDescription()` on a View](GetContentDescriptionOverride.md.html) - [GetLocales: Locale crash](GetLocales.md.html) - [GradleGetter: Gradle Implicit Getter Call](GradleGetter.md.html) - [GradleIdeError: Gradle IDE Support Issues](GradleIdeError.md.html) - [GradlePluginVersion: Incompatible Android Gradle Plugin](GradlePluginVersion.md.html) + - [GuavaChecksUsed: Use Slack's JavaPreconditions instead of Guava's Preconditions checks](GuavaChecksUsed.md.html) + - [GuavaPreconditionsUsedInKotlin: Kotlin precondition checks should use the Kotlin standard library checks](GuavaPreconditionsUsedInKotlin.md.html) - [HalfFloat: Incorrect Half Float](HalfFloat.md.html) - [HighAppVersionCode: VersionCode too high](HighAppVersionCode.md.html) - [ImpliedQuantity: Implied Quantities](ImpliedQuantity.md.html) - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) + - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) + - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) + - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) @@ -109,6 +155,7 @@ - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) - [InvalidWearFeatureAttribute: Invalid attribute for Wear uses-feature](InvalidWearFeatureAttribute.md.html) + - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) - [KotlinNullnessAnnotation: Kotlin nullability annotation](KotlinNullnessAnnotation.md.html) @@ -123,6 +170,7 @@ - [LocalSuppress: @SuppressLint on invalid element](LocalSuppress.md.html) - [LogTagMismatch: Mismatched Log Tags](LogTagMismatch.md.html) - [LongLogTag: Too Long Log Tags](LongLogTag.md.html) + - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) - [MangledCRLF: Mangled file line endings](MangledCRLF.md.html) - [MenuTitle: Missing menu title](MenuTitle.md.html) - [MergeMarker: Code contains merge marker](MergeMarker.md.html) @@ -137,10 +185,44 @@ - [MissingPermission: Missing Permissions](MissingPermission.md.html) - [MissingPrefix: Missing Android XML namespace](MissingPrefix.md.html) - [MissingQuantity: Missing quantity translation](MissingQuantity.md.html) + - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) - [MissingSuperCall: Missing Super Call](MissingSuperCall.md.html) - [MissingTranslation: Incomplete translation](MissingTranslation.md.html) - [MissingTvBanner: TV Missing Banner](MissingTvBanner.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) + - [MoshiUsageAdaptedByRequiresAdapter: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory.](MoshiUsageAdaptedByRequiresAdapter.md.html) + - [MoshiUsageAdaptedByRequiresKeep: Adapters targeted by @AdaptedBy must have @Keep.](MoshiUsageAdaptedByRequiresKeep.md.html) + - [MoshiUsageBlankGenerator: Don't use blank JsonClass.generator values.](MoshiUsageBlankGenerator.md.html) + - [MoshiUsageBlankJsonName: Don't use blank names in `@Json`.](MoshiUsageBlankJsonName.md.html) + - [MoshiUsageBlankTypeLabel: Moshi-sealed requires a type label specified after the 'sealed:' prefix.](MoshiUsageBlankTypeLabel.md.html) + - [MoshiUsageClassVisibility: @JsonClass-annotated types must be public, package-private, or internal.](MoshiUsageClassVisibility.md.html) + - [MoshiUsageDoubleClassAnnotation: Only use one of @AdaptedBy or @JsonClass.](MoshiUsageDoubleClassAnnotation.md.html) + - [MoshiUsageDoubleTypeLabel: Only use one of @TypeLabel or @DefaultObject.](MoshiUsageDoubleTypeLabel.md.html) + - [MoshiUsageDuplicateJsonName: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects.](MoshiUsageDuplicateJsonName.md.html) + - [MoshiUsageEnumAnnotatedUnknown: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json](MoshiUsageEnumAnnotatedUnknown.md.html) + - [MoshiUsageEnumJsonClassGenerated: Enums annotated with @JsonClass must not set `generateAdapter` to true.](MoshiUsageEnumJsonClassGenerated.md.html) + - [MoshiUsageEnumMissingJsonClass: Enums serialized with Moshi should be annotated with @JsonClass.](MoshiUsageEnumMissingJsonClass.md.html) + - [MoshiUsageEnumMissingUnknown: Enums serialized with Moshi must reserve the first member as UNKNOWN.](MoshiUsageEnumMissingUnknown.md.html) + - [MoshiUsageEnumPropertyDefaultUnknown: Suspicious default value to 'UNKNOWN' for a Moshi enum.](MoshiUsageEnumPropertyDefaultUnknown.md.html) + - [MoshiUsageGenerateAdapterShouldBeTrue: JsonClass.generateAdapter must be true in order for Moshi code gen to run.](MoshiUsageGenerateAdapterShouldBeTrue.md.html) + - [MoshiUsageGenericSealedSubtype: Sealed subtypes used with moshi-sealed cannot be generic.](MoshiUsageGenericSealedSubtype.md.html) + - [MoshiUsageInappropriateTypeLabel: Inappropriate @TypeLabel or @DefaultObject annotation.](MoshiUsageInappropriateTypeLabel.md.html) + - [MoshiUsageMissingPrimary: @JsonClass-annotated types must have a primary constructor or be sealed.](MoshiUsageMissingPrimary.md.html) + - [MoshiUsageMissingTypeLabel: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject.](MoshiUsageMissingTypeLabel.md.html) + - [MoshiUsageMutableCollections: Use immutable collections rather than mutable versions.](MoshiUsageMutableCollections.md.html) + - [MoshiUsageNonMoshiClassExternal: External type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassExternal.md.html) + - [MoshiUsageObject: Object types cannot be annotated with @JsonClass.](MoshiUsageObject.md.html) + - [MoshiUsageParamNeedsInit: Constructor non-property parameters in Moshi classes must have default values.](MoshiUsageParamNeedsInit.md.html) + - [MoshiUsagePrivateConstructor: Constructors in Moshi classes cannot be private.](MoshiUsagePrivateConstructor.md.html) + - [MoshiUsagePrivateConstructorProperty: Constructor parameter properties in Moshi classes cannot be private.](MoshiUsagePrivateConstructorProperty.md.html) + - [MoshiUsageQualifierRetention: JsonQualifiers must have RUNTIME retention.](MoshiUsageQualifierRetention.md.html) + - [MoshiUsageQualifierTarget: JsonQualifiers must include FIELD targeting.](MoshiUsageQualifierTarget.md.html) + - [MoshiUsageRedundantSiteTarget: Use of site-targets on @Json are redundant.](MoshiUsageRedundantSiteTarget.md.html) + - [MoshiUsageSealedMustBeSealed: Moshi-sealed can only be applied to 'sealed' types.](MoshiUsageSealedMustBeSealed.md.html) + - [MoshiUsageSerializedName: Use Moshi's @Json rather than Gson's @SerializedName.](MoshiUsageSerializedName.md.html) + - [MoshiUsageTransientNeedsInit: Transient constructor properties must have default values.](MoshiUsageTransientNeedsInit.md.html) + - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) + - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) @@ -153,9 +235,9 @@ - [OnClick: `onClick` method does not exist](OnClick.md.html) - [OpenForTesting: Extending API only allowed from tests](OpenForTesting.md.html) - [Orientation: Missing explicit orientation](Orientation.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) + - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) @@ -164,7 +246,9 @@ - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [Range: Outside Range](Range.md.html) + - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) + - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - [RememberReturnType: `remember` calls must not return `Unit`](RememberReturnType.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) @@ -173,28 +257,44 @@ - [ReservedSystemPermission: Permission name is a reserved Android permission](ReservedSystemPermission.md.html) - [ResourceAsColor: Should pass resolved color instead of resource id](ResourceAsColor.md.html) - [ResourceType: Wrong Resource Type](ResourceType.md.html) + - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RestrictedApi: Restricted API](RestrictedApi.md.html) + - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [ReturnThis: Method must return `this`](ReturnThis.md.html) - [RtlCompat: Right-to-left text compatibility issues](RtlCompat.md.html) + - [RxJava2MissingCompositeDisposableClear: Marks CompositeDisposables that are not being cleared.](RxJava2MissingCompositeDisposableClear.md.html) + - [RxJava2SubscribeMissingOnError: Flags a version of the subscribe() method without an error Consumer.](RxJava2SubscribeMissingOnError.md.html) + - [ScheduleExactAlarm: Scheduling Exact Alarms Without Required Permission](ScheduleExactAlarm.md.html) + - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) + - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [StringFormatInvalid: Invalid format string](StringFormatInvalid.md.html) - [StringFormatMatches: `String.format` string doesn't match the XML format string](StringFormatMatches.md.html) - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) + - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) - [SupportAnnotationUsage: Incorrect support annotation usage](SupportAnnotationUsage.md.html) - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) + - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) + - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) + - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) + - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) + - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) + - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) + - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) @@ -206,21 +306,27 @@ - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) - [VectorDrawableCompat: Using VectorDrawableCompat](VectorDrawableCompat.md.html) - [ViewBindingType: `tools:viewBindingType` issues](ViewBindingType.md.html) + - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WebViewLayout: WebViews in wrap_content parents](WebViewLayout.md.html) - [WebpUnsupported: WebP Unsupported](WebpUnsupported.md.html) - [WifiManagerLeak: WifiManager Leak](WifiManagerLeak.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) + - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) + - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) + - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) - [WrongThread: Wrong Thread](WrongThread.md.html) - [WrongThreadInterprocedural: Wrong Thread (Interprocedural)](WrongThreadInterprocedural.md.html) - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) -* Warning (299) +* Warning (378) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) + - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) - [AllCaps: Combining textAllCaps and markup](AllCaps.md.html) - [AllowAllHostnameVerifier: Insecure `HostnameVerifier`](AllowAllHostnameVerifier.md.html) - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) @@ -232,28 +338,40 @@ - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) + - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) + - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) - [AuthLeak: Code might contain an auth leak](AuthLeak.md.html) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) + - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [Autofill: Use Autofill](Autofill.md.html) - [BackButton: Back button](BackButton.md.html) - [BadHostnameVerifier: Insecure HostnameVerifier](BadHostnameVerifier.md.html) - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) + - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) + - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) + - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) + - [ChromeOsOnConfigurationChanged: Poor performance with APIs inside `onConfigurationChanged()`](ChromeOsOnConfigurationChanged.md.html) - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) + - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) - [CommitPrefEdits: Missing `commit()` on `SharedPreference` editor](CommitPrefEdits.md.html) - [CommitTransaction: Missing `commit()` calls](CommitTransaction.md.html) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) + - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) + - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConstantLocale: Constant Locale](ConstantLocale.md.html) + - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) @@ -264,10 +382,13 @@ - [DataBindingWithoutKapt: Data Binding without Annotation Processing](DataBindingWithoutKapt.md.html) - [DataExtractionRules: Missing data extraction rules](DataExtractionRules.md.html) - [DeepLinkInActivityDestination: A should not be attached to an destination](DeepLinkInActivityDestination.md.html) + - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) - [Deprecated: Using deprecated resources](Deprecated.md.html) + - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) + - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) - [DetachAndAttachSameFragment: Separate attach() and detach() into separate FragmentTransactions](DetachAndAttachSameFragment.md.html) - [DevModeObsolete: Dev Mode Obsolete](DevModeObsolete.md.html) - [DeviceAdmin: Malformed Device Admin](DeviceAdmin.md.html) @@ -283,14 +404,17 @@ - [EasterEgg: Code contains easter egg](EasterEgg.md.html) - [EmptySuperCall: Calling an empty super method](EmptySuperCall.md.html) - [EnqueueWork: WorkManager Enqueue](EnqueueWork.md.html) + - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExportedContentProvider: Content provider does not require permission](ExportedContentProvider.md.html) - [ExportedPreferenceActivity: PreferenceActivity should not be exported](ExportedPreferenceActivity.md.html) - [ExportedReceiver: Receiver does not require permission](ExportedReceiver.md.html) - [ExportedService: Exported service does not require permission](ExportedService.md.html) + - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) - [FileEndsWithExt: File endsWith on file extensions](FileEndsWithExt.md.html) - [FindViewByIdCast: Add Explicit Cast](FindViewByIdCast.md.html) + - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) - [GestureBackNavigation: Usage of KeyEvent.KEYCODE_BACK](GestureBackNavigation.md.html) @@ -324,10 +448,13 @@ - [IgnoreWithoutReason: @Ignore without Reason](IgnoreWithoutReason.md.html) - [IllegalResourceRef: Name and version must be integer or string, not resource](IllegalResourceRef.md.html) - [ImplicitSamInstance: Implicit SAM Instances](ImplicitSamInstance.md.html) + - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) + - [IncorrectChainMarginsUsage: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain.](IncorrectChainMarginsUsage.md.html) + - [IncorrectMatchParentUsage: Prefer using `Dimension.percent(1f)` when defining custom constraints.](IncorrectMatchParentUsage.md.html) - [InefficientWeight: Inefficient layout weight](InefficientWeight.md.html) - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) @@ -338,16 +465,27 @@ - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) + - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) + - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) + - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) + - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) - [JobSchedulerService: JobScheduler problems](JobSchedulerService.md.html) + - [JvmStaticProvidesInObjectDetector: @JvmStatic used for @Provides function in an object class](JvmStaticProvidesInObjectDetector.md.html) + - [KaptUsageInsteadOfKsp: Kapt usage should be replaced with KSP](KaptUsageInsteadOfKsp.md.html) - [KeyboardInaccessibleWidget: Keyboard inaccessible widget](KeyboardInaccessibleWidget.md.html) + - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) + - [KotlinRequireNotNullUseMessage: Marks usage of the requireNotNull method without lazy messages.](KotlinRequireNotNullUseMessage.md.html) + - [KotlincFE10: Avoid using old K1 Kotlin compiler APIs](KotlincFE10.md.html) - [LabelFor: Missing accessibility label](LabelFor.md.html) - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) - [LaunchActivityFromNotification: Notification Launches Services or BroadcastReceivers](LaunchActivityFromNotification.md.html) + - [LayoutFileNameMatchesClass: Checks that the layout file matches the class name.](LayoutFileNameMatchesClass.md.html) - [LeanbackUsesWifi: Using android.hardware.wifi on TV](LeanbackUsesWifi.md.html) - [LifecycleAnnotationProcessorWithJava8: Lifecycle Annotation Processor with Java 8 Compile Option](LifecycleAnnotationProcessorWithJava8.md.html) - [LintDocExample: Missing Documentation Example](LintDocExample.md.html) @@ -356,7 +494,10 @@ - [LocaleFolder: Wrong locale name](LocaleFolder.md.html) - [LockedOrientationActivity: Incompatible screenOrientation value](LockedOrientationActivity.md.html) - [LogConditional: Unconditional Logging Calls](LogConditional.md.html) + - [LogNotTimber: Logging call to Log instead of Timber](LogNotTimber.md.html) - [ManifestOrder: Incorrect order of elements in manifest](ManifestOrder.md.html) + - [MatchingMenuId: Flags menu ids that don't match with the file name.](MatchingMenuId.md.html) + - [MatchingViewId: Flags view ids that don't match with the file name.](MatchingViewId.md.html) - [MergeRootFrame: FrameLayout can be replaced with `` tag](MergeRootFrame.md.html) - [MinSdkTooLow: API Version Too Low](MinSdkTooLow.md.html) - [MipmapIcons: Use Mipmap Launcher Icons](MipmapIcons.md.html) @@ -365,18 +506,32 @@ - [MissingColorAlphaChannel: Missing Color alpha channel](MissingColorAlphaChannel.md.html) - [MissingFirebaseInstanceTokenRefresh: Missing Firebase Messaging Callback](MissingFirebaseInstanceTokenRefresh.md.html) - [MissingId: Fragments should specify an `id` or `tag`](MissingId.md.html) + - [MissingScrollbars: Scroll views should declare a scrollbar.](MissingScrollbars.md.html) - [MissingVersion: Missing application name/version](MissingVersion.md.html) + - [MissingXmlHeader: Flags xml files that don't have a header.](MissingXmlHeader.md.html) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) + - [ModuleCompanionObjects: Module companion objects should not be annotated with @Module.](ModuleCompanionObjects.md.html) + - [ModuleCompanionObjectsNotInModuleParent: Companion objects should not be annotated with @Module.](ModuleCompanionObjectsNotInModuleParent.md.html) - [MonochromeLauncherIcon: Monochrome icon is not defined](MonochromeLauncherIcon.md.html) + - [MoshiUsageArray: Prefer List over Array.](MoshiUsageArray.md.html) + - [MoshiUsageEnumCasing: Consider using `@Json(name = ...)` rather than lower casing.](MoshiUsageEnumCasing.md.html) + - [MoshiUsageEnumPropertyCouldBeMoshi: Consider making enum properties also use Moshi.](MoshiUsageEnumPropertyCouldBeMoshi.md.html) + - [MoshiUsageNonMoshiClassPlatform: Platform type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassPlatform.md.html) + - [MoshiUsageRedundantJsonName: Json.name with the same value as the property/enum member name is redundant.](MoshiUsageRedundantJsonName.md.html) + - [MoshiUsageSnakeCase: Consider using `@Json(name = ...)` rather than direct snake casing.](MoshiUsageSnakeCase.md.html) + - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) + - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) + - [NamingPattern: Names should be well named.](NamingPattern.md.html) - [NegativeMargin: Negative Margins](NegativeMargin.md.html) - [NestedScrolling: Nested scrolling widgets](NestedScrolling.md.html) - [NestedWeights: Nested layout weights](NestedWeights.md.html) - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) + - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) @@ -385,9 +540,9 @@ - [ObsoleteLayoutParam: Obsolete layout params](ObsoleteLayoutParam.md.html) - [ObsoleteSdkInt: Obsolete SDK_INT Version Check](ObsoleteSdkInt.md.html) - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) + - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - [Overdraw: Overdraw: Painting regions more than once](Overdraw.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) @@ -396,20 +551,31 @@ - [PrivateApi: Using Private APIs](PrivateApi.md.html) - [PrivateResource: Using private resources](PrivateResource.md.html) - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) + - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) + - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) + - [RawDimen: Flags dimensions that are not defined as resource.](RawDimen.md.html) - [Recycle: Missing `recycle()` calls](Recycle.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [RedundantNamespace: Redundant namespace](RedundantNamespace.md.html) - [Registered: Class is not registered in the manifest](Registered.md.html) - [RelativeOverlap: Overlapping items in RelativeLayout](RelativeOverlap.md.html) - [RequiresFeature: Requires Feature](RequiresFeature.md.html) + - [ResourcesGetColorCall: Marks usage of deprecated getColor() on Resources.](ResourcesGetColorCall.md.html) + - [ResourcesGetColorStateListCall: Marks usage of deprecated getColorStateList() on Resources.](ResourcesGetColorStateListCall.md.html) + - [ResourcesGetDrawableCall: Marks usage of deprecated getDrawable() on Resources.](ResourcesGetDrawableCall.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) - [RtlEnabled: Using RTL attributes without enabling RTL support](RtlEnabled.md.html) - [RtlHardcoded: Using left/right instead of start/end attributes](RtlHardcoded.md.html) - [RtlSymmetry: Padding and margin symmetry](RtlSymmetry.md.html) + - [RxJava2DefaultScheduler: Pass a scheduler instead of relying on the default Scheduler.](RxJava2DefaultScheduler.md.html) + - [RxJava2DisposableAddAllCall: Marks usage of addAll() on CompositeDisposable.](RxJava2DisposableAddAllCall.md.html) + - [RxJava2DisposableDisposeCall: Marks usage of dispose() on CompositeDisposable.](RxJava2DisposableDisposeCall.md.html) + - [RxJava2MethodMissingCheckReturnValue: Method is missing the @CheckReturnValue annotation.](RxJava2MethodMissingCheckReturnValue.md.html) + - [RxJava2SchedulersFactoryCall: Instead of calling the Schedulers factory methods directly inject the Schedulers.](RxJava2SchedulersFactoryCall.md.html) - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) @@ -419,12 +585,14 @@ - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) + - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) - [SetWorldReadable: `File.setReadable()` used to make file world-readable](SetWorldReadable.md.html) - [SetWorldWritable: `File.setWritable()` used to make file world-writable](SetWorldWritable.md.html) - [ShiftFlags: Dangerous Flag Constant Declaration](ShiftFlags.md.html) - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) + - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) @@ -437,7 +605,12 @@ - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - [StaticFieldLeak: Static Field Leaks](StaticFieldLeak.md.html) - [StringFormatCount: Formatting argument types incomplete or inconsistent](StringFormatCount.md.html) + - [StringFormatInTimber: Logging call with Timber contains String#format()](StringFormatInTimber.md.html) - [StringFormatTrivial: `String.format` string only contains trivial conversions](StringFormatTrivial.md.html) + - [StringNotCapitalized: Marks strings which are not capitalized.](StringNotCapitalized.md.html) + - [SuperfluousMarginDeclaration: Flags margin declarations that can be simplified.](SuperfluousMarginDeclaration.md.html) + - [SuperfluousNameSpace: Flags namespaces that are already declared.](SuperfluousNameSpace.md.html) + - [SuperfluousPaddingDeclaration: Flags padding declarations that can be simplified.](SuperfluousPaddingDeclaration.md.html) - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - [SyntheticAccessor: Synthetic Accessor](SyntheticAccessor.md.html) @@ -445,7 +618,9 @@ - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) - [TextFields: Missing `inputType`](TextFields.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) + - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) + - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) - [TooDeepLayout: Layout hierarchy is too deep](TooDeepLayout.md.html) - [TooManyViews: Layout has too many views](TooManyViews.md.html) - [TranslucentOrientation: Mixing screenOrientation and translucency](TranslucentOrientation.md.html) @@ -464,14 +639,15 @@ - [UnnecessaryComposedModifier: Modifier.composed should only be used for modifiers that invoke @Composable functions](UnnecessaryComposedModifier.md.html) - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) + - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) - [UnsafeProtectedBroadcastReceiver: Unsafe Protected `BroadcastReceiver`](UnsafeProtectedBroadcastReceiver.md.html) - - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) - [UnsupportedChromeOsCameraSystemFeature: Looking for Rear Camera only feature](UnsupportedChromeOsCameraSystemFeature.md.html) - [Untranslatable: Translated Untranslatable](Untranslatable.md.html) - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) - [UnusedIds: Unused id](UnusedIds.md.html) + - [UnusedMergeAttributes: Flags android and app attributes that are used on a attribute for custom Views.](UnusedMergeAttributes.md.html) - [UnusedNamespace: Unused namespace](UnusedNamespace.md.html) - [UnusedQuantity: Unused quantity translations](UnusedQuantity.md.html) - [UnusedResources: Unused resources](UnusedResources.md.html) @@ -491,10 +667,10 @@ - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) - [UseSwitchCompatOrMaterialXml: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialXml.md.html) + - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) - [UseValueOf: Should use `valueOf` instead of `new`](UseValueOf.md.html) - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [VectorPath: Long vector paths](VectorPath.md.html) @@ -507,7 +683,7 @@ - [WakelockTimeout: Using wakeLock without timeout](WakelockTimeout.md.html) - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) - - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) + - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableConfigurationAction: Wear configuration action metadata must match an activity](WearableConfigurationAction.md.html) - [WebViewApiAvailability: WebView API Availability](WebViewApiAvailability.md.html) @@ -516,19 +692,34 @@ - [WifiManagerPotentialLeak: WifiManager Potential Leak](WifiManagerPotentialLeak.md.html) - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) + - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) + - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) + - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) + - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) + - [WrongMenuIdFormat: Flag menu ids that are not in lowerCamelCase Format.](WrongMenuIdFormat.md.html) - [WrongRegion: Suspicious Language/Region Combination](WrongRegion.md.html) + - [WrongTestMethodName: Flags test methods that start with test.](WrongTestMethodName.md.html) + - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) + - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) -* Information (1) +* Information (7) + - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) + - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) + - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) + - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) + - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) + - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) -* Disabled By Default (40) +* Disabled By Default (42) - [AppCompatMethod](AppCompatMethod.md.html) - [AppLinksAutoVerify](AppLinksAutoVerify.md.html) - [BackButton](BackButton.md.html) - [ComposableLambdaParameterNaming](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition](ComposableLambdaParameterPosition.md.html) + - [ComposeM2Api](ComposeM2Api.md.html) - [ConvertToWebp](ConvertToWebp.md.html) - [DalvikOverride](DalvikOverride.md.html) - [DefaultEncoding](DefaultEncoding.md.html) @@ -539,6 +730,7 @@ - [ImplicitSamInstance](ImplicitSamInstance.md.html) - [InvalidPackage](InvalidPackage.md.html) - [KotlinPropertyAccess](KotlinPropertyAccess.md.html) + - [KotlincFE10](KotlincFE10.md.html) - [LambdaLast](LambdaLast.md.html) - [LintDocExample](LintDocExample.md.html) - [LintImplPsiEquals](LintImplPsiEquals.md.html) @@ -549,7 +741,7 @@ - [NegativeMargin](NegativeMargin.md.html) - [NewerVersionAvailable](NewerVersionAvailable.md.html) - [NoHardKeywords](NoHardKeywords.md.html) - - [PermissionImpliesUnsupportedChromeOsHardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) + - [NoOp](NoOp.md.html) - [PermissionNamingConvention](PermissionNamingConvention.md.html) - [Registered](Registered.md.html) - [RequiredSize](RequiredSize.md.html) @@ -565,7 +757,7 @@ - [VulnerableCordovaVersion](VulnerableCordovaVersion.md.html) - [WrongThreadInterprocedural](WrongThreadInterprocedural.md.html) -* Withdrawn or Obsolete Issues (14) +* Withdrawn or Obsolete Issues (17) - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) @@ -581,4 +773,7 @@ - [MediaCapabilities](MediaCapabilities.md.html) - [UnpackedNativeCode](UnpackedNativeCode.md.html) - [Assert](Assert.md.html) + - [UsesMinSdkAttributes](UsesMinSdkAttributes.md.html) + - [Override](Override.md.html) + - [PackageManagerGetSignatures](PackageManagerGetSignatures.md.html) \ No newline at end of file diff --git a/docs/checks/vendors.md.html b/docs/checks/vendors.md.html index 09c517e7..f97d43f9 100644 --- a/docs/checks/vendors.md.html +++ b/docs/checks/vendors.md.html @@ -1,9 +1,9 @@ (#) Lint Issue Index -Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | By vendor | [By severity](severity.md.html) | [By year](year.md.html) +Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | By vendor | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Built In (430) +* Built In (448) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) @@ -32,7 +32,9 @@ - [BadHostnameVerifier: Insecure HostnameVerifier](BadHostnameVerifier.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) + - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) + - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) @@ -41,6 +43,8 @@ - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) + - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) + - [ChromeOsOnConfigurationChanged: Poor performance with APIs inside `onConfigurationChanged()`](ChromeOsOnConfigurationChanged.md.html) - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [CommitPrefEdits: Missing `commit()` on `SharedPreference` editor](CommitPrefEdits.md.html) @@ -78,10 +82,12 @@ - [DuplicateStrings: Duplicate Strings](DuplicateStrings.md.html) - [DuplicateUsesFeature: Feature declared more than once](DuplicateUsesFeature.md.html) - [EasterEgg: Code contains easter egg](EasterEgg.md.html) + - [EditedTargetSdkVersion: Manually Edited TargetSdkVersion](EditedTargetSdkVersion.md.html) - [EllipsizeMaxLines: Combining Ellipsize and Maxlines](EllipsizeMaxLines.md.html) - [EmptySuperCall: Calling an empty super method](EmptySuperCall.md.html) - [EnforceUTF8: Encoding used in resource files is not UTF-8](EnforceUTF8.md.html) - [EnqueueWork: WorkManager Enqueue](EnqueueWork.md.html) + - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExpiredTargetSdkVersion: TargetSdkVersion No Longer Supported](ExpiredTargetSdkVersion.md.html) @@ -95,6 +101,8 @@ - [FileEndsWithExt: File endsWith on file extensions](FileEndsWithExt.md.html) - [FindViewByIdCast: Add Explicit Cast](FindViewByIdCast.md.html) - [FontValidation: Validation of font files](FontValidation.md.html) + - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) + - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) - [FullBackupContent: Valid Full Backup Content File](FullBackupContent.md.html) - [GestureBackNavigation: Usage of KeyEvent.KEYCODE_BACK](GestureBackNavigation.md.html) - [GetContentDescriptionOverride: Overriding `getContentDescription()` on a View](GetContentDescriptionOverride.md.html) @@ -169,10 +177,12 @@ - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) - [JobSchedulerService: JobScheduler problems](JobSchedulerService.md.html) + - [KaptUsageInsteadOfKsp: Kapt usage should be replaced with KSP](KaptUsageInsteadOfKsp.md.html) - [KeyboardInaccessibleWidget: Keyboard inaccessible widget](KeyboardInaccessibleWidget.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) - [KotlinNullnessAnnotation: Kotlin nullability annotation](KotlinNullnessAnnotation.md.html) - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) + - [KotlincFE10: Avoid using old K1 Kotlin compiler APIs](KotlincFE10.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - [LabelFor: Missing accessibility label](LabelFor.md.html) - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) @@ -241,6 +251,7 @@ - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) + - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) @@ -260,9 +271,7 @@ - [Orientation: Missing explicit orientation](Orientation.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - [Overdraw: Overdraw: Painting regions more than once](Overdraw.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) @@ -279,6 +288,7 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) @@ -292,6 +302,7 @@ - [Registered: Class is not registered in the manifest](Registered.md.html) - [RelativeOverlap: Overlapping items in RelativeLayout](RelativeOverlap.md.html) - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) + - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - [RequiresFeature: Requires Feature](RequiresFeature.md.html) - [ResAuto: Hardcoded Package in Namespace](ResAuto.md.html) @@ -310,6 +321,7 @@ - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) + - [ScheduleExactAlarm: Scheduling Exact Alarms Without Required Permission](ScheduleExactAlarm.md.html) - [ScopedStorage: Affected by scoped storage](ScopedStorage.md.html) - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) @@ -317,6 +329,7 @@ - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) + - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) - [SetWorldReadable: `File.setReadable()` used to make file world-readable](SetWorldReadable.md.html) @@ -372,9 +385,12 @@ - [UnlocalizedSms: SMS phone number missing country code](UnlocalizedSms.md.html) - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) + - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) + - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - [UnsafeProtectedBroadcastReceiver: Unsafe Protected `BroadcastReceiver`](UnsafeProtectedBroadcastReceiver.md.html) - [UnspecifiedImmutableFlag: Missing `PendingIntent` mutability flag](UnspecifiedImmutableFlag.md.html) + - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) - [UnsupportedChromeOsCameraSystemFeature: Looking for Rear Camera only feature](UnsupportedChromeOsCameraSystemFeature.md.html) - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) @@ -391,10 +407,10 @@ - [UseCompoundDrawables: Node can be replaced by a `TextView` with compound drawables](UseCompoundDrawables.md.html) - [UseOfBundledGooglePlayServices: Use of bundled version of Google Play services](UseOfBundledGooglePlayServices.md.html) - [UseSparseArrays: HashMap can be replaced with SparseArray](UseSparseArrays.md.html) + - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) - [UseValueOf: Should use `valueOf` instead of `new`](UseValueOf.md.html) - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - [UsingC2DM: Using C2DM](UsingC2DM.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) @@ -412,6 +428,8 @@ - [WakelockTimeout: Using wakeLock without timeout](WakelockTimeout.md.html) - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) + - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) @@ -440,11 +458,12 @@ - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) -* Android Open Source Project (androidx.annotation.experimental) (3) +* Android Open Source Project (androidx.annotation.experimental) (4) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) + - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) * Android Open Source Project (androidx.appcompat) (10) @@ -463,6 +482,12 @@ - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) +* Android Open Source Project (androidx.constraintlayout.compose) (3) + + - [IncorrectChainMarginsUsage: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain.](IncorrectChainMarginsUsage.md.html) + - [IncorrectMatchParentUsage: Prefer using `Dimension.percent(1f)` when defining custom constraints.](IncorrectMatchParentUsage.md.html) + - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) + * Android Open Source Project (androidx.fragment) (9) - [DetachAndAttachSameFragment: Separate attach() and detach() into separate FragmentTransactions](DetachAndAttachSameFragment.md.html) @@ -479,6 +504,10 @@ - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) +* Android Open Source Project (androidx.fragment.testing.manifest) (1) + + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) + * Android Open Source Project (androidx.lifecycle) (3) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) @@ -515,12 +544,31 @@ - [UseRxSetProgress2: `setProgress` is deprecated. Use `setCompletableProgress` instead.](UseRxSetProgress2.md.html) - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) +* Google (com.google.dagger:dagger-lint) (4) + + - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) + - [JvmStaticProvidesInObjectDetector: @JvmStatic used for @Provides function in an object class](JvmStaticProvidesInObjectDetector.md.html) + - [ModuleCompanionObjects: Module companion objects should not be annotated with @Module.](ModuleCompanionObjects.md.html) + - [ModuleCompanionObjectsNotInModuleParent: Companion objects should not be annotated with @Module.](ModuleCompanionObjectsNotInModuleParent.md.html) + +* JakeWharton/timber (com.jakewharton.timber:timber:{version}) (8) + + - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) + - [LogNotTimber: Logging call to Log instead of Timber](LogNotTimber.md.html) + - [StringFormatInTimber: Logging call with Timber contains String#format()](StringFormatInTimber.md.html) + - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) + - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) + - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) + - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) + - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) + * Jetpack Activity Compose (androidx.activity.compose) (1) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) -* Jetpack Compose (androidx.compose.animation) (1) +* Jetpack Compose (androidx.compose.animation) (2) + - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) * Jetpack Compose (androidx.compose.animation.core) (2) @@ -542,8 +590,10 @@ - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) -* Jetpack Compose (androidx.compose.runtime) (11) +* Jetpack Compose (androidx.compose.runtime) (14) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) + - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) @@ -551,6 +601,7 @@ - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) + - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - [ProduceStateDoesNotAssignValue: produceState calls should assign `value` inside the producer lambda](ProduceStateDoesNotAssignValue.md.html) - [RememberReturnType: `remember` calls must not return `Unit`](RememberReturnType.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) @@ -560,14 +611,17 @@ - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) -* Jetpack Compose (androidx.compose.ui) (7) +* Jetpack Compose (androidx.compose.ui) (10) - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) + - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) + - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) + - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [UnnecessaryComposedModifier: Modifier.composed should only be used for modifiers that invoke @Composable functions](UnnecessaryComposedModifier.md.html) * Jetpack Compose (androidx.compose.ui.graphics) (2) @@ -581,7 +635,168 @@ - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) -* Withdrawn or Obsolete Issues (14) +* slack (com.slack.lint.compose:compose-lints) (18) + + - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) + - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) + - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) + - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) + - [ComposeMultipleContentEmitters: Composables should only be emit from one source](ComposeMultipleContentEmitters.md.html) + - [ComposeMutableParameters: Mutable objects in Compose will break state](ComposeMutableParameters.md.html) + - [ComposeNamingLowercase: Value-returning Composables should be lowercase](ComposeNamingLowercase.md.html) + - [ComposeNamingUppercase: Unit Composables should be uppercase](ComposeNamingUppercase.md.html) + - [ComposeParameterOrder: Composable function parameters should be ordered](ComposeParameterOrder.md.html) + - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) + - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) + - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) + - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) + - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) + +* slack (slack-lint) (81) + + - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) + - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) + - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) + - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) + - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) + - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) + - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) + - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) + - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) + - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) + - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) + - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) + - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) + - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) + - [GuavaChecksUsed: Use Slack's JavaPreconditions instead of Guava's Preconditions checks](GuavaChecksUsed.md.html) + - [GuavaPreconditionsUsedInKotlin: Kotlin precondition checks should use the Kotlin standard library checks](GuavaPreconditionsUsedInKotlin.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) + - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) + - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) + - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) + - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) + - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) + - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) + - [MoshiUsageAdaptedByRequiresAdapter: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory.](MoshiUsageAdaptedByRequiresAdapter.md.html) + - [MoshiUsageAdaptedByRequiresKeep: Adapters targeted by @AdaptedBy must have @Keep.](MoshiUsageAdaptedByRequiresKeep.md.html) + - [MoshiUsageArray: Prefer List over Array.](MoshiUsageArray.md.html) + - [MoshiUsageBlankGenerator: Don't use blank JsonClass.generator values.](MoshiUsageBlankGenerator.md.html) + - [MoshiUsageBlankJsonName: Don't use blank names in `@Json`.](MoshiUsageBlankJsonName.md.html) + - [MoshiUsageBlankTypeLabel: Moshi-sealed requires a type label specified after the 'sealed:' prefix.](MoshiUsageBlankTypeLabel.md.html) + - [MoshiUsageClassVisibility: @JsonClass-annotated types must be public, package-private, or internal.](MoshiUsageClassVisibility.md.html) + - [MoshiUsageDoubleClassAnnotation: Only use one of @AdaptedBy or @JsonClass.](MoshiUsageDoubleClassAnnotation.md.html) + - [MoshiUsageDoubleTypeLabel: Only use one of @TypeLabel or @DefaultObject.](MoshiUsageDoubleTypeLabel.md.html) + - [MoshiUsageDuplicateJsonName: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects.](MoshiUsageDuplicateJsonName.md.html) + - [MoshiUsageEnumAnnotatedUnknown: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json](MoshiUsageEnumAnnotatedUnknown.md.html) + - [MoshiUsageEnumCasing: Consider using `@Json(name = ...)` rather than lower casing.](MoshiUsageEnumCasing.md.html) + - [MoshiUsageEnumJsonClassGenerated: Enums annotated with @JsonClass must not set `generateAdapter` to true.](MoshiUsageEnumJsonClassGenerated.md.html) + - [MoshiUsageEnumMissingJsonClass: Enums serialized with Moshi should be annotated with @JsonClass.](MoshiUsageEnumMissingJsonClass.md.html) + - [MoshiUsageEnumMissingUnknown: Enums serialized with Moshi must reserve the first member as UNKNOWN.](MoshiUsageEnumMissingUnknown.md.html) + - [MoshiUsageEnumPropertyCouldBeMoshi: Consider making enum properties also use Moshi.](MoshiUsageEnumPropertyCouldBeMoshi.md.html) + - [MoshiUsageEnumPropertyDefaultUnknown: Suspicious default value to 'UNKNOWN' for a Moshi enum.](MoshiUsageEnumPropertyDefaultUnknown.md.html) + - [MoshiUsageGenerateAdapterShouldBeTrue: JsonClass.generateAdapter must be true in order for Moshi code gen to run.](MoshiUsageGenerateAdapterShouldBeTrue.md.html) + - [MoshiUsageGenericSealedSubtype: Sealed subtypes used with moshi-sealed cannot be generic.](MoshiUsageGenericSealedSubtype.md.html) + - [MoshiUsageInappropriateTypeLabel: Inappropriate @TypeLabel or @DefaultObject annotation.](MoshiUsageInappropriateTypeLabel.md.html) + - [MoshiUsageMissingPrimary: @JsonClass-annotated types must have a primary constructor or be sealed.](MoshiUsageMissingPrimary.md.html) + - [MoshiUsageMissingTypeLabel: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject.](MoshiUsageMissingTypeLabel.md.html) + - [MoshiUsageMutableCollections: Use immutable collections rather than mutable versions.](MoshiUsageMutableCollections.md.html) + - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) + - [MoshiUsageNonMoshiClassExternal: External type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassExternal.md.html) + - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) + - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) + - [MoshiUsageNonMoshiClassPlatform: Platform type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassPlatform.md.html) + - [MoshiUsageObject: Object types cannot be annotated with @JsonClass.](MoshiUsageObject.md.html) + - [MoshiUsageParamNeedsInit: Constructor non-property parameters in Moshi classes must have default values.](MoshiUsageParamNeedsInit.md.html) + - [MoshiUsagePrivateConstructor: Constructors in Moshi classes cannot be private.](MoshiUsagePrivateConstructor.md.html) + - [MoshiUsagePrivateConstructorProperty: Constructor parameter properties in Moshi classes cannot be private.](MoshiUsagePrivateConstructorProperty.md.html) + - [MoshiUsageQualifierRetention: JsonQualifiers must have RUNTIME retention.](MoshiUsageQualifierRetention.md.html) + - [MoshiUsageQualifierTarget: JsonQualifiers must include FIELD targeting.](MoshiUsageQualifierTarget.md.html) + - [MoshiUsageRedundantJsonName: Json.name with the same value as the property/enum member name is redundant.](MoshiUsageRedundantJsonName.md.html) + - [MoshiUsageRedundantSiteTarget: Use of site-targets on @Json are redundant.](MoshiUsageRedundantSiteTarget.md.html) + - [MoshiUsageSealedMustBeSealed: Moshi-sealed can only be applied to 'sealed' types.](MoshiUsageSealedMustBeSealed.md.html) + - [MoshiUsageSerializedName: Use Moshi's @Json rather than Gson's @SerializedName.](MoshiUsageSerializedName.md.html) + - [MoshiUsageSnakeCase: Consider using `@Json(name = ...)` rather than direct snake casing.](MoshiUsageSnakeCase.md.html) + - [MoshiUsageTransientNeedsInit: Transient constructor properties must have default values.](MoshiUsageTransientNeedsInit.md.html) + - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) + - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) + - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) + - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) + - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) + - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) + - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) + - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) + - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) + - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) + +* Uber (AutoDispose) (1) + + - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) + +* vanniktech/lint-rules/ (49) + + - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) + - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) + - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) + - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) + - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) + - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) + - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) + - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) + - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) + - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) + - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) + - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) + - [KotlinRequireNotNullUseMessage: Marks usage of the requireNotNull method without lazy messages.](KotlinRequireNotNullUseMessage.md.html) + - [LayoutFileNameMatchesClass: Checks that the layout file matches the class name.](LayoutFileNameMatchesClass.md.html) + - [MatchingMenuId: Flags menu ids that don't match with the file name.](MatchingMenuId.md.html) + - [MatchingViewId: Flags view ids that don't match with the file name.](MatchingViewId.md.html) + - [MissingScrollbars: Scroll views should declare a scrollbar.](MissingScrollbars.md.html) + - [MissingXmlHeader: Flags xml files that don't have a header.](MissingXmlHeader.md.html) + - [NamingPattern: Names should be well named.](NamingPattern.md.html) + - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) + - [RawDimen: Flags dimensions that are not defined as resource.](RawDimen.md.html) + - [ResourcesGetColorCall: Marks usage of deprecated getColor() on Resources.](ResourcesGetColorCall.md.html) + - [ResourcesGetColorStateListCall: Marks usage of deprecated getColorStateList() on Resources.](ResourcesGetColorStateListCall.md.html) + - [ResourcesGetDrawableCall: Marks usage of deprecated getDrawable() on Resources.](ResourcesGetDrawableCall.md.html) + - [RxJava2DefaultScheduler: Pass a scheduler instead of relying on the default Scheduler.](RxJava2DefaultScheduler.md.html) + - [RxJava2DisposableAddAllCall: Marks usage of addAll() on CompositeDisposable.](RxJava2DisposableAddAllCall.md.html) + - [RxJava2DisposableDisposeCall: Marks usage of dispose() on CompositeDisposable.](RxJava2DisposableDisposeCall.md.html) + - [RxJava2MethodMissingCheckReturnValue: Method is missing the @CheckReturnValue annotation.](RxJava2MethodMissingCheckReturnValue.md.html) + - [RxJava2MissingCompositeDisposableClear: Marks CompositeDisposables that are not being cleared.](RxJava2MissingCompositeDisposableClear.md.html) + - [RxJava2SchedulersFactoryCall: Instead of calling the Schedulers factory methods directly inject the Schedulers.](RxJava2SchedulersFactoryCall.md.html) + - [RxJava2SubscribeMissingOnError: Flags a version of the subscribe() method without an error Consumer.](RxJava2SubscribeMissingOnError.md.html) + - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) + - [StringNotCapitalized: Marks strings which are not capitalized.](StringNotCapitalized.md.html) + - [SuperfluousMarginDeclaration: Flags margin declarations that can be simplified.](SuperfluousMarginDeclaration.md.html) + - [SuperfluousNameSpace: Flags namespaces that are already declared.](SuperfluousNameSpace.md.html) + - [SuperfluousPaddingDeclaration: Flags padding declarations that can be simplified.](SuperfluousPaddingDeclaration.md.html) + - [Todo: Marks todos in any given file.](Todo.md.html) + - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) + - [UnusedMergeAttributes: Flags android and app attributes that are used on a attribute for custom Views.](UnusedMergeAttributes.md.html) + - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) + - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) + - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) + - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) + - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) + - [WrongMenuIdFormat: Flag menu ids that are not in lowerCamelCase Format.](WrongMenuIdFormat.md.html) + - [WrongTestMethodName: Flags test methods that start with test.](WrongTestMethodName.md.html) + - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) + - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) + +* Withdrawn or Obsolete Issues (17) - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) @@ -597,4 +812,7 @@ - [MediaCapabilities](MediaCapabilities.md.html) - [UnpackedNativeCode](UnpackedNativeCode.md.html) - [Assert](Assert.md.html) + - [UsesMinSdkAttributes](UsesMinSdkAttributes.md.html) + - [Override](Override.md.html) + - [PackageManagerGetSignatures](PackageManagerGetSignatures.md.html) \ No newline at end of file diff --git a/docs/checks/year.md.html b/docs/checks/year.md.html index 525d9306..4669ac27 100644 --- a/docs/checks/year.md.html +++ b/docs/checks/year.md.html @@ -1,42 +1,94 @@ (#) Lint Issue Index -Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | By year +Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | By year | [Libraries](libraries.md.html) -* 2022 (26) +* 2023 (28) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) + - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) + - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) + - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) + - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) + - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) + - [ComposeMultipleContentEmitters: Composables should only be emit from one source](ComposeMultipleContentEmitters.md.html) + - [ComposeMutableParameters: Mutable objects in Compose will break state](ComposeMutableParameters.md.html) + - [ComposeNamingLowercase: Value-returning Composables should be lowercase](ComposeNamingLowercase.md.html) + - [ComposeNamingUppercase: Unit Composables should be uppercase](ComposeNamingUppercase.md.html) + - [ComposeParameterOrder: Composable function parameters should be ordered](ComposeParameterOrder.md.html) + - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) + - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) + - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) + - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) + - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) + - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) + - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) + - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) + - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) + - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) + - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) + - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + +* 2022 (44) + + - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) + - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [DeepLinkInActivityDestination: A should not be attached to an destination](DeepLinkInActivityDestination.md.html) + - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) + - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) - [EmptySuperCall: Calling an empty super method](EmptySuperCall.md.html) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) + - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) - [GestureBackNavigation: Usage of KeyEvent.KEYCODE_BACK](GestureBackNavigation.md.html) + - [IncorrectChainMarginsUsage: Use `LayoutReference.withChainParams()` to define margins for elements in a Chain.](IncorrectChainMarginsUsage.md.html) + - [IncorrectMatchParentUsage: Prefer using `Dimension.percent(1f)` when defining custom constraints.](IncorrectMatchParentUsage.md.html) + - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) - [KotlinNullnessAnnotation: Kotlin nullability annotation](KotlinNullnessAnnotation.md.html) + - [KotlincFE10: Avoid using old K1 Kotlin compiler APIs](KotlincFE10.md.html) - [MissingInflatedId: ID not found in inflated resource](MissingInflatedId.md.html) + - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) - [MonochromeLauncherIcon: Monochrome icon is not defined](MonochromeLauncherIcon.md.html) + - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [NotificationId0: Notification Id is 0](NotificationId0.md.html) - [NotificationPermission: Notifications Without Permission](NotificationPermission.md.html) - [OpenForTesting: Extending API only allowed from tests](OpenForTesting.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) + - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) + - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) - [ReservedSystemPermission: Permission name is a reserved Android permission](ReservedSystemPermission.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [ReturnThis: Method must return `this`](ReturnThis.md.html) + - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [SystemPermissionTypo: Permission appears to be a standard permission with a typo](SystemPermissionTypo.md.html) - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) + - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) + - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) + - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) - [UnusedTranslation: Unused Translation](UnusedTranslation.md.html) - [UseOfNonLambdaOffsetOverload: Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.](UseOfNonLambdaOffsetOverload.md.html) + - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) -* 2021 (44) +* 2021 (120) - [AnnotateVersionCheck: Annotate SDK_INT checks](AnnotateVersionCheck.md.html) - [AppBundleLocaleChanges: App Bundle handling of runtime locale changes](AppBundleLocaleChanges.md.html) + - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) + - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) @@ -44,24 +96,96 @@ - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [DefaultEncoding: Using Default Character Encoding](DefaultEncoding.md.html) + - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) + - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) - [DialogFragmentCallbacksDetector: Use onCancel() and onDismiss() instead of calling setOnCancelListener() and setOnDismissListener() from onCreateDialog()](DialogFragmentCallbacksDetector.md.html) - [DiscouragedApi: Using discouraged APIs](DiscouragedApi.md.html) + - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) + - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) + - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) + - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) + - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) + - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [FileEndsWithExt: File endsWith on file extensions](FileEndsWithExt.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) + - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) + - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) + - [GuavaChecksUsed: Use Slack's JavaPreconditions instead of Guava's Preconditions checks](GuavaChecksUsed.md.html) + - [GuavaPreconditionsUsedInKotlin: Kotlin precondition checks should use the Kotlin standard library checks](GuavaPreconditionsUsedInKotlin.md.html) - [HighSamplingRate: High sensor sampling rate](HighSamplingRate.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) + - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) + - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) + - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) + - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) - [LeanbackUsesWifi: Using android.hardware.wifi on TV](LeanbackUsesWifi.md.html) + - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) - [MissingColorAlphaChannel: Missing Color alpha channel](MissingColorAlphaChannel.md.html) + - [MoshiUsageAdaptedByRequiresAdapter: @AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory.](MoshiUsageAdaptedByRequiresAdapter.md.html) + - [MoshiUsageAdaptedByRequiresKeep: Adapters targeted by @AdaptedBy must have @Keep.](MoshiUsageAdaptedByRequiresKeep.md.html) + - [MoshiUsageArray: Prefer List over Array.](MoshiUsageArray.md.html) + - [MoshiUsageBlankGenerator: Don't use blank JsonClass.generator values.](MoshiUsageBlankGenerator.md.html) + - [MoshiUsageBlankJsonName: Don't use blank names in `@Json`.](MoshiUsageBlankJsonName.md.html) + - [MoshiUsageBlankTypeLabel: Moshi-sealed requires a type label specified after the 'sealed:' prefix.](MoshiUsageBlankTypeLabel.md.html) + - [MoshiUsageClassVisibility: @JsonClass-annotated types must be public, package-private, or internal.](MoshiUsageClassVisibility.md.html) + - [MoshiUsageDoubleClassAnnotation: Only use one of @AdaptedBy or @JsonClass.](MoshiUsageDoubleClassAnnotation.md.html) + - [MoshiUsageDoubleTypeLabel: Only use one of @TypeLabel or @DefaultObject.](MoshiUsageDoubleTypeLabel.md.html) + - [MoshiUsageDuplicateJsonName: Duplicate JSON names are errors as JSON does not allow duplicate keys in objects.](MoshiUsageDuplicateJsonName.md.html) + - [MoshiUsageEnumAnnotatedUnknown: UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json](MoshiUsageEnumAnnotatedUnknown.md.html) + - [MoshiUsageEnumCasing: Consider using `@Json(name = ...)` rather than lower casing.](MoshiUsageEnumCasing.md.html) + - [MoshiUsageEnumJsonClassGenerated: Enums annotated with @JsonClass must not set `generateAdapter` to true.](MoshiUsageEnumJsonClassGenerated.md.html) + - [MoshiUsageEnumMissingJsonClass: Enums serialized with Moshi should be annotated with @JsonClass.](MoshiUsageEnumMissingJsonClass.md.html) + - [MoshiUsageEnumMissingUnknown: Enums serialized with Moshi must reserve the first member as UNKNOWN.](MoshiUsageEnumMissingUnknown.md.html) + - [MoshiUsageEnumPropertyCouldBeMoshi: Consider making enum properties also use Moshi.](MoshiUsageEnumPropertyCouldBeMoshi.md.html) + - [MoshiUsageEnumPropertyDefaultUnknown: Suspicious default value to 'UNKNOWN' for a Moshi enum.](MoshiUsageEnumPropertyDefaultUnknown.md.html) + - [MoshiUsageGenerateAdapterShouldBeTrue: JsonClass.generateAdapter must be true in order for Moshi code gen to run.](MoshiUsageGenerateAdapterShouldBeTrue.md.html) + - [MoshiUsageGenericSealedSubtype: Sealed subtypes used with moshi-sealed cannot be generic.](MoshiUsageGenericSealedSubtype.md.html) + - [MoshiUsageInappropriateTypeLabel: Inappropriate @TypeLabel or @DefaultObject annotation.](MoshiUsageInappropriateTypeLabel.md.html) + - [MoshiUsageMissingPrimary: @JsonClass-annotated types must have a primary constructor or be sealed.](MoshiUsageMissingPrimary.md.html) + - [MoshiUsageMissingTypeLabel: Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject.](MoshiUsageMissingTypeLabel.md.html) + - [MoshiUsageMutableCollections: Use immutable collections rather than mutable versions.](MoshiUsageMutableCollections.md.html) + - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) + - [MoshiUsageNonMoshiClassExternal: External type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassExternal.md.html) + - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) + - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) + - [MoshiUsageNonMoshiClassPlatform: Platform type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassPlatform.md.html) + - [MoshiUsageObject: Object types cannot be annotated with @JsonClass.](MoshiUsageObject.md.html) + - [MoshiUsageParamNeedsInit: Constructor non-property parameters in Moshi classes must have default values.](MoshiUsageParamNeedsInit.md.html) + - [MoshiUsagePrivateConstructor: Constructors in Moshi classes cannot be private.](MoshiUsagePrivateConstructor.md.html) + - [MoshiUsagePrivateConstructorProperty: Constructor parameter properties in Moshi classes cannot be private.](MoshiUsagePrivateConstructorProperty.md.html) + - [MoshiUsageQualifierRetention: JsonQualifiers must have RUNTIME retention.](MoshiUsageQualifierRetention.md.html) + - [MoshiUsageQualifierTarget: JsonQualifiers must include FIELD targeting.](MoshiUsageQualifierTarget.md.html) + - [MoshiUsageRedundantJsonName: Json.name with the same value as the property/enum member name is redundant.](MoshiUsageRedundantJsonName.md.html) + - [MoshiUsageRedundantSiteTarget: Use of site-targets on @Json are redundant.](MoshiUsageRedundantSiteTarget.md.html) + - [MoshiUsageSealedMustBeSealed: Moshi-sealed can only be applied to 'sealed' types.](MoshiUsageSealedMustBeSealed.md.html) + - [MoshiUsageSerializedName: Use Moshi's @Json rather than Gson's @SerializedName.](MoshiUsageSerializedName.md.html) + - [MoshiUsageSnakeCase: Consider using `@Json(name = ...)` rather than direct snake casing.](MoshiUsageSnakeCase.md.html) + - [MoshiUsageTransientNeedsInit: Transient constructor properties must have default values.](MoshiUsageTransientNeedsInit.md.html) + - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) + - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) + - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) + - [NoOp: NoOp Code](NoOp.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) - [ProduceStateDoesNotAssignValue: produceState calls should assign `value` inside the producer lambda](ProduceStateDoesNotAssignValue.md.html) + - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) + - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) + - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) + - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) + - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) + - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) @@ -78,8 +202,9 @@ - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableConfigurationAction: Wear configuration action metadata must match an activity](WearableConfigurationAction.md.html) - [WebViewClientOnReceivedSslError: Proceeds with the HTTPS connection despite SSL errors](WebViewClientOnReceivedSslError.md.html) + - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) -* 2020 (51) +* 2020 (56) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) @@ -88,12 +213,15 @@ - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) + - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) - [IdleBatteryChargingConstraints: Constraints may not be met for some devices](IdleBatteryChargingConstraints.md.html) - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) - [InvalidSetHasFixedSize: When using `setHasFixedSize() in an `RecyclerView`, `wrap_content` cannot be used as \ a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) + - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) + - [JvmStaticProvidesInObjectDetector: @JvmStatic used for @Provides function in an object class](JvmStaticProvidesInObjectDetector.md.html) - [LaunchActivityFromNotification: Notification Launches Services or BroadcastReceivers](LaunchActivityFromNotification.md.html) - [LintDocExample: Missing Documentation Example](LintDocExample.md.html) - [LintImplBadUrl: Bad More Info Link](LintImplBadUrl.md.html) @@ -109,6 +237,8 @@ - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) - [ModifierParameter: Guidelines for Modifier parameters in a Composable function](ModifierParameter.md.html) + - [ModuleCompanionObjects: Module companion objects should not be annotated with @Module.](ModuleCompanionObjects.md.html) + - [ModuleCompanionObjectsNotInModuleParent: Companion objects should not be annotated with @Module.](ModuleCompanionObjectsNotInModuleParent.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NotificationTrampoline: Notification Trampolines](NotificationTrampoline.md.html) @@ -134,8 +264,9 @@ - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) -* 2019 (19) +* 2019 (21) + - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) @@ -143,6 +274,7 @@ - [FragmentAddMenuProvider: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentAddMenuProvider.md.html) - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) @@ -156,11 +288,12 @@ - [WebViewApiAvailability: WebView API Availability](WebViewApiAvailability.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) -* 2018 (30) +* 2018 (31) - [Autofill: Use Autofill](Autofill.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) + - [ChromeOsOnConfigurationChanged: Poor performance with APIs inside `onConfigurationChanged()`](ChromeOsOnConfigurationChanged.md.html) - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) - [DiffUtilEquals: Suspicious DiffUtil Equality](DiffUtilEquals.md.html) - [DuplicateStrings: Duplicate Strings](DuplicateStrings.md.html) @@ -254,12 +387,13 @@ - [VectorDrawableCompat: Using VectorDrawableCompat](VectorDrawableCompat.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) -* 2015 (35) +* 2015 (37) - [AllowAllHostnameVerifier: Insecure `HostnameVerifier`](AllowAllHostnameVerifier.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [BadHostnameVerifier: Insecure HostnameVerifier](BadHostnameVerifier.md.html) - [CustomX509TrustManager: Implements custom TLS trust manager](CustomX509TrustManager.md.html) + - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - [FullBackupContent: Valid Full Backup Content File](FullBackupContent.md.html) - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) @@ -281,6 +415,7 @@ - [SQLiteString: Using STRING instead of TEXT](SQLiteString.md.html) - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) + - [ScheduleExactAlarm: Scheduling Exact Alarms Without Required Permission](ScheduleExactAlarm.md.html) - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) - [TrustAllX509TrustManager: Insecure TLS/SSL trust manager](TrustAllX509TrustManager.md.html) - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) @@ -292,7 +427,7 @@ - [VectorRaster: Vector Image Generation](VectorRaster.md.html) - [VulnerableCordovaVersion: Vulnerable Cordova Version](VulnerableCordovaVersion.md.html) -* 2014 (65) +* 2014 (69) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) @@ -302,13 +437,16 @@ - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) + - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) + - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) - [DataBindingWithoutKapt: Data Binding without Annotation Processing](DataBindingWithoutKapt.md.html) - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) - [DevModeObsolete: Dev Mode Obsolete](DevModeObsolete.md.html) - [DuplicatePlatformClasses: Duplicate Platform Classes](DuplicatePlatformClasses.md.html) + - [EditedTargetSdkVersion: Manually Edited TargetSdkVersion](EditedTargetSdkVersion.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExpiredTargetSdkVersion: TargetSdkVersion No Longer Supported](ExpiredTargetSdkVersion.md.html) - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) @@ -330,6 +468,7 @@ - [InvalidResourceFolder: Invalid Resource Folder](InvalidResourceFolder.md.html) - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) + - [KaptUsageInsteadOfKsp: Kapt usage should be replaced with KSP](KaptUsageInsteadOfKsp.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - [LifecycleAnnotationProcessorWithJava8: Lifecycle Annotation Processor with Java 8 Compile Option](LifecycleAnnotationProcessorWithJava8.md.html) - [LocaleFolder: Wrong locale name](LocaleFolder.md.html) @@ -340,7 +479,6 @@ - [NotInterpolated: Incorrect Interpolation](NotInterpolated.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - - [PackageManagerGetSignatures: Potential Multiple Certificate Exploit](PackageManagerGetSignatures.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) @@ -354,6 +492,7 @@ - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) - [UseAlpha2: Using 3-letter Codes](UseAlpha2.md.html) - [UseOfBundledGooglePlayServices: Use of bundled version of Google Play services](UseOfBundledGooglePlayServices.md.html) + - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) - [ViewHolder: View Holder Candidates](ViewHolder.md.html) - [WebViewLayout: WebViews in wrap_content parents](WebViewLayout.md.html) @@ -376,7 +515,7 @@ - [WifiManagerPotentialLeak: WifiManager Potential Leak](WifiManagerPotentialLeak.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) -* 2012 (64) +* 2012 (63) - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) @@ -411,7 +550,6 @@ - [NewApi: Calling new methods on older versions](NewApi.md.html) - [ObsoleteSdkInt: Obsolete SDK_INT Version Check](ObsoleteSdkInt.md.html) - [OnClick: `onClick` method does not exist](OnClick.md.html) - - [Override: Method conflicts with new inherited method](Override.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [PrivateResource: Using private resources](PrivateResource.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) @@ -443,7 +581,7 @@ - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) -* 2011 (99) +* 2011 (98) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) @@ -537,7 +675,6 @@ - [UseCompoundDrawables: Node can be replaced by a `TextView` with compound drawables](UseCompoundDrawables.md.html) - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - - [UsesMinSdkAttributes: Minimum SDK and target SDK attributes not defined](UsesMinSdkAttributes.md.html) - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) - [WebpUnsupported: WebP Unsupported](WebpUnsupported.md.html) - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) @@ -545,7 +682,67 @@ - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) -* Withdrawn or Obsolete Issues (14) +* Unknown (57) + + - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) + - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) + - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) + - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) + - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) + - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) + - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) + - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) + - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) + - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) + - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) + - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) + - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) + - [KotlinRequireNotNullUseMessage: Marks usage of the requireNotNull method without lazy messages.](KotlinRequireNotNullUseMessage.md.html) + - [LayoutFileNameMatchesClass: Checks that the layout file matches the class name.](LayoutFileNameMatchesClass.md.html) + - [LogNotTimber: Logging call to Log instead of Timber](LogNotTimber.md.html) + - [MatchingMenuId: Flags menu ids that don't match with the file name.](MatchingMenuId.md.html) + - [MatchingViewId: Flags view ids that don't match with the file name.](MatchingViewId.md.html) + - [MissingScrollbars: Scroll views should declare a scrollbar.](MissingScrollbars.md.html) + - [MissingXmlHeader: Flags xml files that don't have a header.](MissingXmlHeader.md.html) + - [NamingPattern: Names should be well named.](NamingPattern.md.html) + - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) + - [RawDimen: Flags dimensions that are not defined as resource.](RawDimen.md.html) + - [ResourcesGetColorCall: Marks usage of deprecated getColor() on Resources.](ResourcesGetColorCall.md.html) + - [ResourcesGetColorStateListCall: Marks usage of deprecated getColorStateList() on Resources.](ResourcesGetColorStateListCall.md.html) + - [ResourcesGetDrawableCall: Marks usage of deprecated getDrawable() on Resources.](ResourcesGetDrawableCall.md.html) + - [RxJava2DefaultScheduler: Pass a scheduler instead of relying on the default Scheduler.](RxJava2DefaultScheduler.md.html) + - [RxJava2DisposableAddAllCall: Marks usage of addAll() on CompositeDisposable.](RxJava2DisposableAddAllCall.md.html) + - [RxJava2DisposableDisposeCall: Marks usage of dispose() on CompositeDisposable.](RxJava2DisposableDisposeCall.md.html) + - [RxJava2MethodMissingCheckReturnValue: Method is missing the @CheckReturnValue annotation.](RxJava2MethodMissingCheckReturnValue.md.html) + - [RxJava2MissingCompositeDisposableClear: Marks CompositeDisposables that are not being cleared.](RxJava2MissingCompositeDisposableClear.md.html) + - [RxJava2SchedulersFactoryCall: Instead of calling the Schedulers factory methods directly inject the Schedulers.](RxJava2SchedulersFactoryCall.md.html) + - [RxJava2SubscribeMissingOnError: Flags a version of the subscribe() method without an error Consumer.](RxJava2SubscribeMissingOnError.md.html) + - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) + - [StringFormatInTimber: Logging call with Timber contains String#format()](StringFormatInTimber.md.html) + - [StringNotCapitalized: Marks strings which are not capitalized.](StringNotCapitalized.md.html) + - [SuperfluousMarginDeclaration: Flags margin declarations that can be simplified.](SuperfluousMarginDeclaration.md.html) + - [SuperfluousNameSpace: Flags namespaces that are already declared.](SuperfluousNameSpace.md.html) + - [SuperfluousPaddingDeclaration: Flags padding declarations that can be simplified.](SuperfluousPaddingDeclaration.md.html) + - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) + - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) + - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) + - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) + - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) + - [Todo: Marks todos in any given file.](Todo.md.html) + - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) + - [UnusedMergeAttributes: Flags android and app attributes that are used on a attribute for custom Views.](UnusedMergeAttributes.md.html) + - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) + - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) + - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) + - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) + - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) + - [WrongMenuIdFormat: Flag menu ids that are not in lowerCamelCase Format.](WrongMenuIdFormat.md.html) + - [WrongTestMethodName: Flags test methods that start with test.](WrongTestMethodName.md.html) + - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) + - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) + +* Withdrawn or Obsolete Issues (17) - [GoogleAppIndexingWarning](GoogleAppIndexingWarning.md.html) - [GoogleAppIndexingApiWarning](GoogleAppIndexingApiWarning.md.html) @@ -561,4 +758,7 @@ - [MediaCapabilities](MediaCapabilities.md.html) - [UnpackedNativeCode](UnpackedNativeCode.md.html) - [Assert](Assert.md.html) + - [UsesMinSdkAttributes](UsesMinSdkAttributes.md.html) + - [Override](Override.md.html) + - [PackageManagerGetSignatures](PackageManagerGetSignatures.md.html) \ No newline at end of file From 978786046cf4ead15deabf2c262d22840fe0c581 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Mon, 26 Jun 2023 16:18:01 -0700 Subject: [PATCH 02/20] Update documentation snapshot ...from latest manually edited docs in the lint source tree. --- docs/api-guide/basics.md.html | 9 +-- docs/api-guide/changes.md.html | 52 +++++++++++++++ docs/api-guide/dataflow-analyzer.md.html | 49 ++++++++++++++ docs/api-guide/messages.md.html | 12 ++++ docs/api-guide/test-modes.md.html | 14 ++++ docs/api-guide/unit-testing.md.html | 85 ++++++++++++++++++++++-- docs/internal/document-checks.md.html | 32 ++------- docs/internal/verify.md.html | 8 ++- docs/usage/agp-dsl.md.html | 10 +-- docs/usage/changes.md.html | 38 ++++++++++- docs/usage/flags.md.html | 3 + docs/usage/variables.md.html | 15 +++++ 12 files changed, 284 insertions(+), 43 deletions(-) diff --git a/docs/api-guide/basics.md.html b/docs/api-guide/basics.md.html index 1cbbb3ac..142c3683 100644 --- a/docs/api-guide/basics.md.html +++ b/docs/api-guide/basics.md.html @@ -714,10 +714,11 @@ example layouts are processed before value files like translations) 3. Kotlin and Java files 4. Bytecode (local `.class` files and library `.jar` files) -5. Gradle files -6. Other files -7. ProGuard files -8. Property Files +5. TOML files +6. Gradle files +7. Other files +8. ProGuard files +9. Property Files Similarly, lint will always process libraries before the modules that depend on them. diff --git a/docs/api-guide/changes.md.html b/docs/api-guide/changes.md.html index 1f0816c0..eeb1d5f3 100644 --- a/docs/api-guide/changes.md.html +++ b/docs/api-guide/changes.md.html @@ -5,6 +5,58 @@ information about user visible changes to lint, see the User Guide. +**8.2** + +* For unit tests, you can now specify the language level to be used + for Kotlin and Java. For example, if your unit test is using Java + records, add `.javaLanguageLevel("17")` to your `lint()` test + configuration. + +**8.1** + +* The [data flow analyzer](dataflow-analyzer.md.html) has been + improved; in addition to fixing a few bugs, there are a couple of + new convenience sub classes which makes common tasks easier to + accomplish; see the documentation for `TargetMethodDataFlowAnalyzer` + for example. + +* The new `mavenLibrary` (and `binaryStub`) test files make it simple + to create binary stub files in your tests, without having to perform + compilation and check in base64 and gzip encoded test files. When + your detector resolves references, the PSI elements you get back + differ whether you're calling into source or into binary (jar/.class + file) elements, so testing both (which the new test files automate + using test modes) is helpful. More information about this is + available in [](unit-testing.md.html). + +* Lint now supports analyzing TOML files. There is a new + Scope.TOML_FILE detectors can register an interest in, a new + TomlScanner interface to implement for visitTomlDocument callbacks, + etc. From a GradleScanner, you can directly resolve version catalog + libraries via lookup methods on the GradleContext. + +* Lint's “diff” output for unit test verification has been improved; + it's now smarter about combining nearby chunks. (This should not + break existing tests; the test infrastructure will try the older + format as a fallback if the diffs aren't matching for the new + format.) + +* Lint contains JVM 17 bytecode. You will now need to use JDK 17+ + when compiling custom Lint checks. You should also configure + the Kotlin compiler to target JVM 17, otherwise you may see errors + when calling inline functions declared in Lint, UAST, or PSI. + +* Lint's testing infrastructure now looks not just for test/ + but also androidTest/ and testFixtures/ to set the corresponding + source set type on each test context. + +**8.0** + +* A new testmode which makes sure lint checks are all suppressible. + It analyzes the reported error locations from the expected test + output, and inserts suppress annotations in XML, Kotlin and Java + files and makes sure that the corresponding warnings disappear. + **7.4** * Annotation detectors can now specify just an annotation name instead diff --git a/docs/api-guide/dataflow-analyzer.md.html b/docs/api-guide/dataflow-analyzer.md.html index a94bc2a5..39b0c56a 100644 --- a/docs/api-guide/dataflow-analyzer.md.html +++ b/docs/api-guide/dataflow-analyzer.md.html @@ -44,6 +44,13 @@ `DataFlowAnalyzer` class, and override one or more of its callbacks, and then tell it to analyze a method scope. +!!! Tip + In recent versions of lint, there is a new special subclass of the + `DataFlowAnalyzer`, `TargetMethodDataFlowAnalyzer`, which makes it + easier to write flow analyzers where you are looking for a specific + “cleanup” or close function invoked on an instance. See the separate + section on `TargetMethodDataFlowAnalyzer` below for more information. + For the above transaction scenario, it might look like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers @@ -303,6 +310,12 @@ case you want to perform additional analysis to track field values; see the next section. +!!! Tip + There is a special subclass of the `DataFlowAnalyzer`, called + `EscapeCheckingDataFlowAnalyzer`, which you can extend instead. This + handles recording all the scenarios where the instance escapes from + the method, and at the end you can just check its `escaped` property. + ## Non Local Analysis In the above examples, if we found that the value escaped via a return @@ -347,4 +360,40 @@ [Source](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/SliceDetector.kt) [Test](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/SliceDetectorTest.kt) +## TargetMethodDataFlowAnalyzer + +The `TargetMethodDataFlowAnalyzer` is a special subclass of the +`DataFlowAnalyzer` which makes it simple to see if you eventually wind up +calling a target method on a particular instance. For example, calling +`close` on a file that was opened, or calling `start` on an animation you +created. + +In addition, there is an extension function on `UMethod` which visits +this analyzer, and then checks for various conditions, e.g. whether the +instance “escaped” (for example by being stored in a field or passed to +another method), in which case you probably don't want to conclude (and +report) that the close method is never called. It also handles failures +to resolve, where it remembers whether there was a resolve failure, and +if so it looks to see if it finds a likely match (with the same name as +the target function), and if so also makes sure you don't report a false +positive. + +A simple way to do this is as follows: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +val targets = mapOf("show" to listOf("android.widget.Toast", + "com.google.android.material.snackbar.Snackbar") +val analyzer = TargetMethodDataFlowAnalyzer.create(node, targets) +if (method.isMissingTarget(analyzer)) { + context.report(...) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can subclass `TargetMethodDataFlowAnalyzer` directly and override the +`getTargetMethod` methods and any other UAST visitor methods if you want +to customize the behavior further. + +One advantage of using the `TargetMethodDataFlowAnalyzer` is that it also +correctly handles method references. + diff --git a/docs/api-guide/messages.md.html b/docs/api-guide/messages.md.html index 2267cc21..54f15cae 100644 --- a/docs/api-guide/messages.md.html +++ b/docs/api-guide/messages.md.html @@ -89,6 +89,18 @@ ”Hello.“ to ”Hello, world!“ is compatible. * Adding a prefix +## Plurals + +Avoid trying to make sentences gramatically correct and flexible by +using constructs like ”(s)“ to quantity strings. In other words, +instead of for example saying + + *”register your receiver(s) in the manifest“* + +just use the plural form, + + *”register your receivers in the manifest“* + ## Examples Here are some examples from lint's built-in checks. Note that these are not diff --git a/docs/api-guide/test-modes.md.html b/docs/api-guide/test-modes.md.html index bca73fee..698ef2e0 100644 --- a/docs/api-guide/test-modes.md.html +++ b/docs/api-guide/test-modes.md.html @@ -517,4 +517,18 @@ string resources, and will convert regular text into `CDATA` and makes sure the results continue to be the same. +### Suppressible Mode + +Users should be able to ignore lint warnings by inserting suppress annotations +(in Kotlin and Java), and via `tools:ignore` attributes in XML files. + +This normally works for simple checks, but if you are combining results from +different parts of the code, or for example caching locations and reporting +them later, this is sometimes broken. + +This test mode looks at the reported warnings from your unit tests, and then +for each one, it looks up the corresponding error location's source file, and +inserts a suppress directive at the nearest applicable location. It then +re-runs the analysis, and makes sure that the warning no longer appears. + diff --git a/docs/api-guide/unit-testing.md.html b/docs/api-guide/unit-testing.md.html index 4e849770..f4a54e31 100644 --- a/docs/api-guide/unit-testing.md.html +++ b/docs/api-guide/unit-testing.md.html @@ -338,10 +338,65 @@ ## Binary and Compiled Source Files -If you need to use binaries in your unit tests, there is -a special test file type for that: base64gzip. Here's an -example from a lint check which tries to recognize usage -of Cordova in the bytecode: +If you need to use binaries in your unit tests, there are two options: + + 1. base64gzip + 2. API stubs + +If you want to analyze bytecode of method bodies, you'll need to use +the first option. + +The first type requires you to actually compile your test file into a +set of .class files, and check those in as a gzip-compressed, base64 +encoded string. Lint has utilities for this; see the next section. + +The second option is using API stubs. For simple stub files (where you +only need to provide APIs you'll call as binaries, but not code), lint +can produce the corresponding bytecode on the fly, so you don't need +to pre-create binary contents of the class. This is particularly +helpful when you just want to create stubs for a library your lint +check is targeting and you want to make sure the detector is seeing +the same types of elements as it will when analyzing real code outside +of tests (since there is a difference between resolving into APIs from +source and form binaries; when you're analyzing calls into source, you +can access for example method bodies, and this isn't available via +UAST from byte code.) + +These test files also let you specify an artifact name instead of a +jar path, and lint will use this to place the jar in a special place +such that it recognizes it (via `JavaEvaluator.findOwnerLibrary`) as +belonging to this library. + +Here's an example of how you can create one of these binary stub +files: + +``` +fun testIdentityEqualsOkay() { + lint().files( + kotlin( + "/*test contents here *using* some recycler view APIs*/" + ).indented(), + mavenLibrary( + "androidx.recyclerview:recyclerview:1.0.0", + java( + """ + package androidx.recyclerview.widget; + public class DiffUtil { + public abstract static class ItemCallback { + public abstract boolean areItemsTheSame(T oldItem, T newItem); + public abstract boolean areContentsTheSame(T oldItem, T newItem); + } + } + """ + ).indented() + ) + ).run().expect( +``` + +## Base64-encoded gzipped byte code + +Here's an example from a lint check which tries to recognize usage of +Cordova in the bytecode: ``` fun testVulnerableCordovaVersionInClasses() { @@ -411,4 +466,26 @@ Dependencies and Stubs“ section above, as well as the [frequently asked questions](faq.md.html). +## Language Level + +Lint will analyze Java and Kotlin test files using its own default +language levels. If you need a higher (or lower) language level in order +to test a particular scenario, you can use the `kotlinLanguageLevel` +and `javaLanguageLevel` setter methods on the lint test configuration. +Here's an example of a unit test setup for Java records: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin + lint() + .files( + java(""" + record Person(String name, int age) { + } + """) + .indented() + ) + .javaLanguageLevel("17") + .run() + .expect(...) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + diff --git a/docs/internal/document-checks.md.html b/docs/internal/document-checks.md.html index a25a6e14..12e82267 100644 --- a/docs/internal/document-checks.md.html +++ b/docs/internal/document-checks.md.html @@ -27,6 +27,10 @@ --builtins Generate documentation for the built-in issues. This is implied if --lint-jars is not specified +--gmaven Generate documentation for the lint checks + found on maven.google.com. +--maven-central Generate documentation for a few well known + lint libraries distributed on Maven Central. --lint-jars Read the lint issues from the specific path (separated by : of custom jar files --issues [issues] Limits the issues documented to the specific @@ -85,34 +89,6 @@ checks. If your lint check are packaged as an AAR file, you can unzip this file to find `lint.jar` inside. -## Generating AndroidX documentation - -To generate the AndroidX documentation, check out the androidx -repository into `$ANDROIDX_REPO`; then run - -```shell -$ cd $ANDROIDX_REPO/frameworks/support -$ ./gradlew createArchive -``` - -This will build all the lint custom checks in AndroidX. Then invoke the -documentation generation tool like this: - -```shell -$ export ANDROID_URI_PREFIX=https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main: - -$ lint \ - --generate-docs \ - --output /tmp/lint-docs/ \ - --lint-jars $ANDROIDX_REPO/out \ - --source-url $ANDROID_URI_PREFIX $ANDROIDX_REPO/frameworks/support \ - --test-url $ANDROID_URI_PREFIX $ANDROIDX_REPO/frameworks/support -``` - -If you want to include all the built-in Studio checks as well into a -documentation set containing both, merge in the `--builtins` and -`--source-url` and `--test-url` flags from above. - ## Special Conventions If you include a test URL search path (and note that the URI prefix is diff --git a/docs/internal/verify.md.html b/docs/internal/verify.md.html index 706e83fc..0b80d59a 100644 --- a/docs/internal/verify.md.html +++ b/docs/internal/verify.md.html @@ -46,7 +46,8 @@ ```ksh runGradleForAndroidX() { CUSTOM_REPO=$ADT_SOURCE_TREE/out/repo \ - GRADLE_PLUGIN_VERSION=7.1.0-dev \ + GRADLE_PLUGIN_VERSION=8.0.0-dev \ + LINT_VERSION=31.0.0-dev \ GRADLE_PLUGIN_REPO=$ADT_SOURCE_TREE/out/repo:$ADT_SOURCE_TREE/prebuilts/tools/common/m2/repository \ $ADT_SOURCE_TREE/tools/gradlew --parallel ${@} } @@ -64,6 +65,11 @@ flag with `--no-daemon -Dorg.gradle.debug=true`, run the build, and create a Remote configuration in IntelliJ and use it to attach. +You can also run `gwx updateLintBaseline` to have lint successfully +run all targets and update the baselines and then inspect the diffs if +you've added/updated lint checks and don't want it to stop after the +first new (and correct) failure. + ## Testing against Android Platform Lint is run as part of the Android platform builds, including a number of custom lint checks specific to the platform. diff --git a/docs/usage/agp-dsl.md.html b/docs/usage/agp-dsl.md.html index 7c486319..1129c1fe 100644 --- a/docs/usage/agp-dsl.md.html +++ b/docs/usage/agp-dsl.md.html @@ -135,7 +135,7 @@ standard output or standard error streams respectively. In recent versions of lint, this will also imply `textReport true`. - Example: `textOutput file(“$reportsDir/lint-results.txt”)` + Example: `textOutput file(“$buildDir/reports/lint-results.txt”)` `xmlReport` *true or false* : Whether lint should generate an XML report. If you don't specify a @@ -143,11 +143,11 @@ `lint-results-`*$variant*`.xml` in $module`/build/reports/, such as `app/build/reports/lint-results-debug.xml`. -`xmlOutput file("$reportsDir/lint-report.xml")` +`xmlOutput file("$buildDir/reports/lint-report.xml")` : Where lint should write its XML report. In recent versions of lint, this will also imply `xmlReport true`. - Example: `xmlOutput file("$reportsDir/lint-results.xml")` + Example: `xmlOutput file("$buildDir/reports/lint-results.xml")` `htmlReport` *true or false* : Whether lint should generate an HTML report, with issue explanations, @@ -162,7 +162,7 @@ chapter](variables.md.html) for some flags to configure the HTML report. - Example: `htmlOutput file(“$reportsDir/lint-results.html”)` + Example: `htmlOutput file(“$buildDir/reports/lint-results.html”)` `sarifReport` *true or false* : Whether lint should generate a @@ -176,7 +176,7 @@ : Where lint should write its HTML SARIF. In recent versions of lint, this will also imply `sarifReport true`. - Example: `sarifOutput file("$reportsDir/lint-report.sarif.json")` + Example: `sarifOutput file("$buildDir/reports/lint-report.sarif.json")` `quiet` *true or false* : Whether lint should limit its diagnostic output. *False by default.* diff --git a/docs/usage/changes.md.html b/docs/usage/changes.md.html index dc194942..4f005799 100644 --- a/docs/usage/changes.md.html +++ b/docs/usage/changes.md.html @@ -4,6 +4,41 @@ For information about internal improvements and API changes affecting lint check authors, see the API Guide. +**8.1** + +* Lint now supports and includes checks for Gradle version catalog + files. The built in checks around dependencies in Gradle files + also apply to these TOML version catalog files. + +* New built-in lint-checks: + + Issue ID | Summary + ----------------------------------|----------------------------------- + `NoOp` | Finds leftover code constructs which have no side effect or purpose + `UnspecifiedRegisterReceiverFlag` | Missing `registerReceiver()` exported flag + `UnsafeImplicitIntentLaunch` | Implicit intent matches an internal non-exported component + `ShortcutUsageDetector` | Shortcut usage should be reported + `UseTomlInstead` | Mixing and matching Gradle build file and TOML dependencies + `KaptUsageInsteadOfKsp` | Using kapt where KSP would also be available + `BomWithoutPlatform` | BOM artifact added as a dependency instead of as a platform + `ProviderReadPermissionOnly` | Provider with readPermission only and implemented write APIs + + (The `NoOp` and `UnsafeImplicitIntentLaunch` lint checks are + currently disabled by default.) + +**8.0** + +* New built-in lint-checks: + + Issue ID | Summary + ----------------------------------|----------------------------------- + `ChromeOsOnConfigurationChanged` | ChromeOS performance checks in onConfigurationChanged() + `SetAndClearCommunicationDevice` | Missing `clearCommunicationDevice()` after set + + * Lint's API check now supports SDK extensions. The version checking + utilities (VersionChecks, ApiConstraint) have also been improved + to handle more scenarios. + **7.4** * New built-in lint-checks: @@ -14,7 +49,7 @@ `KnownPermissionError` | Well-known permission errors, e.g. `android:permission="true"` `SystemPermissionTypo` | Usage of permissions that look like system permissions, but have typos `CustomPermissionTypo` | Usage of permissions that look like custom permissions from the same project, but have typos - `ReservedSystemPermission` | Accidental redefining of a framework permission + `ReservedSystemPermission` | Accidental redefining of a framework permission, or usage of the `andriod.` prefix `GestureBackNavigation` | Usage of KeyEvent.KEYCODE_BACK `UnusedTranslation` | Unused translation, not declared in localeConfig `NotificationPermission` | Notifications Without android.permission.POST_NOTIFICATIONS @@ -23,6 +58,7 @@ `TileProviderPermissions` | TileProvider does not set permission `SquareAndRoundTilePreviews`| TileProvider does not have round and square previews `InternalInsetResource` | Using internal inset dimension resource + `BinderGetCallingInMainThread`| Incorrect usage of getCallingUid() or getCallingPid() * Lint now respects the `--offline` flag passed to Gradle, and will refrain from making network calls for checks that normally do (such as diff --git a/docs/usage/flags.md.html b/docs/usage/flags.md.html index b3f77ce1..a368e2e9 100644 --- a/docs/usage/flags.md.html +++ b/docs/usage/flags.md.html @@ -119,6 +119,9 @@ also used and there are lint issues, a new baseline file will be created, and the lint issues will be written to it. +`--baseline-omit-line-numbers` +: Omit line numbers when writing out the baseline file + `--allow-suppress` : Whether to allow suppressing issues that have been explicitly registered as not suppressible. diff --git a/docs/usage/variables.md.html b/docs/usage/variables.md.html index 16d87d50..dbc77d15 100644 --- a/docs/usage/variables.md.html +++ b/docs/usage/variables.md.html @@ -87,6 +87,12 @@ : Point lint to an alternative API database XML file instead of the normally used `$SDK/platforms/android-?/data/api-versions.xml` file. +`ANDROID_LINT_SKIP_BYTECODE_VERIFIER` +: If set to `true`, lint will *not* perform bytecode verification of custom + lint check jars from libraries or passed in via command line flags. + + Corresponding system property: `android.lint.skip.bytecode.verifier` + ### Lint Development Variables `LINT_PRINT_STACKTRACE` @@ -159,4 +165,13 @@ : Controls whether lint will complain about custom check lint jar loading problems. By default, true. +`android.lint.api-database-binary-path` +: Point lint to a precomputed per-SDK platform, per-lint **binary** API + database to read from. If the file is not found or uses the wrong format + version, lint will fail. + +`android.lint.skip.bytecode.verifier` +: Alias for `$ANDROID_LINT_SKIP_BYTECODE_VERIFIER` + + Corresponding system property: `android.lint.skip.bytecode.verifier` From b95e75f346360a7b7690a5b0a009d36c9f0d3895 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Tue, 31 Oct 2023 10:47:19 -0700 Subject: [PATCH 03/20] Update build files to KTS and version catalogs (and latest AGP) --- app/build.gradle | 37 ---------------------------- app/build.gradle.kts | 33 +++++++++++++++++++++++++ build.gradle | 31 ------------------------ build.gradle.kts | 8 ++++++ checks/app | 51 +++++++++++++++++++++++++++++++++++++++ checks/build.gradle | 26 -------------------- checks/build.gradle.kts | 24 ++++++++++++++++++ gradle/libs.versions.toml | 37 ++++++++++++++++++++++++++++ library/build.gradle | 23 ------------------ library/build.gradle.kts | 26 ++++++++++++++++++++ settings.gradle | 1 - settings.gradle.kts | 26 ++++++++++++++++++++ 12 files changed, 205 insertions(+), 118 deletions(-) delete mode 100644 app/build.gradle create mode 100644 app/build.gradle.kts delete mode 100644 build.gradle create mode 100644 build.gradle.kts create mode 100644 checks/app delete mode 100644 checks/build.gradle create mode 100644 checks/build.gradle.kts create mode 100644 gradle/libs.versions.toml delete mode 100644 library/build.gradle create mode 100644 library/build.gradle.kts delete mode 100644 settings.gradle create mode 100644 settings.gradle.kts diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 7f031ff9..00000000 --- a/app/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -android { - compileSdkVersion 33 - - defaultConfig { - applicationId "com.android.example.lint_usage" - minSdkVersion 21 - targetSdkVersion 33 - versionCode 1 - versionName "1.0" - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - kotlinOptions { - jvmTarget = '17' - } - namespace 'com.android.example' - lint { - checkDependencies true - // Produce report for CI: - // https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning - sarifOutput file('../lint-results.sarif') - textReport true - } -} - -dependencies { - implementation project(':library') -} - diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 00000000..b397c317 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,33 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.android.example" + compileSdk = 34 + + defaultConfig { + applicationId = "com.android.example.lint_usage" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { + checkDependencies = true + // Produce report for CI: + // https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/sarif-support-for-code-scanning + sarifOutput = file("../lint-results.sarif") + textReport = true + } +} + +dependencies { + implementation(project(":library")) +} \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 8d9778fd..00000000 --- a/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext { - kotlinVersion = '1.8.20' - // Current release: Flamingo / AGP 8.0 - gradlePluginVersion = '8.0.2' - lintVersion = '31.0.2' - // Current preview release: Hedgehog - //gradlePluginVersion = '8.2.0-alpha07' - //lintVersion = '31.2.0-alpha07' - } - - repositories { - google() - mavenCentral() - } - dependencies { - classpath "com.android.tools.build:gradle:$gradlePluginVersion" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..7511b799 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,8 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { + alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.android.lint) apply false +} diff --git a/checks/app b/checks/app new file mode 100644 index 00000000..123a6651 --- /dev/null +++ b/checks/app @@ -0,0 +1,51 @@ +plugins { + alias(libs.plugins.androidApplication) + alias(libs.plugins.kotlinAndroid) +} + +android { + namespace = "com.android.example.lint_usage" + compileSdk = 34 + + defaultConfig { + applicationId = "com.android.example.lint_usage" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = "1.8" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.1" + } +} + +dependencies { + + implementation(libs.core.ktx) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.activity.compose) + implementation(platform(libs.compose.bom)) + implementation(libs.ui) + implementation(libs.ui.graphics) + implementation(libs.ui.tooling.preview) + implementation(libs.material3) + implementation(project(":library")) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) + androidTestImplementation(platform(libs.compose.bom)) + androidTestImplementation(libs.ui.test.junit4) + debugImplementation(libs.ui.tooling) + debugImplementation(libs.ui.test.manifest) +} \ No newline at end of file diff --git a/checks/build.gradle b/checks/build.gradle deleted file mode 100644 index b2976f1b..00000000 --- a/checks/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -apply plugin: 'java-library' -apply plugin: 'kotlin' -apply plugin: 'com.android.lint' - -lintOptions { - htmlReport true - htmlOutput file("lint-report.html") - textReport true - absolutePaths false - ignoreTestSources true -} - -dependencies { - // For a description of the below dependencies, see the main project README - compileOnly "com.android.tools.lint:lint-api:$lintVersion" - // You typically don't need this one: - compileOnly "com.android.tools.lint:lint-checks:$lintVersion" - compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" - - testImplementation "junit:junit:4.13.2" - testImplementation "com.android.tools.lint:lint:$lintVersion" - testImplementation "com.android.tools.lint:lint-tests:$lintVersion" -} - -sourceCompatibility = "17" -targetCompatibility = "17" diff --git a/checks/build.gradle.kts b/checks/build.gradle.kts new file mode 100644 index 00000000..2f515374 --- /dev/null +++ b/checks/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("java-library") + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.android.lint) +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +lint { + htmlReport = true + htmlOutput = file("lint-report.html") + textReport = true + absolutePaths = false + ignoreTestSources = true +} + +dependencies { + // For a description of the below dependencies, see the main project README + compileOnly(libs.bundles.lint.api) + testImplementation(libs.bundles.lint.tests) +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..3b94864e --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,37 @@ +[versions] +agp = '8.1.2' +lint = '31.1.2' # = agp + 23.0.0 +kotlin = '1.9.10' +junit = '4.13.2' + + +[libraries] +# For a description of the below dependencies, see the main project README +lint-api = { group = "com.android.tools.lint", name = "lint-api", version.ref = "lint" } +lint-checks = { group = "com.android.tools.lint", name = "lint-checks", version.ref = "lint" } +lint-cli = { group = "com.android.tools.lint", name = "lint", version.ref = "lint" } +lint-tests = { group = "com.android.tools.lint", name = "lint-tests", version.ref = "lint" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } + +[bundles] +lint-api = [ + "kotlin-stdlib", + "lint-api", + # You typically don't need this one, but it does have some utilities + # like the API database that some lint checks may want to use + #"lint-checks", +] +lint-tests = [ + "junit", + "lint-cli", + "lint-tests" +] + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +android-library = { id = "com.android.library", version.ref = "agp" } +android-lint = { id = "com.android.lint", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } + diff --git a/library/build.gradle b/library/build.gradle deleted file mode 100644 index 73beb630..00000000 --- a/library/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 33 - defaultConfig { - minSdkVersion 19 - targetSdkVersion 33 - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } - namespace 'com.example.lint.library' - lint { - checkDependencies true - } -} - -/** Package the given lint checks library into this AAR */ -dependencies { - implementation project(':checks') - lintPublish project(':checks') -} diff --git a/library/build.gradle.kts b/library/build.gradle.kts new file mode 100644 index 00000000..7c5071d9 --- /dev/null +++ b/library/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.android) +} + +android { + namespace = "com.example.lint.library" + compileSdk = 34 + + defaultConfig { + minSdk = 19 + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { + checkDependencies = true + } +} + +dependencies { + implementation(project(":checks")) + lintPublish(project(":checks")) +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 802b0e45..00000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':checks', ':library', ':app' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..84a573c8 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,26 @@ +@file:Suppress("UnstableApiUsage") + +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +include(":app") +include(":checks") +include(":library") From 01703ae072844b864ec1fa21acd3b1b91ad6bd9a Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Thu, 25 Jan 2024 13:51:35 -0800 Subject: [PATCH 04/20] Update lint docs to current versions --- docs/api-guide.html | 567 +++++++++++++++++++++++++----- docs/api-guide/basics.md.html | 7 +- docs/api-guide/changes.md.html | 43 +++ docs/api-guide/messages.md.html | 1 + docs/api-guide/publishing.md.html | 4 +- docs/book.html | 4 +- docs/index.html | 11 +- docs/usage/agp-dsl.md.html | 2 +- docs/usage/changes.md.html | 63 +++- docs/usage/variables.md.html | 23 ++ docs/user-guide.html | 425 ++++++++++++++++++++-- 11 files changed, 1010 insertions(+), 140 deletions(-) diff --git a/docs/api-guide.html b/docs/api-guide.html index 08663230..7bd067e2 100644 --- a/docs/api-guide.html +++ b/docs/api-guide.html @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/docs/checks/AlertDialogUsage.md.html b/docs/checks/AlertDialogUsage.md.html index e0ef65d2..b957bc20 100644 --- a/docs/checks/AlertDialogUsage.md.html +++ b/docs/checks/AlertDialogUsage.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,46 +29,11 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AlertDialogUsageDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.kt) Support library AlertDialog is much more powerful and plays better together with the new theming / styling than the AlertDialog built into the framework. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/Test.java:4:Warning: Should not be using android.app.AlertDialog -[AlertDialogUsage] - - public Test(AlertDialog dialog) { } - ------------------ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/Test.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -import android.app.AlertDialog; - -class Test { - public Test(AlertDialog dialog) { } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AlertDialogUsageDetectorTest.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, `AlertDialogUsageDetector.constructorParameterInJava`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -78,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -96,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/AndroidGradlePluginVersion.md.html b/docs/checks/AndroidGradlePluginVersion.md.html index f27e22ae..1c80057b 100644 --- a/docs/checks/AndroidGradlePluginVersion.md.html +++ b/docs/checks/AndroidGradlePluginVersion.md.html @@ -48,7 +48,7 @@ [AndroidGradlePluginVersion] classpath 'com.android.tools.build:gradle:3.4.0-alpha3' - ------------------------------------------------------- + --------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/AppLinkUrlError.md.html b/docs/checks/AppLinkUrlError.md.html index 6070e7ad..5fcd5988 100644 --- a/docs/checks/AppLinkUrlError.md.html +++ b/docs/checks/AppLinkUrlError.md.html @@ -1,17 +1,17 @@ -(#) URL not supported by app for Firebase App Indexing +(#) URI invalid -!!! ERROR: URL not supported by app for Firebase App Indexing +!!! ERROR: URI invalid This is an error. Id : `AppLinkUrlError` Summary -: URL not supported by app for Firebase App Indexing +: URI invalid Severity : Error Category -: Usability +: Correctness Platform : Android Vendor @@ -23,6 +23,8 @@ Editing : This check runs on the fly in the IDE editor See +: https://developer.android.com/training/app-links +See : https://g.co/AppIndexing/AndroidStudio 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/AppLinksValidDetector.kt) @@ -31,8 +33,8 @@ Copyright Year : 2017 -Ensure the URL is supported by your app, to get installs and traffic to -your app from Google Search. +Ensure your intent filter has the documented elements for deep links, +web links, or Android App Links. !!! Tip This lint check has an associated quickfix available in the IDE. diff --git a/docs/checks/ArcAnimationSpecTypeIssue.md.html b/docs/checks/ArcAnimationSpecTypeIssue.md.html new file mode 100644 index 00000000..73ba6770 --- /dev/null +++ b/docs/checks/ArcAnimationSpecTypeIssue.md.html @@ -0,0 +1,193 @@ + +(#) 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. + +Id +: `ArcAnimationSpecTypeIssue` +Summary +: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset. +Severity +: Information +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation.core +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-core-lint/src/main/java/androidx/compose/animation/core/lint/ArcAnimationSpecTypeDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/ArcAnimationSpecTypeDetectorTest.kt) +Copyright Year +: 2023 + +ArcAnimationSpec is designed for 2D values. Particularly, for positional +values such as Offset. +Trying to use it for values of different dimensions (Float, Size, Color, +etc.) will result in unpredictable animation behavior. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/test.kt:14:Information: Arc animation is intended for 2D values +such as Offset, IntOffset or DpOffset. +Otherwise, the animation might not be what you expect. +[ArcAnimationSpecTypeIssue] + + ArcAnimationSpec<Float>(ArcAbove) + ---------------- + + +src/foo/test.kt:15:Information: Arc animation is intended for 2D values +such as Offset, IntOffset or DpOffset. +Otherwise, the animation might not be what you expect. +[ArcAnimationSpecTypeIssue] + + ArcAnimationSpec<String>(ArcAbove) + ---------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import androidx.compose.animation.core.ArcAnimationSpec +import androidx.compose.animation.core.ArcAbove +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.unit.DpOffset +import androidx.compose.ui.unit.IntOffset + +fun test() { + ArcAnimationSpec(ArcAbove) + ArcAnimationSpec(ArcAbove) + ArcAnimationSpec(ArcAbove) + ArcAnimationSpec(ArcAbove) + ArcAnimationSpec(ArcAbove) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/animation/animation-core-lint/src/test/java/androidx/compose/animation/core/lint/ArcAnimationSpecTypeDetectorTest.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, `ArcAnimationSpecTypeDetector.testPreferredTypeIssue`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-core-android) + +# libs.versions.toml +[versions] +animation-core-android = "1.7.0-alpha01" +[libraries] +animation-core-android = { + module = "androidx.compose.animation:animation-core-android", + version.ref = "animation-core-android" +} +``` + +1.7.0-alpha01 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). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ArcAnimationSpecTypeIssue") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ArcAnimationSpecTypeIssue") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ArcAnimationSpecTypeIssue + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ArcAnimationSpecTypeIssue" severity="ignore" /> + </lint> + ``` + 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 'ArcAnimationSpecTypeIssue' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ArcAnimationSpecTypeIssue ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ArgInFormattedQuantityStringRes.md.html b/docs/checks/ArgInFormattedQuantityStringRes.md.html index 7a5caa77..a46b5d1f 100644 --- a/docs/checks/ArgInFormattedQuantityStringRes.md.html +++ b/docs/checks/ArgInFormattedQuantityStringRes.md.html @@ -92,17 +92,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -110,7 +110,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/AssertionSideEffect.md.html b/docs/checks/AssertionSideEffect.md.html index 4124f441..01955acc 100644 --- a/docs/checks/AssertionSideEffect.md.html +++ b/docs/checks/AssertionSideEffect.md.html @@ -42,128 +42,30 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:4:Warning: Assertion condition has a side effect: i++ +src/test.kt:5:Warning: Assertion condition has a side effect: setOf(42) [AssertionSideEffect] - assert(i++ < 5) // WARN 1 - --- + assert(42 != f.setOf(42)) // WARN 1 + ----------- -src/test.kt:5:Warning: Assertion condition has a side effect: x++ -[AssertionSideEffect] - - assert(method1() > 5) // WARN 2 - --------- - - -src/test.kt:6:Warning: Assertion condition has a side effect: x++ -[AssertionSideEffect] - - assert(method2() > 5) // WARN 3 - --------- - - -src/test.kt:7:Warning: Assertion condition has a side effect: x = 0 -[AssertionSideEffect] - - assert(method3()) // WARN 4 - --------- - - -src/test.kt:9:Warning: Assertion condition has a side effect: delete() -[AssertionSideEffect] - - assert(file.delete()) // WARN 5 - ------------- - - -src/test.kt:10:Warning: Assertion condition has a side effect: mkdirs() -[AssertionSideEffect] - - assert(file.mkdirs()) // WARN 6 - ------------- - - -src/test.kt:11:Warning: Assertion condition has a side effect: -add("test") [AssertionSideEffect] +src/test.kt:6:Warning: Assertion condition has a side effect: f.of = +2024 [AssertionSideEffect] - assert(list.add("test")) // WARN 7 - ---------------- - - -src/test.kt:12:Warning: Assertion condition has a side effect: -setExecutable(true) [AssertionSideEffect] - - assert(file.setExecutable(true)) // WARN 8 - ------------------------ - - -src/test.kt:14:Warning: Assertion condition has a side effect: x++ -[AssertionSideEffect] - - assert(method5()) // WARN 9 - --------- - - -src/test.kt:15:Warning: Assertion condition has a side effect: x++ -[AssertionSideEffect] - - assert(method6()) // WARN 10 - --------- - - -src/test.kt:16:Warning: Assertion condition has a side effect: x++ -[AssertionSideEffect] - - assert(method7()) // WARN 11 - --------- + assert(2024 != (f.of = 2024)) // WARN 2 + ----------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -var x: Int = 0 -fun test(file: java.io.File, list: java.util.List) { - var i = 0 - assert(i++ < 5) // WARN 1 - assert(method1() > 5) // WARN 2 - assert(method2() > 5) // WARN 3 - assert(method3()) // WARN 4 - assert(method4()) // OK 1 - assert(file.delete()) // WARN 5 - assert(file.mkdirs()) // WARN 6 - assert(list.add("test")) // WARN 7 - assert(file.setExecutable(true)) // WARN 8 - assert(list.contains("test")) // OK 2 - assert(method5()) // WARN 9 - assert(method6()) // WARN 10 - assert(method7()) // WARN 11 -} +import test.pkg.Foo -fun method1(): Int = x++ // side effect -fun method2(): Int = method1() // indirect side effect -fun method3(): Boolean { - x = 0 // side effect - return true -} -fun method4(): Boolean { - val x: Int - x = 0 // not a side effect - x++ // not a side effect - return true -} -fun method5(v: Int): Boolean { - if (v > 5) { } else { x++ } - return true -} -fun method6(v: Int): Boolean { - for (i in 0 until v) x++ - return true -} -fun method7(v: Int): Boolean { - try { println(v) } finally { x++ } - return true +fun test() { + val f = Foo() + assert(42 != f.setOf(42)) // WARN 1 + assert(2024 != (f.of = 2024)) // WARN 2 } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -172,7 +74,7 @@ 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, `AssertDetector.testSideEffects`. +found for this lint check, `AssertDetector.testSetOf_JavaSyntheticPropertySetter`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/AssertjImport.md.html b/docs/checks/AssertjImport.md.html index 28ca2c0d..a7f408cd 100644 --- a/docs/checks/AssertjImport.md.html +++ b/docs/checks/AssertjImport.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,19 +29,12 @@ : Kotlin and Java files and test sources Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AssertjDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AssertjDetectorTest.kt) Importing org.assertj.core.api.Assertions is not ideal. Since it can require Java 8. It's simple as instead org.assertj.core.api.Java6Assertions can be imported and provides guarantee to run on Java 6 as well. -!!! Tip - This lint check has an associated quickfix available in the IDE. - (##) Including !!! @@ -51,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -69,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/AutoDispose.md.html b/docs/checks/AutoDispose.md.html index fd66a752..5c9ac225 100644 --- a/docs/checks/AutoDispose.md.html +++ b/docs/checks/AutoDispose.md.html @@ -21,9 +21,9 @@ Feedback : https://github.com/uber/AutoDispose/issues Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled -: Lint 7.0 +: Lint 8.0 and 8.1 Artifact : [com.uber.autodispose2:autodispose-lint](com_uber_autodispose2_autodispose-lint.md.html) @@ -96,17 +96,17 @@ ``` // build.gradle.kts -lintChecks("com.uber.autodispose2:autodispose-lint:2.1.1") +lintChecks("com.uber.autodispose2:autodispose-lint:2.2.1") // build.gradle -lintChecks 'com.uber.autodispose2:autodispose-lint:2.1.1' +lintChecks 'com.uber.autodispose2:autodispose-lint:2.2.1' // build.gradle.kts with version catalogs: lintChecks(libs.autodispose-lint) # libs.versions.toml [versions] -autodispose-lint = "2.1.1" +autodispose-lint = "2.2.1" [libraries] autodispose-lint = { module = "com.uber.autodispose2:autodispose-lint", @@ -114,7 +114,7 @@ } ``` -2.1.1 is the version this documentation was generated from; +2.2.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.uber.autodispose2:autodispose-lint](com_uber_autodispose2_autodispose-lint.md.html). diff --git a/docs/checks/AutoboxingStateCreation.md.html b/docs/checks/AutoboxingStateCreation.md.html index b234dc94..7c3e2f30 100644 --- a/docs/checks/AutoboxingStateCreation.md.html +++ b/docs/checks/AutoboxingStateCreation.md.html @@ -1,15 +1,15 @@ (#) `State` will autobox values assigned to this state. Use a specialized state type instead. -!!! WARNING: `State` will autobox values assigned to this state. Use a specialized state type instead. - This is a warning. +!!! Tip: `State` will autobox values assigned to this state. Use a specialized state type instead. + Advice from this check is just a tip. Id : `AutoboxingStateCreation` Summary : `State` will autobox values assigned to this state. Use a specialized state type instead. Severity -: Warning +: Information Category : Performance Platform @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files @@ -45,7 +45,9 @@ work to auto-unbox values when reading the value of the state. Instead, prefer to use a specialized primitive state implementation for `Int`, `Long`, `Float`, and `Double` when the state does not need to track null -values and does not override the default `SnapshotMutationPolicy`. +values and does not override the default `SnapshotMutationPolicy`. See +`mutableIntStateOf()`, `mutableLongStateOf()`, `mutableFloatStateOf()`, +and `mutableDoubleStateOf()` for more information. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -93,28 +95,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/AutoboxingStateValueProperty.md.html b/docs/checks/AutoboxingStateValueProperty.md.html index 7a5c381b..6502536f 100644 --- a/docs/checks/AutoboxingStateValueProperty.md.html +++ b/docs/checks/AutoboxingStateValueProperty.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -38,11 +38,11 @@ Copyright Year : 2023 -Avoid using the generic value accessor when using a State objects with a -specialized types. Usages of the generic value property result in an -unnecessary autoboxing operation whenever the state's value is read or -written to. Use the specialized value accessor or property delegation to -avoid unnecessary allocations. +Avoid using the generic `value` property when using a specialized State +type. Reading or writing to the state's generic `value` property will +result in an unnecessary autoboxing operation. Prefer the specialized +value property (e.g. `intValue` for `MutableIntState`), or use property +delegation to avoid unnecessary allocations. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -51,7 +51,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/androidx/compose/runtime/lint/test/test.kt:9:Warning: Reading value +src/androidx/compose/runtime/lint/test/test.kt:7:Warning: Reading value will cause an autoboxing operation. Use intValue to avoid unnecessary allocations. [AutoboxingStateValueProperty] @@ -65,12 +65,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers package androidx.compose.runtime.lint.test -import androidx.compose.runtime.sandbox.MutableIntState -import androidx.compose.runtime.getValue -import androidx.compose.runtime.setValue +import androidx.compose.runtime.mutableIntStateOf fun valueAssignment() { - val state = MutableIntState() + val state = mutableIntStateOf(4) val value = state.value } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -92,28 +90,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/BadConfigurationProvider.md.html b/docs/checks/BadConfigurationProvider.md.html index 2d1a71f4..f557b1be 100644 --- a/docs/checks/BadConfigurationProvider.md.html +++ b/docs/checks/BadConfigurationProvider.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html index a60d530d..59912a5a 100644 --- a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html +++ b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/BatteryLife.md.html b/docs/checks/BatteryLife.md.html index ebce6991..8414f8ea 100644 --- a/docs/checks/BatteryLife.md.html +++ b/docs/checks/BatteryLife.md.html @@ -58,7 +58,7 @@ REQUEST_IGNORE_BATTERY_OPTIMIZATIONS violates the Play Store Content Policy regarding acceptable use cases, as described in https://developer.android.com/training/monitoring-device-state/doze-standby.html - [BatteryLife] +[BatteryLife] <action android:name="android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> ----------------------------------------------------- diff --git a/docs/checks/BindingReceiverParameter.md.html b/docs/checks/BindingReceiverParameter.md.html new file mode 100644 index 00000000..15985df0 --- /dev/null +++ b/docs/checks/BindingReceiverParameter.md.html @@ -0,0 +1,259 @@ + +(#) @Binds/@Provides functions cannot be extension functions. + +!!! ERROR: @Binds/@Provides functions cannot be extension functions. + This is an error. + +Id +: `BindingReceiverParameter` +Summary +: @Binds/@Provides functions cannot be extension functions. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds/@Provides functions cannot be extension functions. Move the +receiver type to a parameter via IDE inspection (option+enter and +convert to parameter). + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:12:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Int.bind(): Number + --- + + +src/foo/MyQualifier.kt:13:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Long.bind(): Number + ---- + + +src/foo/MyQualifier.kt:14:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Double.bind(): Number + ------ + + +src/foo/MyQualifier.kt:15:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Float.bind(): Number + ----- + + +src/foo/MyQualifier.kt:16:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Short.bind(): Number + ----- + + +src/foo/MyQualifier.kt:17:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Byte.bind(): Number + ---- + + +src/foo/MyQualifier.kt:18:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun Char.bind(): Comparable<Char> + ---- + + +src/foo/MyQualifier.kt:19:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun String.bind(): Comparable<String> + ------ + + +src/foo/MyQualifier.kt:20:Error: @Binds/@Provides functions cannot be +extensions [BindingReceiverParameter] + + @Binds fun @receiver:MyQualifier Boolean.bind(): Comparable<Boolean> + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +interface MyModule { + @Binds fun Int.bind(): Number + @Binds fun Long.bind(): Number + @Binds fun Double.bind(): Number + @Binds fun Float.bind(): Number + @Binds fun Short.bind(): Number + @Binds fun Byte.bind(): Number + @Binds fun Char.bind(): Comparable + @Binds fun String.bind(): Comparable + @Binds fun @receiver:MyQualifier Boolean.bind(): Comparable +} + +@Module +interface MyModule2 { + @Provides fun Int.bind(): Number = this@bind + @Provides fun Long.bind(): Number = this@bind + @Provides fun Double.bind(): Number = this@bind + @Provides fun Float.bind(): Number = this@bind + @Provides fun Short.bind(): Number = this@bind + @Provides fun Byte.bind(): Number = this@bind + @Provides fun Char.bind(): Comparable = this@bind + @Provides fun String.bind(): Comparable = this@bind + @Provides fun @receiver:MyQualifier Boolean.bind(): Comparable = this@bind +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.bindings cannot be extension functions`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindingReceiverParameter") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindingReceiverParameter") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindingReceiverParameter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindingReceiverParameter" severity="ignore" /> + </lint> + ``` + 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 'BindingReceiverParameter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindingReceiverParameter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BindingReturnType.md.html b/docs/checks/BindingReturnType.md.html new file mode 100644 index 00000000..27b48aa6 --- /dev/null +++ b/docs/checks/BindingReturnType.md.html @@ -0,0 +1,195 @@ + +(#) @Binds/@Provides functions must have a return type. Cannot be void or Unit. + +!!! ERROR: @Binds/@Provides functions must have a return type. Cannot be void or Unit. + This is an error. + +Id +: `BindingReturnType` +Summary +: @Binds/@Provides functions must have a return type. Cannot be void or Unit. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds/@Provides functions must have a return type. Cannot be void or +Unit. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:14:Error: @Binds/@Provides must have a return +type [BindingReturnType] + + @Provides fun invalidBind3() { + ^ + + +src/foo/MyQualifier.kt:17:Error: @Binds/@Provides must have a return +type [BindingReturnType] + + @Provides fun invalidBind4(): Unit { + ^ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +abstract class MyModule { + @Binds fun invalidBind1(@MyQualifier real: Unit) + @Binds fun invalidBind2(@MyQualifier real: Unit): Unit + @Provides fun invalidBind3() { + + } + @Provides fun invalidBind4(): Unit { + return Unit + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.invalid return types`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindingReturnType") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindingReturnType") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindingReturnType + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindingReturnType" severity="ignore" /> + </lint> + ``` + 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 'BindingReturnType' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindingReturnType ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BindsMustBeAbstract.md.html b/docs/checks/BindsMustBeAbstract.md.html new file mode 100644 index 00000000..387aabb7 --- /dev/null +++ b/docs/checks/BindsMustBeAbstract.md.html @@ -0,0 +1,194 @@ + +(#) @Binds functions must be abstract and cannot have function bodies. + +!!! ERROR: @Binds functions must be abstract and cannot have function bodies. + This is an error. + +Id +: `BindsMustBeAbstract` +Summary +: @Binds functions must be abstract and cannot have function bodies. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds functions must be abstract and cannot have function bodies. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:12:Error: @Binds functions must be abstract +[BindsMustBeAbstract] + + @Binds fun invalidBind1(@MyQualifier real: Unit) + ------------------------------------------------ + + +src/foo/MyQualifier.kt:13:Error: @Binds functions must be abstract +[BindsMustBeAbstract] + + @Binds fun invalidBind2(@MyQualifier real: Unit): Unit + ------------------------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +abstract class MyModule { + @Binds fun invalidBind1(@MyQualifier real: Unit) + @Binds fun invalidBind2(@MyQualifier real: Unit): Unit + @Provides fun invalidBind3() { + + } + @Provides fun invalidBind4(): Unit { + return Unit + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.invalid return types`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindsMustBeAbstract") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindsMustBeAbstract") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindsMustBeAbstract + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindsMustBeAbstract" severity="ignore" /> + </lint> + ``` + 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 'BindsMustBeAbstract' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindsMustBeAbstract ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BindsTypeMismatch.md.html b/docs/checks/BindsTypeMismatch.md.html new file mode 100644 index 00000000..e2133e02 --- /dev/null +++ b/docs/checks/BindsTypeMismatch.md.html @@ -0,0 +1,206 @@ + +(#) @Binds function parameters must be type-assignable to their return types. + +!!! ERROR: @Binds function parameters must be type-assignable to their return types. + This is an error. + +Id +: `BindsTypeMismatch` +Summary +: @Binds function parameters must be type-assignable to their return types. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds function parameters must be type-assignable to their return +types. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/TestModule.kt:18:Error: @Binds parameter/return must be +type-assignable [BindsTypeMismatch] + + @Binds fun invalidBind(real: Long): String + ------------------------------------------ + + +src/foo/TestModule.kt:19:Error: @Binds parameter/return must be +type-assignable [BindsTypeMismatch] + + @Binds fun invalidBind(real: Long): Comparable<Boolean> + ------------------------------------------------------- + + +src/foo/TestModule.kt:23:Error: @Binds parameter/return must be +type-assignable [BindsTypeMismatch] + + @Binds fun invalidComplexBinding(real: DetailTypeAItemMapper): ItemMapper<ItemDetail> + ------------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/TestModule.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Module + +sealed interface ItemDetail { + object DetailTypeA : ItemDetail +} + +interface ItemMapper + +class DetailTypeAItemMapper : ItemMapper + +@Module +interface MyModule { + @Binds fun validBind(real: Int): Number + @Binds fun validBind(real: Boolean): Comparable + @Binds fun invalidBind(real: Long): String + @Binds fun invalidBind(real: Long): Comparable + + @Binds fun validComplexBinding(real: DetailTypeAItemMapper): ItemMapper + @Binds fun validComplexBinding2(real: DetailTypeAItemMapper): ItemMapper<*> + @Binds fun invalidComplexBinding(real: DetailTypeAItemMapper): ItemMapper +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.binds type mismatches`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindsTypeMismatch") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindsTypeMismatch") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindsTypeMismatch + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindsTypeMismatch" severity="ignore" /> + </lint> + ``` + 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 'BindsTypeMismatch' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindsTypeMismatch ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BindsWrongParameterCount.md.html b/docs/checks/BindsWrongParameterCount.md.html new file mode 100644 index 00000000..b3015866 --- /dev/null +++ b/docs/checks/BindsWrongParameterCount.md.html @@ -0,0 +1,184 @@ + +(#) @Binds functions require a single parameter as an input to bind. + +!!! ERROR: @Binds functions require a single parameter as an input to bind. + This is an error. + +Id +: `BindsWrongParameterCount` +Summary +: @Binds functions require a single parameter as an input to bind. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds functions require a single parameter as an input to bind. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyModule.kt:8:Error: @Binds must have one parameter +[BindsWrongParameterCount] + + @Binds fun invalidBind(real: Int, second: Int): Number + ------------------------ + + +src/foo/MyModule.kt:9:Error: @Binds must have one parameter +[BindsWrongParameterCount] + + @Binds fun invalidBind(): Number + -------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyModule.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import dagger.Binds +import dagger.Module + +@Module +interface MyModule { + @Binds fun validBind(real: Int): Number + @Binds fun invalidBind(real: Int, second: Int): Number + @Binds fun invalidBind(): Number +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.binds param counts`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BindsWrongParameterCount") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BindsWrongParameterCount") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BindsWrongParameterCount + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BindsWrongParameterCount" severity="ignore" /> + </lint> + ``` + 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 'BindsWrongParameterCount' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BindsWrongParameterCount ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/BomWithoutPlatform.md.html b/docs/checks/BomWithoutPlatform.md.html index 427f479d..f2ff833f 100644 --- a/docs/checks/BomWithoutPlatform.md.html +++ b/docs/checks/BomWithoutPlatform.md.html @@ -79,6 +79,8 @@ testImplementation(libs.compose.bom) testImplementation "androidx.compose:compose-bom:2023.01.00" api("androidx.compose:compose-bom:2023.01.00") + // Make sure we don't complain about existing platforms + implementation platform("androidx.compose:compose-bom:2023.01.00") } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/BuildListAdds.md.html b/docs/checks/BuildListAdds.md.html new file mode 100644 index 00000000..be7c68ce --- /dev/null +++ b/docs/checks/BuildListAdds.md.html @@ -0,0 +1,138 @@ + +(#) Missing `add` call in `buildList` + +!!! WARNING: Missing `add` call in `buildList` + This is a warning. + +Id +: `BuildListAdds` +Summary +: Missing `add` call in `buildList` +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/BuildListDetector.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/BuildListDetectorTest.kt) +Copyright Year +: 2024 + +The `buildList { }` standard library function is a convenient way to +build lists, but you need to actually call `add` on the items. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/Cubic.kt:4:Warning: No add calls within buildList lambda; this is +usually a mistake [BuildListAdds] + + return buildList { // ERROR + --------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/Cubic.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +class Cubic(id: Int) +val _morphMatch = listOf(1) +fun asCubics_broken(progress: Float): List { + return buildList { // ERROR + for (i in _morphMatch.indices) { + Cubic(i) + } + } +} + +fun asCubics_correct(progress: Float): List { + return buildList { // OK + for (i in _morphMatch.indices) { + add(Cubic(i)) + } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/BuildListDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("BuildListAdds") + fun method() { + buildList(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("BuildListAdds") + void method() { + buildList(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection BuildListAdds + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="BuildListAdds" severity="ignore" /> + </lint> + ``` + 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 'BuildListAdds' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore BuildListAdds ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/CastingViewContextToActivity.md.html b/docs/checks/CastingViewContextToActivity.md.html index e846799a..7526a6ef 100644 --- a/docs/checks/CastingViewContextToActivity.md.html +++ b/docs/checks/CastingViewContextToActivity.md.html @@ -54,17 +54,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -72,7 +72,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ChromeOsAbiSupport.md.html b/docs/checks/ChromeOsAbiSupport.md.html index 3f263883..8db74d90 100644 --- a/docs/checks/ChromeOsAbiSupport.md.html +++ b/docs/checks/ChromeOsAbiSupport.md.html @@ -45,7 +45,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:10:Warning: Missing x86 and x86_64 ABI support for ChromeOS +build.gradle:10:Warning: Missing x86_64 ABI support for ChromeOS [ChromeOsAbiSupport] abiFilters 'arm64-v8a' @@ -76,7 +76,7 @@ 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, `GradleDetector.testChromeOSAbiFiltersMissingX86`. +found for this lint check, `GradleDetector.testChromeOSAbiFiltersMissingX8664`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/ColorCasing.md.html b/docs/checks/ColorCasing.md.html index 8e02a72f..a7028c57 100644 --- a/docs/checks/ColorCasing.md.html +++ b/docs/checks/ColorCasing.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,45 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ColorCasingDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ColorCasingDetectorTest.kt) Colors should have uppercase letters. #FF0099 is valid while #ff0099 isn't since the ff should be written in uppercase. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/layout.xml:2:Warning: Should be using uppercase letters -[ColorCasing] - - tools:textColor="#fff"/> - ---- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/layout.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView xmlns:tools="http://schemas.android.com/tools" - tools:textColor="#fff"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ColorCasingDetectorTest.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, `ColorCasingDetector.lowercaseColor`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/ComposableDestinationInComposeScope.md.html b/docs/checks/ComposableDestinationInComposeScope.md.html index 4ace057e..f9396ed4 100644 --- a/docs/checks/ComposableDestinationInComposeScope.md.html +++ b/docs/checks/ComposableDestinationInComposeScope.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.7.0-beta01") +implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' +implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.7.0-beta01" +navigation-compose = "2.8.0-alpha01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -108,7 +108,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/ComposableLambdaParameterNaming.md.html b/docs/checks/ComposableLambdaParameterNaming.md.html index 797a558c..9c3351bb 100644 --- a/docs/checks/ComposableLambdaParameterNaming.md.html +++ b/docs/checks/ComposableLambdaParameterNaming.md.html @@ -23,11 +23,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -85,28 +85,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableLambdaParameterPosition.md.html b/docs/checks/ComposableLambdaParameterPosition.md.html index 2b4e2b29..feb9c788 100644 --- a/docs/checks/ComposableLambdaParameterPosition.md.html +++ b/docs/checks/ComposableLambdaParameterPosition.md.html @@ -23,11 +23,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -87,28 +87,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableNaming.md.html b/docs/checks/ComposableNaming.md.html index cf2d975e..97342ee4 100644 --- a/docs/checks/ComposableNaming.md.html +++ b/docs/checks/ComposableNaming.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -87,28 +87,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ComposableNavGraphInComposeScope.md.html b/docs/checks/ComposableNavGraphInComposeScope.md.html index 3e9601bc..52dcf6b5 100644 --- a/docs/checks/ComposableNavGraphInComposeScope.md.html +++ b/docs/checks/ComposableNavGraphInComposeScope.md.html @@ -89,17 +89,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.7.0-beta01") +implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' +implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.7.0-beta01" +navigation-compose = "2.8.0-alpha01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -107,7 +107,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/ComposeComposableModifier.md.html b/docs/checks/ComposeComposableModifier.md.html index 312b4067..4eccedb6 100644 --- a/docs/checks/ComposeComposableModifier.md.html +++ b/docs/checks/ComposeComposableModifier.md.html @@ -45,33 +45,29 @@ function tree. See https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions - for more information. +for more information. (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:1:Error: Using @Composable builder functions for modifiers -is not recommended, as they cause unnecessary recompositions. -You should use Modifier.composed { ... } instead, as it limits -recomposition to just the modifier instance, rather than the whole -function tree. -See +src/test.kt:4:Error: Using @Composable builder functions for modifiers +is not recommended, as they cause unnecessary recompositions.You should +use the Modifier.Node API instead, as it limits recomposition to just +the modifier instance, rather than the whole function tree.See https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions - for more information. [ComposeComposableModifier] +for more information. [ComposeComposableModifier] @Composable ^ -src/test.kt:3:Error: Using @Composable builder functions for modifiers -is not recommended, as they cause unnecessary recompositions. -You should use Modifier.composed { ... } instead, as it limits -recomposition to just the modifier instance, rather than the whole -function tree. -See +src/test.kt:6:Error: Using @Composable builder functions for modifiers +is not recommended, as they cause unnecessary recompositions.You should +use the Modifier.Node API instead, as it limits recomposition to just +the modifier instance, rather than the whole function tree.See https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions - for more information. [ComposeComposableModifier] +for more information. [ComposeComposableModifier] @Composable ^ @@ -81,6 +77,9 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + @Composable fun Modifier.something1(): Modifier { } @Composable diff --git a/docs/checks/ComposeCompositionLocalUsage.md.html b/docs/checks/ComposeCompositionLocalUsage.md.html index b280f529..83db6997 100644 --- a/docs/checks/ComposeCompositionLocalUsage.md.html +++ b/docs/checks/ComposeCompositionLocalUsage.md.html @@ -68,8 +68,8 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/test.kt:2:Warning: `CompositionLocal`s are implicit dependencies and -creating new ones should be avoided. -See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +creating new ones should be avoided. See +https://slackhq.github.io/compose-lints/rules/#compositionlocals for more information. [ComposeCompositionLocalUsage] private val LocalApple = staticCompositionLocalOf<String> { "Apple" } @@ -77,8 +77,8 @@ src/test.kt:3:Warning: `CompositionLocal`s are implicit dependencies and -creating new ones should be avoided. -See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +creating new ones should be avoided. See +https://slackhq.github.io/compose-lints/rules/#compositionlocals for more information. [ComposeCompositionLocalUsage] internal val LocalPlum: String = staticCompositionLocalOf { "Plum" } @@ -86,8 +86,8 @@ src/test.kt:4:Warning: `CompositionLocal`s are implicit dependencies and -creating new ones should be avoided. -See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +creating new ones should be avoided. See +https://slackhq.github.io/compose-lints/rules/#compositionlocals for more information. [ComposeCompositionLocalUsage] val LocalPrune = compositionLocalOf { "Prune" } @@ -95,8 +95,8 @@ src/test.kt:5:Warning: `CompositionLocal`s are implicit dependencies and -creating new ones should be avoided. -See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +creating new ones should be avoided. See +https://slackhq.github.io/compose-lints/rules/#compositionlocals for more information. [ComposeCompositionLocalUsage] private val LocalKiwi: String = compositionLocalOf { "Kiwi" } diff --git a/docs/checks/ComposeContentEmitterReturningValues.md.html b/docs/checks/ComposeContentEmitterReturningValues.md.html index 154b12c7..303c7bcd 100644 --- a/docs/checks/ComposeContentEmitterReturningValues.md.html +++ b/docs/checks/ComposeContentEmitterReturningValues.md.html @@ -45,7 +45,7 @@ the composable function by the caller. See https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result - for more information. +for more information. (##) Options @@ -71,27 +71,25 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:1:Error: Composable functions should either emit content -into the composition or return a value, but not both. -If a composable should offer additional control surfaces to its caller, -those control surfaces or callbacks should be provided as parameters to -the composable function by the caller. -See +src/test.kt:3:Error: Composable functions should either emit content +into the composition or return a value, but not both.If a composable +should offer additional control surfaces to its caller, those control +surfaces or callbacks should be provided as parameters to the composable +function by the caller.See https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result - for more information. [ComposeContentEmitterReturningValues] +for more information. [ComposeContentEmitterReturningValues] @Composable ^ -src/test.kt:6:Error: Composable functions should either emit content -into the composition or return a value, but not both. -If a composable should offer additional control surfaces to its caller, -those control surfaces or callbacks should be provided as parameters to -the composable function by the caller. -See +src/test.kt:8:Error: Composable functions should either emit content +into the composition or return a value, but not both.If a composable +should offer additional control surfaces to its caller, those control +surfaces or callbacks should be provided as parameters to the composable +function by the caller.See https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result - for more information. [ComposeContentEmitterReturningValues] +for more information. [ComposeContentEmitterReturningValues] @Composable ^ @@ -101,6 +99,8 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + @Composable fun Something() { Text("Hi") diff --git a/docs/checks/ComposeM2Api.md.html b/docs/checks/ComposeM2Api.md.html index 79fd9822..a18b199c 100644 --- a/docs/checks/ComposeM2Api.md.html +++ b/docs/checks/ComposeM2Api.md.html @@ -70,36 +70,36 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/test.kt:9:Error: Compose Material 2 (M2) is succeeded by Material 3 -(M3). Please use M3 APIs. -See https://slackhq.github.io/compose-lints/rules/#use-material-3 for -more information. [ComposeM2Api] +(M3). Please use M3 APIs.See +https://slackhq.github.io/compose-lints/rules/#use-material-3 for more +information. [ComposeM2Api] Text("Hello, world!") --------------------- src/test.kt:23:Error: Compose Material 2 (M2) is succeeded by Material 3 -(M3). Please use M3 APIs. -See https://slackhq.github.io/compose-lints/rules/#use-material-3 for -more information. [ComposeM2Api] +(M3). Please use M3 APIs.See +https://slackhq.github.io/compose-lints/rules/#use-material-3 for more +information. [ComposeM2Api] Text("Hello, world!") --------------------- src/test.kt:24:Error: Compose Material 2 (M2) is succeeded by Material 3 -(M3). Please use M3 APIs. -See https://slackhq.github.io/compose-lints/rules/#use-material-3 for -more information. [ComposeM2Api] +(M3). Please use M3 APIs.See +https://slackhq.github.io/compose-lints/rules/#use-material-3 for more +information. [ComposeM2Api] val elevation = BottomNavigationDefaults.Elevation ---------------------------------- src/test.kt:25:Error: Compose Material 2 (M2) is succeeded by Material 3 -(M3). Please use M3 APIs. -See https://slackhq.github.io/compose-lints/rules/#use-material-3 for -more information. [ComposeM2Api] +(M3). Please use M3 APIs.See +https://slackhq.github.io/compose-lints/rules/#use-material-3 for more +information. [ComposeM2Api] val drawerValue = BottomDrawerValue.Closed ------------------------ diff --git a/docs/checks/ComposeModifierMissing.md.html b/docs/checks/ComposeModifierMissing.md.html index f748f187..f0a4241f 100644 --- a/docs/checks/ComposeModifierMissing.md.html +++ b/docs/checks/ComposeModifierMissing.md.html @@ -42,7 +42,7 @@ parameter. See https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters - for more information. +for more information. (##) Options @@ -85,31 +85,28 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Error: This @Composable function emits content but doesn't -have a modifier parameter. -See +src/test.kt:5:Error: This @Composable function emits content but doesn't +have a modifier parameter.See https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters - for more information. [ComposeModifierMissing] +for more information. [ComposeModifierMissing] fun Something1() { ---------- -src/test.kt:7:Error: This @Composable function emits content but doesn't -have a modifier parameter. -See +src/test.kt:10:Error: This @Composable function emits content but +doesn't have a modifier parameter.See https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters - for more information. [ComposeModifierMissing] +for more information. [ComposeModifierMissing] fun Something2() { ---------- -src/test.kt:12:Error: This @Composable function emits content but -doesn't have a modifier parameter. -See +src/test.kt:15:Error: This @Composable function emits content but +doesn't have a modifier parameter.See https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters - for more information. [ComposeModifierMissing] +for more information. [ComposeModifierMissing] fun Something3(): Unit { ---------- @@ -119,6 +116,9 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.ui.Modifier +import androidx.compose.runtime.Composable + @Composable fun Something1() { Row { diff --git a/docs/checks/ComposeModifierReused.md.html b/docs/checks/ComposeModifierReused.md.html index 40922aea..ce058ff2 100644 --- a/docs/checks/ComposeModifierReused.md.html +++ b/docs/checks/ComposeModifierReused.md.html @@ -70,133 +70,133 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:3:Error: Modifiers should only be used once and by the root +src/test.kt:6:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] Row(modifier) { ^ -src/test.kt:4:Error: Modifiers should only be used once and by the root +src/test.kt:7:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingElse(modifier) ----------------------- -src/test.kt:9:Error: Modifiers should only be used once and by the root +src/test.kt:12:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] Column(modifier = modifier) { ^ -src/test.kt:11:Error: Modifiers should only be used once and by the root +src/test.kt:14:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingDifferent(modifier = modifier) --------------------------------------- -src/test.kt:16:Error: Modifiers should only be used once and by the root +src/test.kt:19:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] Column(modifier = modifier) { ^ -src/test.kt:19:Error: Modifiers should only be used once and by the root +src/test.kt:22:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingElse(modifier = modifier) ---------------------------------- -src/test.kt:20:Error: Modifiers should only be used once and by the root +src/test.kt:23:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingElse(modifier = modifier.padding12()) ---------------------------------------------- -src/test.kt:25:Error: Modifiers should only be used once and by the root +src/test.kt:28:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingElse(myMod) -------------------- -src/test.kt:26:Error: Modifiers should only be used once and by the root +src/test.kt:29:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] SomethingElse(myMod) -------------------- -src/test.kt:31:Error: Modifiers should only be used once and by the root +src/test.kt:34:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] Box( ^ -src/test.kt:37:Error: Modifiers should only be used once and by the root +src/test.kt:40:Error: Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with -other modifiers e.g. modifier.fillMaxWidth(). -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. [ComposeModifierReused] +other modifiers e.g. modifier.fillMaxWidth().Use Modifier (with a +capital 'M') to construct a new Modifier that you can pass to other +composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. [ComposeModifierReused] Box( ^ @@ -206,6 +206,9 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + @Composable fun Something(modifier: Modifier) { Row(modifier) { diff --git a/docs/checks/ComposeModifierWithoutDefault.md.html b/docs/checks/ComposeModifierWithoutDefault.md.html index 1a272605..9845a4ca 100644 --- a/docs/checks/ComposeModifierWithoutDefault.md.html +++ b/docs/checks/ComposeModifierWithoutDefault.md.html @@ -42,7 +42,7 @@ default value. See https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters - for more information. +for more information. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -51,21 +51,19 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Error: This @Composable function has a modifier parameter -but it doesn't have a default value. -See +src/test.kt:5:Error: This @Composable function has a modifier parameter +but it doesn't have a default value.See https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters - for more information. [ComposeModifierWithoutDefault] +for more information. [ComposeModifierWithoutDefault] fun Something(modifier: Modifier) { } ------------------ -src/test.kt:4:Error: This @Composable function has a modifier parameter -but it doesn't have a default value. -See +src/test.kt:7:Error: This @Composable function has a modifier parameter +but it doesn't have a default value.See https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters - for more information. [ComposeModifierWithoutDefault] +for more information. [ComposeModifierWithoutDefault] fun Something(modifier: Modifier = Modifier, modifier2: Modifier) { } ------------------- @@ -75,6 +73,9 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + @Composable fun Something(modifier: Modifier) { } @Composable diff --git a/docs/checks/ComposeMultipleContentEmitters.md.html b/docs/checks/ComposeMultipleContentEmitters.md.html index bd9face4..d009c847 100644 --- a/docs/checks/ComposeMultipleContentEmitters.md.html +++ b/docs/checks/ComposeMultipleContentEmitters.md.html @@ -42,7 +42,7 @@ composition from one source at their top level. See https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content - for more information. +for more information. (##) Options @@ -68,21 +68,23 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:1:Error: Composable functions should only be emitting +src/test.kt:3:Error: Composable functions should only be emitting content into the composition from one source at their top level. + See https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content - for more information. [ComposeMultipleContentEmitters] +for more information. [ComposeMultipleContentEmitters] @Composable ^ -src/test.kt:6:Error: Composable functions should only be emitting +src/test.kt:8:Error: Composable functions should only be emitting content into the composition from one source at their top level. + See https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content - for more information. [ComposeMultipleContentEmitters] +for more information. [ComposeMultipleContentEmitters] @Composable ^ @@ -92,6 +94,8 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + @Composable fun Something() { Text("Hi") diff --git a/docs/checks/ComposeMutableParameters.md.html b/docs/checks/ComposeMutableParameters.md.html index 3145014c..591e8bb1 100644 --- a/docs/checks/ComposeMutableParameters.md.html +++ b/docs/checks/ComposeMutableParameters.md.html @@ -45,59 +45,55 @@ recomposition when they change. See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters - for more information. +for more information. (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Error: Using mutable objects as state in Compose will -cause your users to see incorrect or stale data in your app. -Mutable objects that are not observable, such as ArrayList or a -mutable data class, cannot be observed by Compose to trigger -recomposition when they change. -See +src/test.kt:5:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app.Mutable +objects that are not observable, such as ArrayList or a mutable data +class, cannot be observed by Compose to trigger recomposition when they +change.See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters - for more information. [ComposeMutableParameters] +for more information. [ComposeMutableParameters] fun Something(a: MutableState<String>) {} -------------------- -src/test.kt:4:Error: Using mutable objects as state in Compose will -cause your users to see incorrect or stale data in your app. -Mutable objects that are not observable, such as ArrayList or a -mutable data class, cannot be observed by Compose to trigger -recomposition when they change. -See +src/test.kt:7:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app.Mutable +objects that are not observable, such as ArrayList or a mutable data +class, cannot be observed by Compose to trigger recomposition when they +change.See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters - for more information. [ComposeMutableParameters] +for more information. [ComposeMutableParameters] fun Something(a: ArrayList<String>) {} ----------------- -src/test.kt:6:Error: Using mutable objects as state in Compose will -cause your users to see incorrect or stale data in your app. -Mutable objects that are not observable, such as ArrayList or a -mutable data class, cannot be observed by Compose to trigger -recomposition when they change. -See +src/test.kt:9:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app.Mutable +objects that are not observable, such as ArrayList or a mutable data +class, cannot be observed by Compose to trigger recomposition when they +change.See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters - for more information. [ComposeMutableParameters] +for more information. [ComposeMutableParameters] fun Something(a: HashSet<String>) {} --------------- -src/test.kt:8:Error: Using mutable objects as state in Compose will -cause your users to see incorrect or stale data in your app. -Mutable objects that are not observable, such as ArrayList or a -mutable data class, cannot be observed by Compose to trigger -recomposition when they change. -See +src/test.kt:11:Error: Using mutable objects as state in Compose will +cause your users to see incorrect or stale data in your app.Mutable +objects that are not observable, such as ArrayList or a mutable data +class, cannot be observed by Compose to trigger recomposition when they +change.See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters - for more information. [ComposeMutableParameters] +for more information. [ComposeMutableParameters] fun Something(a: MutableMap<String, String>) {} -------------------------- @@ -107,6 +103,9 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.Composable + @Composable fun Something(a: MutableState) {} @Composable diff --git a/docs/checks/ComposeNamingLowercase.md.html b/docs/checks/ComposeNamingLowercase.md.html index 018551b4..cd28ed4d 100644 --- a/docs/checks/ComposeNamingLowercase.md.html +++ b/docs/checks/ComposeNamingLowercase.md.html @@ -45,7 +45,7 @@ for callers when used with @Composable functions. See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly - for more information. +for more information. (##) Options @@ -71,14 +71,13 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Error: Composable functions that return a value should -start with a lowercase letter. -While useful and accepted outside of @Composable functions, this factory -function convention has drawbacks that set inappropriate expectations -for callers when used with @Composable functions. -See +src/test.kt:4:Error: Composable functions that return a value should +start with a lowercase letter.While useful and accepted outside of +@Composable functions, this factory function convention has drawbacks +that set inappropriate expectations for callers when used with +@Composable functions.See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly - for more information. [ComposeNamingLowercase] +for more information. [ComposeNamingLowercase] fun MyComposable(): Something { } ------------ @@ -88,6 +87,8 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + @Composable fun MyComposable(): Something { } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -96,11 +97,6 @@ [source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.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, `ComposableFunctionNamingDetector.errors when a composable returns a value and is capitalized`. -To report a problem with this extracted sample, visit -https://github.com/slackhq/compose-lints/issues. - (##) Including !!! diff --git a/docs/checks/ComposeNamingUppercase.md.html b/docs/checks/ComposeNamingUppercase.md.html index 8ceaa50e..6d7d1530 100644 --- a/docs/checks/ComposeNamingUppercase.md.html +++ b/docs/checks/ComposeNamingUppercase.md.html @@ -45,7 +45,7 @@ classes. See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly - for more information. +for more information. (##) Options @@ -71,27 +71,23 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Error: Composable functions that return Unit should start -with an uppercase letter. -They are considered declarative entities that can be either present or -absent in a composition and therefore follow the naming rules for -classes. -See +src/test.kt:4:Error: Composable functions that return Unit should start +with an uppercase letter.They are considered declarative entities that +can be either present or absent in a composition and therefore follow +the naming rules for classes.See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly - for more information. [ComposeNamingUppercase] +for more information. [ComposeNamingUppercase] fun myComposable() { } ------------ -src/test.kt:5:Error: Composable functions that return Unit should start -with an uppercase letter. -They are considered declarative entities that can be either present or -absent in a composition and therefore follow the naming rules for -classes. -See +src/test.kt:7:Error: Composable functions that return Unit should start +with an uppercase letter.They are considered declarative entities that +can be either present or absent in a composition and therefore follow +the naming rules for classes.See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly - for more information. [ComposeNamingUppercase] +for more information. [ComposeNamingUppercase] fun myComposable(): Unit { } ------------ @@ -101,6 +97,8 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + @Composable fun myComposable() { } @@ -112,11 +110,6 @@ [source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ComposableFunctionNamingDetectorTest.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, `ComposableFunctionNamingDetector.errors when a composable returns nothing or Unit and is lowercase`. -To report a problem with this extracted sample, visit -https://github.com/slackhq/compose-lints/issues. - (##) Including !!! diff --git a/docs/checks/ComposeParameterOrder.md.html b/docs/checks/ComposeParameterOrder.md.html index 8a658568..22fb09a0 100644 --- a/docs/checks/ComposeParameterOrder.md.html +++ b/docs/checks/ComposeParameterOrder.md.html @@ -40,11 +40,14 @@ This is replaced when reported. +!!! Tip + This lint check has an associated quickfix available in the IDE. + (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:1:Error: Parameters in a composable function should be +src/test.kt:5:Error: Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param. @@ -53,13 +56,13 @@ Modifier = Modifier]. See https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly - for more information. [ComposeParameterOrder] +for more information. [ComposeParameterOrder] -@Composable -^ +fun MyComposable(modifier: Modifier = Modifier, other: String, other2: String) { } + -------------------------------------------------------------- -src/test.kt:4:Error: Parameters in a composable function should be +src/test.kt:8:Error: Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param. @@ -68,13 +71,13 @@ "deffo"]. See https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly - for more information. [ComposeParameterOrder] +for more information. [ComposeParameterOrder] -@Composable -^ +fun MyComposable(text: String = "deffo", modifier: Modifier = Modifier) { } + ------------------------------------------------------- -src/test.kt:7:Error: Parameters in a composable function should be +src/test.kt:11:Error: Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param. @@ -83,13 +86,13 @@ = Modifier, modifier2: Modifier = Modifier, text: String = "123"]. See https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly - for more information. [ComposeParameterOrder] +for more information. [ComposeParameterOrder] -@Composable -^ +fun MyComposable(modifier: Modifier = Modifier, text: String = "123", modifier2: Modifier = Modifier) { } + ------------------------------------------------------------------------------------- -src/test.kt:10:Error: Parameters in a composable function should be +src/test.kt:14:Error: Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param. @@ -98,13 +101,13 @@ Modifier, text: String = "123", lambda: () -> Unit]. See https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly - for more information. [ComposeParameterOrder] +for more information. [ComposeParameterOrder] -@Composable -^ +fun MyComposable(text: String = "123", modifier: Modifier = Modifier, lambda: () -> Unit) { } + ------------------------------------------------------------------------- -src/test.kt:13:Error: Parameters in a composable function should be +src/test.kt:17:Error: Parameters in a composable function should be ordered following this pattern: params without defaults, modifiers, params with defaults and optionally, a trailing function that might not have a default param. @@ -114,16 +117,19 @@ Unit]. See https://slackhq.github.io/compose-lints/rules/#ordering-composable-parameters-properly - for more information. [ComposeParameterOrder] +for more information. [ComposeParameterOrder] -@Composable -^ +fun MyComposable(text1: String, m2: Modifier = Modifier, modifier: Modifier = Modifier, trailing: () -> Unit) { } + --------------------------------------------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + @Composable fun MyComposable(modifier: Modifier = Modifier, other: String, other2: String) { } diff --git a/docs/checks/ComposePreviewNaming.md.html b/docs/checks/ComposePreviewNaming.md.html index 621fcdeb..4cf920ef 100644 --- a/docs/checks/ComposePreviewNaming.md.html +++ b/docs/checks/ComposePreviewNaming.md.html @@ -44,33 +44,33 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/Banana.kt:1:Error: Preview annotations with 1 preview annotations +src/Banana.kt:3:Error: Preview annotations with 1 preview annotations should end with the Preview suffix. See https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly - for more information. [ComposePreviewNaming] +for more information. [ComposePreviewNaming] @Preview ^ -src/Banana.kt:3:Error: Preview annotations with 1 preview annotations +src/Banana.kt:5:Error: Preview annotations with 1 preview annotations should end with the Preview suffix. See https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly - for more information. [ComposePreviewNaming] +for more information. [ComposePreviewNaming] @Preview ^ -src/Banana.kt:5:Error: Preview annotations with 1 preview annotations +src/Banana.kt:7:Error: Preview annotations with 1 preview annotations should end with the Preview suffix. See https://slackhq.github.io/compose-lints/rules/#naming-multipreview-annotations-properly - for more information. [ComposePreviewNaming] +for more information. [ComposePreviewNaming] -@BananaPreview +@BananaPreviews ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -78,11 +78,13 @@ `src/Banana.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.ui.tooling.preview.Preview + @Preview annotation class Banana @Preview annotation class BananaPreviews -@BananaPreview +@BananaPreviews annotation class WithBananaPreviews ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/ComposePreviewPublic.md.html b/docs/checks/ComposePreviewPublic.md.html index 37c497eb..c4ae8736 100644 --- a/docs/checks/ComposePreviewPublic.md.html +++ b/docs/checks/ComposePreviewPublic.md.html @@ -42,7 +42,7 @@ the UI should not be public. See https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public - for more information. +for more information. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -72,30 +72,43 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:1:Error: Composables annotated with @Preview that are used -only for previewing the UI should not be public. -See +src/test.kt:4:Error: Composables annotated with @Preview that are used +only for previewing the UI should not be public.See https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public - for more information. [ComposePreviewPublic] +for more information. [ComposePreviewPublic] @Preview ^ -src/test.kt:4:Error: Composables annotated with @Preview that are used -only for previewing the UI should not be public. -See +src/test.kt:7:Error: Composables annotated with @Preview that are used +only for previewing the UI should not be public.See https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public - for more information. [ComposePreviewPublic] +for more information. [ComposePreviewPublic] @CombinedPreviews ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Here is the source file referenced above: +Here are the relevant source files: + +`src/CombinedPreviews.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameterProvider + +@Preview +annotation class CombinedPreviews + +class User +class UserProvider : PreviewParameterProvider +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview + @Preview @Composable fun MyComposable() { } @@ -108,11 +121,6 @@ [source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/PreviewPublicDetectorTest.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, `PreviewPublicDetector.errors when a public preview composable is used when previewPublicOnlyIfParams is false`. -To report a problem with this extracted sample, visit -https://github.com/slackhq/compose-lints/issues. - (##) Including !!! diff --git a/docs/checks/ComposeRememberMissing.md.html b/docs/checks/ComposeRememberMissing.md.html index c0f43fb6..0e731ce3 100644 --- a/docs/checks/ComposeRememberMissing.md.html +++ b/docs/checks/ComposeRememberMissing.md.html @@ -44,25 +44,25 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:3:Error: Using mutableStateOf in a @Composable function +src/test.kt:7:Error: Using mutableStateOf in a @Composable function without it being inside of a remember function. If you don't remember the state instance, a new state instance will be created when the function is recomposed. See https://slackhq.github.io/compose-lints/rules/#state-should-be-remembered-in-composables - for more information. [ComposeRememberMissing] +for more information. [ComposeRememberMissing] val something = mutableStateOf("X") ------------------- -src/test.kt:6:Error: Using mutableStateOf in a @Composable function +src/test.kt:10:Error: Using mutableStateOf in a @Composable function without it being inside of a remember function. If you don't remember the state instance, a new state instance will be created when the function is recomposed. See https://slackhq.github.io/compose-lints/rules/#state-should-be-remembered-in-composables - for more information. [ComposeRememberMissing] +for more information. [ComposeRememberMissing] fun MyComposable(something: State<String> = mutableStateOf("X")) { ------------------- @@ -72,6 +72,10 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.State + @Composable fun MyComposable() { val something = mutableStateOf("X") diff --git a/docs/checks/ComposeUnstableCollections.md.html b/docs/checks/ComposeUnstableCollections.md.html index 8a33d1ca..02022a38 100644 --- a/docs/checks/ComposeUnstableCollections.md.html +++ b/docs/checks/ComposeUnstableCollections.md.html @@ -44,7 +44,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Warning: The Compose Compiler cannot infer the stability +src/test.kt:4:Warning: The Compose Compiler cannot infer the stability of a parameter if a Collection is used in it, even if the item type is stable. You should use Kotlinx Immutable Collections instead: a: @@ -52,13 +52,13 @@ class: @Immutable data class ACollection(val items: Collection) See https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections - for more information. [ComposeUnstableCollections] +for more information. [ComposeUnstableCollections] fun Something(a: Collection<String>) {} ------------------ -src/test.kt:4:Warning: The Compose Compiler cannot infer the stability +src/test.kt:6:Warning: The Compose Compiler cannot infer the stability of a parameter if a List is used in it, even if the item type is stable. You should use Kotlinx Immutable Collections instead: a: @@ -66,13 +66,13 @@ @Immutable data class AList(val items: List) See https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections - for more information. [ComposeUnstableCollections] +for more information. [ComposeUnstableCollections] fun Something(a: List<String>) {} ------------ -src/test.kt:6:Warning: The Compose Compiler cannot infer the stability +src/test.kt:8:Warning: The Compose Compiler cannot infer the stability of a parameter if a Set is used in it, even if the item type is stable. You should use Kotlinx Immutable Collections instead: a: @@ -80,13 +80,13 @@ @Immutable data class ASet(val items: Set) See https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections - for more information. [ComposeUnstableCollections] +for more information. [ComposeUnstableCollections] fun Something(a: Set<String>) {} ----------- -src/test.kt:8:Warning: The Compose Compiler cannot infer the stability +src/test.kt:10:Warning: The Compose Compiler cannot infer the stability of a parameter if a Map is used in it, even if the item type is stable. You should use Kotlinx Immutable Collections instead: a: @@ -94,7 +94,7 @@ class: @Immutable data class AMap(val items: Map) See https://slackhq.github.io/compose-lints/rules/#avoid-using-unstable-collections - for more information. [ComposeUnstableCollections] +for more information. [ComposeUnstableCollections] fun Something(a: Map<String, Int>) {} ---------------- @@ -104,6 +104,8 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + @Composable fun Something(a: Collection) {} @Composable diff --git a/docs/checks/ComposeViewModelForwarding.md.html b/docs/checks/ComposeViewModelForwarding.md.html index 24bdd51e..82778fdb 100644 --- a/docs/checks/ComposeViewModelForwarding.md.html +++ b/docs/checks/ComposeViewModelForwarding.md.html @@ -47,10 +47,11 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:3:Error: Forwarding a ViewModel through multiple @Composable -functions should be avoided. Consider using state hoisting. -See https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things -for more information. [ComposeViewModelForwarding] +src/MyViewModel.kt:7:Error: Forwarding a ViewModel through multiple +@Composable functions should be avoided. Consider using state +hoisting.See +https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things for +more information. [ComposeViewModelForwarding] AnotherComposable(viewModel) ---------------------------- @@ -58,8 +59,12 @@ Here is the source file referenced above: -`src/test.kt`: +`src/MyViewModel.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + +class MyViewModel + @Composable fun MyComposable(viewModel: MyViewModel) { AnotherComposable(viewModel) diff --git a/docs/checks/ComposeViewModelInjection.md.html b/docs/checks/ComposeViewModelInjection.md.html index e6719378..fc8b5fca 100644 --- a/docs/checks/ComposeViewModelInjection.md.html +++ b/docs/checks/ComposeViewModelInjection.md.html @@ -64,7 +64,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:3:Error: Implicit dependencies of composables should be made +src/test.kt:6:Error: Implicit dependencies of composables should be made explicit. Usages of to acquire a ViewModel should be done in composable default parameters, so that it is more testable and flexible. @@ -75,8 +75,8 @@ ------------------------ -src/test.kt:8:Error: Implicit dependencies of composables should be made -explicit. +src/test.kt:11:Error: Implicit dependencies of composables should be +made explicit. Usages of to acquire a ViewModel should be done in composable default parameters, so that it is more testable and flexible. See https://slackhq.github.io/compose-lints/rules/#viewmodels for more @@ -86,7 +86,7 @@ ------------------------ -src/test.kt:13:Error: Implicit dependencies of composables should be +src/test.kt:16:Error: Implicit dependencies of composables should be made explicit. Usages of to acquire a ViewModel should be done in composable default parameters, so that it is more testable and flexible. @@ -101,7 +101,10 @@ `src/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -@Composable +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier + + @Composable fun MyComposable(modifier: Modifier) { val viewModel = () } diff --git a/docs/checks/CompositionLocalNaming.md.html b/docs/checks/CompositionLocalNaming.md.html index 74767e6e..54f98007 100644 --- a/docs/checks/CompositionLocalNaming.md.html +++ b/docs/checks/CompositionLocalNaming.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -110,28 +110,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ConflictingOnColor.md.html b/docs/checks/ConflictingOnColor.md.html index 31c719ee..98fd2ee5 100644 --- a/docs/checks/ConflictingOnColor.md.html +++ b/docs/checks/ConflictingOnColor.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.material:material](androidx_compose_material_material.md.html) +: [androidx.compose.material:material-android](androidx_compose_material_material-android.md.html) Affects : Kotlin and Java files and test sources @@ -214,28 +214,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.material:material:1.5.0-beta02") +implementation("androidx.compose.material:material-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.material:material:1.5.0-beta02' +implementation 'androidx.compose.material:material-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.material) +implementation(libs.material-android) # libs.versions.toml [versions] -material = "1.5.0-beta02" +material-android = "1.7.0-alpha01" [libraries] -material = { - module = "androidx.compose.material:material", - version.ref = "material" +material-android = { + module = "androidx.compose.material:material-android", + version.ref = "material-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.material:material](androidx_compose_material_material.md.html). +[Additional details about androidx.compose.material:material-android](androidx_compose_material_material-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html b/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html index d42901b0..502323d3 100644 --- a/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html +++ b/docs/checks/ConstraintLayoutToolsEditorAttribute.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,11 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetectorTest.kt) The tools:layout_editor xml properties are only used for previewing and won't be used in your APK hence they're unnecessary and just add overhead. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/layout.xml:3:Warning: Don't use tools:layout_editor_absoluteX -[ConstraintLayoutToolsEditorAttribute] - - tools:layout_editor_absoluteX="4dp"/> - ----------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/layout.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView - xmlns:tools="http://schemas.android.com/tools" - tools:layout_editor_absoluteX="4dp"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ConstraintLayoutToolsEditorAttributeDetectorTest.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, `ConstraintLayoutToolsEditorAttributeDetector.toolsLayoutEditor`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/CoroutineCreationDuringComposition.md.html b/docs/checks/CoroutineCreationDuringComposition.md.html index 3897df63..570379fa 100644 --- a/docs/checks/CoroutineCreationDuringComposition.md.html +++ b/docs/checks/CoroutineCreationDuringComposition.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -297,28 +297,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/CredentialDependency.md.html b/docs/checks/CredentialDependency.md.html new file mode 100644 index 00000000..e9d7e6b7 --- /dev/null +++ b/docs/checks/CredentialDependency.md.html @@ -0,0 +1,108 @@ + +(#) `credentials-play-services-auth` is Required + +!!! WARNING: `credentials-play-services-auth` is Required + This is a warning. + +Id +: `CredentialDependency` +Summary +: `credentials-play-services-auth` is Required +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 runs on the fly in the IDE editor +See +: https://developer.android.com/jetpack/androidx/releases/credentials +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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +The dependency `androidx.credentials:credentials-play-services-auth` is +required to get support from Play services for the Credential Manager +API to work. For Android 14 or higher, this is optional. Please check +release notes for the latest version. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:2:Warning: In Android 13 or lower, +credentials-play-services-auth is required when using +androidx.credentials:credentials [CredentialDependency] + + implementation 'androidx.credentials:credentials:+' + ------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + implementation 'androidx.credentials:credentials:+' +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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 CredentialDependency + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="CredentialDependency" severity="ignore" /> + </lint> + ``` + 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 'CredentialDependency' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore CredentialDependency ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/CutPasteId.md.html b/docs/checks/CutPasteId.md.html index ae9c5858..bceb77e5 100644 --- a/docs/checks/CutPasteId.md.html +++ b/docs/checks/CutPasteId.md.html @@ -41,298 +41,41 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/PasteError.java:22:Warning: The id R.id.duplicated has +src/test/pkg/PasteError.java:10:Warning: The id R.id.previous has already been looked up in this method; possible cut & paste error? [CutPasteId] - View view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:78:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:85:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:93:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:102:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:148:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - TextView sectionTitleView = (TextView) root.findViewById(R.id.duplicated); - ---------------------------------- - - -src/test/pkg/PasteError.java:162:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - TextView sectionTitleView = (TextView) root.findViewById(R.id.duplicated); - ---------------------------------- - - -src/test/pkg/PasteError.java:171:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = findViewById(R.id.duplicated); - ----------------------------- - - -src/test/pkg/PasteError.java:182:Warning: The id R.id.duplicated has -already been looked up in this method; possible cut & paste error? -[CutPasteId] - - view2 = requireViewById(R.id.duplicated); - -------------------------------- + next = (Button) findViewById(R.id.previous); // TYPO, meant R.id.next + --------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Here is the source file referenced above: +Here are the relevant source files: `src/test/pkg/PasteError.java`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers package test.pkg; - -import android.annotation.SuppressLint; import android.app.Activity; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; import android.widget.Button; -import android.widget.TextView; -@SuppressWarnings({"ConstantConditions", "UnnecessaryLocalVariable", "ConstantIfStatement", - "StatementWithEmptyBody", "FieldCanBeLocal", "unused", "UnusedAssignment"}) public class PasteError extends Activity { - protected void ok() { - Button button1 = (Button) findViewById(R.id.textView1); - mView2 = findViewById(R.id.textView2); - View view3 = findViewById(R.id.activity_main); - } - - protected void error() { - View view1 = findViewById(R.id.duplicated); - View view2 = findViewById(R.id.duplicated); - View view3 = findViewById(R.id.ok); - } - - protected void ok2() { - View view1; - if (true) { - view1 = findViewById(R.id.ok); - } else { - view1 = findViewById(R.id.ok); - } - } - - @SuppressLint("CutPasteId") - protected void suppressed() { - View view1 = findViewById(R.id.duplicated); - View view2 = findViewById(R.id.duplicated); - } - - private void ok3() { - if (view == null || view.findViewById(R.id.city_name) == null) { - view = mInflater.inflate(R.layout.city_list_item, parent, false); - } - TextView name = (TextView) view.findViewById(R.id.city_name); - } - - private void ok4() { - mPrevAlbumWrapper = mPrevTrackLayout.findViewById(R.id.album_wrapper); - mNextAlbumWrapper = mNextTrackLayout.findViewById(R.id.album_wrapper); - } - - public View getView(int position, View convertView, ViewGroup parent) { - View listItem = convertView; - if (getItemViewType(position) == VIEW_TYPE_HEADER) { - TextView header = (TextView) listItem.findViewById(R.id.name); - } else if (getItemViewType(position) == VIEW_TYPE_BOOLEAN) { - TextView filterName = (TextView) listItem.findViewById(R.id.name); - } else { - TextView filterName = (TextView) listItem.findViewById(R.id.name); - } - return null; - } - - protected void ok_branch_1() { - if (true) { - view1 = findViewById(R.id.ok); - } else { - view2 = findViewById(R.id.ok); - } - } - - protected void error_branch_1() { - if (true) { - view1 = findViewById(R.id.duplicated); - } - if (true) { - view2 = findViewById(R.id.duplicated); - } - } - - protected void error_branch_2() { - view1 = findViewById(R.id.duplicated); - if (true) { - view2 = findViewById(R.id.duplicated); - } - } - - protected void error_branch_3() { - view1 = findViewById(R.id.duplicated); - if (true) { - } else { - view2 = findViewById(R.id.duplicated); - } - } - - protected void error_branch_4() { - view1 = findViewById(R.id.duplicated); - if (true) { - } else { - if (true) { - view2 = findViewById(R.id.duplicated); - } - } - } - - protected void ok_branch_2() { - if (true) { - view1 = findViewById(R.id.ok); - } else { - if (true) { - view2 = findViewById(R.id.ok); - } - } - } - - protected void ok_branch3() { - if (true) { - view1 = findViewById(R.id.ok); - return; - } - if (true) { - view2 = findViewById(R.id.ok); - } - } - - public static void ok_switch(View root, int position) { - // mutually exclusive branches - switch (position) { - case 0: { - TextView titleView = (TextView) root.findViewById(R.id.ok); - } - break; - default: { - TextView sectionTitleView = (TextView) root.findViewById(R.id.ok); - } - break; - } - } - - public static void error_switch_fallthrough(View root, int position) { - switch (position) { - case 0: { - TextView titleView = (TextView) root.findViewById(R.id.duplicated); - // fallthrough! - } - default: { - TextView sectionTitleView = (TextView) root.findViewById(R.id.duplicated); - } - break; - } - } - - public static void warning_switch_to_outer(View root, int position) { - switch (position) { - case 0: - { - TextView titleView = (TextView) root.findViewById(R.id.duplicated); - } - break; - } - TextView sectionTitleView = (TextView) root.findViewById(R.id.duplicated); - } - - public void while_loop_error(View root, int position) { - while (position-- > 0) { // here we can flow back - if (true) { - view1 = findViewById(R.id.duplicated); - } else { - if (true) { - view2 = findViewById(R.id.duplicated); - } - } - } - } - - protected void require_by_id_error_branch_1() { - if (true) { - view1 = requireViewById(R.id.duplicated); - } - if (true) { - view2 = requireViewById(R.id.duplicated); - } - } - - public final T requireViewById(int id) { - throw new RuntimeException("Stub!"); - } - - private View view1; - private View mView2; - private View view; - private View view2; - private LayoutInflater mInflater; - private Object mPrevAlbumWrapper; - private Object mNextAlbumWrapper; - private Activity mPrevTrackLayout; - private Activity mNextTrackLayout; - private android.view.ViewGroup parent; - private static final int VIEW_TYPE_HEADER = 1; - private static final int VIEW_TYPE_BOOLEAN = 2; - private int getItemViewType(int position) { - return VIEW_TYPE_BOOLEAN; + private Button next; + private Button previous; + protected void onCreate() { + previous = (Button) findViewById(R.id.previous); + next = (Button) findViewById(R.id.previous); // TYPO, meant R.id.next } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`test.pkg`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linenumbers +@id/next +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 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/CutPasteDetectorTest.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, `CutPasteDetector.test`. -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: diff --git a/docs/checks/DeepLinkInActivityDestination.md.html b/docs/checks/DeepLinkInActivityDestination.md.html index 93d2244a..c9906177 100644 --- a/docs/checks/DeepLinkInActivityDestination.md.html +++ b/docs/checks/DeepLinkInActivityDestination.md.html @@ -102,17 +102,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-runtime:2.7.0-beta01") +implementation("androidx.navigation:navigation-runtime:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-runtime:2.7.0-beta01' +implementation 'androidx.navigation:navigation-runtime:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-runtime) # libs.versions.toml [versions] -navigation-runtime = "2.7.0-beta01" +navigation-runtime = "2.8.0-alpha01" [libraries] navigation-runtime = { module = "androidx.navigation:navigation-runtime", @@ -120,7 +120,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html). diff --git a/docs/checks/DefaultEncoding.md.html b/docs/checks/DefaultEncoding.md.html index 723c2b16..0dc8e6cf 100644 --- a/docs/checks/DefaultEncoding.md.html +++ b/docs/checks/DefaultEncoding.md.html @@ -45,9 +45,9 @@ Note that on Android, the default file encoding is always UTF-8 (see https://developer.android.com/reference/java/nio/charset/Charset#defaultCharset() - for more), so this lint check deliberately does not flag any problems -in Android code, since it is always safe to rely on the default -character encoding there. +for more), so this lint check deliberately does not flag any problems in +Android code, since it is always safe to rely on the default character +encoding there. (##) Example diff --git a/docs/checks/DefaultLayoutAttribute.md.html b/docs/checks/DefaultLayoutAttribute.md.html index 0747042b..b7363397 100644 --- a/docs/checks/DefaultLayoutAttribute.md.html +++ b/docs/checks/DefaultLayoutAttribute.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetectorTest.kt) Flags default layout values that are not needed. One for instance is the textStyle="normal" that can be just removed. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:5:Warning: This is the default and hence you don't -need to specify it [DefaultLayoutAttribute] - - android:textStyle="normal"/> - ------ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textStyle="normal"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/DefaultLayoutAttributeDetectorTest.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, `DefaultLayoutAttributeDetector.textStyleNormal`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/DefaultLocale.md.html b/docs/checks/DefaultLocale.md.html index 8c601092..6387b12e 100644 --- a/docs/checks/DefaultLocale.md.html +++ b/docs/checks/DefaultLocale.md.html @@ -39,7 +39,7 @@ locale, the uppercase replacement for `i` is **not** `I`. If you want the methods to just perform ASCII replacement, for example -to convert an enum name, call `String#toUpperCase(Locale.US)` instead. +to convert an enum name, call `String#toUpperCase(Locale.ROOT)` instead. If you really want to use the current locale, call `String#toUpperCase(Locale.getDefault())` instead. diff --git a/docs/checks/DenyListedApi.md.html b/docs/checks/DenyListedApi.md.html index 20435bf5..31f52fcd 100644 --- a/docs/checks/DenyListedApi.md.html +++ b/docs/checks/DenyListedApi.md.html @@ -51,7 +51,7 @@ [DenyListedApi] ContextCompat.getDrawable(context, 42) - -------------------------------------- + ----------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -89,17 +89,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -107,7 +107,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DenyListedBlockingApi.md.html b/docs/checks/DenyListedBlockingApi.md.html new file mode 100644 index 00000000..4f6fb65b --- /dev/null +++ b/docs/checks/DenyListedBlockingApi.md.html @@ -0,0 +1,193 @@ + +(#) Deny-listed API + +!!! ERROR: Deny-listed API + This is an error. + +Id +: `DenyListedBlockingApi` +Summary +: Deny-listed API +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files, resource files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/denylistedapis/DenyListedApiDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.kt) +Copyright Year +: 2022 + +This lint check flags usages of APIs in external libraries that we +prefer not to use. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/SomeClass.kt:6:Error: Blocking calls in coroutines can cause +deadlocks and application jank. Prefer making the enclosing function a +suspend function or refactoring this in a way to use non-blocking calls. +If running in a test, use runTest {} or Turbine to test synchronous +values. [DenyListedBlockingApi] + + val result = runBlocking {} + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/SomeClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import kotlinx.coroutines.runBlocking + +class SomeClass { + val result = runBlocking {} +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/denylistedapis/DenyListedApiDetectorTest.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, `DenyListedApiDetector.coroutineRunBlocking`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DenyListedBlockingApi") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DenyListedBlockingApi") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DenyListedBlockingApi + problematicStatement() + ``` + +* Adding the suppression attribute + `tools:ignore="DenyListedBlockingApi"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <java.util.LinkedList xmlns:tools="http://schemas.android.com/tools" + tools:ignore="DenyListedBlockingApi" ...> + ... + </java.util.LinkedList> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DenyListedBlockingApi" severity="ignore" /> + </lint> + ``` + 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 'DenyListedBlockingApi' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DenyListedBlockingApi ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DeprecatedCall.md.html b/docs/checks/DeprecatedCall.md.html index 2e7091f8..2024c6f8 100644 --- a/docs/checks/DeprecatedCall.md.html +++ b/docs/checks/DeprecatedCall.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DeprecatedSinceApi.md.html b/docs/checks/DeprecatedSinceApi.md.html index 5dea317a..5c86b95c 100644 --- a/docs/checks/DeprecatedSinceApi.md.html +++ b/docs/checks/DeprecatedSinceApi.md.html @@ -39,93 +39,100 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/Api.kt:26:Warning: This method is deprecated as of API -level 25 [DeprecatedSinceApi] +src/test/pkg/Test.kt:9:Warning: This method is deprecated as of API +level 21 [DeprecatedSinceApi] - api.someMethod2(0) // WARN 1 - ------------------ + api.noLongerNecessary1(0) // WARN 1 + ------------------------- -src/test/pkg/Api.kt:27:Warning: This method is deprecated as of API -level 30; Use AlarmManager.notify instead [DeprecatedSinceApi] +src/test/pkg/Test.kt:10:Warning: This method is deprecated as of API +level 23; Use AlarmManager.notify instead [DeprecatedSinceApi] - api.someMethod3(0) // WARN 2 - ------------------ + api.noLongerNecessary2(0) // WARN 2 + ------------------------- -src/test/pkg/Api.kt:28:Warning: This field is deprecated as of API level -30 [DeprecatedSinceApi] +src/test/pkg/Test.kt:11:Warning: This method is deprecated as of API +level 24 [DeprecatedSinceApi] - val c = MY_CONSTANT // WARN 3 - ----------- + api.noLongerNecessary3(0) // WARN 3 + ------------------------- -src/test/pkg/Api.kt:29:Warning: This class is deprecated as of API level -28 [DeprecatedSinceApi] +src/test/pkg/Test.kt:18:Warning: This class is deprecated as of API +level 19 [DeprecatedSinceApi] - api2.someMethod1(0) // WARN 4 - ------------------- - - -src/test/pkg/Api.kt:30:Warning: This method is deprecated as of API -level 30 [DeprecatedSinceApi] + val clz = Api2::class.java // WARN 4 + ----------- - api2.someMethod2(0) // WARN 5 - ------------------- +src/test/pkg/Test.kt:19:Warning: This method is deprecated as of API +level 23 [DeprecatedSinceApi] -src/test/pkg/Api.kt:31:Warning: This class is deprecated as of API level -28 [DeprecatedSinceApi] + val method1 = api2::someMethod1 // WARN 5 + ----------------- - val clz = Api2::class.java // WARN 6 - ----------- +src/test/pkg/Test.kt:20:Warning: This method is deprecated as of API +level 21 [DeprecatedSinceApi] -src/test/pkg/Api.kt:32:Warning: This method is deprecated as of API -level 25 [DeprecatedSinceApi] - - println(api::someMethod2) // WARN 7 - ---------------- + val method2 = api2::someMethod2 // WARN 6 + ----------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: -`src/test/pkg/Api.kt`: +`src/test/pkg/Test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +@file:Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE", "unused") package test.pkg import androidx.annotation.DeprecatedSinceApi +class Test { + fun test(api: Api, api2: Api2) { + // minSdkVersion = 24: + + api.noLongerNecessary1(0) // WARN 1 + api.noLongerNecessary2(0) // WARN 2 + api.noLongerNecessary3(0) // WARN 3 + + api.unnecessaryInTheFuture1(0) // OK 1 + api.unnecessaryInTheFuture2(0) // OK 2 + + // The above enforced calls (the most common scenario); check + // some other reference types. + val clz = Api2::class.java // WARN 4 + val method1 = api2::someMethod1 // WARN 5 + val method2 = api2::someMethod2 // WARN 6 + } +} + class Api { @DeprecatedSinceApi(api = 21) - fun someMethod1(arg: Int) { } + fun noLongerNecessary1(arg: Int) { } + + @DeprecatedSinceApi(api = 23, message = "Use AlarmManager.notify instead") + fun noLongerNecessary2(arg: Int) { } + + @DeprecatedSinceApi(api = 24) + fun noLongerNecessary3(arg: Int) { } + @DeprecatedSinceApi(api = 25) - fun someMethod2(arg: Int) { } - @DeprecatedSinceApi(api = 30, message = "Use AlarmManager.notify instead") - fun someMethod3(arg: Int) { } + fun unnecessaryInTheFuture1(arg: Int) { } + + @DeprecatedSinceApi(api = 33) + fun unnecessaryInTheFuture2(arg: Int) { } } -@DeprecatedSinceApi(api = 28) +@DeprecatedSinceApi(api = 19) class Api2 { + @DeprecatedSinceApi(api = 23) fun someMethod1(arg: Int) { } - @DeprecatedSinceApi(api = 30) + @DeprecatedSinceApi(api = 21) fun someMethod2(arg: Int) { } } -@DeprecatedSinceApi(30) -const val MY_CONSTANT = "test" - -class Test { - fun test(api: Api, api2: Api2) { - api.someMethod1(0) // OK - api.someMethod2(0) // WARN 1 - api.someMethod3(0) // WARN 2 - val c = MY_CONSTANT // WARN 3 - api2.someMethod1(0) // WARN 4 - api2.someMethod2(0) // WARN 5 - val clz = Api2::class.java // WARN 6 - println(api::someMethod2) // WARN 7 - } -} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the diff --git a/docs/checks/DeprecatedSqlUsage.md.html b/docs/checks/DeprecatedSqlUsage.md.html index 15c5d175..302f0cff 100644 --- a/docs/checks/DeprecatedSqlUsage.md.html +++ b/docs/checks/DeprecatedSqlUsage.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DetachAndAttachSameFragment.md.html b/docs/checks/DetachAndAttachSameFragment.md.html index 5996253b..cc5d6e4f 100644 --- a/docs/checks/DetachAndAttachSameFragment.md.html +++ b/docs/checks/DetachAndAttachSameFragment.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/DialogFragmentCallbacksDetector.md.html b/docs/checks/DialogFragmentCallbacksDetector.md.html index fbef426e..32676e18 100644 --- a/docs/checks/DialogFragmentCallbacksDetector.md.html +++ b/docs/checks/DialogFragmentCallbacksDetector.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -112,7 +112,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/DiscouragedApi.md.html b/docs/checks/DiscouragedApi.md.html index 68710b75..cc2eb47c 100644 --- a/docs/checks/DiscouragedApi.md.html +++ b/docs/checks/DiscouragedApi.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Kotlin and Java files +: Kotlin and Java files, manifest files and resource files Editing : This check runs on the fly in the IDE editor Implementation @@ -114,7 +114,7 @@ // Kotlin @Suppress("DiscouragedApi") fun method() { - problematicStatement() + scheduleAtFixedRate(...) } ``` @@ -124,7 +124,7 @@ // Java @SuppressWarnings("DiscouragedApi") void method() { - problematicStatement(); + scheduleAtFixedRate(...); } ``` @@ -135,6 +135,12 @@ problematicStatement() ``` +* Adding the suppression attribute `tools:ignore="DiscouragedApi"` 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: diff --git a/docs/checks/DoNotCallProviders.md.html b/docs/checks/DoNotCallProviders.md.html index 948d62aa..f869ddb0 100644 --- a/docs/checks/DoNotCallProviders.md.html +++ b/docs/checks/DoNotCallProviders.md.html @@ -142,17 +142,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -160,7 +160,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotExposeEitherNetInRepositories.md.html b/docs/checks/DoNotExposeEitherNetInRepositories.md.html index 6eccdbff..9dff8888 100644 --- a/docs/checks/DoNotExposeEitherNetInRepositories.md.html +++ b/docs/checks/DoNotExposeEitherNetInRepositories.md.html @@ -91,17 +91,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -109,7 +109,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMock.md.html b/docs/checks/DoNotMock.md.html index 6a6b8fed..4a351f95 100644 --- a/docs/checks/DoNotMock.md.html +++ b/docs/checks/DoNotMock.md.html @@ -45,6 +45,61 @@ These types should define explanations/alternatives in their annotation. +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMock"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMock"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMock"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Example Here is an example of lint warnings produced by this check: @@ -122,17 +177,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -140,7 +195,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockAutoValue.md.html b/docs/checks/DoNotMockAutoValue.md.html index e954d8c5..5cd088df 100644 --- a/docs/checks/DoNotMockAutoValue.md.html +++ b/docs/checks/DoNotMockAutoValue.md.html @@ -43,6 +43,61 @@ `AutoValue` classes represent pure data classes, so mocking them should not be necessary. Construct a real instance of the class instead. +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAutoValue"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAutoValue"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAutoValue"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Including !!! @@ -52,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +125,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockDataClass.md.html b/docs/checks/DoNotMockDataClass.md.html index e0be7bde..84aae0fe 100644 --- a/docs/checks/DoNotMockDataClass.md.html +++ b/docs/checks/DoNotMockDataClass.md.html @@ -43,6 +43,61 @@ data classes represent pure data classes, so mocking them should not be necessary. Construct a real instance of the class instead. +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockDataClass"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockDataClass"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockDataClass"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Including !!! @@ -52,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +125,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockObjectClass.md.html b/docs/checks/DoNotMockObjectClass.md.html index 8d4e9aa8..368800fb 100644 --- a/docs/checks/DoNotMockObjectClass.md.html +++ b/docs/checks/DoNotMockObjectClass.md.html @@ -43,6 +43,61 @@ object classes are global singletons, so mocking them should not be necessary. Use the object instance instead. +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockObjectClass"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockObjectClass"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockObjectClass"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Including !!! @@ -52,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +125,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockPlatformTypes.md.html b/docs/checks/DoNotMockPlatformTypes.md.html new file mode 100644 index 00000000..525d060c --- /dev/null +++ b/docs/checks/DoNotMockPlatformTypes.md.html @@ -0,0 +1,201 @@ + +(#) platform types should not be mocked + +!!! ERROR: platform types should not be mocked + This is an error. + +Id +: `DoNotMockPlatformTypes` +Summary +: platform types should not be mocked +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +Platform types (i.e. classes in java.*, android.*, etc) should not be +mocked. Use a real instance or fake instead. Mocking platform types like +these can lead to surprising test failures due to mocks that actually +behave differently than real instances, especially when passed into real +implementations that use them and expect them to behave in a certain +way. If using Robolectric, consider using its shadow APIs. + +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockPlatformTypes"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockPlatformTypes"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockPlatformTypes"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockPlatformTypes") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockPlatformTypes") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockPlatformTypes + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockPlatformTypes" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockPlatformTypes' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockPlatformTypes ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockRecordClass.md.html b/docs/checks/DoNotMockRecordClass.md.html index 3a5a6fbb..a90694b3 100644 --- a/docs/checks/DoNotMockRecordClass.md.html +++ b/docs/checks/DoNotMockRecordClass.md.html @@ -43,6 +43,61 @@ record classes represent pure data classes, so mocking them should not be necessary. Construct a real instance of the class instead. +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockRecordClass"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockRecordClass"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockRecordClass"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Including !!! @@ -52,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +125,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockSealedClass.md.html b/docs/checks/DoNotMockSealedClass.md.html index 4c74e8f0..cabd8418 100644 --- a/docs/checks/DoNotMockSealedClass.md.html +++ b/docs/checks/DoNotMockSealedClass.md.html @@ -41,8 +41,63 @@ : 2021 sealed classes have a restricted type hierarchy, so creating new -unrestricted mocks will break runtime expectations. Use a subtype -instead. +unrestricted mocks will break runtime expectations. Mockito also cannot +mock sealed classes in Java 17+. Use a subtype instead. + +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockSealedClass"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockSealedClass"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockSealedClass"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (##) Including @@ -53,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +126,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DuplicateDivider.md.html b/docs/checks/DuplicateDivider.md.html index 35a238d4..ed681b4f 100644 --- a/docs/checks/DuplicateDivider.md.html +++ b/docs/checks/DuplicateDivider.md.html @@ -42,7 +42,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/com/example/android/supportv7/widget/decorator/DividerItemDecoration.java:11:Warning: - Replace with android.support.v7.widget.DividerItemDecoration? +Replace with android.support.v7.widget.DividerItemDecoration? [DuplicateDivider] public abstract class DividerItemDecoration extends RecyclerView.ItemDecoration { diff --git a/docs/checks/EmptyNavDeepLink.md.html b/docs/checks/EmptyNavDeepLink.md.html index 9f8620e2..25f89628 100644 --- a/docs/checks/EmptyNavDeepLink.md.html +++ b/docs/checks/EmptyNavDeepLink.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-common:2.7.0-beta01") +implementation("androidx.navigation:navigation-common:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-common:2.7.0-beta01' +implementation 'androidx.navigation:navigation-common:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-common) # libs.versions.toml [versions] -navigation-common = "2.7.0-beta01" +navigation-common = "2.8.0-alpha01" [libraries] navigation-common = { module = "androidx.navigation:navigation-common", @@ -101,7 +101,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-common](androidx_navigation_navigation-common.md.html). diff --git a/docs/checks/EnsureInitializerMetadata.md.html b/docs/checks/EnsureInitializerMetadata.md.html index 47efdd52..32a44fbf 100644 --- a/docs/checks/EnsureInitializerMetadata.md.html +++ b/docs/checks/EnsureInitializerMetadata.md.html @@ -33,12 +33,8 @@ : Kotlin and Java files and manifest files Editing : This check can *not* run live in the IDE editor -Implementation -: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/main/java/androidx/startup/lint/EnsureInitializerMetadataDetector.kt) Tests : [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/startup/startup-runtime-lint/src/test/java/androidx/startup/lint/EnsureInitializerMetadataTest.kt) -Copyright Year -: 2020 When a library defines a Initializer, it needs to be accompanied by a corresponding entry in the AndroidManifest.xml file. diff --git a/docs/checks/ErroneousLayoutAttribute.md.html b/docs/checks/ErroneousLayoutAttribute.md.html index 325db458..7c7e16e7 100644 --- a/docs/checks/ErroneousLayoutAttribute.md.html +++ b/docs/checks/ErroneousLayoutAttribute.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetectorTest.kt) Flags if a layout attribute is not applicable to a particular view. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:5:Warning: Attribute is erroneous on FrameLayout -[ErroneousLayoutAttribute] - - android:orientation="horizontal" - -------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal" - /> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ErroneousLayoutAttributeDetectorTest.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, `ErroneousLayoutAttributeDetector.erroneousFrameLayoutOrientation`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/ErrorProneDoNotMockUsage.md.html b/docs/checks/ErrorProneDoNotMockUsage.md.html index a9fae114..04146ab7 100644 --- a/docs/checks/ErrorProneDoNotMockUsage.md.html +++ b/docs/checks/ErrorProneDoNotMockUsage.md.html @@ -112,17 +112,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -130,7 +130,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ExceptionMessage.md.html b/docs/checks/ExceptionMessage.md.html new file mode 100644 index 00000000..cead9fbc --- /dev/null +++ b/docs/checks/ExceptionMessage.md.html @@ -0,0 +1,180 @@ + +(#) Please provide a string for the lazyMessage parameter + +!!! ERROR: Please provide a string for the lazyMessage parameter + This is an error. + +Id +: `ExceptionMessage` +Summary +: Please provide a string for the lazyMessage parameter +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/ExceptionMessageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/ExceptionMessageDetectorTest.kt) +Copyright Year +: 2023 + +Calls to check(), checkNotNull(), require() and requireNotNull() should +include a message string that can be used to debug issues experienced +by users. + +When we read user-supplied logs, the line numbers are sometimes not +sufficient to determine the cause of a bug. Inline functions can +sometimes make it hard to determine which file threw an exception. +Consider supplying a lazyMessage parameter to identify the check() +or require() call. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/test.kt:5:Error: Please specify a lazyMessage param for check +[ExceptionMessage] + + check(true) + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +fun content() { + check(true) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/ExceptionMessageDetectorTest.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, `ExceptionMessageDetector.checkWithoutMessage`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ExceptionMessage") + fun method() { + check(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ExceptionMessage") + void method() { + check(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ExceptionMessage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ExceptionMessage" severity="ignore" /> + </lint> + ``` + 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 'ExceptionMessage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ExceptionMessage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ExperimentalAnnotationRetention.md.html b/docs/checks/ExperimentalAnnotationRetention.md.html index 1f07a618..07d44374 100644 --- a/docs/checks/ExperimentalAnnotationRetention.md.html +++ b/docs/checks/ExperimentalAnnotationRetention.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) @@ -50,17 +50,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") +implementation("androidx.annotation:annotation-experimental:1.4.0") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' +implementation 'androidx.annotation:annotation-experimental:1.4.0' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0-dev01" +annotation-experimental = "1.4.0" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -68,7 +68,7 @@ } ``` -1.4.0-dev01 is the version this documentation was generated from; +1.4.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/ExpiredTargetSdkVersion.md.html b/docs/checks/ExpiredTargetSdkVersion.md.html index 9454f2bc..7c354ec8 100644 --- a/docs/checks/ExpiredTargetSdkVersion.md.html +++ b/docs/checks/ExpiredTargetSdkVersion.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and manifest files Editing : This check runs on the fly in the IDE editor See @@ -51,17 +51,15 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:5:Error: Google Play requires that apps target API level -or higher. - [ExpiredTargetSdkVersion] +build.gradle:5:Error: Google Play requires that apps target API level 31 +or higher. [ExpiredTargetSdkVersion] targetSdkVersion 17 ------------------- -build.gradle:6:Error: Google Play requires that apps target API level -or higher. - [ExpiredTargetSdkVersion] +build.gradle:6:Error: Google Play requires that apps target API level 31 +or higher. [ExpiredTargetSdkVersion] targetSdk 17 ------------ @@ -101,6 +99,13 @@ problematicStatement() ``` +* Adding the suppression attribute + `tools:ignore="ExpiredTargetSdkVersion"` 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: diff --git a/docs/checks/ExpiringTargetSdkVersion.md.html b/docs/checks/ExpiringTargetSdkVersion.md.html index ed7c0e04..dea32382 100644 --- a/docs/checks/ExpiringTargetSdkVersion.md.html +++ b/docs/checks/ExpiringTargetSdkVersion.md.html @@ -1,15 +1,15 @@ (#) TargetSdkVersion Soon Expiring -!!! ERROR: TargetSdkVersion Soon Expiring - This is an error. +!!! WARNING: TargetSdkVersion Soon Expiring + This is a warning. Id : `ExpiringTargetSdkVersion` Summary : TargetSdkVersion Soon Expiring Severity -: Error +: Warning Category : Compliance Platform @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Gradle build files +: Gradle build files and manifest files Editing : This check runs on the fly in the IDE editor See @@ -49,11 +49,11 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:6:Error: Google Play will soon require that apps target API -level or higher. This will be required for new apps and updates -starting on August 31, . [ExpiringTargetSdkVersion] +build.gradle:6:Warning: Google Play will soon require that apps target +API level 33 or higher. This will be required for new apps and updates +starting on August 31, 2023. [ExpiringTargetSdkVersion] - targetSdkVersion + targetSdkVersion 31 ------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -66,9 +66,9 @@ android { defaultConfig { // Already meeting last year's requirement but not this year's requirement - targetSdkVersion - targetSdkVersion // OK - targetSdkVersion // OK + targetSdkVersion 31 + targetSdkVersion 2023 // OK + targetSdkVersion 2024 // OK } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -93,6 +93,13 @@ problematicStatement() ``` +* Adding the suppression attribute + `tools:ignore="ExpiringTargetSdkVersion"` 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: diff --git a/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html index da6493ad..1476fd47 100644 --- a/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html +++ b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html @@ -185,17 +185,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.46.1") +implementation("com.google.dagger:dagger-lint:2.50") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.46.1' +implementation 'com.google.dagger:dagger-lint:2.50' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.46.1" +dagger-lint = "2.50" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -203,7 +203,7 @@ } ``` -2.46.1 is the version this documentation was generated from; +2.50 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). diff --git a/docs/checks/FlowOperatorInvokedInComposition.md.html b/docs/checks/FlowOperatorInvokedInComposition.md.html index 591b38d1..96b64027 100644 --- a/docs/checks/FlowOperatorInvokedInComposition.md.html +++ b/docs/checks/FlowOperatorInvokedInComposition.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -296,28 +296,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FormalGerman.md.html b/docs/checks/FormalGerman.md.html index cb08baf0..cd971bbd 100644 --- a/docs/checks/FormalGerman.md.html +++ b/docs/checks/FormalGerman.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,74 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/FormalGermanDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/FormalGermanDetectorTest.kt) Informal language should be used at all times. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/values/config.xml:2:Warning: Formal language "Ihr" detected -[FormalGerman] - - <string name="my_string_1">Wie lautet Ihr Name?</string> - ^ - - -res/values/config.xml:3:Warning: Formal language "Sie?" detected -[FormalGerman] - - <string name="my_string_2">Wie heissen Sie?</string> - ^ - - -res/values/config.xml:4:Warning: Formal language "Ihrem" detected -[FormalGerman] - - <string name="my_string_3">Frag nach Ihrem Namen.</string> - ^ - - -res/values/config.xml:5:Warning: Formal language "Sie" detected -[FormalGerman] - - <string name="my_string_4">Wie Sie möchten</string> - ^ - - -res/values/config.xml:6:Warning: Formal language "Ihre" detected -[FormalGerman] - - <string name="my_string_5">Ihre Historie</string> - ^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/values/config.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources> - <string name="my_string_1">Wie lautet Ihr Name?</string> - <string name="my_string_2">Wie heissen Sie?</string> - <string name="my_string_3">Frag nach Ihrem Namen.</string> - <string name="my_string_4">Wie Sie möchten</string> - <string name="my_string_5">Ihre Historie</string> -</resources> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/FormalGermanDetectorTest.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, `FormalGermanDetector.formal`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -106,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -124,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/FragmentAddMenuProvider.md.html b/docs/checks/FragmentAddMenuProvider.md.html index db31f2ba..0bebdced 100644 --- a/docs/checks/FragmentAddMenuProvider.md.html +++ b/docs/checks/FragmentAddMenuProvider.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentBackPressedCallback.md.html b/docs/checks/FragmentBackPressedCallback.md.html index fe96ae93..95b48e39 100644 --- a/docs/checks/FragmentBackPressedCallback.md.html +++ b/docs/checks/FragmentBackPressedCallback.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentConstructorInjection.md.html b/docs/checks/FragmentConstructorInjection.md.html index 5e162f4b..51e6417d 100644 --- a/docs/checks/FragmentConstructorInjection.md.html +++ b/docs/checks/FragmentConstructorInjection.md.html @@ -139,17 +139,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -157,7 +157,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/FragmentFieldInjection.md.html b/docs/checks/FragmentFieldInjection.md.html index d1c24a1c..2ed330e3 100644 --- a/docs/checks/FragmentFieldInjection.md.html +++ b/docs/checks/FragmentFieldInjection.md.html @@ -110,17 +110,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -128,7 +128,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/FragmentGradleConfiguration-2.md.html b/docs/checks/FragmentGradleConfiguration-2.md.html index 5f0a5b2e..5322961b 100644 --- a/docs/checks/FragmentGradleConfiguration-2.md.html +++ b/docs/checks/FragmentGradleConfiguration-2.md.html @@ -82,17 +82,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha01") +implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha01' +implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing-manifest) # libs.versions.toml [versions] -fragment-testing-manifest = "1.7.0-alpha01" +fragment-testing-manifest = "1.7.0-alpha09" [libraries] fragment-testing-manifest = { module = "androidx.fragment:fragment-testing-manifest", @@ -100,7 +100,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment-testing-manifest](androidx_fragment_fragment-testing-manifest.md.html). diff --git a/docs/checks/FragmentGradleConfiguration.md.html b/docs/checks/FragmentGradleConfiguration.md.html index 5398213f..3fe97919 100644 --- a/docs/checks/FragmentGradleConfiguration.md.html +++ b/docs/checks/FragmentGradleConfiguration.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing:1.7.0-alpha01") +implementation("androidx.fragment:fragment-testing:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment-testing:1.7.0-alpha01' +implementation 'androidx.fragment:fragment-testing:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing) # libs.versions.toml [versions] -fragment-testing = "1.7.0-alpha01" +fragment-testing = "1.7.0-alpha09" [libraries] fragment-testing = { module = "androidx.fragment:fragment-testing", @@ -101,7 +101,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment-testing](androidx_fragment_fragment-testing.md.html). diff --git a/docs/checks/FragmentLiveDataObserve.md.html b/docs/checks/FragmentLiveDataObserve.md.html index 0a660947..c9a03a35 100644 --- a/docs/checks/FragmentLiveDataObserve.md.html +++ b/docs/checks/FragmentLiveDataObserve.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentTagUsage.md.html b/docs/checks/FragmentTagUsage.md.html index d8e1ba0e..d786508c 100644 --- a/docs/checks/FragmentTagUsage.md.html +++ b/docs/checks/FragmentTagUsage.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -108,7 +108,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FrequentlyChangedStateReadInComposition.md.html b/docs/checks/FrequentlyChangedStateReadInComposition.md.html index c826337b..d14ed8d4 100644 --- a/docs/checks/FrequentlyChangedStateReadInComposition.md.html +++ b/docs/checks/FrequentlyChangedStateReadInComposition.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) +: [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) Affects : Kotlin and Java files and test sources @@ -142,28 +142,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation:1.5.0-beta02") +implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.foundation) +implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation = "1.5.0-beta02" +foundation-android = "1.7.0-alpha01" [libraries] -foundation = { - module = "androidx.compose.foundation:foundation", - version.ref = "foundation" +foundation-android = { + module = "androidx.compose.foundation:foundation-android", + version.ref = "foundation-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html). +[Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/FullyQualifiedResource.md.html b/docs/checks/FullyQualifiedResource.md.html index 6ea37eac..2745824f 100644 --- a/docs/checks/FullyQualifiedResource.md.html +++ b/docs/checks/FullyQualifiedResource.md.html @@ -113,17 +113,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -131,7 +131,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/GestureBackNavigation.md.html b/docs/checks/GestureBackNavigation.md.html index c104bf96..29ebc5c5 100644 --- a/docs/checks/GestureBackNavigation.md.html +++ b/docs/checks/GestureBackNavigation.md.html @@ -46,7 +46,7 @@ back events, this should be handled through the registration of callbacks on the window level; Please see https://developer.android.com/about/versions/13/features/predictive-back-gesture - [GestureBackNavigation] +[GestureBackNavigation] if (KeyEvent.KEYCODE_BACK == keyCode) { --------------------- diff --git a/docs/checks/GradleCompatible.md.html b/docs/checks/GradleCompatible.md.html index 3df7a09b..7059fdba 100644 --- a/docs/checks/GradleCompatible.md.html +++ b/docs/checks/GradleCompatible.md.html @@ -44,11 +44,12 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:25:Error: This support library should not use a different -version (13) than the compileSdkVersion (19) [GradleCompatible] +build.gradle:5:Error: Version 5.2.08 should not be used; the app can not +be published with this version. Use version 11.1.71 instead. +[GradleCompatible] - compile 'com.android.support:appcompat-v7:13.0.0' - ----------------------------------------- + compile 'com.google.android.gms:play-services:5.2.08' + --------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -57,33 +58,9 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers apply plugin: 'android' -android { - compileSdkVersion 19 - buildToolsVersion "19.0.0" - - defaultConfig { - minSdkVersion 7 - targetSdkVersion 17 - versionCode 1 - versionName "1.0" - } - - productFlavors { - free { - } - pro { - } - } -} - dependencies { - compile 'com.android.support:appcompat-v7:+' - freeCompile 'com.google.guava:guava:11.0.2' - compile 'com.android.support:appcompat-v7:13.0.0' - compile 'com.google.android.support:wearable:1.2.0' - compile 'com.android.support:multidex:1.0.0' - androidTestCompile 'com.android.support.test:runner:0.3' + compile 'com.google.android.gms:play-services:5.2.08' } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -92,7 +69,7 @@ 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, `GradleDetector.testBasic`. +found for this lint check, `GradleDetector.testBadPlayServicesVersion`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/GradleDependency.md.html b/docs/checks/GradleDependency.md.html index 9e72f1a9..2e031585 100644 --- a/docs/checks/GradleDependency.md.html +++ b/docs/checks/GradleDependency.md.html @@ -50,7 +50,7 @@ build.gradle:25:Warning: A newer version of -com.android.support:appcompat-v7 than 13.0.0 is available: 19.1.0 +com.android.support:appcompat-v7 than 13.0.0 is available: 25.3.1 [GradleDependency] compile 'com.android.support:appcompat-v7:13.0.0' @@ -87,7 +87,7 @@ apply plugin: 'android' android { - compileSdkVersion 19 + compileSdkVersion 34 buildToolsVersion "19.0.0" defaultConfig { diff --git a/docs/checks/GradleDeprecated.md.html b/docs/checks/GradleDeprecated.md.html index 0f841da2..3dcd678d 100644 --- a/docs/checks/GradleDeprecated.md.html +++ b/docs/checks/GradleDeprecated.md.html @@ -53,7 +53,7 @@ apply plugin: 'android' android { - compileSdkVersion 19 + compileSdkVersion 34 buildToolsVersion "19.0.0" defaultConfig { diff --git a/docs/checks/GradleDynamicVersion.md.html b/docs/checks/GradleDynamicVersion.md.html index 57384fee..045c1f46 100644 --- a/docs/checks/GradleDynamicVersion.md.html +++ b/docs/checks/GradleDynamicVersion.md.html @@ -58,7 +58,7 @@ apply plugin: 'android' android { - compileSdkVersion 19 + compileSdkVersion 34 buildToolsVersion "19.0.0" defaultConfig { diff --git a/docs/checks/GuavaChecksUsed.md.html b/docs/checks/GuavaChecksUsed.md.html index 0523cfd1..8a04844c 100644 --- a/docs/checks/GuavaChecksUsed.md.html +++ b/docs/checks/GuavaChecksUsed.md.html @@ -121,17 +121,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -139,7 +139,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/GuavaPreconditionsUsedInKotlin.md.html b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html index 0ef0ec9c..a5559bed 100644 --- a/docs/checks/GuavaPreconditionsUsedInKotlin.md.html +++ b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html @@ -122,17 +122,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -140,7 +140,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/IdleBatteryChargingConstraints.md.html b/docs/checks/IdleBatteryChargingConstraints.md.html index dbd608e3..16d82809 100644 --- a/docs/checks/IdleBatteryChargingConstraints.md.html +++ b/docs/checks/IdleBatteryChargingConstraints.md.html @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -67,7 +67,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/ImplicitStringPlaceholder.md.html b/docs/checks/ImplicitStringPlaceholder.md.html index 67439d1a..9ee977cd 100644 --- a/docs/checks/ImplicitStringPlaceholder.md.html +++ b/docs/checks/ImplicitStringPlaceholder.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,45 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetectorTest.kt) It's better and more explicit to use numbered placeholders. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/values/strings.xml:2:Warning: Implicit placeholder -[ImplicitStringPlaceholder] - - <string name="my_string">Hello %s</string> - ^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/values/strings.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources> - <string name="my_string">Hello %s</string> -</resources> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ImplicitStringPlaceholderDetectorTest.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, `ImplicitStringPlaceholderDetector.invalid`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/InclusiveNaming.md.html b/docs/checks/InclusiveNaming.md.html index 1f4457cb..4bede9e7 100644 --- a/docs/checks/InclusiveNaming.md.html +++ b/docs/checks/InclusiveNaming.md.html @@ -68,8 +68,8 @@ id's must be unique, so you cannot combine these libraries. Also defined in: * InclusiveNaming: Use inclusive naming. (this issue) -* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.3.0](InclusiveNaming.md.html) -* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.3.0](InclusiveNaming.md.html) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.0](InclusiveNaming.md.html) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.0](InclusiveNaming.md.html) (##) Including @@ -81,17 +81,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -99,7 +99,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/IncorrectChainMarginsUsage.md.html b/docs/checks/IncorrectChainMarginsUsage.md.html index 96fe2382..3db4b871 100644 --- a/docs/checks/IncorrectChainMarginsUsage.md.html +++ b/docs/checks/IncorrectChainMarginsUsage.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13") // build.gradle -implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13' // build.gradle.kts with version catalogs: implementation(libs.constraintlayout-compose) # libs.versions.toml [versions] -constraintlayout-compose = "1.1.0-alpha10" +constraintlayout-compose = "1.1.0-alpha13" [libraries] constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", @@ -70,7 +70,7 @@ } ``` -1.1.0-alpha10 is the version this documentation was generated from; +1.1.0-alpha13 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). diff --git a/docs/checks/IncorrectMatchParentUsage.md.html b/docs/checks/IncorrectMatchParentUsage.md.html index f7201a01..6828f72b 100644 --- a/docs/checks/IncorrectMatchParentUsage.md.html +++ b/docs/checks/IncorrectMatchParentUsage.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13") // build.gradle -implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13' // build.gradle.kts with version catalogs: implementation(libs.constraintlayout-compose) # libs.versions.toml [versions] -constraintlayout-compose = "1.1.0-alpha10" +constraintlayout-compose = "1.1.0-alpha13" [libraries] constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", @@ -69,7 +69,7 @@ } ``` -1.1.0-alpha10 is the version this documentation was generated from; +1.1.0-alpha13 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). diff --git a/docs/checks/IncorrectReferencesDeclaration.md.html b/docs/checks/IncorrectReferencesDeclaration.md.html index b8b9c575..8bd9f829 100644 --- a/docs/checks/IncorrectReferencesDeclaration.md.html +++ b/docs/checks/IncorrectReferencesDeclaration.md.html @@ -124,17 +124,17 @@ ``` // build.gradle.kts -implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13") // build.gradle -implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13' // build.gradle.kts with version catalogs: implementation(libs.constraintlayout-compose) # libs.versions.toml [versions] -constraintlayout-compose = "1.1.0-alpha10" +constraintlayout-compose = "1.1.0-alpha13" [libraries] constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", @@ -142,7 +142,7 @@ } ``` -1.1.0-alpha10 is the version this documentation was generated from; +1.1.0-alpha13 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html). diff --git a/docs/checks/InjectInJava.md.html b/docs/checks/InjectInJava.md.html index 31ea63cf..6feef522 100644 --- a/docs/checks/InjectInJava.md.html +++ b/docs/checks/InjectInJava.md.html @@ -149,17 +149,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -167,7 +167,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html b/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html index 2f680320..369a9513 100644 --- a/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html +++ b/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html @@ -119,17 +119,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -137,7 +137,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html b/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html index 4e2a4180..a92aa3b0 100644 --- a/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html +++ b/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html @@ -109,17 +109,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -127,7 +127,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/IntentWithNullActionLaunch.md.html b/docs/checks/IntentWithNullActionLaunch.md.html new file mode 100644 index 00000000..bab6c804 --- /dev/null +++ b/docs/checks/IntentWithNullActionLaunch.md.html @@ -0,0 +1,152 @@ + +(#) Unsafe intent launched with no action set + +!!! WARNING: Unsafe intent launched with no action set + This is a warning. + +Id +: `IntentWithNullActionLaunch` +Summary +: Unsafe intent launched with no action set +Severity +: Warning +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest 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/IntentWillNullActionDetector.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/IntentWillNullActionDetectorTest.kt) +Copyright Year +: 2023 + +Intents that have no action and do not specify a component are a +potential security risk, and using them will result in a crash in an +upcoming version of Android. If a specific app is being targeted +(including the case where the current app is the target) then set the +targeted component using `setComponent()`, `setClass()`, +`setClassName()`, or the Intent constructors that take a Class +parameter. If the intent is not intended for a specific app then the +action name should be set. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/TestActivity.java:10:Warning: This intent has no action set +and is not explicit by component. You should either make this intent +explicit by component or set an action matching the targeted intent +filter. [IntentWithNullActionLaunch] + + Intent intent = new Intent(); + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/TestActivity.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import android.content.Intent; +import android.app.Activity; + +public class TestActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + Intent intent = new Intent(); + startActivity(intent); + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/IntentWillNullActionDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("IntentWithNullActionLaunch") + fun method() { + Intent(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("IntentWithNullActionLaunch") + void method() { + new Intent(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection IntentWithNullActionLaunch + problematicStatement() + ``` + +* Adding the suppression attribute + `tools:ignore="IntentWithNullActionLaunch"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="IntentWithNullActionLaunch" severity="ignore" /> + </lint> + ``` + 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 'IntentWithNullActionLaunch' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore IntentWithNullActionLaunch ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidAccessibility.md.html b/docs/checks/InvalidAccessibility.md.html index 3bd19fc0..75f718f2 100644 --- a/docs/checks/InvalidAccessibility.md.html +++ b/docs/checks/InvalidAccessibility.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetectorTest.kt) Marks usages of invalid accessibility and suggests corrections. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:5:Warning: Either set a proper accessibility text or -use importantForAccessibility [InvalidAccessibility] - - android:contentDescription="@null"/> - ----- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<ImageView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:contentDescription="@null"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidAccessibilityDetectorTest.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, `InvalidAccessibilityDetector.contentDescriptionNull`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/InvalidColorHexValue.md.html b/docs/checks/InvalidColorHexValue.md.html index 49d684e0..cd802313 100644 --- a/docs/checks/InvalidColorHexValue.md.html +++ b/docs/checks/InvalidColorHexValue.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) +: [androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html) Affects : Kotlin and Java files and test sources @@ -97,28 +97,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui-graphics) +implementation(libs.ui-graphics-android) # libs.versions.toml [versions] -ui-graphics = "1.5.0-beta02" +ui-graphics-android = "1.7.0-alpha01" [libraries] -ui-graphics = { - module = "androidx.compose.ui:ui-graphics", - version.ref = "ui-graphics" +ui-graphics-android = { + module = "androidx.compose.ui:ui-graphics-android", + version.ref = "ui-graphics-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html). +[Additional details about androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/InvalidFragmentVersionForActivityResult.md.html b/docs/checks/InvalidFragmentVersionForActivityResult.md.html index 47ee6c70..dc213d0f 100644 --- a/docs/checks/InvalidFragmentVersionForActivityResult.md.html +++ b/docs/checks/InvalidFragmentVersionForActivityResult.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity:1.8.0-alpha05") +implementation("androidx.activity:activity:1.9.0-alpha02") // build.gradle -implementation 'androidx.activity:activity:1.8.0-alpha05' +implementation 'androidx.activity:activity:1.9.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.activity) # libs.versions.toml [versions] -activity = "1.8.0-alpha05" +activity = "1.9.0-alpha02" [libraries] activity = { module = "androidx.activity:activity", @@ -105,7 +105,7 @@ } ``` -1.8.0-alpha05 is the version this documentation was generated from; +1.9.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.activity:activity](androidx_activity_activity.md.html). diff --git a/docs/checks/InvalidImport.md.html b/docs/checks/InvalidImport.md.html index 4cddb957..1ddc7200 100644 --- a/docs/checks/InvalidImport.md.html +++ b/docs/checks/InvalidImport.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,46 +29,11 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidImportDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidImportDetectorTest.kt) Flags invalid imports. One example is com.foo.bar.R.drawable. Instead just the generated class R should be imported and not R.drawable. Also you should never import anything that's in an internal package. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:3:Warning: Forbidden import [InvalidImport] - -import foo.R.drawable; - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import foo.R.drawable; - -class Example { -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidImportDetectorTest.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, `InvalidImportDetector.rDrawableImport`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -78,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -96,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html index c928e5fd..08127b7d 100644 --- a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html +++ b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -69,7 +69,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/InvalidSetHasFixedSize.md.html b/docs/checks/InvalidSetHasFixedSize.md.html index 0325c80f..665f2464 100644 --- a/docs/checks/InvalidSetHasFixedSize.md.html +++ b/docs/checks/InvalidSetHasFixedSize.md.html @@ -28,7 +28,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.recyclerview:recyclerview](androidx_recyclerview_recyclerview.md.html) @@ -54,17 +54,17 @@ ``` // build.gradle.kts -implementation("androidx.recyclerview:recyclerview:1.3.1-rc01") +implementation("androidx.recyclerview:recyclerview:1.4.0-alpha01") // build.gradle -implementation 'androidx.recyclerview:recyclerview:1.3.1-rc01' +implementation 'androidx.recyclerview:recyclerview:1.4.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.recyclerview) # libs.versions.toml [versions] -recyclerview = "1.3.1-rc01" +recyclerview = "1.4.0-alpha01" [libraries] recyclerview = { module = "androidx.recyclerview:recyclerview", @@ -72,7 +72,7 @@ } ``` -1.3.1-rc01 is the version this documentation was generated from; +1.4.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.recyclerview:recyclerview](androidx_recyclerview_recyclerview.md.html). diff --git a/docs/checks/InvalidSingleLineComment.md.html b/docs/checks/InvalidSingleLineComment.md.html index c62f561f..f7e04fda 100644 --- a/docs/checks/InvalidSingleLineComment.md.html +++ b/docs/checks/InvalidSingleLineComment.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,50 +29,10 @@ : Gradle build files and Kotlin and Java files Editing : This check can *not* run live in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetectorTest.kt) Single line comments should always be sentences. They're part of the code and hence they deserve as much detail and respect as code. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:5:Warning: Comment does not contain a space at the -beginning [InvalidSingleLineComment] - - //Something. - --- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -class Example { - public void foo() { - //Something. - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidSingleLineCommentDetectorTest.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, `InvalidSingleLineCommentDetector.invalidSingleLineCommentNoSpace`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -82,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -100,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/InvalidString.md.html b/docs/checks/InvalidString.md.html index 94eba804..4727f64a 100644 --- a/docs/checks/InvalidString.md.html +++ b/docs/checks/InvalidString.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/InvalidStringDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidStringDetectorTest.kt) A translation string is invalid if it contains new lines instead of the escaped \n or if it contains trailing whitespace. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/values/strings.xml:2:Warning: Text contains new line. -[InvalidString] - - <string name="my_string">My string" - ^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/values/strings.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources> - <string name="my_string">My string" -</string> -</resources> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/InvalidStringDetectorTest.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, `InvalidStringDetector.stringContainingNewLine`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/JCenter.md.html b/docs/checks/JCenter.md.html index 1678f535..80f86c7a 100644 --- a/docs/checks/JCenter.md.html +++ b/docs/checks/JCenter.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,11 @@ : Gradle build files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/JcenterDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/JcenterDetectorTest.kt) JCenter has gotten less and less reliable and it's best to avoid if possible. This check will flag usages of jcenter() in your gradle files. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:3:Warning: Don't use jcenter() [JCenter] - - jcenter() - --------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`build.gradle`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers -buildscript { - repositories { - jcenter() - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/JcenterDetectorTest.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, `JcenterDetector.jcenter`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/JavaOnlyDetector.md.html b/docs/checks/JavaOnlyDetector.md.html index 45dfdf3f..581ea63a 100644 --- a/docs/checks/JavaOnlyDetector.md.html +++ b/docs/checks/JavaOnlyDetector.md.html @@ -102,17 +102,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -120,7 +120,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/JvmStaticProvidesInObjectDetector.md.html b/docs/checks/JvmStaticProvidesInObjectDetector.md.html index c84d4de8..8ee5f29e 100644 --- a/docs/checks/JvmStaticProvidesInObjectDetector.md.html +++ b/docs/checks/JvmStaticProvidesInObjectDetector.md.html @@ -200,17 +200,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.46.1") +implementation("com.google.dagger:dagger-lint:2.50") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.46.1' +implementation 'com.google.dagger:dagger-lint:2.50' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.46.1" +dagger-lint = "2.50" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -218,7 +218,7 @@ } ``` -2.46.1 is the version this documentation was generated from; +2.50 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). diff --git a/docs/checks/KotlinPairNotCreated.md.html b/docs/checks/KotlinPairNotCreated.md.html index d169d057..9573241c 100644 --- a/docs/checks/KotlinPairNotCreated.md.html +++ b/docs/checks/KotlinPairNotCreated.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -112,7 +112,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/KotlinRequireNotNullUseMessage.md.html b/docs/checks/KotlinRequireNotNullUseMessage.md.html index ef53f7e6..f8bc4b9b 100644 --- a/docs/checks/KotlinRequireNotNullUseMessage.md.html +++ b/docs/checks/KotlinRequireNotNullUseMessage.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html) @@ -29,43 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/main/java/com/vanniktech/lintrules/kotlin/KotlinRequireNotNullUseMessageDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/test/java/com/vanniktech/lintrules/rxjava2/KotlinRequireNotNullUseMessageDetectorTest.kt) The default generated message from requireNotNull often lacks context, hence it's best to provide a custom message. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test.kt:2:Warning: Provide a message -[KotlinRequireNotNullUseMessage] - - requireNotNull(value) - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/test.kt`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -fun test(value: Int?) { - requireNotNull(value) -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-kotlin-lint/src/test/java/com/vanniktech/lintrules/rxjava2/KotlinRequireNotNullUseMessageDetectorTest.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, `KotlinRequireNotNullUseMessageDetector.requireNotNull`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -75,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-kotlin:0.24.0") +lintChecks("com.vanniktech:lint-rules-kotlin:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-kotlin:0.24.0' +lintChecks 'com.vanniktech:lint-rules-kotlin:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-kotlin) # libs.versions.toml [versions] -lint-rules-kotlin = "0.24.0" +lint-rules-kotlin = "0.25.0" [libraries] lint-rules-kotlin = { module = "com.vanniktech:lint-rules-kotlin", @@ -93,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html). diff --git a/docs/checks/LaunchDuringComposition.md.html b/docs/checks/LaunchDuringComposition.md.html index 3909ed56..6fda0576 100644 --- a/docs/checks/LaunchDuringComposition.md.html +++ b/docs/checks/LaunchDuringComposition.md.html @@ -166,17 +166,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity-compose:1.8.0-alpha05") +implementation("androidx.activity:activity-compose:1.9.0-alpha02") // build.gradle -implementation 'androidx.activity:activity-compose:1.8.0-alpha05' +implementation 'androidx.activity:activity-compose:1.9.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.activity-compose) # libs.versions.toml [versions] -activity-compose = "1.8.0-alpha05" +activity-compose = "1.9.0-alpha02" [libraries] activity-compose = { module = "androidx.activity:activity-compose", @@ -184,7 +184,7 @@ } ``` -1.8.0-alpha05 is the version this documentation was generated from; +1.9.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.activity:activity-compose](androidx_activity_activity-compose.md.html). diff --git a/docs/checks/LayoutFileNameMatchesClass.md.html b/docs/checks/LayoutFileNameMatchesClass.md.html index 38d71918..4a4ea4ee 100644 --- a/docs/checks/LayoutFileNameMatchesClass.md.html +++ b/docs/checks/LayoutFileNameMatchesClass.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,50 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetectorTest.kt) Layout file names should always match the name of the class. FooActivity should have a layout file named activity_foo hence. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/main/java/foo/FooActivity.java:5:Warning: Parameter should be named -R.layout.unit_test_activity_foo [LayoutFileNameMatchesClass] - - setContentView(R.layout.activity_bar); - --------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/main/java/foo/FooActivity.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -class FooActivity extends Activity { - void foo() { - setContentView(R.layout.activity_bar); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/LayoutFileNameMatchesClassDetectorTest.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, `LayoutFileNameMatchesClassDetector.fooActivityUsesActivityBarWithResourcePrefix`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -82,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -100,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/LintImplUseUast.md.html b/docs/checks/LintImplUseUast.md.html index 2122014e..33a7a35d 100644 --- a/docs/checks/LintImplUseUast.md.html +++ b/docs/checks/LintImplUseUast.md.html @@ -55,6 +55,14 @@ ---------------- +src/test/pkg/MyJavaLintDetector.java:42:Error: Don't call +PsiMethod#getBody(); you must use UAST instead. If you don't have a +UMethod call UastFacade.getMethodBody(method) [LintImplUseUast] + + method.getBody(); // ERROR - must use UAST + ---------------- + + src/test/pkg/MyJavaLintDetector.java:45:Error: Don't call PsiMember#getContainingClass(); you should use UAST instead and call getContainingUClass() [LintImplUseUast] diff --git a/docs/checks/MainScopeUsage.md.html b/docs/checks/MainScopeUsage.md.html index 6609329b..1d3e5db0 100644 --- a/docs/checks/MainScopeUsage.md.html +++ b/docs/checks/MainScopeUsage.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MatchingMenuId.md.html b/docs/checks/MatchingMenuId.md.html index ee31768e..4c12d1cc 100644 --- a/docs/checks/MatchingMenuId.md.html +++ b/docs/checks/MatchingMenuId.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,11 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MatchingMenuIdDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingMenuIdDetectorTest.kt) When the layout file is named menu_home all of the containing ids should be prefixed with menuHome to avoid ambiguity between different menu files across different menu items. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/menu/menu_main.xml:2:Warning: Id should start with: menuMain -[MatchingMenuId] - - <item android:id="@+id/something"/> - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/menu/menu_main.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/something"/> -</menu> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingMenuIdDetectorTest.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, `MatchingMenuIdDetector.idWithoutPrefix`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/MatchingViewId.md.html b/docs/checks/MatchingViewId.md.html index 464a80f6..a82ad185 100644 --- a/docs/checks/MatchingViewId.md.html +++ b/docs/checks/MatchingViewId.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,45 +29,11 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MatchingViewIdDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingViewIdDetectorTest.kt) When the layout file is named activity_home all of the containing ids should be prefixed with activityHome to avoid ambiguity between different layout files across different views. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/activity_main.xml:1:Warning: Id should start with: -activityMain [MatchingViewId] - -<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"/> - --------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/activity_main.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MatchingViewIdDetectorTest.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, `MatchingViewIdDetector.idWithoutPrefix`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/MissingColorAlphaChannel.md.html b/docs/checks/MissingColorAlphaChannel.md.html index 4af0523b..bf0ff29e 100644 --- a/docs/checks/MissingColorAlphaChannel.md.html +++ b/docs/checks/MissingColorAlphaChannel.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) +: [androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html) Affects : Kotlin and Java files and test sources @@ -119,28 +119,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui-graphics) +implementation(libs.ui-graphics-android) # libs.versions.toml [versions] -ui-graphics = "1.5.0-beta02" +ui-graphics-android = "1.7.0-alpha01" [libraries] -ui-graphics = { - module = "androidx.compose.ui:ui-graphics", - version.ref = "ui-graphics" +ui-graphics-android = { + module = "androidx.compose.ui:ui-graphics-android", + version.ref = "ui-graphics-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html). +[Additional details about androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html b/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html index a6fcae7c..d12836cb 100644 --- a/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html +++ b/docs/checks/MissingFirebaseInstanceTokenRefresh.md.html @@ -40,7 +40,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/com/google/firebase/samples/messaging/advanced/services/MessagingService.java:5:Warning: - Apps that use Firebase Cloud Messaging should implement onNewToken() in +Apps that use Firebase Cloud Messaging should implement onNewToken() in order to observe token changes [MissingFirebaseInstanceTokenRefresh] public class MessagingService extends FirebaseMessagingService { diff --git a/docs/checks/MissingResourceImportAlias.md.html b/docs/checks/MissingResourceImportAlias.md.html index 203f86a5..49418370 100644 --- a/docs/checks/MissingResourceImportAlias.md.html +++ b/docs/checks/MissingResourceImportAlias.md.html @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MissingScrollbars.md.html b/docs/checks/MissingScrollbars.md.html index 3d3b63a7..a67a8d5a 100644 --- a/docs/checks/MissingScrollbars.md.html +++ b/docs/checks/MissingScrollbars.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MissingScrollbarsDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingScrollbarsDetectorTest.kt) Every scroll view should explicitly define whether it has scrollbars (none | vertical | horizontal). -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:1:Warning: Missing scrollbars on ScrollView -[MissingScrollbars] - -<ScrollView -^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<ScrollView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - /> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingScrollbarsDetectorTest.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, `MissingScrollbarsDetector.scrollView`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/MissingXmlHeader.md.html b/docs/checks/MissingXmlHeader.md.html index 1a11ddb9..e4751d33 100644 --- a/docs/checks/MissingXmlHeader.md.html +++ b/docs/checks/MissingXmlHeader.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,44 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetectorTest.kt) An xml file should always have the xml header to declare that it is an xml file despite the file ending. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/values/strings.xml:1:Warning: Missing an xml header -[MissingXmlHeader] - -<resources/> ------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/values/strings.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/MissingXmlHeaderDetectorTest.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, `MissingXmlHeaderDetector.missingHeader`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -76,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -94,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/ModifierFactoryExtensionFunction.md.html b/docs/checks/ModifierFactoryExtensionFunction.md.html index a8e04416..89711880 100644 --- a/docs/checks/ModifierFactoryExtensionFunction.md.html +++ b/docs/checks/ModifierFactoryExtensionFunction.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -119,28 +119,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierFactoryReturnType.md.html b/docs/checks/ModifierFactoryReturnType.md.html index 0340fd9b..ddf13b9d 100644 --- a/docs/checks/ModifierFactoryReturnType.md.html +++ b/docs/checks/ModifierFactoryReturnType.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -85,28 +85,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html index 4388f23b..8f816047 100644 --- a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html +++ b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -90,28 +90,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierNodeInspectableProperties.md.html b/docs/checks/ModifierNodeInspectableProperties.md.html index 57977f65..92f152e3 100644 --- a/docs/checks/ModifierNodeInspectableProperties.md.html +++ b/docs/checks/ModifierNodeInspectableProperties.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files @@ -92,28 +92,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModifierParameter.md.html b/docs/checks/ModifierParameter.md.html index 6467557c..44f765a9 100644 --- a/docs/checks/ModifierParameter.md.html +++ b/docs/checks/ModifierParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -94,28 +94,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ModuleCompanionObjects.md.html b/docs/checks/ModuleCompanionObjects.md.html index ce67cff5..5373ab6d 100644 --- a/docs/checks/ModuleCompanionObjects.md.html +++ b/docs/checks/ModuleCompanionObjects.md.html @@ -200,17 +200,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.46.1") +implementation("com.google.dagger:dagger-lint:2.50") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.46.1' +implementation 'com.google.dagger:dagger-lint:2.50' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.46.1" +dagger-lint = "2.50" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -218,7 +218,7 @@ } ``` -2.46.1 is the version this documentation was generated from; +2.50 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). diff --git a/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html index 7823c54e..74eeb2a0 100644 --- a/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html +++ b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html @@ -56,17 +56,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.46.1") +implementation("com.google.dagger:dagger-lint:2.50") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.46.1' +implementation 'com.google.dagger:dagger-lint:2.50' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.46.1" +dagger-lint = "2.50" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -74,7 +74,7 @@ } ``` -2.46.1 is the version this documentation was generated from; +2.50 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). diff --git a/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html index 10bcb45e..24d23ae2 100644 --- a/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html +++ b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html index 1e304ff3..43c4ea42 100644 --- a/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html +++ b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html @@ -109,17 +109,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -127,7 +127,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageArray.md.html b/docs/checks/MoshiUsageArray.md.html index a8a01c4d..a7d406aa 100644 --- a/docs/checks/MoshiUsageArray.md.html +++ b/docs/checks/MoshiUsageArray.md.html @@ -166,17 +166,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -184,7 +184,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankGenerator.md.html b/docs/checks/MoshiUsageBlankGenerator.md.html index 6f25c188..78c75db9 100644 --- a/docs/checks/MoshiUsageBlankGenerator.md.html +++ b/docs/checks/MoshiUsageBlankGenerator.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankJsonName.md.html b/docs/checks/MoshiUsageBlankJsonName.md.html index ec49f445..a2c68eba 100644 --- a/docs/checks/MoshiUsageBlankJsonName.md.html +++ b/docs/checks/MoshiUsageBlankJsonName.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankTypeLabel.md.html b/docs/checks/MoshiUsageBlankTypeLabel.md.html index 121b97d2..1858f020 100644 --- a/docs/checks/MoshiUsageBlankTypeLabel.md.html +++ b/docs/checks/MoshiUsageBlankTypeLabel.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageClassVisibility.md.html b/docs/checks/MoshiUsageClassVisibility.md.html index d4c17ff1..434d9d2f 100644 --- a/docs/checks/MoshiUsageClassVisibility.md.html +++ b/docs/checks/MoshiUsageClassVisibility.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDoubleClassAnnotation.md.html b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html index bf315eb5..5726302e 100644 --- a/docs/checks/MoshiUsageDoubleClassAnnotation.md.html +++ b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDoubleTypeLabel.md.html b/docs/checks/MoshiUsageDoubleTypeLabel.md.html index 00539aca..84226b9a 100644 --- a/docs/checks/MoshiUsageDoubleTypeLabel.md.html +++ b/docs/checks/MoshiUsageDoubleTypeLabel.md.html @@ -97,17 +97,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -115,7 +115,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDuplicateJsonName.md.html b/docs/checks/MoshiUsageDuplicateJsonName.md.html index 66f8bbc4..8612f1ef 100644 --- a/docs/checks/MoshiUsageDuplicateJsonName.md.html +++ b/docs/checks/MoshiUsageDuplicateJsonName.md.html @@ -111,17 +111,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -129,7 +129,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html index e8b0e7bc..3bc494d0 100644 --- a/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html +++ b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumCasing.md.html b/docs/checks/MoshiUsageEnumCasing.md.html index cf1970c6..8bf22881 100644 --- a/docs/checks/MoshiUsageEnumCasing.md.html +++ b/docs/checks/MoshiUsageEnumCasing.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html index db693fd3..5e67ef5e 100644 --- a/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html +++ b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +70,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumMissingJsonClass.md.html b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html index 8a1a95f1..95d10b55 100644 --- a/docs/checks/MoshiUsageEnumMissingJsonClass.md.html +++ b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumMissingUnknown.md.html b/docs/checks/MoshiUsageEnumMissingUnknown.md.html index 04cc2e77..58447e23 100644 --- a/docs/checks/MoshiUsageEnumMissingUnknown.md.html +++ b/docs/checks/MoshiUsageEnumMissingUnknown.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html index e26d933d..c7ea6776 100644 --- a/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html +++ b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -108,7 +108,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html index 5626c5d4..a50884f0 100644 --- a/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html +++ b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html @@ -112,17 +112,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -130,7 +130,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html index 17fc98bd..e1d0c383 100644 --- a/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html +++ b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html @@ -85,17 +85,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -103,7 +103,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageGenericSealedSubtype.md.html b/docs/checks/MoshiUsageGenericSealedSubtype.md.html index 1f706aef..e813c13c 100644 --- a/docs/checks/MoshiUsageGenericSealedSubtype.md.html +++ b/docs/checks/MoshiUsageGenericSealedSubtype.md.html @@ -95,17 +95,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -113,7 +113,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageInappropriateTypeLabel.md.html b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html index 373ad5e7..44191dfd 100644 --- a/docs/checks/MoshiUsageInappropriateTypeLabel.md.html +++ b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html @@ -108,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -126,7 +126,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMissingPrimary.md.html b/docs/checks/MoshiUsageMissingPrimary.md.html index 2d4734b5..167f47b9 100644 --- a/docs/checks/MoshiUsageMissingPrimary.md.html +++ b/docs/checks/MoshiUsageMissingPrimary.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMissingTypeLabel.md.html b/docs/checks/MoshiUsageMissingTypeLabel.md.html index a179a33d..2e65f4db 100644 --- a/docs/checks/MoshiUsageMissingTypeLabel.md.html +++ b/docs/checks/MoshiUsageMissingTypeLabel.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMutableCollections.md.html b/docs/checks/MoshiUsageMutableCollections.md.html index ce98cffd..c96ecd2c 100644 --- a/docs/checks/MoshiUsageMutableCollections.md.html +++ b/docs/checks/MoshiUsageMutableCollections.md.html @@ -163,17 +163,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -181,7 +181,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassCollection.md.html b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html index f51d09bc..b1a273d2 100644 --- a/docs/checks/MoshiUsageNonMoshiClassCollection.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html @@ -153,17 +153,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -171,7 +171,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassExternal.md.html b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html index 4259964a..654b868d 100644 --- a/docs/checks/MoshiUsageNonMoshiClassExternal.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html @@ -167,17 +167,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -185,7 +185,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassInternal.md.html b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html index c35eaa3a..9b5cac2f 100644 --- a/docs/checks/MoshiUsageNonMoshiClassInternal.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html @@ -144,17 +144,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -162,7 +162,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassMap.md.html b/docs/checks/MoshiUsageNonMoshiClassMap.md.html index 5801d664..2653abba 100644 --- a/docs/checks/MoshiUsageNonMoshiClassMap.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassMap.md.html @@ -143,17 +143,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -161,7 +161,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html index d971d874..2c8b958a 100644 --- a/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html @@ -145,17 +145,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -163,7 +163,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageObject.md.html b/docs/checks/MoshiUsageObject.md.html index 4f4e773d..ed54aaac 100644 --- a/docs/checks/MoshiUsageObject.md.html +++ b/docs/checks/MoshiUsageObject.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageParamNeedsInit.md.html b/docs/checks/MoshiUsageParamNeedsInit.md.html index ada1d7cf..71dce9fb 100644 --- a/docs/checks/MoshiUsageParamNeedsInit.md.html +++ b/docs/checks/MoshiUsageParamNeedsInit.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsagePrivateConstructor.md.html b/docs/checks/MoshiUsagePrivateConstructor.md.html index 3fd86caf..c3e2392c 100644 --- a/docs/checks/MoshiUsagePrivateConstructor.md.html +++ b/docs/checks/MoshiUsagePrivateConstructor.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -112,7 +112,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsagePrivateConstructorProperty.md.html b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html index f26ee34c..45788498 100644 --- a/docs/checks/MoshiUsagePrivateConstructorProperty.md.html +++ b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageQualifierRetention.md.html b/docs/checks/MoshiUsageQualifierRetention.md.html index d306d0ed..50c74356 100644 --- a/docs/checks/MoshiUsageQualifierRetention.md.html +++ b/docs/checks/MoshiUsageQualifierRetention.md.html @@ -119,17 +119,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -137,7 +137,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageQualifierTarget.md.html b/docs/checks/MoshiUsageQualifierTarget.md.html index f28e2b94..75ce558f 100644 --- a/docs/checks/MoshiUsageQualifierTarget.md.html +++ b/docs/checks/MoshiUsageQualifierTarget.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageRedundantJsonName.md.html b/docs/checks/MoshiUsageRedundantJsonName.md.html index 3566929b..4f96d1b0 100644 --- a/docs/checks/MoshiUsageRedundantJsonName.md.html +++ b/docs/checks/MoshiUsageRedundantJsonName.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -105,7 +105,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageRedundantSiteTarget.md.html b/docs/checks/MoshiUsageRedundantSiteTarget.md.html index 1cc343a5..0a642bb5 100644 --- a/docs/checks/MoshiUsageRedundantSiteTarget.md.html +++ b/docs/checks/MoshiUsageRedundantSiteTarget.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -105,7 +105,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSealedMustBeSealed.md.html b/docs/checks/MoshiUsageSealedMustBeSealed.md.html index 928d158a..9a7516e0 100644 --- a/docs/checks/MoshiUsageSealedMustBeSealed.md.html +++ b/docs/checks/MoshiUsageSealedMustBeSealed.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -101,7 +101,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSerializedName.md.html b/docs/checks/MoshiUsageSerializedName.md.html index 8182c298..fe478ca2 100644 --- a/docs/checks/MoshiUsageSerializedName.md.html +++ b/docs/checks/MoshiUsageSerializedName.md.html @@ -123,17 +123,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -141,7 +141,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSnakeCase.md.html b/docs/checks/MoshiUsageSnakeCase.md.html index d2eb610b..0a7119c3 100644 --- a/docs/checks/MoshiUsageSnakeCase.md.html +++ b/docs/checks/MoshiUsageSnakeCase.md.html @@ -89,17 +89,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -107,7 +107,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageTransientNeedsInit.md.html b/docs/checks/MoshiUsageTransientNeedsInit.md.html index 4bdb5ee6..64060a5c 100644 --- a/docs/checks/MoshiUsageTransientNeedsInit.md.html +++ b/docs/checks/MoshiUsageTransientNeedsInit.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageUnsupportedType.md.html b/docs/checks/MoshiUsageUnsupportedType.md.html index fe0d0003..db4d9e78 100644 --- a/docs/checks/MoshiUsageUnsupportedType.md.html +++ b/docs/checks/MoshiUsageUnsupportedType.md.html @@ -117,17 +117,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -135,7 +135,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageUseData.md.html b/docs/checks/MoshiUsageUseData.md.html index de13a282..b9528e53 100644 --- a/docs/checks/MoshiUsageUseData.md.html +++ b/docs/checks/MoshiUsageUseData.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageVarProperty.md.html b/docs/checks/MoshiUsageVarProperty.md.html index a2890119..0550ac92 100644 --- a/docs/checks/MoshiUsageVarProperty.md.html +++ b/docs/checks/MoshiUsageVarProperty.md.html @@ -85,17 +85,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -103,7 +103,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MultipleAwaitPointerEventScopes.md.html b/docs/checks/MultipleAwaitPointerEventScopes.md.html index f4de5ceb..e05819c0 100644 --- a/docs/checks/MultipleAwaitPointerEventScopes.md.html +++ b/docs/checks/MultipleAwaitPointerEventScopes.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -52,28 +52,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/MustBeInModule.md.html b/docs/checks/MustBeInModule.md.html new file mode 100644 index 00000000..af46b378 --- /dev/null +++ b/docs/checks/MustBeInModule.md.html @@ -0,0 +1,226 @@ + +(#) @Binds/@Provides function must be in `@Module`-annotated classes. + +!!! ERROR: @Binds/@Provides function must be in `@Module`-annotated classes. + This is an error. + +Id +: `MustBeInModule` +Summary +: @Binds/@Provides function must be in `@Module`-annotated classes. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds/@Provides function must be in `@Module`-annotated classes. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyModule.kt:7:Error: @Binds/@Provides functions must be in +modules [MustBeInModule] + + @Binds fun invalidBind(real: Int): Number + ----------------------------------------- + + +src/foo/MyModule.kt:10:Error: @Binds/@Provides functions must be in +modules [MustBeInModule] + + @Provides fun invalidBind(): Int = 3 + ------------------------------------ + + +src/foo/MyModule.kt:15:Error: @Binds/@Provides functions must be in +modules [MustBeInModule] + + @Binds abstract fun invalidBind(real: Int): Number + -------------------------------------------------- + + +src/foo/MyModule.kt:18:Error: @Binds/@Provides functions must be in +modules [MustBeInModule] + + @Provides fun invalidBind(): Int = 3 + ------------------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyModule.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import dagger.Binds +import dagger.Provides +import dagger.Module + +interface MyModule { + @Binds fun invalidBind(real: Int): Number + + companion object { + @Provides fun invalidBind(): Int = 3 + } +} + +abstract class MyModule2 { + @Binds abstract fun invalidBind(real: Int): Number + + companion object { + @Provides fun invalidBind(): Int = 3 + } +} + +@Module +interface MyModule3 { + @Binds fun validBind(real: Int): Number + + companion object { + @Provides fun validBind(): Int = 3 + } +} + +@Module +abstract class MyModule4 { + @Binds abstract fun validBind(real: Int): Number + + companion object { + @Provides fun validBind(): Int = 3 + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.must be in a module`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MustBeInModule") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MustBeInModule") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MustBeInModule + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MustBeInModule" severity="ignore" /> + </lint> + ``` + 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 'MustBeInModule' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MustBeInModule ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/MutableCollectionMutableState.md.html b/docs/checks/MutableCollectionMutableState.md.html index 86604d57..2eed87ac 100644 --- a/docs/checks/MutableCollectionMutableState.md.html +++ b/docs/checks/MutableCollectionMutableState.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -174,28 +174,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/MutableImplicitPendingIntent.md.html b/docs/checks/MutableImplicitPendingIntent.md.html new file mode 100644 index 00000000..244cc22b --- /dev/null +++ b/docs/checks/MutableImplicitPendingIntent.md.html @@ -0,0 +1,108 @@ + +(#) Mutable Implicit PendingIntent is disallowed + +!!! ERROR: Mutable Implicit PendingIntent is disallowed + This is an error. + +Id +: `MutableImplicitPendingIntent` +Summary +: Mutable Implicit PendingIntent is disallowed +Severity +: Error +Category +: Security +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/PendingIntentMutableImplicitDetector.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/PendingIntentMutableImplicitDetectorTest.kt) +Copyright Year +: 2023 + +Apps targeting Android 14 and above are not allowed to create +`PendingIntents` with `FLAG_MUTABLE` and an implicit intent within for +security reasons. + +To retrieve an existing PendingIntent, use `FLAG_NO_CREATE`. To create a +new `PendingIntent`, either make the intent explicit, or make it +immutable with `FLAG_IMMUTABLE`. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("MutableImplicitPendingIntent") + fun method() { + getActivity(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("MutableImplicitPendingIntent") + void method() { + getActivity(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection MutableImplicitPendingIntent + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="MutableImplicitPendingIntent" severity="ignore" /> + </lint> + ``` + 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 'MutableImplicitPendingIntent' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore MutableImplicitPendingIntent ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/NamingPattern.md.html b/docs/checks/NamingPattern.md.html index 30fd5f9d..bfe231c3 100644 --- a/docs/checks/NamingPattern.md.html +++ b/docs/checks/NamingPattern.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,49 +29,12 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/NamingPatternDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/NamingPatternDetectorTest.kt) Sometimes there is more than one reasonable way to convert an English phrase into camel case, such as when acronyms or unusual constructs like "IPv6" or "iOS" are present. XML HTTP request becomes XmlHttpRequest. XMLHTTPRequest would be incorrect. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Foo.java:5:Warning: iOSVersion is not named in defined camel -case [NamingPattern] - - String iOSVersion; - ---------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Foo.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -class Foo { - private void fun() { - String iOSVersion; - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/NamingPatternDetectorTest.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, `NamingPatternDetector.incorrectVariableName`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -99,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/NoCollectCallFound.md.html b/docs/checks/NoCollectCallFound.md.html new file mode 100644 index 00000000..d1dd131d --- /dev/null +++ b/docs/checks/NoCollectCallFound.md.html @@ -0,0 +1,250 @@ + +(#) You must call collect on the given progress flow when using PredictiveBackHandler + +!!! ERROR: You must call collect on the given progress flow when using PredictiveBackHandler + This is an error. + +Id +: `NoCollectCallFound` +Summary +: You must call collect on the given progress flow when using PredictiveBackHandler +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Activity Compose +Identifier +: androidx.activity.compose +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/activity/activity-compose-lint/src/main/java/androidx/activity/compose/lint/CollectProgressDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/activity/activity-compose-lint/src/test/java/androidx/activity/compose/lint/CollectProgressDetectorTest.kt) +Copyright Year +: 2023 + +You must call collect on the progress in the onBack function. The +collect call is what properly splits the callback so it knows what to do +when the back gestures is started vs when it is completed. Failing to +call collect will cause all code in the block to run when the gesture is +started. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/com/example/test.kt:9:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:13:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:17:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:26:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:29:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:35:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- + + +src/com/example/test.kt:39:Error: You must call collect() on Flow +progress [NoCollectCallFound] + + PredictiveBackHandler { progress -> } + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/com/example/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package com.example + +import androidx.compose.runtime.Composable +import androidx.activity.compose.PredictiveBackHandler + +@Composable +fun Test() { + PredictiveBackHandler { progress -> } +} + +val lambda = @Composable { + PredictiveBackHandler { progress -> } +} + +val lambda2: @Composable () -> Unit = { + PredictiveBackHandler { progress -> } +} + +@Composable +fun LambdaParameter(content: @Composable () -> Unit) {} + +@Composable +fun Test2() { + LambdaParameter(content = { + PredictiveBackHandler { progress -> } + }) + LambdaParameter { + PredictiveBackHandler { progress -> } + } +} + +fun test3() { + val localLambda1 = @Composable { + PredictiveBackHandler { progress -> } + } + + val localLambda2: @Composable () -> Unit = { + PredictiveBackHandler { progress -> } + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/activity/activity-compose-lint/src/test/java/androidx/activity/compose/lint/CollectProgressDetectorTest.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, `CollectProgressDetector.errors`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity-compose:1.9.0-alpha02") + +// build.gradle +implementation 'androidx.activity:activity-compose:1.9.0-alpha02' + +// build.gradle.kts with version catalogs: +implementation(libs.activity-compose) + +# libs.versions.toml +[versions] +activity-compose = "1.9.0-alpha02" +[libraries] +activity-compose = { + module = "androidx.activity:activity-compose", + version.ref = "activity-compose" +} +``` + +1.9.0-alpha02 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.activity:activity-compose](androidx_activity_activity-compose.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("NoCollectCallFound") + fun method() { + PredictiveBackHandler(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("NoCollectCallFound") + void method() { + PredictiveBackHandler(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection NoCollectCallFound + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="NoCollectCallFound" severity="ignore" /> + </lint> + ``` + 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 'NoCollectCallFound' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore NoCollectCallFound ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/NullSafeMutableLiveData.md.html b/docs/checks/NullSafeMutableLiveData.md.html index f880f3fd..841c6da9 100644 --- a/docs/checks/NullSafeMutableLiveData.md.html +++ b/docs/checks/NullSafeMutableLiveData.md.html @@ -62,17 +62,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1") +implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01") // build.gradle -implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1' +implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-livedata-core-ktx) # libs.versions.toml [versions] -lifecycle-livedata-core-ktx = "2.6.1" +lifecycle-livedata-core-ktx = "2.8.0-alpha01" [libraries] lifecycle-livedata-core-ktx = { module = "androidx.lifecycle:lifecycle-livedata-core-ktx", @@ -80,7 +80,7 @@ } ``` -2.6.1 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html). diff --git a/docs/checks/OldTargetApi.md.html b/docs/checks/OldTargetApi.md.html index 7a85b12e..ddc5c62a 100644 --- a/docs/checks/OldTargetApi.md.html +++ b/docs/checks/OldTargetApi.md.html @@ -19,7 +19,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Manifest files +: Gradle build files and manifest files Editing : This check runs on the fly in the IDE editor See @@ -27,11 +27,11 @@ See : https://developer.android.com/reference/android/os/Build.VERSION_CODES.html 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/ManifestDetector.kt) +: [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/GradleDetector.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/ManifestDetectorTest.kt) +: [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/GradleDetectorTest.kt) Copyright Year -: 2011 +: 2014 When your application runs on a version of Android that is more recent than your `targetSdkVersion` specifies that it has been tested with, @@ -45,7 +45,7 @@ may want to consult the compatibility notes to see what changes apply to each version you are adding support for: https://developer.android.com/reference/android/os/Build.VERSION_CODES.html - as well as follow this guide: +as well as follow this guide: https://developer.android.com/distribute/best-practices/develop/target-sdk.html. !!! Tip @@ -60,7 +60,7 @@ version. Consult the android.os.Build.VERSION_CODES javadoc for details. [OldTargetApi] - <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14" /> + <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="33" /> ----------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -73,7 +73,7 @@ android:versionCode="1" android:versionName="1.0" > - <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14" /> + <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="33" /> <application android:icon="@drawable/ic_launcher" @@ -93,11 +93,11 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/ManifestDetectorTest.kt) +[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/GradleDetectorTest.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, `ManifestDetector.testOldTargetSdk`. +found for this lint check, `GradleDetector.testNotTheNewestTargetSdk`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. @@ -111,13 +111,11 @@ element in the XML file if it's not already there: `xmlns:tools="http://schemas.android.com/tools"`. - ```xml - <?xml version="1.0" encoding="UTF-8"?> - <manifest xmlns:tools="http://schemas.android.com/tools"> - ... - <application tools:ignore="OldTargetApi" .../> - ... - </manifest> +* Using a suppression comment like this on the line above: + + ```kt + //noinspection OldTargetApi + problematicStatement() ``` * Using a special `lint.xml` file in the source tree which turns off diff --git a/docs/checks/OpaqueUnitKey.md.html b/docs/checks/OpaqueUnitKey.md.html index 1b05b2fc..46fb0ce1 100644 --- a/docs/checks/OpaqueUnitKey.md.html +++ b/docs/checks/OpaqueUnitKey.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -99,28 +99,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/OutdatedLibrary.md.html b/docs/checks/OutdatedLibrary.md.html index 235ade98..717aeb25 100644 --- a/docs/checks/OutdatedLibrary.md.html +++ b/docs/checks/OutdatedLibrary.md.html @@ -23,7 +23,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://play.google.com/sdks +: https://developer.android.com/distribute/sdk-index 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/GradleDetector.kt) Tests @@ -64,7 +64,7 @@ build.gradle:13:Warning: com.example.ads.third.party:example version 7.2.0 has been marked as outdated by its author [OutdatedLibrary] - compile 'com.example.ads.third.party:example:7.2.0' // Outdated & Non compliant & Critical + compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity ------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -84,7 +84,17 @@ compile 'com.example.ads.third.party:example:8.0.0' // OK compile 'com.example.ads.third.party:example:7.2.2' // OK compile 'com.example.ads.third.party:example:7.2.1' // OK - compile 'com.example.ads.third.party:example:7.2.0' // Outdated & Non compliant & Critical + compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity + compile 'com.example.ads.third.party:example:7.1.0' // Policy (Ads), non-blocking + compile 'com.example.ads.third.party:example:7.1.1' // Policy (Device and Network Abuse), blocking + compile 'com.example.ads.third.party:example:7.1.2' // Policy (Deceptive Behavior), no severity + compile 'com.example.ads.third.party:example:7.1.3' // Policy (User Data), non-blocking + compile 'com.example.ads.third.party:example:7.1.4' // Policy (Permissions), blocking + compile 'com.example.ads.third.party:example:7.1.5' // Policy (Mobile Unwanted Software), no-severity + compile 'com.example.ads.third.party:example:7.1.6' // Policy (Malware), non-blocking + compile 'com.example.ads.third.party:example:7.1.7' // Policy (multiple types), non-blocking + compile 'com.example.ads.third.party:example:7.1.8' // Policy (multiple types), blocking + compile 'com.example.ads.third.party:example:7.1.9' // Policy (multiple types), no severity compile 'log4j:log4j:latest.release' // OK compile 'log4j:log4j' // OK diff --git a/docs/checks/OverrideAbstract.md.html b/docs/checks/OverrideAbstract.md.html index 5a60e2f6..7f15e7c9 100644 --- a/docs/checks/OverrideAbstract.md.html +++ b/docs/checks/OverrideAbstract.md.html @@ -45,7 +45,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text src/test/pkg/OverrideConcreteTest.java:23:Error: Must override android.service.notification.NotificationListenerService.onNotificationPosted(android.service.notification.StatusBarNotification): - Method was abstract until 21, and your minSdkVersion is 18 +Method was abstract until 21, and your minSdkVersion is 18 [OverrideAbstract] private static class MyNotificationListenerService2 extends NotificationListenerService { @@ -54,7 +54,7 @@ src/test/pkg/OverrideConcreteTest.java:30:Error: Must override android.service.notification.NotificationListenerService.onNotificationRemoved(android.service.notification.StatusBarNotification): - Method was abstract until 21, and your minSdkVersion is 18 +Method was abstract until 21, and your minSdkVersion is 18 [OverrideAbstract] private static class MyNotificationListenerService3 extends NotificationListenerService { @@ -63,7 +63,7 @@ src/test/pkg/OverrideConcreteTest.java:37:Error: Must override android.service.notification.NotificationListenerService.onNotificationPosted(android.service.notification.StatusBarNotification): - Method was abstract until 21, and your minSdkVersion is 18 +Method was abstract until 21, and your minSdkVersion is 18 [OverrideAbstract] private static class MyNotificationListenerService4 extends NotificationListenerService { @@ -72,7 +72,7 @@ src/test/pkg/OverrideConcreteTest.java:57:Error: Must override android.service.notification.NotificationListenerService.onNotificationRemoved(android.service.notification.StatusBarNotification): - Method was abstract until 21, and your minSdkVersion is 18 +Method was abstract until 21, and your minSdkVersion is 18 [OverrideAbstract] private static class MyNotificationListenerService7 extends MyNotificationListenerService3 { diff --git a/docs/checks/ParcelizeFunctionProperty.md.html b/docs/checks/ParcelizeFunctionProperty.md.html index 823ea78d..df905478 100644 --- a/docs/checks/ParcelizeFunctionProperty.md.html +++ b/docs/checks/ParcelizeFunctionProperty.md.html @@ -154,17 +154,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -172,7 +172,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/PlaySdkIndexGenericIssues.md.html b/docs/checks/PlaySdkIndexGenericIssues.md.html new file mode 100644 index 00000000..bc89c67a --- /dev/null +++ b/docs/checks/PlaySdkIndexGenericIssues.md.html @@ -0,0 +1,81 @@ + +(#) Library has issues in SDK Index + +!!! ERROR: Library has issues in SDK Index + This is an error. + +Id +: `PlaySdkIndexGenericIssues` +Summary +: Library has issues in SDK Index +Severity +: Error +Category +: Compliance +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 runs on the fly in the IDE editor +See +: https://developer.android.com/distribute/sdk-index +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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +This library version has issues that could block publishing in the +Google Play Store. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection PlaySdkIndexGenericIssues + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="PlaySdkIndexGenericIssues" severity="ignore" /> + </lint> + ``` + 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 'PlaySdkIndexGenericIssues' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore PlaySdkIndexGenericIssues ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/PlaySdkIndexNonCompliant.md.html b/docs/checks/PlaySdkIndexNonCompliant.md.html index c6d1673b..85330230 100644 --- a/docs/checks/PlaySdkIndexNonCompliant.md.html +++ b/docs/checks/PlaySdkIndexNonCompliant.md.html @@ -23,7 +23,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://play.google.com/sdks +: https://developer.android.com/distribute/sdk-index 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/GradleDetector.kt) Tests @@ -34,6 +34,152 @@ This library version has policy issues that will block publishing in the Google Play Store. +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +build.gradle:6:Warning: log4j:log4j version 1.2.14 has policy issues +that will block publishing of your app to Play Console in the future +[PlaySdkIndexNonCompliant] + + compile 'log4j:log4j:1.2.14' // Non compliant + -------------------- + + +build.gradle:13:Warning: com.example.ads.third.party:example version +7.2.0 has User Data policy issues that will block publishing of your app +to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity + ------------------------------------------- + + +build.gradle:14:Warning: com.example.ads.third.party:example version +7.1.0 has Ads policy issues that will block publishing of your app to +Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.0' // Policy (Ads), non-blocking + ------------------------------------------- + + +build.gradle:15:Error: com.example.ads.third.party:example version 7.1.1 +has Device and Network Abuse policy issues that will block publishing of +your app to Play Console [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.1' // Policy (Device and Network Abuse), blocking + ------------------------------------------- + + +build.gradle:16:Warning: com.example.ads.third.party:example version +7.1.2 has Deceptive Behavior policy issues that will block publishing of +your app to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.2' // Policy (Deceptive Behavior), no severity + ------------------------------------------- + + +build.gradle:17:Warning: com.example.ads.third.party:example version +7.1.3 has User Data policy issues that will block publishing of your app +to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.3' // Policy (User Data), non-blocking + ------------------------------------------- + + +build.gradle:18:Error: com.example.ads.third.party:example version 7.1.4 +has Permissions policy issues that will block publishing of your app to +Play Console [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.4' // Policy (Permissions), blocking + ------------------------------------------- + + +build.gradle:19:Warning: com.example.ads.third.party:example version +7.1.5 has Mobile Unwanted Software policy issues that will block +publishing of your app to Play Console in the future +[PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.5' // Policy (Mobile Unwanted Software), no-severity + ------------------------------------------- + + +build.gradle:20:Warning: com.example.ads.third.party:example version +7.1.6 has Malware policy issues that will block publishing of your app +to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.6' // Policy (Malware), non-blocking + ------------------------------------------- + + +build.gradle:21:Warning: com.example.ads.third.party:example version +7.1.7 has User Data policy issues that will block publishing of your app +to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.7' // Policy (multiple types), non-blocking + ------------------------------------------- + + +build.gradle:22:Error: com.example.ads.third.party:example version 7.1.8 +has User Data policy issues that will block publishing of your app to +Play Console [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.8' // Policy (multiple types), blocking + ------------------------------------------- + + +build.gradle:23:Warning: com.example.ads.third.party:example version +7.1.9 has Permissions policy issues that will block publishing of your +app to Play Console in the future [PlaySdkIndexNonCompliant] + + compile 'com.example.ads.third.party:example:7.1.9' // Policy (multiple types), no severity + ------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + compile 'log4j:log4j:1.2.18' // OK, latest + compile 'log4j:log4j:1.2.17' // OK + compile 'log4j:log4j:1.2.16' // Critical NON_BLOCKING + compile 'log4j:log4j:1.2.15' // Outdated NON_BLOCKING + compile 'log4j:log4j:1.2.14' // Non compliant + compile 'log4j:log4j:1.2.13' // Critical BLOCKING + compile 'log4j:log4j:1.2.12' // OUTDATED BLOCKING + compile 'log4j:log4j:1.2.11' // Ok (not in Index) + compile 'com.example.ads.third.party:example:8.0.0' // OK + compile 'com.example.ads.third.party:example:7.2.2' // OK + compile 'com.example.ads.third.party:example:7.2.1' // OK + compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity + compile 'com.example.ads.third.party:example:7.1.0' // Policy (Ads), non-blocking + compile 'com.example.ads.third.party:example:7.1.1' // Policy (Device and Network Abuse), blocking + compile 'com.example.ads.third.party:example:7.1.2' // Policy (Deceptive Behavior), no severity + compile 'com.example.ads.third.party:example:7.1.3' // Policy (User Data), non-blocking + compile 'com.example.ads.third.party:example:7.1.4' // Policy (Permissions), blocking + compile 'com.example.ads.third.party:example:7.1.5' // Policy (Mobile Unwanted Software), no-severity + compile 'com.example.ads.third.party:example:7.1.6' // Policy (Malware), non-blocking + compile 'com.example.ads.third.party:example:7.1.7' // Policy (multiple types), non-blocking + compile 'com.example.ads.third.party:example:7.1.8' // Policy (multiple types), blocking + compile 'com.example.ads.third.party:example:7.1.9' // Policy (multiple types), no severity + + compile 'log4j:log4j:latest.release' // OK + compile 'log4j:log4j' // OK + compile 'log4j:log4j:_' // OK + + compile 'com.another.example:example' // Ok (not in Index) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/GradleDetectorTest.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, `GradleDetector.testSdkIndexLibrary`. +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: diff --git a/docs/checks/ProduceStateDoesNotAssignValue.md.html b/docs/checks/ProduceStateDoesNotAssignValue.md.html index c2a21d3e..16c86dc2 100644 --- a/docs/checks/ProduceStateDoesNotAssignValue.md.html +++ b/docs/checks/ProduceStateDoesNotAssignValue.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -131,28 +131,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ProguardSplit.md.html b/docs/checks/ProguardSplit.md.html index 8fa2708d..6ff32b09 100644 --- a/docs/checks/ProguardSplit.md.html +++ b/docs/checks/ProguardSplit.md.html @@ -64,7 +64,7 @@ Android configuration: Inherit these settings instead? Modify project.properties to define proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:myfile.txt - and then keep only project-specific configuration here [ProguardSplit] +and then keep only project-specific configuration here [ProguardSplit] -keep public class * extends android.app.Activity ^ diff --git a/docs/checks/ProtoLayoutMinSchema-2.md.html b/docs/checks/ProtoLayoutMinSchema-2.md.html new file mode 100644 index 00000000..84f6b5be --- /dev/null +++ b/docs/checks/ProtoLayoutMinSchema-2.md.html @@ -0,0 +1,163 @@ + +(#) ProtoLayout feature is not guaranteed to be available on the target device API. + +!!! ERROR: ProtoLayout feature is not guaranteed to be available on the target device API. + This is an error. + +Id +: `ProtoLayoutMinSchema` +Summary +: ProtoLayout feature is not guaranteed to be available on the target device API. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ProtoLayoutMinSchemaDetector.kt) +Copyright Year +: 2023 + +Using features that are not supported by an older ProtoLayout +renderer/evaluator, can lead to unexpected rendering or invalid results +(for expressions). + +Each Wear OS platform version has a guaranteed minimum ProtoLayout +schema version. +On API 33, all consumers for ProtoLayout support at least Schema version +1.2 (major=1, minor=200). +On API 34, all consumers for ProtoLayout support at least Schema version +1.3 (major=1, minor=300). + +You can use those newer features through conditional Android API checks, +or by increasing the minSdk for your project. +You can also annotate your methods with @RequiresApi or +@RequiresSchemaAnnotation if you know they require the +corresponding version. +Note that @RequiresSchemaVersion annotation on classes are mostly +ignored (except for Builder classes). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API. (this issue) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01](ProtoLayoutMinSchema.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.1.0-rc01](ProtoLayoutMinSchema-2.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout:1.1.0-rc01") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout:1.1.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout) + +# libs.versions.toml +[versions] +protolayout = "1.1.0-rc01" +[libraries] +protolayout = { + module = "androidx.wear.protolayout:protolayout", + version.ref = "protolayout" +} +``` + +1.1.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutMinSchema") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutMinSchema") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutMinSchema + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutMinSchema" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutMinSchema' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutMinSchema ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutMinSchema.md.html b/docs/checks/ProtoLayoutMinSchema.md.html new file mode 100644 index 00000000..f192fe87 --- /dev/null +++ b/docs/checks/ProtoLayoutMinSchema.md.html @@ -0,0 +1,163 @@ + +(#) ProtoLayout feature is not guaranteed to be available on the target device API. + +!!! ERROR: ProtoLayout feature is not guaranteed to be available on the target device API. + This is an error. + +Id +: `ProtoLayoutMinSchema` +Summary +: ProtoLayout feature is not guaranteed to be available on the target device API. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ProtoLayoutMinSchemaDetector.kt) +Copyright Year +: 2023 + +Using features that are not supported by an older ProtoLayout +renderer/evaluator, can lead to unexpected rendering or invalid results +(for expressions). + +Each Wear OS platform version has a guaranteed minimum ProtoLayout +schema version. +On API 33, all consumers for ProtoLayout support at least Schema version +1.2 (major=1, minor=200). +On API 34, all consumers for ProtoLayout support at least Schema version +1.3 (major=1, minor=300). + +You can use those newer features through conditional Android API checks, +or by increasing the minSdk for your project. +You can also annotate your methods with @RequiresApi or +@RequiresSchemaAnnotation if you know they require the +corresponding version. +Note that @RequiresSchemaVersion annotation on classes are mostly +ignored (except for Builder classes). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API. (this issue) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01](ProtoLayoutMinSchema.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.1.0-rc01](ProtoLayoutMinSchema-2.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-expression:1.1.0-rc01") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-expression:1.1.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-expression) + +# libs.versions.toml +[versions] +protolayout-expression = "1.1.0-rc01" +[libraries] +protolayout-expression = { + module = "androidx.wear.protolayout:protolayout-expression", + version.ref = "protolayout-expression" +} +``` + +1.1.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutMinSchema") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutMinSchema") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutMinSchema + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutMinSchema" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutMinSchema' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutMinSchema ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProvidesMustNotBeAbstract.md.html b/docs/checks/ProvidesMustNotBeAbstract.md.html new file mode 100644 index 00000000..69ea5618 --- /dev/null +++ b/docs/checks/ProvidesMustNotBeAbstract.md.html @@ -0,0 +1,257 @@ + +(#) @Provides functions cannot be abstract. + +!!! ERROR: @Provides functions cannot be abstract. + This is an error. + +Id +: `ProvidesMustNotBeAbstract` +Summary +: @Provides functions cannot be abstract. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Provides functions cannot be abstract. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:25:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Int.bind(): Number = this@bind + -------------------------------------------- + + +src/foo/MyQualifier.kt:26:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Long.bind(): Number = this@bind + --------------------------------------------- + + +src/foo/MyQualifier.kt:27:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Double.bind(): Number = this@bind + ----------------------------------------------- + + +src/foo/MyQualifier.kt:28:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Float.bind(): Number = this@bind + ---------------------------------------------- + + +src/foo/MyQualifier.kt:29:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Short.bind(): Number = this@bind + ---------------------------------------------- + + +src/foo/MyQualifier.kt:30:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Byte.bind(): Number = this@bind + --------------------------------------------- + + +src/foo/MyQualifier.kt:31:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun Char.bind(): Comparable<Char> = this@bind + ------------------------------------------------------- + + +src/foo/MyQualifier.kt:32:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun String.bind(): Comparable<String> = this@bind + ----------------------------------------------------------- + + +src/foo/MyQualifier.kt:33:Error: @Provides functions cannot be abstract +[ProvidesMustNotBeAbstract] + + @Provides fun @receiver:MyQualifier Boolean.bind(): Comparable<Boolean> = this@bind + ----------------------------------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Provides +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +interface MyModule { + @Binds fun Int.bind(): Number + @Binds fun Long.bind(): Number + @Binds fun Double.bind(): Number + @Binds fun Float.bind(): Number + @Binds fun Short.bind(): Number + @Binds fun Byte.bind(): Number + @Binds fun Char.bind(): Comparable + @Binds fun String.bind(): Comparable + @Binds fun @receiver:MyQualifier Boolean.bind(): Comparable +} + +@Module +interface MyModule2 { + @Provides fun Int.bind(): Number = this@bind + @Provides fun Long.bind(): Number = this@bind + @Provides fun Double.bind(): Number = this@bind + @Provides fun Float.bind(): Number = this@bind + @Provides fun Short.bind(): Number = this@bind + @Provides fun Byte.bind(): Number = this@bind + @Provides fun Char.bind(): Comparable = this@bind + @Provides fun String.bind(): Comparable = this@bind + @Provides fun @receiver:MyQualifier Boolean.bind(): Comparable = this@bind +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.bindings cannot be extension functions`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProvidesMustNotBeAbstract") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProvidesMustNotBeAbstract") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProvidesMustNotBeAbstract + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProvidesMustNotBeAbstract" severity="ignore" /> + </lint> + ``` + 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 'ProvidesMustNotBeAbstract' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProvidesMustNotBeAbstract ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/PublicKeyCredential.md.html b/docs/checks/PublicKeyCredential.md.html new file mode 100644 index 00000000..141e793b --- /dev/null +++ b/docs/checks/PublicKeyCredential.md.html @@ -0,0 +1,146 @@ + +(#) Creating public key credential + +!!! WARNING: Creating public key credential + This is a warning. + +Id +: `PublicKeyCredential` +Summary +: Creating public key credential +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/PublicKeyCredentialDetector.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/PublicKeyCredentialDetectorTest.kt) +Copyright Year +: 2023 + +Credential Manager API supports creating public key credential +(Passkeys) starting Android 9 or higher. Please check for the Android +version before calling the method. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/main/kotlin/test/pkg/Test.kt:7:Warning: PublicKeyCredential is only +supported from Android 9 (API level 28) and higher +[PublicKeyCredential] + + val request = CreatePublicKeyCredentialRequest() + ---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +dependencies { + implementation 'androidx.credentials:credentials-play-services-auth:+' +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/main/kotlin/test/pkg/Test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import androidx.credentials.CreatePublicKeyCredentialRequest + +class Test { + fun test() { + val request = CreatePublicKeyCredentialRequest() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/CreatePublicKeyCredentialRequest.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package androidx.credentials + +class CreatePublicKeyCredentialRequest +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/PublicKeyCredentialDetectorTest.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 PublicKeyCredential + problematicStatement() + ``` + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("PublicKeyCredential") + fun method() { + CreatePublicKeyCredentialRequest(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("PublicKeyCredential") + void method() { + new CreatePublicKeyCredentialRequest(...); + } + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="PublicKeyCredential" severity="ignore" /> + </lint> + ``` + 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 'PublicKeyCredential' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore PublicKeyCredential ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/Range.md.html b/docs/checks/Range.md.html index 6eeda1c2..74eff689 100644 --- a/docs/checks/Range.md.html +++ b/docs/checks/Range.md.html @@ -29,7 +29,7 @@ Copyright Year : 2017 -Some parameters are required to in a particular numerical range; this +Some parameters are required to be in a particular numerical range; this check makes sure that arguments passed fall within the range. For arrays, Strings and collections this refers to the size or length. diff --git a/docs/checks/RawColor.md.html b/docs/checks/RawColor.md.html index dfb07f69..bca2a665 100644 --- a/docs/checks/RawColor.md.html +++ b/docs/checks/RawColor.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,44 +29,12 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/RawColorDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawColorDetectorTest.kt) Color value should all be defined as color resources. This has the benefit that you can easily see all of your colors in one file. One benefit is an easier addition to Dark Theme for instance. This check will run on layouts as well as xml drawables. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/layout.xml:2:Warning: Should be using a color resource -instead. [RawColor] - - app:someCustomColor="#fff"/> - ---- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/layout.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView xmlns:app="http://schemas.android.com/apk/res-auto" - app:someCustomColor="#fff"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawColorDetectorTest.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, `RawColorDetector.appCustomColor`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -76,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -94,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/RawDimen.md.html b/docs/checks/RawDimen.md.html index 3ae84813..2689265d 100644 --- a/docs/checks/RawDimen.md.html +++ b/docs/checks/RawDimen.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,10 +29,6 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/RawDimenDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawDimenDetectorTest.kt) Dimensions should all be defined as dimension resources. This has the benefit that you can easily see all of your dimensions in one file. One @@ -40,33 +36,6 @@ you only have to adjust it in one place. This check will run on layouts as well as xml drawables. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:1:Warning: Should be using a dimension resource -instead. [RawDimen] - -<TextView xmlns:app="http://schemas.android.com/apk/res-auto" app:someCustomAttribute="16dp"/> - ---- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView xmlns:app="http://schemas.android.com/apk/res-auto" app:someCustomAttribute="16dp"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/RawDimenDetectorTest.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, `RawDimenDetector.appCustom`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -76,17 +45,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -94,7 +63,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/RawDispatchersUse.md.html b/docs/checks/RawDispatchersUse.md.html index eedf9add..12563b99 100644 --- a/docs/checks/RawDispatchersUse.md.html +++ b/docs/checks/RawDispatchersUse.md.html @@ -138,17 +138,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -156,7 +156,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RedactedInJavaUsage.md.html b/docs/checks/RedactedInJavaUsage.md.html index fe33acd1..9a3693d1 100644 --- a/docs/checks/RedactedInJavaUsage.md.html +++ b/docs/checks/RedactedInJavaUsage.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RedundantBinds.md.html b/docs/checks/RedundantBinds.md.html new file mode 100644 index 00000000..d142cf28 --- /dev/null +++ b/docs/checks/RedundantBinds.md.html @@ -0,0 +1,190 @@ + +(#) @Binds functions should return a different type (including annotations) than the input type. + +!!! ERROR: @Binds functions should return a different type (including annotations) than the input type. + This is an error. + +Id +: `RedundantBinds` +Summary +: @Binds functions should return a different type (including annotations) than the input type. +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerIssuesDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.kt) +Copyright Year +: 2021 + +@Binds functions should return a different type (including annotations) +than the input type. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/MyQualifier.kt:13:Error: @Binds functions should return a +different type [RedundantBinds] + + @Binds fun invalidBind(real: Long): Long + ---------------------------------------- + + +src/foo/MyQualifier.kt:14:Error: @Binds functions should return a +different type [RedundantBinds] + + @Binds fun invalidBind(real: Long): Long + ---------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/MyQualifier.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo +import javax.inject.Qualifier +import dagger.Binds +import dagger.Module + +@Qualifier +annotation class MyQualifier + +@Module +interface MyModule { + @MyQualifier @Binds fun validBind(real: Boolean): Boolean + @Binds fun validBind(@MyQualifier real: Boolean): Boolean + @Binds fun invalidBind(real: Long): Long + @Binds fun invalidBind(real: Long): Long +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerIssuesDetectorTest.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, `DaggerIssuesDetector.redundant types`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/slack-lints. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.0" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RedundantBinds") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RedundantBinds") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RedundantBinds + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RedundantBinds" severity="ignore" /> + </lint> + ``` + 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 'RedundantBinds' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RedundantBinds ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RememberReturnType.md.html b/docs/checks/RememberReturnType.md.html index eb8b5e44..7d08d8cd 100644 --- a/docs/checks/RememberReturnType.md.html +++ b/docs/checks/RememberReturnType.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -302,28 +302,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RememberSaveableSaverParameter.md.html b/docs/checks/RememberSaveableSaverParameter.md.html index 49647938..947d44c9 100644 --- a/docs/checks/RememberSaveableSaverParameter.md.html +++ b/docs/checks/RememberSaveableSaverParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html) +: [androidx.compose.runtime:runtime-saveable-android](androidx_compose_runtime_runtime-saveable-android.md.html) Affects : Kotlin and Java files and test sources @@ -152,28 +152,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-saveable:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime-saveable:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime-saveable) +implementation(libs.runtime-saveable-android) # libs.versions.toml [versions] -runtime-saveable = "1.5.0-beta02" +runtime-saveable-android = "1.7.0-alpha01" [libraries] -runtime-saveable = { - module = "androidx.compose.runtime:runtime-saveable", - version.ref = "runtime-saveable" +runtime-saveable-android = { + module = "androidx.compose.runtime:runtime-saveable-android", + version.ref = "runtime-saveable-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html). +[Additional details about androidx.compose.runtime:runtime-saveable-android](androidx_compose_runtime_runtime-saveable-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RemoteViewLayout.md.html b/docs/checks/RemoteViewLayout.md.html index 9cf1a0fc..aaf3ada0 100644 --- a/docs/checks/RemoteViewLayout.md.html +++ b/docs/checks/RemoteViewLayout.md.html @@ -45,7 +45,7 @@ --------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Here is the source file referenced above: +Here are the relevant source files: `src/test/pkg/test.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers @@ -57,15 +57,45 @@ } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +`res/layout/test.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<merge> + <Button /> + <AdapterViewFlipper /> + <FrameLayout /> + <GridLayout /> + <GridView /> + <LinearLayout /> + <ListView /> + <RelativeLayout /> + <StackView /> + <ViewFlipper /> + <AnalogClock /> + <Button /> + <Chronometer /> + <ImageButton /> + <ImageView /> + <ProgressBar /> + <TextClock /> + <TextView /> + <DatePicker /> + <CheckBox /> + <Switch /> + <RadioButton /> + <RadioGroup /> + <androidx.appcompat.widget.AppCompatTextView /> +</merge> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`test.pkg`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ linenumbers +@layout/test +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + 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/RemoteViewDetectorTest.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, `RemoteViewDetector.testBasic`. -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: diff --git a/docs/checks/RemoveWorkManagerInitializer.md.html b/docs/checks/RemoveWorkManagerInitializer.md.html index ea60d82c..b9b2dfdc 100644 --- a/docs/checks/RemoveWorkManagerInitializer.md.html +++ b/docs/checks/RemoveWorkManagerInitializer.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -104,7 +104,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/RepeatOnLifecycleWrongUsage.md.html b/docs/checks/RepeatOnLifecycleWrongUsage.md.html index 94177390..3369897d 100644 --- a/docs/checks/RepeatOnLifecycleWrongUsage.md.html +++ b/docs/checks/RepeatOnLifecycleWrongUsage.md.html @@ -50,17 +50,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-runtime-ktx) # libs.versions.toml [versions] -lifecycle-runtime-ktx = "2.6.1" +lifecycle-runtime-ktx = "2.8.0-alpha01" [libraries] lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", @@ -68,7 +68,7 @@ } ``` -2.6.1 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). diff --git a/docs/checks/ReportShortcutUsage.md.html b/docs/checks/ReportShortcutUsage.md.html index 40725e89..259b9a7d 100644 --- a/docs/checks/ReportShortcutUsage.md.html +++ b/docs/checks/ReportShortcutUsage.md.html @@ -45,7 +45,7 @@ shortcut usage and allow launchers to adjust which shortcuts appear based on activation history. Please see https://developer.android.com/develop/ui/views/launch/shortcuts/managing-shortcuts#track-usage - [ReportShortcutUsage] +[ReportShortcutUsage] ShortcutManagerCompat.setDynamicShortcuts(context, shortcuts); ------------------------------------------------------------- diff --git a/docs/checks/ResourcesGetColorCall.md.html b/docs/checks/ResourcesGetColorCall.md.html index a4014efa..2428c0af 100644 --- a/docs/checks/ResourcesGetColorCall.md.html +++ b/docs/checks/ResourcesGetColorCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) Instead of getColor(), ContextCompat or the method with the Theme Overload should be used instead. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:6:Warning: Calling deprecated getColor -[ResourcesGetColorCall] - - resources.getColor(0); - -------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; -import android.content.res.Resources; -class Example { - public void foo() { - Resources resources = null; - resources.getColor(0); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetColor`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/ResourcesGetColorStateListCall.md.html b/docs/checks/ResourcesGetColorStateListCall.md.html index db8cecb7..64c5ce3c 100644 --- a/docs/checks/ResourcesGetColorStateListCall.md.html +++ b/docs/checks/ResourcesGetColorStateListCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) Instead of getColorStateList(), ContextCompat or the method with the Theme Overload should be used instead. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:6:Warning: Calling deprecated getColorStateList -[ResourcesGetColorStateListCall] - - resources.getColorStateList(0); - ----------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; -import android.content.res.Resources; -class Example { - public void foo() { - Resources resources = null; - resources.getColorStateList(0); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetColorStateList`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/ResourcesGetDrawableCall.md.html b/docs/checks/ResourcesGetDrawableCall.md.html index aa8561e2..a9c822d7 100644 --- a/docs/checks/ResourcesGetDrawableCall.md.html +++ b/docs/checks/ResourcesGetDrawableCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AndroidDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.kt) Instead of getDrawable(), ContextCompat or the method with the Theme Overload should be used instead. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:6:Warning: Calling deprecated getDrawable -[ResourcesGetDrawableCall] - - resources.getDrawable(0); - ----------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; -import android.content.res.Resources; -class Example { - public void foo() { - Resources resources = null; - resources.getDrawable(0); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AndroidDetectorTest.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, `AndroidDetector.callingGetDrawable`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/RestrictCallsTo.md.html b/docs/checks/RestrictCallsTo.md.html index ac5c11a2..f2ac8762 100644 --- a/docs/checks/RestrictCallsTo.md.html +++ b/docs/checks/RestrictCallsTo.md.html @@ -124,17 +124,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -142,7 +142,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RestrictedApi.md.html b/docs/checks/RestrictedApi.md.html index c9ebb954..75377934 100644 --- a/docs/checks/RestrictedApi.md.html +++ b/docs/checks/RestrictedApi.md.html @@ -98,11 +98,6 @@ [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/RestrictToDetectorTest.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, `RestrictToDetector.testRestrictToSubClass`. -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: diff --git a/docs/checks/RetrofitUsage.md.html b/docs/checks/RetrofitUsage.md.html index 32a74751..cd155d54 100644 --- a/docs/checks/RetrofitUsage.md.html +++ b/docs/checks/RetrofitUsage.md.html @@ -117,17 +117,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -135,7 +135,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ReturnFromAwaitPointerEventScope.md.html b/docs/checks/ReturnFromAwaitPointerEventScope.md.html index 06e5fde1..93a17737 100644 --- a/docs/checks/ReturnFromAwaitPointerEventScope.md.html +++ b/docs/checks/ReturnFromAwaitPointerEventScope.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -52,28 +52,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RiskyLibrary.md.html b/docs/checks/RiskyLibrary.md.html index e273bc4c..29c9cb36 100644 --- a/docs/checks/RiskyLibrary.md.html +++ b/docs/checks/RiskyLibrary.md.html @@ -23,7 +23,7 @@ Editing : This check runs on the fly in the IDE editor See -: https://play.google.com/sdks +: https://developer.android.com/distribute/sdk-index See : https://goo.gle/RiskyLibrary Implementation @@ -76,7 +76,17 @@ compile 'com.example.ads.third.party:example:8.0.0' // OK compile 'com.example.ads.third.party:example:7.2.2' // OK compile 'com.example.ads.third.party:example:7.2.1' // OK - compile 'com.example.ads.third.party:example:7.2.0' // Outdated & Non compliant & Critical + compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity + compile 'com.example.ads.third.party:example:7.1.0' // Policy (Ads), non-blocking + compile 'com.example.ads.third.party:example:7.1.1' // Policy (Device and Network Abuse), blocking + compile 'com.example.ads.third.party:example:7.1.2' // Policy (Deceptive Behavior), no severity + compile 'com.example.ads.third.party:example:7.1.3' // Policy (User Data), non-blocking + compile 'com.example.ads.third.party:example:7.1.4' // Policy (Permissions), blocking + compile 'com.example.ads.third.party:example:7.1.5' // Policy (Mobile Unwanted Software), no-severity + compile 'com.example.ads.third.party:example:7.1.6' // Policy (Malware), non-blocking + compile 'com.example.ads.third.party:example:7.1.7' // Policy (multiple types), non-blocking + compile 'com.example.ads.third.party:example:7.1.8' // Policy (multiple types), blocking + compile 'com.example.ads.third.party:example:7.1.9' // Policy (multiple types), no severity compile 'log4j:log4j:latest.release' // OK compile 'log4j:log4j' // OK diff --git a/docs/checks/RxJava2DefaultScheduler.md.html b/docs/checks/RxJava2DefaultScheduler.md.html index 2f63456d..a4e6131d 100644 --- a/docs/checks/RxJava2DefaultScheduler.md.html +++ b/docs/checks/RxJava2DefaultScheduler.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,51 +29,11 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetectorTest.kt) Calling this method will rely on a default scheduler. This is not necessary the best default. Being explicit and taking the overload for passing one is preferred. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:8:Warning: interval() is using its default -scheduler [RxJava2DefaultScheduler] - - Observable.interval(5, TimeUnit.SECONDS); - -------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import java.util.concurrent.TimeUnit; -import io.reactivex.Observable; - -class Example { - public void foo() { - Observable.interval(5, TimeUnit.SECONDS); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DefaultSchedulerDetectorTest.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, `RxJava2DefaultSchedulerDetector.schedulerSupportComputation`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -83,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -101,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2DisposableAddAllCall.md.html b/docs/checks/RxJava2DisposableAddAllCall.md.html index 75ed0b79..99360ec4 100644 --- a/docs/checks/RxJava2DisposableAddAllCall.md.html +++ b/docs/checks/RxJava2DisposableAddAllCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,48 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetectorTest.kt) Instead of using addAll(), add() should be used separately for each Disposable. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:6:Warning: Calling addAll instead of add separately -[RxJava2DisposableAddAllCall] - - cd.addAll(); - ------ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; -import io.reactivex.disposables.CompositeDisposable; -class Example { - public void foo() { - CompositeDisposable cd = null; - cd.addAll(); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableAddAllCallDetectorTest.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, `RxJava2DisposableAddAllCallDetector.callingCompositeDisposableAddAll`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -98,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2DisposableDisposeCall.md.html b/docs/checks/RxJava2DisposableDisposeCall.md.html index 5d267ac1..3471f986 100644 --- a/docs/checks/RxJava2DisposableDisposeCall.md.html +++ b/docs/checks/RxJava2DisposableDisposeCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,54 +29,11 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetectorTest.kt) Instead of using dispose(), clear() should be used. Calling clear will result in a CompositeDisposable that can be used further to add more Disposables. When using dispose() this is not the case. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:8:Warning: Calling dispose instead of clear -[RxJava2DisposableDisposeCall] - - cd.dispose(); - ------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import io.reactivex.disposables.CompositeDisposable; - -class Example { - public void foo() { - CompositeDisposable cd = null; - cd.dispose(); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2DisposableDisposeCallDetectorTest.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, `RxJava2DisposableDisposeCallDetector.callingCompositeDisposableDispose`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -86,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -104,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html b/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html index 17a59842..eab05ebd 100644 --- a/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html +++ b/docs/checks/RxJava2MethodMissingCheckReturnValue.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,10 +29,6 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetectorTest.kt) Methods returning RxJava Reactive Types should be annotated with the @CheckReturnValue annotation. Static analyze tools such as Lint or @@ -40,163 +36,6 @@ This is usually an indication of a bug. If this is done on purpose (e.g. fire & forget) it should be stated explicitly. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:15:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - private Observable<Object> observable() { - ---------- - - -src/foo/Example.java:19:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - protected Flowable<Object> flowable() { - -------- - - -src/foo/Example.java:23:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - protected Single<Object> single() { - ------ - - -src/foo/Example.java:27:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - protected Maybe<Object> single() { - ------ - - -src/foo/Example.java:31:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public Completable completable() { - ----------- - - -src/foo/Example.java:35:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public Disposable disposable() { - ---------- - - -src/foo/Example.java:39:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public CompositeDisposable compositeDisposable() { - ------------------- - - -src/foo/Example.java:43:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public TestObserver testObserver() { - ------------ - - -src/foo/Example.java:47:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public TestSubscriber testSubscriber() { - -------------- - - -src/foo/Example.java:51:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - public Scheduler scheduler() { - --------- - - -src/foo/Example.java:55:Warning: Method should have @CheckReturnValue -annotation [RxJava2MethodMissingCheckReturnValue] - - private Observable<List<Object>> observableList() { - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import io.reactivex.Observable; -import io.reactivex.Flowable; -import io.reactivex.Single; -import io.reactivex.Maybe; -import io.reactivex.Completable; -import io.reactivex.disposables.Disposable; -import io.reactivex.disposables.CompositeDisposable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subscribers.TestSubscriber; -import io.reactivex.Scheduler; - -class Example { - private Observable observable() { - return null; - } - - protected Flowable flowable() { - return null; - } - - protected Single single() { - return null; - } - - protected Maybe single() { - return null; - } - - public Completable completable() { - return null; - } - - public Disposable disposable() { - return null; - } - - public CompositeDisposable compositeDisposable() { - return null; - } - - public TestObserver testObserver() { - return null; - } - - public TestSubscriber testSubscriber() { - return null; - } - - public Scheduler scheduler() { - return null; - } - - private Observable> observableList() { - return null; - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MethodMissingCheckReturnValueDetectorTest.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, `RxJava2MethodMissingCheckReturnValueDetector.methodMissingCheckReturnValue`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -206,17 +45,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -224,7 +63,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2MissingCompositeDisposableClear.md.html b/docs/checks/RxJava2MissingCompositeDisposableClear.md.html index 675da259..92377d0c 100644 --- a/docs/checks/RxJava2MissingCompositeDisposableClear.md.html +++ b/docs/checks/RxJava2MissingCompositeDisposableClear.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,49 +29,12 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetectorTest.kt) A class is using CompositeDisposable and not calling clear(). This can leave operations running and even cause memory leaks. It's best to always call clear() once you're done. e.g. in onDestroy() for Activitys. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:6:Error: clear() is not called -[RxJava2MissingCompositeDisposableClear] - - CompositeDisposable cd; - ----------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import io.reactivex.disposables.CompositeDisposable; - -class Example { - CompositeDisposable cd; -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2MissingCompositeDisposableClearDetectorTest.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, `RxJava2MissingCompositeDisposableClearDetector.compositeDisposableMissingClear`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -99,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2SchedulersFactoryCall.md.html b/docs/checks/RxJava2SchedulersFactoryCall.md.html index 37d4ec67..0ea85f79 100644 --- a/docs/checks/RxJava2SchedulersFactoryCall.md.html +++ b/docs/checks/RxJava2SchedulersFactoryCall.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,53 +29,12 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetectorTest.kt) Injecting the Schedulers instead of accessing them via the factory methods has the benefit that unit testing is way easier. Instead of overriding them via the Plugin mechanism we can just pass a custom Scheduler. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:9:Warning: Inject this Scheduler instead of calling -it directly [RxJava2SchedulersFactoryCall] - - return Schedulers.io(); - -- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import io.reactivex.annotations.CheckReturnValue; -import io.reactivex.Scheduler; -import io.reactivex.schedulers.Schedulers; - -class Example { - @CheckReturnValue Scheduler provideSchedulerIo() { - return Schedulers.io(); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SchedulersFactoryCallDetectorTest.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, `RxJava2SchedulersFactoryCallDetector.ioCallInsideCheckReturnValueMethod`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -85,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -103,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/RxJava2SubscribeMissingOnError.md.html b/docs/checks/RxJava2SubscribeMissingOnError.md.html index 3b7d1080..a5938d02 100644 --- a/docs/checks/RxJava2SubscribeMissingOnError.md.html +++ b/docs/checks/RxJava2SubscribeMissingOnError.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) @@ -29,51 +29,11 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/main/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetectorTest.kt) When calling the subscribe() method an error Consumer should always be used. Otherwise errors might be thrown and may crash the application or get forwarded to the Plugin Error handler. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:8:Error: Using a version of subscribe() without an -error Consumer [RxJava2SubscribeMissingOnError] - - o.subscribe(); - --------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import io.reactivex.Observable; - -class Example { - public void foo() { - Observable o = null; - o.subscribe(); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-rxjava2-lint/src/test/java/com/vanniktech/lintrules/rxjava2/RxJava2SubscribeMissingOnErrorDetectorTest.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, `RxJava2SubscribeMissingOnErrorDetector.callingObservableSubscribe`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -83,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -101,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html). diff --git a/docs/checks/ScrollViewSize.md.html b/docs/checks/ScrollViewSize.md.html index 5fac6071..1ff0919a 100644 --- a/docs/checks/ScrollViewSize.md.html +++ b/docs/checks/ScrollViewSize.md.html @@ -23,7 +23,7 @@ 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/ScrollViewChildDetector.java) +: [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/ScrollViewChildDetector.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/ScrollViewChildDetectorTest.kt) Copyright Year @@ -68,11 +68,6 @@ [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/ScrollViewChildDetectorTest.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, `ScrollViewChildDetector.testScrollView`. -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: diff --git a/docs/checks/SecretInSource.md.html b/docs/checks/SecretInSource.md.html new file mode 100644 index 00000000..c8e1b2b3 --- /dev/null +++ b/docs/checks/SecretInSource.md.html @@ -0,0 +1,143 @@ + +(#) Secret in source code + +!!! WARNING: Secret in source code + This is a warning. + +Id +: `SecretInSource` +Summary +: Secret in source code +Severity +: Warning +Category +: Security +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +See +: https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin +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/SecretDetector.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/SecretDetectorTest.kt) +Copyright Year +: 2023 + +Including secrets, such as API keys, in source code is a security risk. +It is generally best practice to not include API keys in source code, +and instead use something like the Secrets Gradle Plugin for Android. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/com/pkg/keydemo/test.kt:8:Warning: This argument looks like an API +key that has come from source code; API keys should not be included in +source code [SecretInSource] + + val model1 = GenerativeModel("name", KEY) + --- + + +src/com/pkg/keydemo/test.kt:9:Warning: This argument looks like an API +key that has come from source code; API keys should not be included in +source code [SecretInSource] + + val model2 = GenerativeModel("name", "AIzadGhpcyBpcyBhbm90aGVy_IHQ-akd==") + ---------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/com/pkg/keydemo/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package com.pkg.keydemo + +import com.google.ai.client.generativeai.GenerativeModel + +val KEY = "AIzadGhpcyBpcyBhbm90aGVy_IHQ-akd==" + +fun foo(extra: String) { + val model1 = GenerativeModel("name", KEY) + val model2 = GenerativeModel("name", "AIzadGhpcyBpcyBhbm90aGVy_IHQ-akd==") +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/SecretDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("SecretInSource") + fun method() { + GenerativeModel(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("SecretInSource") + void method() { + new GenerativeModel(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SecretInSource + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SecretInSource" severity="ignore" /> + </lint> + ``` + 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 'SecretInSource' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SecretInSource ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SelectedPhotoAccess.md.html b/docs/checks/SelectedPhotoAccess.md.html new file mode 100644 index 00000000..0f655e45 --- /dev/null +++ b/docs/checks/SelectedPhotoAccess.md.html @@ -0,0 +1,137 @@ + +(#) Behavior change when requesting photo library access + +!!! WARNING: Behavior change when requesting photo library access + This is a warning. + +Id +: `SelectedPhotoAccess` +Summary +: Behavior change when requesting photo library access +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Manifest files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/about/versions/14/changes/partial-photo-video-access +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/SelectedPhotoAccessDetector.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/SelectedPhotoAccessDetectorTest.kt) +Copyright Year +: 2022 + +Selected Photo Access is a new ability for users to share partial access +to their photo library when apps request access to their device storage +on Android 14+. + +Instead of letting the system manage the selection lifecycle, we +recommend you adapt your app to handle partial access to the photo +library. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:11:Warning: Your app is currently not handling +Selected Photos Access introduced in Android 14+ [SelectedPhotoAccess] + + <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:minSdkVersion="33" /> + ------------------------------------ + + +AndroidManifest.xml:13:Warning: Your app is currently not handling +Selected Photos Access introduced in Android 14+ [SelectedPhotoAccess] + + <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" android:minSdkVersion="33"/> + ----------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers + <manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + package="foo.bar" + android:versionCode="990000000" + android:versionName="9.1.0.0.0x"> + + <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="34" /> + + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/> + <!-- Media permissions introduced in Android 13 (T) --> + <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:minSdkVersion="33" /> + <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" android:minSdkVersion="33" /> + <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" android:minSdkVersion="33"/> + <uses-permission android:name="android.permission.CAMERA" /> + + <application + android:icon="@drawable/ic_launcher" + android:label="@string/app_name" + android:permission="android.permission.READ_CONTACTS"> + </application> + +</manifest> + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/SelectedPhotoAccessDetectorTest.kt) +for the unit tests for this check to see additional scenarios. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute + `tools:ignore="SelectedPhotoAccess"` 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SelectedPhotoAccess" severity="ignore" /> + </lint> + ``` + 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 'SelectedPhotoAccess' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SelectedPhotoAccess ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SerializableUsage.md.html b/docs/checks/SerializableUsage.md.html index b9a7a6b6..bf16ccd8 100644 --- a/docs/checks/SerializableUsage.md.html +++ b/docs/checks/SerializableUsage.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ShouldUseStaticImport.md.html b/docs/checks/ShouldUseStaticImport.md.html index 5e83f749..0e3afe23 100644 --- a/docs/checks/ShouldUseStaticImport.md.html +++ b/docs/checks/ShouldUseStaticImport.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetectorTest.kt) Certain declarations like TimeUnit.SECONDS should be statically imported to increase the readability. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:5:Warning: Should statically import SECONDS -[ShouldUseStaticImport] - - TimeUnit.SECONDS.toDays(1); - ------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; -import java.util.concurrent.TimeUnit; -class Example { - public void foo() { - TimeUnit.SECONDS.toDays(1); - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/ShouldUseStaticImportDetectorTest.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, `ShouldUseStaticImportDetector.timeUnitSeconds`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/SpanMarkPointMissingMask.md.html b/docs/checks/SpanMarkPointMissingMask.md.html index 4e8e99d2..066cf11d 100644 --- a/docs/checks/SpanMarkPointMissingMask.md.html +++ b/docs/checks/SpanMarkPointMissingMask.md.html @@ -92,17 +92,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -110,7 +110,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/SpecifyForegroundServiceType.md.html b/docs/checks/SpecifyForegroundServiceType.md.html index c09aabd1..24409e64 100644 --- a/docs/checks/SpecifyForegroundServiceType.md.html +++ b/docs/checks/SpecifyForegroundServiceType.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/SpecifyJobSchedulerIdRange.md.html b/docs/checks/SpecifyJobSchedulerIdRange.md.html index bc40b7db..6a155fff 100644 --- a/docs/checks/SpecifyJobSchedulerIdRange.md.html +++ b/docs/checks/SpecifyJobSchedulerIdRange.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -71,7 +71,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/SquareAndRoundTilePreviews.md.html b/docs/checks/SquareAndRoundTilePreviews.md.html index 3d8bb039..d887dd4a 100644 --- a/docs/checks/SquareAndRoundTilePreviews.md.html +++ b/docs/checks/SquareAndRoundTilePreviews.md.html @@ -22,6 +22,8 @@ : Binary resource files and manifest files Editing : This check can *not* run live in the IDE editor +See +: https://developer.android.com/design/ui/wear/guides/surfaces/tiles#tile-previews 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/TileProviderDetector.kt) Tests @@ -38,7 +40,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:7:Warning: Tiles need preview assets +AndroidManifest.xml:8:Warning: Tiles need preview assets [SquareAndRoundTilePreviews] <service @@ -51,6 +53,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.pkg"> + <uses-feature android:name="android.hardware.type.watch" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > diff --git a/docs/checks/StartActivityAndCollapseDeprecated.md.html b/docs/checks/StartActivityAndCollapseDeprecated.md.html new file mode 100644 index 00000000..9a865e82 --- /dev/null +++ b/docs/checks/StartActivityAndCollapseDeprecated.md.html @@ -0,0 +1,135 @@ + +(#) TileService.startActivityAndCollapse(Intent) is deprecated + +!!! ERROR: TileService.startActivityAndCollapse(Intent) is deprecated + This is an error. + +Id +: `StartActivityAndCollapseDeprecated` +Summary +: TileService.startActivityAndCollapse(Intent) is deprecated +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/TileServiceActivityDetector.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/TileServiceActivityDetectorTest.kt) +Copyright Year +: 2023 + +`TileService#startActivityAndCollapse(Intent)` has been deprecated, and +will throw an `UnsupportedOperationException` if used in apps targeting +Android versions UpsideDownCake and higher. Convert the Intent to a +PendingIntent. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:6:Error: TileService#startActivityAndCollapse(Intent) is +deprecated. Use TileService#startActivityAndCollapse(PendingIntent) +instead. [StartActivityAndCollapseDeprecated] + + tileService.startActivityAndCollapse(intent) // ERROR + ------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import android.app.PendingIntent +import android.content.Intent +import android.service.quicksettings.TileService + +fun callAMethod(tileService: TileService, intent: Intent) { + tileService.startActivityAndCollapse(intent) // ERROR +} + +fun callAMethod(tileService: TileService, intent: PendingIntent) { + tileService.startActivityAndCollapse(intent) // OK +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/TileServiceActivityDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("StartActivityAndCollapseDeprecated") + fun method() { + startActivityAndCollapse(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("StartActivityAndCollapseDeprecated") + void method() { + startActivityAndCollapse(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection StartActivityAndCollapseDeprecated + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="StartActivityAndCollapseDeprecated" severity="ignore" /> + </lint> + ``` + 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 'StartActivityAndCollapseDeprecated' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore StartActivityAndCollapseDeprecated ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/StateFlowValueCalledInComposition.md.html b/docs/checks/StateFlowValueCalledInComposition.md.html index 971bee79..172f404f 100644 --- a/docs/checks/StateFlowValueCalledInComposition.md.html +++ b/docs/checks/StateFlowValueCalledInComposition.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -136,28 +136,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/StringNotCapitalized.md.html b/docs/checks/StringNotCapitalized.md.html index 228400ea..feac8b5d 100644 --- a/docs/checks/StringNotCapitalized.md.html +++ b/docs/checks/StringNotCapitalized.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,45 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetectorTest.kt) Every string should be capitalized. If not, it is flagged. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/values/strings.xml:2:Warning: String is not capitalized -[StringNotCapitalized] - - <string name="my_string">my string</string> - ^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/values/strings.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<resources> - <string name="my_string">my string</string> -</resources> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/StringNotCapitalizedDetectorTest.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, `StringNotCapitalizedDetector.lowercase`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/SubscribeOnMain.md.html b/docs/checks/SubscribeOnMain.md.html index 5778f706..cdbea0b0 100644 --- a/docs/checks/SubscribeOnMain.md.html +++ b/docs/checks/SubscribeOnMain.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/SuperfluousMarginDeclaration.md.html b/docs/checks/SuperfluousMarginDeclaration.md.html index db075fec..3840293a 100644 --- a/docs/checks/SuperfluousMarginDeclaration.md.html +++ b/docs/checks/SuperfluousMarginDeclaration.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,49 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetectorTest.kt) Instead of using start-, end-, bottom- and top margins, layout_margin can be used. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:1:Warning: Should be using layout_margin instead. -[SuperfluousMarginDeclaration] - -<TextView -^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_marginTop="16dp" - android:layout_marginBottom="16dp" - android:layout_marginStart="16dp" - android:layout_marginEnd="16dp"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousMarginDeclarationDetectorTest.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, `SuperfluousMarginDeclarationDetector.androidMarginSame`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -99,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/SuperfluousNameSpace.md.html b/docs/checks/SuperfluousNameSpace.md.html index 694b47db..4507b37c 100644 --- a/docs/checks/SuperfluousNameSpace.md.html +++ b/docs/checks/SuperfluousNameSpace.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,47 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetectorTest.kt) Re-declaring a namespace is unnecessary and hence can be just removed. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/activity_home.xml:3:Warning: This name space is already -declared and hence not needed [SuperfluousNameSpace] - - xmlns:android="http://schemas.android.com/apk/res/android" - ---------------------------------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/activity_home.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> - <TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content"/> -</LinearLayout> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousNameSpaceDetectorTest.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, `SuperfluousNameSpaceDetector.androidNamespaceOnChild`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -79,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -97,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/SuperfluousPaddingDeclaration.md.html b/docs/checks/SuperfluousPaddingDeclaration.md.html index d73447e1..2cfa5d84 100644 --- a/docs/checks/SuperfluousPaddingDeclaration.md.html +++ b/docs/checks/SuperfluousPaddingDeclaration.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,49 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetectorTest.kt) Instead of using start-, end-, bottom- and top paddings, padding can be used. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:1:Warning: Should be using padding instead. -[SuperfluousPaddingDeclaration] - -<TextView -^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:paddingTop="16dp" - android:paddingBottom="16dp" - android:paddingStart="16dp" - android:paddingEnd="16dp"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/SuperfluousPaddingDeclarationDetectorTest.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, `SuperfluousPaddingDeclarationDetector.androidPaddingSame`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -99,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/SuspiciousCompositionLocalModifierRead.md.html b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html index 176edcdb..3411e0fc 100644 --- a/docs/checks/SuspiciousCompositionLocalModifierRead.md.html +++ b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -120,28 +120,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/TestLifecycleOwnerInCoroutine.md.html b/docs/checks/TestLifecycleOwnerInCoroutine.md.html new file mode 100644 index 00000000..82cc641a --- /dev/null +++ b/docs/checks/TestLifecycleOwnerInCoroutine.md.html @@ -0,0 +1,141 @@ + +(#) Use the suspending function setCurrentState(), rather than directly accessing the currentState property. + +!!! ERROR: Use the suspending function setCurrentState(), rather than directly accessing the currentState property. + This is an error. + +Id +: `TestLifecycleOwnerInCoroutine` +Summary +: Use the suspending function setCurrentState(), rather than directly accessing the currentState property. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-runtime-testing](androidx_lifecycle_lifecycle-runtime-testing.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-testing-lint/src/main/java/androidx/lifecycle/testing/lint/TestLifecycleOwnerInCoroutineDetector.kt) +Copyright Year +: 2021 + +When using TestLifecycleOwner, one of the main use cases is to change + the currentState property. Under the hood, we do this using +runBlocking to keep it thread-safe. However, when using +TestLifecycleOwner from the context of a coroutine (like +runTest), this will cause the setter to hang, since coroutines + should remain asynchronous. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-testing) + +# libs.versions.toml +[versions] +lifecycle-runtime-testing = "2.8.0-alpha01" +[libraries] +lifecycle-runtime-testing = { + module = "androidx.lifecycle:lifecycle-runtime-testing", + version.ref = "lifecycle-runtime-testing" +} +``` + +2.8.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-runtime-testing](androidx_lifecycle_lifecycle-runtime-testing.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("TestLifecycleOwnerInCoroutine") + fun method() { + runTest(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("TestLifecycleOwnerInCoroutine") + void method() { + runTest(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection TestLifecycleOwnerInCoroutine + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TestLifecycleOwnerInCoroutine" severity="ignore" /> + </lint> + ``` + 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 'TestLifecycleOwnerInCoroutine' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TestLifecycleOwnerInCoroutine ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TestManifestGradleConfiguration.md.html b/docs/checks/TestManifestGradleConfiguration.md.html index 87059248..d1b87847 100644 --- a/docs/checks/TestManifestGradleConfiguration.md.html +++ b/docs/checks/TestManifestGradleConfiguration.md.html @@ -130,17 +130,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-test-manifest:1.5.0-beta02") +implementation("androidx.compose.ui:ui-test-manifest:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui-test-manifest:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.ui-test-manifest) # libs.versions.toml [versions] -ui-test-manifest = "1.5.0-beta02" +ui-test-manifest = "1.7.0-alpha01" [libraries] ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", @@ -148,7 +148,7 @@ } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html). diff --git a/docs/checks/TilePreviewImageFormat.md.html b/docs/checks/TilePreviewImageFormat.md.html new file mode 100644 index 00000000..7e526b97 --- /dev/null +++ b/docs/checks/TilePreviewImageFormat.md.html @@ -0,0 +1,131 @@ + +(#) Tile preview is not compliant with standards + +!!! ERROR: Tile preview is not compliant with standards + This is an error. + +Id +: `TilePreviewImageFormat` +Summary +: Tile preview is not compliant with standards +Severity +: Error +Category +: Usability: Icons +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Binary resource files and manifest files +Editing +: This check can *not* run live in the IDE editor +See +: https://developer.android.com/design/ui/wear/guides/surfaces/tiles#tile-previews +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/TileProviderDetector.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/TileProviderDetectorTest.kt) +Copyright Year +: 2021 + +Tile projects should specify preview resources with aspect ratio 1:1 and +at least 384px by 384px in size. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:13:Error: Tile previews should have 1:1 aspect ratio +[TilePreviewImageFormat] + + android:resource="@drawable/ic_walk" /> + ----------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="test.pkg"> + <uses-feature android:name="android.hardware.type.watch" /> + <application android:icon="@drawable/ic_launcher" + android:label="@string/app_name" > + </application> + <service android:name=".MyTileProvider" + android:permission="com.google.android.wearable.permission.BIND_TILE_PROVIDER"> + <intent-filter> + <action android:name="androidx.wear.tiles.action.BIND_TILE_PROVIDER" /> + </intent-filter> + <meta-data android:name="androidx.wear.tiles.PREVIEW" + android:resource="@drawable/ic_walk" /> + </service> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/TileProviderDetectorTest.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, `TileProviderDetector.testAspectRatioAndSize`. +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="TilePreviewImageFormat"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <service tools:ignore="TilePreviewImageFormat" .../> + ... + </manifest> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="TilePreviewImageFormat" severity="ignore" /> + </lint> + ``` + 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 'TilePreviewImageFormat' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore TilePreviewImageFormat ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/TileProviderPermissions.md.html b/docs/checks/TileProviderPermissions.md.html index ff1cf74b..b049ab49 100644 --- a/docs/checks/TileProviderPermissions.md.html +++ b/docs/checks/TileProviderPermissions.md.html @@ -40,7 +40,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:7:Warning: TileProvider does not specify +AndroidManifest.xml:8:Warning: TileProvider does not specify BIND_TILE_PROVIDER permission [TileProviderPermissions] <service @@ -53,6 +53,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.pkg"> + <uses-feature android:name="android.hardware.type.watch" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > diff --git a/docs/checks/Todo.md.html b/docs/checks/Todo.md.html index 6eccbf31..72878684 100644 --- a/docs/checks/Todo.md.html +++ b/docs/checks/Todo.md.html @@ -21,9 +21,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -31,43 +31,9 @@ : Gradle build files, Kotlin and Java files, manifest files, resource files and shrinking configuration files Editing : This check can *not* run live in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/TodoDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/TodoDetectorTest.kt) Marks todo in any given file since they should be resolved. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/Example.java:4:Error: Contains todo [Todo] - - // TODO something - ---- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/Example.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -class Example { - // TODO something -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/TodoDetectorTest.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, `TodoDetector.javaFile`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/TrulyRandom.md.html b/docs/checks/TrulyRandom.md.html index 8e50ab62..51344dd2 100644 --- a/docs/checks/TrulyRandom.md.html +++ b/docs/checks/TrulyRandom.md.html @@ -40,7 +40,7 @@ If your application relies on cryptographically secure random number generation you should apply the workaround described in https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html - . +. This lint rule is mostly informational; it does not accurately detect whether cryptographically secure RNG is required, or whether the @@ -54,7 +54,7 @@ src/test/pkg/PrngCalls.java:13:Warning: Potentially insecure random numbers on Android 4.3 and older. Read https://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html - for more info. [TrulyRandom] +for more info. [TrulyRandom] KeyGenerator generator = KeyGenerator.getInstance("AES", "BC"); ----------- diff --git a/docs/checks/TypographyQuotes.md.html b/docs/checks/TypographyQuotes.md.html index 1574bb8a..2316c42c 100644 --- a/docs/checks/TypographyQuotes.md.html +++ b/docs/checks/TypographyQuotes.md.html @@ -1,13 +1,13 @@ -(#) Straight quotes can be replaced with curvy quotes +(#) Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes. -!!! WARNING: Straight quotes can be replaced with curvy quotes +!!! WARNING: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes. This is a warning. Id : `TypographyQuotes` Summary -: Straight quotes can be replaced with curvy quotes +: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes. Note : **This issue is disabled by default**; use `--enable TypographyQuotes` Severity @@ -34,10 +34,10 @@ : 2011 Straight single quotes and double quotes, when used as a pair, can be -replaced by "curvy quotes" (or directional quotes). This can make the -text more readable. Note that you should never use grave accents and -apostrophes to quote, `like this'. (Also note that you should not use -curvy quotes for code fragments.) +replaced by "curvy quotes" (or directional quotes). Use the right single +quotation mark for apostrophes. Never use generic quotes ", ' or +free-standing accents `, ´ for quotation marks, apostrophes, or primes. +This can make the text more readable. !!! Tip This lint check has an associated quickfix available in the IDE. @@ -71,14 +71,14 @@ typographic apostrophe (’, ’) ? [TypographyQuotes] <string name="single">Android's</string> - --------- + - res/values/typography.xml:9:Warning: Replace apostrophe (') with typographic apostrophe (’, ’) ? [TypographyQuotes] <string name="badquotes1">`First'</string> - ------- + - res/values/typography.xml:10:Warning: Avoid quoting with grave accents; @@ -94,6 +94,20 @@ <string name="notbadquotes">Type Option-` then 'Escape'</string> --------------------------- + + +res/values/typography.xml:22:Warning: Replace apostrophe (') with +typographic apostrophe (’, ’) ? [TypographyQuotes] + + <string name="notdirectional">A's and B's</string> + ----------- + + +res/values/typography.xml:29:Warning: Replace apostrophe (') with +typographic apostrophe (’, ’) ? [TypographyQuotes] + + <string>something somthing d\'avoir something something l\'écran.</string> + --------------------------------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/UnnecessaryComposedModifier.md.html b/docs/checks/UnnecessaryComposedModifier.md.html index 05a0f1da..47170011 100644 --- a/docs/checks/UnnecessaryComposedModifier.md.html +++ b/docs/checks/UnnecessaryComposedModifier.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources @@ -122,28 +122,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-alpha01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnrememberedAnimatable.md.html b/docs/checks/UnrememberedAnimatable.md.html index 19333a83..64422dd6 100644 --- a/docs/checks/UnrememberedAnimatable.md.html +++ b/docs/checks/UnrememberedAnimatable.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) +: [androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html) Affects : Kotlin and Java files and test sources @@ -319,28 +319,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core:1.5.0-beta02") +implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.animation-core) +implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core = "1.5.0-beta02" +animation-core-android = "1.7.0-alpha01" [libraries] -animation-core = { - module = "androidx.compose.animation:animation-core", - version.ref = "animation-core" +animation-core-android = { + module = "androidx.compose.animation:animation-core-android", + version.ref = "animation-core-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html). +[Additional details about androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnrememberedGetBackStackEntry.md.html b/docs/checks/UnrememberedGetBackStackEntry.md.html index f7f5ceb6..c736e754 100644 --- a/docs/checks/UnrememberedGetBackStackEntry.md.html +++ b/docs/checks/UnrememberedGetBackStackEntry.md.html @@ -191,17 +191,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.7.0-beta01") +implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' +implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.7.0-beta01" +navigation-compose = "2.8.0-alpha01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -209,7 +209,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/UnrememberedMutableInteractionSource.md.html b/docs/checks/UnrememberedMutableInteractionSource.md.html new file mode 100644 index 00000000..3e3ea4d8 --- /dev/null +++ b/docs/checks/UnrememberedMutableInteractionSource.md.html @@ -0,0 +1,272 @@ + +(#) Creating a MutableInteractionSource during composition without using `remember` + +!!! ERROR: Creating a MutableInteractionSource during composition without using `remember` + This is an error. + +Id +: `UnrememberedMutableInteractionSource` +Summary +: Creating a MutableInteractionSource during composition without using `remember` +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.foundation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/UnrememberedMutableInteractionSourceDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/test/java/androidx/compose/foundation/lint/UnrememberedMutableInteractionSourceDetectorTest.kt) +Copyright Year +: 2023 + +MutableInteractionSource instances created during composition need to be +`remember`ed, otherwise they will be recreated during recomposition, and +lose their state. Either hoist the MutableInteractionSource to an object +that is not created during composition, or wrap the +MutableInteractionSource in a call to `remember`. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/{.kt:9:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:13:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:17:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:26:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:29:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:35:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:39:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ + + +src/test/{.kt:46:Error: Creating a MutableInteractionSource during +composition without using remember +[UnrememberedMutableInteractionSource] + + val interactionSource = MutableInteractionSource() + ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/{.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import androidx.compose.foundation.interaction.* +import androidx.compose.runtime.* + +@Composable +fun Test() { + val interactionSource = MutableInteractionSource() +} + +val lambda = @Composable { + val interactionSource = MutableInteractionSource() +} + +val lambda2: @Composable () -> Unit = { + val interactionSource = MutableInteractionSource() +} + +@Composable +fun LambdaParameter(content: @Composable () -> Unit) {} + +@Composable +fun Test2() { + LambdaParameter(content = { + val interactionSource = MutableInteractionSource() + }) + LambdaParameter { + val interactionSource = MutableInteractionSource() + } +} + +fun test3() { + val localLambda1 = @Composable { + val interactionSource = MutableInteractionSource() + } + + val localLambda2: @Composable () -> Unit = { + val interactionSource = MutableInteractionSource() + } +} + +@Composable +fun Test4() { + val localObject = object { + val interactionSource = MutableInteractionSource() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/test/java/androidx/compose/foundation/lint/UnrememberedMutableInteractionSourceDetectorTest.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, `UnrememberedMutableInteractionSourceDetector.notRemembered`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation-android) + +# libs.versions.toml +[versions] +foundation-android = "1.7.0-alpha01" +[libraries] +foundation-android = { + module = "androidx.compose.foundation:foundation-android", + version.ref = "foundation-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnrememberedMutableInteractionSource") + fun method() { + MutableInteractionSource(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnrememberedMutableInteractionSource") + void method() { + MutableInteractionSource(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnrememberedMutableInteractionSource + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnrememberedMutableInteractionSource" severity="ignore" /> + </lint> + ``` + 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 'UnrememberedMutableInteractionSource' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnrememberedMutableInteractionSource ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnrememberedMutableState.md.html b/docs/checks/UnrememberedMutableState.md.html index e8dd0fa2..dd5f3ccf 100644 --- a/docs/checks/UnrememberedMutableState.md.html +++ b/docs/checks/UnrememberedMutableState.md.html @@ -21,11 +21,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) +: [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) Affects : Kotlin and Java files and test sources @@ -364,28 +364,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.runtime) +implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime = "1.5.0-beta02" +runtime-android = "1.7.0-alpha01" [libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html). +[Additional details about androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnsafeLifecycleWhenUsage.md.html b/docs/checks/UnsafeLifecycleWhenUsage.md.html index 50ae7751..264c4029 100644 --- a/docs/checks/UnsafeLifecycleWhenUsage.md.html +++ b/docs/checks/UnsafeLifecycleWhenUsage.md.html @@ -59,17 +59,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-runtime-ktx) # libs.versions.toml [versions] -lifecycle-runtime-ktx = "2.6.1" +lifecycle-runtime-ktx = "2.8.0-alpha01" [libraries] lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", @@ -77,7 +77,7 @@ } ``` -2.6.1 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). diff --git a/docs/checks/UnsafeOptInUsageError.md.html b/docs/checks/UnsafeOptInUsageError.md.html index 7db9f117..f684525a 100644 --- a/docs/checks/UnsafeOptInUsageError.md.html +++ b/docs/checks/UnsafeOptInUsageError.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) @@ -70,17 +70,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") +implementation("androidx.annotation:annotation-experimental:1.4.0") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' +implementation 'androidx.annotation:annotation-experimental:1.4.0' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0-dev01" +annotation-experimental = "1.4.0" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -88,7 +88,7 @@ } ``` -1.4.0-dev01 is the version this documentation was generated from; +1.4.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/UnsafeOptInUsageWarning.md.html b/docs/checks/UnsafeOptInUsageWarning.md.html index c81ef2bf..ec71e816 100644 --- a/docs/checks/UnsafeOptInUsageWarning.md.html +++ b/docs/checks/UnsafeOptInUsageWarning.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) @@ -70,17 +70,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") +implementation("androidx.annotation:annotation-experimental:1.4.0") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' +implementation 'androidx.annotation:annotation-experimental:1.4.0' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0-dev01" +annotation-experimental = "1.4.0" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -88,7 +88,7 @@ } ``` -1.4.0-dev01 is the version this documentation was generated from; +1.4.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html index 9b6b748d..14dde395 100644 --- a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html +++ b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UnspecifiedImmutableFlag.md.html b/docs/checks/UnspecifiedImmutableFlag.md.html index f94151be..baff5645 100644 --- a/docs/checks/UnspecifiedImmutableFlag.md.html +++ b/docs/checks/UnspecifiedImmutableFlag.md.html @@ -41,7 +41,7 @@ `FLAG_IMMUTABLE` is available since target SDK 23, and is almost always the best choice. See https://developer.android.com/guide/components/intents-filters#CreateImmutablePendingIntents - for a list of common exceptions to this rule. +for a list of common exceptions to this rule. !!! Tip This lint check has an associated quickfix available in the IDE. diff --git a/docs/checks/UnsupportedLayoutAttribute.md.html b/docs/checks/UnsupportedLayoutAttribute.md.html index cfefda44..f8990923 100644 --- a/docs/checks/UnsupportedLayoutAttribute.md.html +++ b/docs/checks/UnsupportedLayoutAttribute.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,48 +29,12 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetectorTest.kt) Some layout attributes are not supported. Your app will still compile but it makes no sense to have them around. This can happen when refactoring a LinearLayout to a ScrollView. The orientation is no longer needed and can be removed. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/activity_home.xml:3:Error: orientation is not allowed in -RelativeLayout [UnsupportedLayoutAttribute] - - android:orientation="vertical"/> - ------------------------------ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/activity_home.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnsupportedLayoutAttributeDetectorTest.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, `UnsupportedLayoutAttributeDetector.orientationInRelativeLayout`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -80,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -98,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/UnusedBoxWithConstraintsScope.md.html b/docs/checks/UnusedBoxWithConstraintsScope.md.html new file mode 100644 index 00000000..a5b8d44a --- /dev/null +++ b/docs/checks/UnusedBoxWithConstraintsScope.md.html @@ -0,0 +1,201 @@ + +(#) BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope + +!!! ERROR: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope + This is an error. + +Id +: `UnusedBoxWithConstraintsScope` +Summary +: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.foundation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/BoxWithConstraintsDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/test/java/androidx/compose/foundation/lint/BoxWithConstraintsDetectorTest.kt) +Copyright Year +: 2023 + +The `content` lambda in BoxWithConstraints has a scope which will +include the incoming constraints. If this scope is ignored, then the +cost of subcomposition is being wasted and this BoxWithConstraints +should be replaced with a Box. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/test.kt:9:Error: BoxWithConstraints scope is not used +[UnusedBoxWithConstraintsScope] + + BoxWithConstraints { /**/ } + -------- + + +src/foo/test.kt:10:Error: BoxWithConstraints scope is not used +[UnusedBoxWithConstraintsScope] + + BoxWithConstraints { foo } + ------- + + +src/foo/test.kt:11:Error: BoxWithConstraints scope is not used +[UnusedBoxWithConstraintsScope] + + BoxWithConstraints(content = { /**/ }) + -------- + + +src/foo/test.kt:12:Error: BoxWithConstraints scope is not used +[UnusedBoxWithConstraintsScope] + + BoxWithConstraints(propagateMinConstraints = false, content = { /**/ }) + -------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import androidx.compose.foundation.layout.BoxWithConstraints +import androidx.compose.runtime.Composable + +@Composable +fun Test() { + val foo = 123 + BoxWithConstraints { /**/ } + BoxWithConstraints { foo } + BoxWithConstraints(content = { /**/ }) + BoxWithConstraints(propagateMinConstraints = false, content = { /**/ }) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/foundation/foundation-lint/src/test/java/androidx/compose/foundation/lint/BoxWithConstraintsDetectorTest.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, `BoxWithConstraintsDetector.unreferencedConstraints`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation-android) + +# libs.versions.toml +[versions] +foundation-android = "1.7.0-alpha01" +[libraries] +foundation-android = { + module = "androidx.compose.foundation:foundation-android", + version.ref = "foundation-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnusedBoxWithConstraintsScope") + fun method() { + BoxWithConstraints(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnusedBoxWithConstraintsScope") + void method() { + BoxWithConstraints(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnusedBoxWithConstraintsScope + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnusedBoxWithConstraintsScope" severity="ignore" /> + </lint> + ``` + 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 'UnusedBoxWithConstraintsScope' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnusedBoxWithConstraintsScope ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnusedContentLambdaTargetStateParameter.md.html b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html index c8d4ea3c..06216ed4 100644 --- a/docs/checks/UnusedContentLambdaTargetStateParameter.md.html +++ b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) +: [androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html) Affects : Kotlin and Java files and test sources @@ -179,28 +179,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation:1.5.0-beta02") +implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.animation:animation:1.5.0-beta02' +implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.animation) +implementation(libs.animation-android) # libs.versions.toml [versions] -animation = "1.5.0-beta02" +animation-android = "1.7.0-alpha01" [libraries] -animation = { - module = "androidx.compose.animation:animation", - version.ref = "animation" +animation-android = { + module = "androidx.compose.animation:animation-android", + version.ref = "animation-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.animation:animation](androidx_compose_animation_animation.md.html). +[Additional details about androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html index 930fcec6..713535e1 100644 --- a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html +++ b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) +: [androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html) Affects : Kotlin and Java files and test sources @@ -131,28 +131,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation:1.5.0-beta02") +implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.animation:animation:1.5.0-beta02' +implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.animation) +implementation(libs.animation-android) # libs.versions.toml [versions] -animation = "1.5.0-beta02" +animation-android = "1.7.0-alpha01" [libraries] -animation = { - module = "androidx.compose.animation:animation", - version.ref = "animation" +animation-android = { + module = "androidx.compose.animation:animation-android", + version.ref = "animation-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.animation:animation](androidx_compose_animation_animation.md.html). +[Additional details about androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html index 7860b961..991a6a37 100644 --- a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.material3:material3](androidx_compose_material3_material3.md.html) +: [androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html) Affects : Kotlin and Java files and test sources @@ -127,28 +127,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.material3:material3:1.2.0-alpha02") +implementation("androidx.compose.material3:material3-android:1.2.0-rc01") // build.gradle -implementation 'androidx.compose.material3:material3:1.2.0-alpha02' +implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' // build.gradle.kts with version catalogs: -implementation(libs.material3) +implementation(libs.material3-android) # libs.versions.toml [versions] -material3 = "1.2.0-alpha02" +material3-android = "1.2.0-rc01" [libraries] -material3 = { - module = "androidx.compose.material3:material3", - version.ref = "material3" +material3-android = { + module = "androidx.compose.material3:material3-android", + version.ref = "material3-android" } ``` -1.2.0-alpha02 is the version this documentation was generated from; +1.2.0-rc01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.material3:material3](androidx_compose_material3_material3.md.html). +[Additional details about androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html index ae6028b3..f8448097 100644 --- a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.material:material](androidx_compose_material_material.md.html) +: [androidx.compose.material:material-android](androidx_compose_material_material-android.md.html) Affects : Kotlin and Java files and test sources @@ -127,28 +127,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.material:material:1.5.0-beta02") +implementation("androidx.compose.material:material-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.material:material:1.5.0-beta02' +implementation 'androidx.compose.material:material-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.material) +implementation(libs.material-android) # libs.versions.toml [versions] -material = "1.5.0-beta02" +material-android = "1.7.0-alpha01" [libraries] -material = { - module = "androidx.compose.material:material", - version.ref = "material" +material-android = { + module = "androidx.compose.material:material-android", + version.ref = "material-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.material:material](androidx_compose_material_material.md.html). +[Additional details about androidx.compose.material:material-android](androidx_compose_material_material-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnusedMergeAttributes.md.html b/docs/checks/UnusedMergeAttributes.md.html index c5c56c87..cd61a81a 100644 --- a/docs/checks/UnusedMergeAttributes.md.html +++ b/docs/checks/UnusedMergeAttributes.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,49 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetectorTest.kt) Adding android, app and other attributes to won't be used by the system for custom views and hence can lead to errors. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/view_custom.xml:4:Warning: Attribute won't be used -[UnusedMergeAttributes] - - android:layout_marginTop="64dp" - ------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/view_custom.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<merge - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - android:layout_marginTop="64dp" - tools:parentTag="LinearLayout" - /> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/UnusedMergeAttributesDetectorTest.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, `UnusedMergeAttributesDetector.androidAttribute`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -99,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/UnusedTransitionTargetStateParameter.md.html b/docs/checks/UnusedTransitionTargetStateParameter.md.html index f4b66334..7d1b4a83 100644 --- a/docs/checks/UnusedTransitionTargetStateParameter.md.html +++ b/docs/checks/UnusedTransitionTargetStateParameter.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) +: [androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html) Affects : Kotlin and Java files and test sources @@ -134,28 +134,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core:1.5.0-beta02") +implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.animation-core) +implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core = "1.5.0-beta02" +animation-core-android = "1.7.0-alpha01" [libraries] -animation-core = { - module = "androidx.compose.animation:animation-core", - version.ref = "animation-core" +animation-core-android = { + module = "androidx.compose.animation:animation-core-android", + version.ref = "animation-core-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html). +[Additional details about androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseAndroidAlpha.md.html b/docs/checks/UseAndroidAlpha.md.html index f5926613..c2249a2e 100644 --- a/docs/checks/UseAndroidAlpha.md.html +++ b/docs/checks/UseAndroidAlpha.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -69,7 +69,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseAppTint.md.html b/docs/checks/UseAppTint.md.html index 33381987..7c6468aa 100644 --- a/docs/checks/UseAppTint.md.html +++ b/docs/checks/UseAppTint.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -69,7 +69,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatLoadingForColorStateLists.md.html b/docs/checks/UseCompatLoadingForColorStateLists.md.html index 8f36d9fa..64590f2e 100644 --- a/docs/checks/UseCompatLoadingForColorStateLists.md.html +++ b/docs/checks/UseCompatLoadingForColorStateLists.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatLoadingForDrawables.md.html b/docs/checks/UseCompatLoadingForDrawables.md.html index 1903b418..613287a1 100644 --- a/docs/checks/UseCompatLoadingForDrawables.md.html +++ b/docs/checks/UseCompatLoadingForDrawables.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatTextViewDrawableApis.md.html b/docs/checks/UseCompatTextViewDrawableApis.md.html index 75ebc490..00a68bf4 100644 --- a/docs/checks/UseCompatTextViewDrawableApis.md.html +++ b/docs/checks/UseCompatTextViewDrawableApis.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatTextViewDrawableXml.md.html b/docs/checks/UseCompatTextViewDrawableXml.md.html index af34b36e..e11d2453 100644 --- a/docs/checks/UseCompatTextViewDrawableXml.md.html +++ b/docs/checks/UseCompatTextViewDrawableXml.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -70,7 +70,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseGetLayoutInflater.md.html b/docs/checks/UseGetLayoutInflater.md.html index 3227d0b8..dccb1b9c 100644 --- a/docs/checks/UseGetLayoutInflater.md.html +++ b/docs/checks/UseGetLayoutInflater.md.html @@ -100,17 +100,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -118,7 +118,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UseOfNonLambdaOffsetOverload.md.html b/docs/checks/UseOfNonLambdaOffsetOverload.md.html index b8c1d245..27c41c60 100644 --- a/docs/checks/UseOfNonLambdaOffsetOverload.md.html +++ b/docs/checks/UseOfNonLambdaOffsetOverload.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) +: [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) Affects : Kotlin and Java files and test sources @@ -50,28 +50,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation:1.5.0-beta02") +implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' // build.gradle.kts with version catalogs: -implementation(libs.foundation) +implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation = "1.5.0-beta02" +foundation-android = "1.7.0-alpha01" [libraries] -foundation = { - module = "androidx.compose.foundation:foundation", - version.ref = "foundation" +foundation-android = { + module = "androidx.compose.foundation:foundation-android", + version.ref = "foundation-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html). +[Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UseRequireInsteadOfGet.md.html b/docs/checks/UseRequireInsteadOfGet.md.html index f23e2b35..eb1a544c 100644 --- a/docs/checks/UseRequireInsteadOfGet.md.html +++ b/docs/checks/UseRequireInsteadOfGet.md.html @@ -169,17 +169,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -187,7 +187,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UseRxSetProgress2.md.html b/docs/checks/UseRxSetProgress2.md.html index 45234c0d..e206cd67 100644 --- a/docs/checks/UseRxSetProgress2.md.html +++ b/docs/checks/UseRxSetProgress2.md.html @@ -54,17 +54,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -72,7 +72,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/UseSdkSuppress.md.html b/docs/checks/UseSdkSuppress.md.html new file mode 100644 index 00000000..c1162759 --- /dev/null +++ b/docs/checks/UseSdkSuppress.md.html @@ -0,0 +1,143 @@ + +(#) Using `@SdkSuppress` instead of `@RequiresApi` + +!!! ERROR: Using `@SdkSuppress` instead of `@RequiresApi` + This is an error. + +Id +: `UseSdkSuppress` +Summary +: Using `@SdkSuppress` instead of `@RequiresApi` +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and test sources +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/SdkSuppressDetector.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/SdkSuppressDetectorTest.kt) +Copyright Year +: 2022 + +In tests, you should be using `@SdkSuppress` instead of `@RequiresApi`. +The `@RequiresApi` annotation is used to propagate a version requirement +out to the caller of the API -- but the testing framework is only +looking for `@SdkSuppress`, which it uses to skip tests that are +intended for newer versions. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/java/test/pkg/UnitTestKotlin.kt:4:Error: Don't use @RequiresApi +from tests; use @SdkSuppress on UnitTestKotlin instead [UseSdkSuppress] + +@RequiresApi(29) // ERROR: don't use in tests, use @SdkSuppress instead +---------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`src/test/java/test/pkg/UnitTestKotlin.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import android.widget.GridLayout +import androidx.annotation.RequiresApi + +@RequiresApi(29) // ERROR: don't use in tests, use @SdkSuppress instead +class UnitTestKotlin { + private val field1 = GridLayout(null) // OK via @RequiresApiSuppress +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`build.gradle`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~groovy linenumbers +android { + lintOptions { + checkTestSources true + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/SdkSuppressDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UseSdkSuppress") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UseSdkSuppress") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UseSdkSuppress + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UseSdkSuppress" severity="ignore" /> + </lint> + ``` + 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 'UseSdkSuppress' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UseSdkSuppress ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UseSupportActionBar.md.html b/docs/checks/UseSupportActionBar.md.html index 9dcd71e7..c5291d1e 100644 --- a/docs/checks/UseSupportActionBar.md.html +++ b/docs/checks/UseSupportActionBar.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseSwitchCompatOrMaterialCode.md.html b/docs/checks/UseSwitchCompatOrMaterialCode.md.html index 6e28f6d4..6558578a 100644 --- a/docs/checks/UseSwitchCompatOrMaterialCode.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialCode.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseSwitchCompatOrMaterialXml.md.html b/docs/checks/UseSwitchCompatOrMaterialXml.md.html index b7105be0..554b6cf3 100644 --- a/docs/checks/UseSwitchCompatOrMaterialXml.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialXml.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UsingMaterialAndMaterial3Libraries.md.html b/docs/checks/UsingMaterialAndMaterial3Libraries.md.html new file mode 100644 index 00000000..615f49ca --- /dev/null +++ b/docs/checks/UsingMaterialAndMaterial3Libraries.md.html @@ -0,0 +1,178 @@ + +(#) material and material3 are separate, incompatible design system libraries + +!!! WARNING: material and material3 are separate, incompatible design system libraries + This is a warning. + +Id +: `UsingMaterialAndMaterial3Libraries` +Summary +: material and material3 are separate, incompatible design system libraries +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.material3 +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/material3/material3-lint/src/main/java/androidx/compose/material3/lint/MaterialImportDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/material3/material3-lint/src/test/java/androidx/compose/material3/lint/MaterialImportDetectorTest.kt) +Copyright Year +: 2023 + +material and material3 are separate design system libraries that are +incompatible with each other, as they have their own distinct theming +systems. Using components from both libraries concurrently can cause +issues: for example material components will not pick up the correct +content color from a material3 container, and vice versa. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/foo/test.kt:4:Warning: Using a material import while also using the +material3 library [UsingMaterialAndMaterial3Libraries] + + import androidx.compose.material.Button + -------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/foo/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package foo + +import androidx.compose.material.Button +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material3.Button +import androidx.compose.material.ripple.rememberRipple +import androidx.compose.material.icons.Icons +import androidx.compose.material.pullrefresh.pullRefresh + +fun test() {} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/material3/material3-lint/src/test/java/androidx/compose/material3/lint/MaterialImportDetectorTest.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, `MaterialImportDetector.material_imports`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=612128. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material3:material3-android:1.2.0-rc01") + +// build.gradle +implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.material3-android) + +# libs.versions.toml +[versions] +material3-android = "1.2.0-rc01" +[libraries] +material3-android = { + module = "androidx.compose.material3:material3-android", + version.ref = "material3-android" +} +``` + +1.2.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UsingMaterialAndMaterial3Libraries") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UsingMaterialAndMaterial3Libraries") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UsingMaterialAndMaterial3Libraries + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UsingMaterialAndMaterial3Libraries" severity="ignore" /> + </lint> + ``` + 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 'UsingMaterialAndMaterial3Libraries' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UsingMaterialAndMaterial3Libraries ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UsingOnClickInXml.md.html b/docs/checks/UsingOnClickInXml.md.html index 2a2f02c1..0c14f262 100644 --- a/docs/checks/UsingOnClickInXml.md.html +++ b/docs/checks/UsingOnClickInXml.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/VectorDrawableCompat.md.html b/docs/checks/VectorDrawableCompat.md.html index da23a9b6..40893ad5 100644 --- a/docs/checks/VectorDrawableCompat.md.html +++ b/docs/checks/VectorDrawableCompat.md.html @@ -39,6 +39,9 @@ `build.gradle` file, and second, use `app:srcCompat` instead of `android:src` to refer to vector drawables. +!!! Tip + This lint check has an associated quickfix available in the IDE. + (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/VisibleForTests.md.html b/docs/checks/VisibleForTests.md.html index 9f3d0f27..00cfd2e6 100644 --- a/docs/checks/VisibleForTests.md.html +++ b/docs/checks/VisibleForTests.md.html @@ -29,19 +29,32 @@ Copyright Year : 2017 -With the `@VisibleForTesting` annotation you can specify an `otherwise=` -attribute which specifies the intended visibility if the method had not -been made more widely visible for the tests. - This check looks for accesses from production code (e.g. not tests) where the access would not have been allowed with the intended production visibility. +Depending on your development environment, you may be able to use an +`@VisibleForTesting` annotation to specify the intended visibility if +the method had not been more widely visible for the tests. + +When using `androidx.annotations.VisibleForTesting`, the production +visibility is assumed to be private unless specified with the +`otherwise=` parameter. +`com.google.common.annotations.VisibleForTesting` and +`com.android.internal.annotations.VisibleForTesting` work similarly with +their own parameters called `productionVisibility` and `visibility`. + +If instead you use `org.jetbrains.annotations.VisibleForTesting`, there +is no such parameter, and the production visibility is instead assumed +to be "one step down" from the testing visibility. For example, if the +testing visibility is public, the production visibility is assumed to be +package-private. + (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/Code.kt:4:Warning: This method should only be accessed from tests or +src/Code.kt:3:Warning: This method should only be accessed from tests or within private scope [VisibleForTests] ProductionCode().initialize() // Not allowed; this method is intended to be private diff --git a/docs/checks/Wakelock.md.html b/docs/checks/Wakelock.md.html index affa48d6..d58d99f6 100644 --- a/docs/checks/Wakelock.md.html +++ b/docs/checks/Wakelock.md.html @@ -19,13 +19,13 @@ Feedback : https://issuetracker.google.com/issues/new?component=192708 Affects -: Class files +: Kotlin and Java 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/WakelockDetector.java) +: [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/WakelockDetector.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/WakelockDetectorTest.java) +: [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/WakelockDetectorTest.kt) Copyright Year : 2012 @@ -45,49 +45,76 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/WakelockActivity1.java:15:Warning: Found a wakelock -acquire() but no release() calls anywhere [Wakelock] +src/test/pkg/WakelockActivity3.java:13:Warning: The release() call is +not always reached (because of a possible exception in the path +acquire() → randomCall() → exit; use try/finally to ensure release is +always called) [Wakelock] - mWakeLock.acquire(); // Never released - ------- + lock.release(); // Should be in finally block + ------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: -`src/test/pkg/WakelockActivity1.java`: +`src/test/pkg/WakelockActivity3.java`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers package test.pkg; import android.app.Activity; -import android.os.Bundle; import android.os.PowerManager; -public class WakelockActivity1 extends Activity { - private PowerManager.WakeLock mWakeLock; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); +public class WakelockActivity3 extends Activity { + void wrongFlow() { PowerManager manager = (PowerManager) getSystemService(POWER_SERVICE); - mWakeLock = manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test"); - mWakeLock.acquire(); // Never released + PowerManager.WakeLock lock = + manager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Test"); + lock.acquire(); + randomCall(); + lock.release(); // Should be in finally block + } + + static void randomCall() { + System.out.println("test"); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/WakelockDetectorTest.java) +[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/WakelockDetectorTest.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, `WakelockDetector.test1`. -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: +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("Wakelock") + fun method() { + acquire(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("Wakelock") + void method() { + acquire(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection Wakelock + 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: diff --git a/docs/checks/WakelockTimeout.md.html b/docs/checks/WakelockTimeout.md.html index 41c1923a..92dd4a95 100644 --- a/docs/checks/WakelockTimeout.md.html +++ b/docs/checks/WakelockTimeout.md.html @@ -23,9 +23,9 @@ 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/WakelockDetector.java) +: [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/WakelockDetector.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/WakelockDetectorTest.java) +: [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/WakelockDetectorTest.kt) Copyright Year : 2012 @@ -80,7 +80,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/WakelockDetectorTest.java) +[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/WakelockDetectorTest.kt) for the unit tests for this check to see additional scenarios. The above example was automatically extracted from the first unit test diff --git a/docs/checks/WearBackNavigation.md.html b/docs/checks/WearBackNavigation.md.html index 10de2c0c..b446de78 100644 --- a/docs/checks/WearBackNavigation.md.html +++ b/docs/checks/WearBackNavigation.md.html @@ -21,7 +21,7 @@ Affects : Resource files Editing -: This check can *not* run live in the IDE editor +: This check runs on the fly in the IDE editor See : https://developer.android.com/training/wearables/views/exit#disabling-swipe-to-dismiss Implementation @@ -94,6 +94,20 @@ You can suppress false positives using one of the following mechanisms: +* Adding the suppression attribute `tools:ignore="WearBackNavigation"` + 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <item xmlns:tools="http://schemas.android.com/tools" + tools:ignore="WearBackNavigation" ...> + ... + </item> + ``` + * 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: diff --git a/docs/checks/WearMaterialTheme.md.html b/docs/checks/WearMaterialTheme.md.html new file mode 100644 index 00000000..6ffa7667 --- /dev/null +++ b/docs/checks/WearMaterialTheme.md.html @@ -0,0 +1,135 @@ + +(#) Using not non-Wear `MaterialTheme` in a Wear OS project + +!!! ERROR: Using not non-Wear `MaterialTheme` in a Wear OS project + This is an error. + +Id +: `WearMaterialTheme` +Summary +: Using not non-Wear `MaterialTheme` in a Wear OS project +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/WearMaterialThemeDetector.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/WearMaterialThemeDetectorTest.kt) +Copyright Year +: 2023 + +Wear projects should use `androidx.wear.compose.material.MaterialTheme` +instead of `androidx.compose.material.MaterialTheme` + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/BadImport.java:3:Error: Don't use +androidx.compose.material.MaterialTheme in a Wear OS project; use +androidx.wear.compose.material.MaterialTheme instead +[WearMaterialTheme] + +import androidx.compose.material.MaterialTheme; // ERROR +-------------------------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/BadImport.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +package test.pkg; + +import androidx.compose.material.MaterialTheme; // ERROR +import androidx.wear.compose.material.MaterialTheme; // OK + +public class BadImport { +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WearMaterialThemeDetectorTest.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, `WearMaterialThemeDetector.testJava`. +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: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WearMaterialTheme") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WearMaterialTheme") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WearMaterialTheme + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WearMaterialTheme" severity="ignore" /> + </lint> + ``` + 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 'WearMaterialTheme' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WearMaterialTheme ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WearRecents.md.html b/docs/checks/WearRecents.md.html new file mode 100644 index 00000000..3464d53e --- /dev/null +++ b/docs/checks/WearRecents.md.html @@ -0,0 +1,151 @@ + +(#) Wear OS: Recents and app resume + +!!! WARNING: Wear OS: Recents and app resume + This is a warning. + +Id +: `WearRecents` +Summary +: Wear OS: Recents and app resume +Severity +: Warning +Category +: Usability +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files and manifest files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/training/wearables/apps/launcher +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/WearRecentsDetector.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/WearRecentsDetectorTest.kt) +Copyright Year +: 2023 + +In recents, correctly represent your app's activities, consistent with +device implementation. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:8:Warning: Set taskAffinity for Wear activities to +make them appear correctly in recents [WearRecents] + + <activity android:name=".MainActivity" /> + ----------------------------------------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.example.helloworld" + android:versionCode="1" + android:versionName="1.0"> + <uses-sdk android:minSdkVersion="30" /> + <uses-feature android:name="android.hardware.type.watch" /> + <application android:icon="@drawable/icon" android:label="@string/app_name"> + <activity android:name=".MainActivity" /> + </application> +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WearRecentsDetectorTest.kt) +for the unit tests for this check to see additional scenarios. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WearRecents"` 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <activity tools:ignore="WearRecents" .../> + ... + </manifest> + ``` + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WearRecents") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WearRecents") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WearRecents + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WearRecents" severity="ignore" /> + </lint> + ``` + 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 'WearRecents' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WearRecents ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WearSplashScreen.md.html b/docs/checks/WearSplashScreen.md.html new file mode 100644 index 00000000..f7836585 --- /dev/null +++ b/docs/checks/WearSplashScreen.md.html @@ -0,0 +1,97 @@ + +(#) Wear: Use `SplashScreen` library + +!!! WARNING: Wear: Use `SplashScreen` library + This is a warning. + +Id +: `WearSplashScreen` +Summary +: Wear: Use `SplashScreen` library +Severity +: Warning +Category +: Usability +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Manifest files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/training/wearables/apps/splash-screen +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/WearSplashScreenDetector.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/WearSplashScreenDetectorTest.kt) +Copyright Year +: 2023 + +If your app implements a custom splash screen or uses a launcher theme, +migrate your app to the `SplashScreen` library, available in Jetpack, to +ensure it displays correctly on all Wear OS versions. Starting in +Android 12, the system always applies the new Android system default +splash screen on cold and warm starts for all apps. By default, this +system default splash screen is constructed using your app’s launcher +icon element and the `windowBackground` of your theme (if it's a single +color). If you do not migrate your app, your app launch experience on +Android 12 and higher will be either degraded or may have unintended +results. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Adding the suppression attribute `tools:ignore="WearSplashScreen"` + 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"`. + + ```xml + <?xml version="1.0" encoding="UTF-8"?> + <manifest xmlns:tools="http://schemas.android.com/tools"> + ... + <activity tools:ignore="WearSplashScreen" .../> + ... + </manifest> + ``` + +* 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WearSplashScreen" severity="ignore" /> + </lint> + ``` + 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 'WearSplashScreen' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WearSplashScreen ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WorkerHasAPublicModifier.md.html b/docs/checks/WorkerHasAPublicModifier.md.html index 7b3e66ef..1605745f 100644 --- a/docs/checks/WorkerHasAPublicModifier.md.html +++ b/docs/checks/WorkerHasAPublicModifier.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/WrongAnnotationOrder.md.html b/docs/checks/WrongAnnotationOrder.md.html index 37c3b1a3..ed49a0a2 100644 --- a/docs/checks/WrongAnnotationOrder.md.html +++ b/docs/checks/WrongAnnotationOrder.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,50 +29,10 @@ : Kotlin and Java files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/AnnotationOrderDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AnnotationOrderDetectorTest.kt) Annotations should always be applied with the same order to have consistency across the code base. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/MyTest.java:5:Warning: Annotations are in wrong order. Should be -@Override @Test [WrongAnnotationOrder] - - @Test @Override int something; - --------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/MyTest.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -public class MyTest { - void something() { - @Test @Override int something; - } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/AnnotationOrderDetectorTest.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, `AnnotationOrderDetector.overrideComesFirstOnVariables`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -82,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -100,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongCommentType.md.html b/docs/checks/WrongCommentType.md.html new file mode 100644 index 00000000..3cbf16c6 --- /dev/null +++ b/docs/checks/WrongCommentType.md.html @@ -0,0 +1,159 @@ + +(#) Wrong Comment Type + +!!! WARNING: Wrong Comment Type + This is a warning. + +Id +: `WrongCommentType` +Summary +: Wrong Comment Type +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/WrongCommentTypeDetector.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/WrongCommentTypeDetectorTest.kt) +Copyright Year +: 2023 + +This check flags any block comments which look like they had been +intended to be KDoc or javadoc comments instead. + +If you really want to use Javadoc-like constructs in a block comment, +there's a convention you can use: include `(non-Javadoc)` somewhere in +the comment, e.g. +``` + /* (non-Javadoc) + * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator) + */ + @Override + public void setDocumentLocator(Locator locator) { +``` +(see https://stackoverflow.com/questions/5172841/non-javadoc-meaning) + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/ParentClass.kt:2:Warning: This block comment looks like it was +intended to be a KDoc comment [WrongCommentType] + + * @see tags point to KDoc + ----------------------- + + +src/Test.java:2:Warning: This block comment looks like it was intended +to be a javadoc comment [WrongCommentType] + + /* @since 1.5 */ String text; + ---------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`src/ParentClass.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +/* Block comment + * @see tags point to KDoc + */ +open class ParentClass { + /** Ok, already KDoc */ + open fun someMethod(arg: Int) { } + /* Ok, no tags */ + open fun someMethod2(arg: Int) { } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/Test.java`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers +public class Test { + /* @since 1.5 */ String text; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/WrongCommentTypeDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("WrongCommentType") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("WrongCommentType") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection WrongCommentType + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="WrongCommentType" severity="ignore" /> + </lint> + ``` + 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 'WrongCommentType' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore WrongCommentType ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/WrongConstraintLayoutUsage.md.html b/docs/checks/WrongConstraintLayoutUsage.md.html index e8800447..02ca91ae 100644 --- a/docs/checks/WrongConstraintLayoutUsage.md.html +++ b/docs/checks/WrongConstraintLayoutUsage.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,49 +29,9 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetectorTest.kt) Instead of using left & right constraints start & end should be used. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:6:Error: This attribute won't work with RTL. Please -use layout_constraintStart_toStartOf instead. -[WrongConstraintLayoutUsage] - - app:layout_constraintLeft_toLeftOf="parent"/> - ---------------------------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:layout_constraintLeft_toLeftOf="parent"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongConstraintLayoutUsageDetectorTest.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, `WrongConstraintLayoutUsageDetector.constraintLeftToLeftOf`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -81,17 +41,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -99,7 +59,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongDrawableName.md.html b/docs/checks/WrongDrawableName.md.html index 6fa18ef2..e1f5670e 100644 --- a/docs/checks/WrongDrawableName.md.html +++ b/docs/checks/WrongDrawableName.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,10 +29,6 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongDrawableNameDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongDrawableNameDetectorTest.kt) The drawable file name should be prefixed with one of the following: animated_selector, animated_vector_, background_, ic_, img_, @@ -40,34 +36,6 @@ improve consistency in your code base as well as enforce a certain structure. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/drawable/random.xml:Warning: Drawable does not start with one of the -following prefixes: animated_selector, animated_vector_, background_, -ic_, img_, notification_icon_, ripple_, selector_, shape_, vector_ -[WrongDrawableName] - -0 errors, 1 warnings -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/drawable/random.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<merge/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongDrawableNameDetectorTest.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, `WrongDrawableNameDetector.randomDrawableFile`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +45,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +63,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongGlobalIconColor.md.html b/docs/checks/WrongGlobalIconColor.md.html index 6af7803e..12985310 100644 --- a/docs/checks/WrongGlobalIconColor.md.html +++ b/docs/checks/WrongGlobalIconColor.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,54 +29,11 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetectorTest.kt) In order to reuse icons, it's best if all icons share the same color and can be used at every position in the app. On the target side, tinting can be applied. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/drawable/ic_drawable.xml:7:Warning: Should use global tint color -[WrongGlobalIconColor] - - android:fillColor="#FF0000" - ------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/drawable/ic_drawable.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:height="24dp" - android:viewportHeight="24" - android:viewportWidth="24" - android:width="24dp"> - <path - android:fillColor="#FF0000" - android:fillType="evenOdd" - android:pathData="M18.364,5.636C18.7545,6.0266 18.7545,6.6597 18.364,7.0503L13.4135,11.9993L18.364,16.9497C18.7545,17.3403 18.7545,17.9734 18.364,18.364C17.9734,18.7545 17.3403,18.7545 16.9497,18.364L11.9993,13.4135L7.0503,18.364C6.6597,18.7545 6.0266,18.7545 5.636,18.364C5.2455,17.9734 5.2455,17.3403 5.636,16.9497L10.5858,11.9986L5.636,7.0503C5.2455,6.6597 5.2455,6.0266 5.636,5.636C6.0266,5.2455 6.6597,5.2455 7.0503,5.636L12,10.5844L16.9497,5.636C17.3403,5.2455 17.9734,5.2455 18.364,5.636Z" /> -</vector> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongGlobalIconColorDetectorTest.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, `WrongGlobalIconColorDetector.flagsIcDrawable`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -86,17 +43,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -104,7 +61,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongLayoutName.md.html b/docs/checks/WrongLayoutName.md.html index 1ddd6f0e..f25873f6 100644 --- a/docs/checks/WrongLayoutName.md.html +++ b/docs/checks/WrongLayoutName.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,43 +29,12 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongLayoutNameDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongLayoutNameDetectorTest.kt) The layout file name should be prefixed with one of the following: activity_, view_, fragment_, dialog_, bottom_sheet_, adapter_item_, divider_, space_, popup_window_. This will improve consistency in your code base as well as enforce a certain structure. -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/random.xml:Warning: Layout does not start with one of the -following prefixes: activity_, view_, fragment_, dialog_, bottom_sheet_, -adapter_item_, divider_, space_, popup_window_ [WrongLayoutName] - -0 errors, 1 warnings -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/random.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<merge/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongLayoutNameDetectorTest.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, `WrongLayoutNameDetector.randomLayoutFile`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -75,17 +44,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -93,7 +62,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongMenuIdFormat.md.html b/docs/checks/WrongMenuIdFormat.md.html index 22664cdf..91e4c178 100644 --- a/docs/checks/WrongMenuIdFormat.md.html +++ b/docs/checks/WrongMenuIdFormat.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,46 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetectorTest.kt) Menu ids should be in lowerCamelCase format. This has the benefit of saving an unnecessary underscore and also just looks nicer. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/menu/ids.xml:2:Warning: Id is not in lowerCamelCaseFormat -[WrongMenuIdFormat] - - <item android:id="@+id/CamelCase"/> - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/menu/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/CamelCase"/> -</menu> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongMenuIdFormatDetectorTest.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, `WrongMenuIdFormatDetector.idCamelCase`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -78,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -96,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongRequiresOptIn.md.html b/docs/checks/WrongRequiresOptIn.md.html index 35475a06..01f91baa 100644 --- a/docs/checks/WrongRequiresOptIn.md.html +++ b/docs/checks/WrongRequiresOptIn.md.html @@ -23,7 +23,7 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html) @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") +implementation("androidx.annotation:annotation-experimental:1.4.0") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' +implementation 'androidx.annotation:annotation-experimental:1.4.0' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0-dev01" +annotation-experimental = "1.4.0" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -70,7 +70,7 @@ } ``` -1.4.0-dev01 is the version this documentation was generated from; +1.4.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/WrongResourceImportAlias.md.html b/docs/checks/WrongResourceImportAlias.md.html index 90dfd3f2..ed3a3a75 100644 --- a/docs/checks/WrongResourceImportAlias.md.html +++ b/docs/checks/WrongResourceImportAlias.md.html @@ -108,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -126,7 +126,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/WrongTestMethodName.md.html b/docs/checks/WrongTestMethodName.md.html index a90c036e..8222fc58 100644 --- a/docs/checks/WrongTestMethodName.md.html +++ b/docs/checks/WrongTestMethodName.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,50 +29,10 @@ : Kotlin and Java files and test sources Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetectorTest.kt) The @Test annotation already states that this is a test hence the test prefix is not necessary. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/MyTest.java:6:Warning: Test method starts with test -[WrongTestMethodName] - - @Test public void testSomething() { } - ------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/MyTest.java`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java linenumbers -package foo; - -import org.junit.Test; - -public class MyTest { - @Test public void testSomething() { } -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongTestMethodNameDetectorTest.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, `WrongTestMethodNameDetector.methodStartingWithTestAndJUnitTestAnnotation`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -82,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -100,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/WrongViewIdFormat.md.html b/docs/checks/WrongViewIdFormat.md.html index 2b79e7ea..a93f78ab 100644 --- a/docs/checks/WrongViewIdFormat.md.html +++ b/docs/checks/WrongViewIdFormat.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,45 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetectorTest.kt) View ids should be in lowerCamelCase format. This has the benefit of saving an unnecessary underscore and also just looks nicer. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/ids.xml:2:Warning: Id is not in lowerCamelCaseFormat -[WrongViewIdFormat] - - android:id="@+id/CamelCase"/> - -------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/ids.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/CamelCase"/> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/WrongViewIdFormatDetectorTest.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, `WrongViewIdFormatDetector.idCamelCase`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -77,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -95,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/XmlSpacing.md.html b/docs/checks/XmlSpacing.md.html index 1ac0ccdf..6e0b2a78 100644 --- a/docs/checks/XmlSpacing.md.html +++ b/docs/checks/XmlSpacing.md.html @@ -19,9 +19,9 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact : [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) @@ -29,74 +29,10 @@ : Resource files Editing : This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/main/java/com/vanniktech/lintrules/android/XmlSpacingDetector.kt) -Tests -: [Source Code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/XmlSpacingDetectorTest.kt) Having newlines in xml files just adds noise and should be avoided. The only exception is the new lint at the end of the file. -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -res/layout/activity_home.xml:1:Warning: Unnecessary new line at line 1 -[XmlSpacing] - - -^ - - -res/layout/activity_home.xml:3:Warning: Unnecessary new line at line 3 -[XmlSpacing] - - -^ - - -res/layout/activity_home.xml:7:Warning: Unnecessary new line at line 7 -[XmlSpacing] - - -^ - - -res/layout/activity_home.xml:9:Warning: Unnecessary new line at line 9 -[XmlSpacing] - - -^ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`res/layout/activity_home.xml`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"> - - <TextView - xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="wrap_content" - - /> - -</LinearLayout> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/vanniktech/lint-rules/tree/master/lint-rules-android-lint/src/test/java/com/vanniktech/lintrules/android/XmlSpacingDetectorTest.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, `XmlSpacingDetector.layoutXmlFileWithNewLines`. -To report a problem with this extracted sample, visit -https://github.com/vanniktech/lint-rules/issues. - (##) Including !!! @@ -106,17 +42,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -124,7 +60,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html). diff --git a/docs/checks/androidx_activity_activity-compose.md.html b/docs/checks/androidx_activity_activity-compose.md.html index 5cd310b9..efcf4e92 100644 --- a/docs/checks/androidx_activity_activity-compose.md.html +++ b/docs/checks/androidx_activity_activity-compose.md.html @@ -17,13 +17,14 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.activity:activity-compose:1.8.0-alpha05 +: androidx.activity:activity-compose:1.9.0-alpha02 (##) Included Issues |Issue Id |Issue Description | |----------------------------------------------------------|---------------------------------------------------------------------------------| |[LaunchDuringComposition](LaunchDuringComposition.md.html)|Calls to `launch` should happen inside of a SideEffect and not during composition| +|[NoCollectCallFound](NoCollectCallFound.md.html) |You must call collect on the given progress flow when using PredictiveBackHandler| (##) Including @@ -33,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity-compose:1.8.0-alpha05") +implementation("androidx.activity:activity-compose:1.9.0-alpha02") // build.gradle -implementation 'androidx.activity:activity-compose:1.8.0-alpha05' +implementation 'androidx.activity:activity-compose:1.9.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.activity-compose) # libs.versions.toml [versions] -activity-compose = "1.8.0-alpha05" +activity-compose = "1.9.0-alpha02" [libraries] activity-compose = { module = "androidx.activity:activity-compose", @@ -51,12 +52,13 @@ } ``` -1.8.0-alpha05 is the version this documentation was generated from; +1.9.0-alpha02 is the version this documentation was generated from; there may be newer versions available. (##) Changes * 1.4.0: First version includes LaunchDuringComposition. +* 1.8.0: Adds NoCollectCallFound. (##) Version Compatibility @@ -64,11 +66,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.8.0-alpha05|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha03|2023/04/12| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha02|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| -| 1.8.0-alpha01|2023/02/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.9.0-alpha02|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.9.0-alpha01|2023/11/29| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.2|2023/12/13| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.1|2023/11/15| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.2|2023/05/24| 1| Yes| 8.0 and 8.1| 7.0| | 1.7.1|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| | 1.7.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| diff --git a/docs/checks/androidx_activity_activity.md.html b/docs/checks/androidx_activity_activity.md.html index 8980c631..9f7c7d7e 100644 --- a/docs/checks/androidx_activity_activity.md.html +++ b/docs/checks/androidx_activity_activity.md.html @@ -18,7 +18,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.activity:activity:1.8.0-alpha05 +: androidx.activity:activity:1.9.0-alpha02 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity:1.8.0-alpha05") +implementation("androidx.activity:activity:1.9.0-alpha02") // build.gradle -implementation 'androidx.activity:activity:1.8.0-alpha05' +implementation 'androidx.activity:activity:1.9.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.activity) # libs.versions.toml [versions] -activity = "1.8.0-alpha05" +activity = "1.9.0-alpha02" [libraries] activity = { module = "androidx.activity:activity", @@ -52,7 +52,7 @@ } ``` -1.8.0-alpha05 is the version this documentation was generated from; +1.9.0-alpha02 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,11 +66,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.8.0-alpha05|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha03|2023/04/12| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.8.0-alpha02|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| -| 1.8.0-alpha01|2023/02/08| 1| Yes| 7.3 and 7.4| 7.0| +| 1.9.0-alpha02|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.9.0-alpha01|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.2|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.1|2023/11/15| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.2|2023/05/24| 1| Yes| 8.0 and 8.1| 7.0| | 1.7.1|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| | 1.7.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| diff --git a/docs/checks/androidx_annotation_annotation-experimental.md.html b/docs/checks/androidx_annotation_annotation-experimental.md.html index e26aca30..b8ce3623 100644 --- a/docs/checks/androidx_annotation_annotation-experimental.md.html +++ b/docs/checks/androidx_annotation_annotation-experimental.md.html @@ -18,9 +18,9 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: androidx.annotation:annotation-experimental:1.4.0-dev01 +: androidx.annotation:annotation-experimental:1.4.0 (##) Included Issues @@ -39,17 +39,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0-dev01") +implementation("androidx.annotation:annotation-experimental:1.4.0") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0-dev01' +implementation 'androidx.annotation:annotation-experimental:1.4.0' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0-dev01" +annotation-experimental = "1.4.0" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -57,7 +57,7 @@ } ``` -1.4.0-dev01 is the version this documentation was generated from; +1.4.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -67,7 +67,7 @@ * 1.1.0: Adds UnsafeOptInUsageError, UnsafeOptInUsageWarning. Removes UnsafeExperimentalUsageError, UnsafeExperimentalUsageWarning. * 1.2.0: Adds ExperimentalAnnotationRetention. -* 1.4.0-dev01: Adds WrongRequiresOptIn. +* 1.3.1: Adds WrongRequiresOptIn. (##) Version Compatibility @@ -75,7 +75,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.4.0-dev01|2023/02/08| 4| Yes| 7.3 and 7.4| 7.0| +| 1.4.0|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.1|2023/06/21| 4| Yes| 7.3 and 7.4| 7.0| | 1.3.0|2022/09/07| 3| Yes| 7.3 and 7.4| 7.0| | 1.2.0|2021/12/15| 3| No[^1]| 7.1| 4.1| | 1.1.0|2021/04/07| 2| Yes| 4.1| 4.1| diff --git a/docs/checks/androidx_appcompat_appcompat.md.html b/docs/checks/androidx_appcompat_appcompat.md.html index 2cf867a8..3ff62280 100644 --- a/docs/checks/androidx_appcompat_appcompat.md.html +++ b/docs/checks/androidx_appcompat_appcompat.md.html @@ -1,12 +1,10 @@ (#) androidx.appcompat:appcompat Name -: Android AppCompat Library +: AppCompat Description -: The Support Library is a static library that you can add to your Android -: application in order to use APIs that are either not available for older -: platform versions or utility APIs that aren't a part of the framework -: APIs. Compatible on devices running API 14 or later. +: Provides backwards-compatible implementations of UI-related Android SDK +: functionality, including dark mode and Material theming. License : [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) Vendor @@ -18,9 +16,9 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: androidx.appcompat:appcompat:1.7.0-alpha02 +: androidx.appcompat:appcompat:1.7.0-alpha03 (##) Included Issues @@ -45,17 +43,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha02") +implementation("androidx.appcompat:appcompat:1.7.0-alpha03") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha02' +implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha02" +appcompat = "1.7.0-alpha03" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -63,7 +61,7 @@ } ``` -1.7.0-alpha02 is the version this documentation was generated from; +1.7.0-alpha03 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -80,6 +78,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha03|2023/07/26| 10| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha02|2023/02/08| 10| Yes| 7.3 and 7.4| 7.0| | 1.7.0-alpha01|2022/10/05| 10| Yes| 7.3 and 7.4| 7.0| | 1.6.1|2023/02/08| 10| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_compose_animation_animation-android.md.html b/docs/checks/androidx_compose_animation_animation-android.md.html new file mode 100644 index 00000000..c160b67b --- /dev/null +++ b/docs/checks/androidx_compose_animation_animation-android.md.html @@ -0,0 +1,77 @@ +(#) androidx.compose.animation:animation-android + +Name +: Compose Animation +Description +: Compose animation library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.animation:animation-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| +|[UnusedCrossfadeTargetStateParameter](UnusedCrossfadeTargetStateParameter.md.html) |Crossfade calls should use the provided `T` parameter in the content lambda | +|[UnusedContentLambdaTargetStateParameter](UnusedContentLambdaTargetStateParameter.md.html)|AnimatedContent calls should use the provided `T` parameter in the content lambda| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-android) + +# libs.versions.toml +[versions] +animation-android = "1.7.0-alpha01" +[libraries] +animation-android = { + module = "androidx.compose.animation:animation-android", + version.ref = "animation-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes UnusedContentLambdaTargetStateParameter, + UnusedCrossfadeTargetStateParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_animation_animation-core-android.md.html b/docs/checks/androidx_compose_animation_animation-core-android.md.html new file mode 100644 index 00000000..32af25f1 --- /dev/null +++ b/docs/checks/androidx_compose_animation_animation-core-android.md.html @@ -0,0 +1,80 @@ +(#) androidx.compose.animation:animation-core-android + +Name +: Compose Animation Core +Description +: Animation engine and animation primitives that are the building blocks +: of the Compose animation library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.animation.core +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.animation:animation-core-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------| +|[UnusedTransitionTargetStateParameter](UnusedTransitionTargetStateParameter.md.html)|Transition.animate* calls should use the provided targetState when defining values | +|[UnrememberedAnimatable](UnrememberedAnimatable.md.html) |Creating an Animatable during composition without using `remember` | +|[ArcAnimationSpecTypeIssue](ArcAnimationSpecTypeIssue.md.html) |ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.animation-core-android) + +# libs.versions.toml +[versions] +animation-core-android = "1.7.0-alpha01" +[libraries] +animation-core-android = { + module = "androidx.compose.animation:animation-core-android", + version.ref = "animation-core-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes UnrememberedAnimatable, + UnusedTransitionTargetStateParameter. +* 1.7.0-alpha01: Adds ArcAnimationSpecTypeIssue. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_foundation_foundation-android.md.html b/docs/checks/androidx_compose_foundation_foundation-android.md.html new file mode 100644 index 00000000..dbfd3b0c --- /dev/null +++ b/docs/checks/androidx_compose_foundation_foundation-android.md.html @@ -0,0 +1,83 @@ +(#) androidx.compose.foundation:foundation-android + +Name +: Compose Foundation +Description +: Higher level abstractions of the Compose UI primitives. This library is +: design system agnostic, providing the high-level building blocks for +: both application and design-system developers +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.foundation +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.foundation:foundation-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------| +|[FrequentlyChangedStateReadInComposition](FrequentlyChangedStateReadInComposition.md.html)|Frequently changing state should not be directly read in composable function | +|[UnrememberedMutableInteractionSource](UnrememberedMutableInteractionSource.md.html) |Creating a MutableInteractionSource during composition without using `remember` | +|[UseOfNonLambdaOffsetOverload](UseOfNonLambdaOffsetOverload.md.html) |Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments. | +|[UnusedBoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) |BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.foundation-android) + +# libs.versions.toml +[versions] +foundation-android = "1.7.0-alpha01" +[libraries] +foundation-android = { + module = "androidx.compose.foundation:foundation-android", + version.ref = "foundation-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes FrequentlyChangedStateReadInComposition, + UseOfNonLambdaOffsetOverload. +* 1.6.0: Adds UnrememberedMutableInteractionSource, + UnusedBoxWithConstraintsScope. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_material3_material3-android.md.html b/docs/checks/androidx_compose_material3_material3-android.md.html new file mode 100644 index 00000000..cffa9469 --- /dev/null +++ b/docs/checks/androidx_compose_material3_material3-android.md.html @@ -0,0 +1,85 @@ +(#) androidx.compose.material3:material3-android + +Name +: Compose Material3 Components +Description +: Compose Material You Design Components library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.material3 +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.material3:material3-android:1.2.0-rc01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| +|[UsingMaterialAndMaterial3Libraries](UsingMaterialAndMaterial3Libraries.md.html) |material and material3 are separate, incompatible design system libraries| +|[UnusedMaterial3ScaffoldPaddingParameter](UnusedMaterial3ScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material3:material3-android:1.2.0-rc01") + +// build.gradle +implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.material3-android) + +# libs.versions.toml +[versions] +material3-android = "1.2.0-rc01" +[libraries] +material3-android = { + module = "androidx.compose.material3:material3-android", + version.ref = "material3-android" +} +``` + +1.2.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0-alpha02: First version includes + UnusedMaterial3ScaffoldPaddingParameter. +* 1.2.0-alpha04: Adds UsingMaterialAndMaterial3Libraries. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.2.0-rc01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-beta02|2024/01/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-beta01|2023/12/13| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha12|2023/11/29| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha11|2023/11/15| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha10|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha09|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha08|2023/09/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha07|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha06|2023/08/23| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha05|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha04|2023/07/26| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha03|2023/06/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha02|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_material_material-android.md.html b/docs/checks/androidx_compose_material_material-android.md.html new file mode 100644 index 00000000..84ff2e7b --- /dev/null +++ b/docs/checks/androidx_compose_material_material-android.md.html @@ -0,0 +1,77 @@ +(#) androidx.compose.material:material-android + +Name +: Compose Material Components +Description +: Compose Material Design Components library +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.material +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.material:material-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|----------------------------------------------------------------------| +|[ConflictingOnColor](ConflictingOnColor.md.html) |Background colors with the same value should have the same 'on' color | +|[UnusedMaterialScaffoldPaddingParameter](UnusedMaterialScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.material:material-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.material:material-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.material-android) + +# libs.versions.toml +[versions] +material-android = "1.7.0-alpha01" +[libraries] +material-android = { + module = "androidx.compose.material:material-android", + version.ref = "material-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes ConflictingOnColor, + UnusedMaterialScaffoldPaddingParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime-android.md.html b/docs/checks/androidx_compose_runtime_runtime-android.md.html new file mode 100644 index 00000000..2487b44b --- /dev/null +++ b/docs/checks/androidx_compose_runtime_runtime-android.md.html @@ -0,0 +1,95 @@ +(#) androidx.compose.runtime:runtime-android + +Name +: Compose Runtime +Description +: Tree composition support for code generated by the Compose compiler +: plugin and corresponding public API +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.runtime:runtime-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| +|[AutoboxingStateValueProperty](AutoboxingStateValueProperty.md.html) |State access causes value to be autoboxed | +|[AutoboxingStateCreation](AutoboxingStateCreation.md.html) |`State` will autobox values assigned to this state. Use a specialized state type instead.| +|[CoroutineCreationDuringComposition](CoroutineCreationDuringComposition.md.html)|Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition | +|[FlowOperatorInvokedInComposition](FlowOperatorInvokedInComposition.md.html) |Flow operator functions should not be invoked within composition | +|[ComposableLambdaParameterNaming](ComposableLambdaParameterNaming.md.html) |Primary composable lambda parameter not named `content` | +|[ComposableLambdaParameterPosition](ComposableLambdaParameterPosition.md.html) |Non-trailing primary composable lambda parameter | +|[ComposableNaming](ComposableNaming.md.html) |Incorrect naming for @Composable functions | +|[StateFlowValueCalledInComposition](StateFlowValueCalledInComposition.md.html) |StateFlow.value should not be called within composition | +|[CompositionLocalNaming](CompositionLocalNaming.md.html) |CompositionLocal properties should be prefixed with `Local` | +|[MutableCollectionMutableState](MutableCollectionMutableState.md.html) |Creating a MutableState object with a mutable collection type | +|[ProduceStateDoesNotAssignValue](ProduceStateDoesNotAssignValue.md.html) |produceState calls should assign `value` inside the producer lambda | +|[RememberReturnType](RememberReturnType.md.html) |`remember` calls must not return `Unit` | +|[OpaqueUnitKey](OpaqueUnitKey.md.html) |Passing an expression which always returns `Unit` as a key argument | +|[UnrememberedMutableState](UnrememberedMutableState.md.html) |Creating a state object during composition without using `remember` | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime-android) + +# libs.versions.toml +[versions] +runtime-android = "1.7.0-alpha01" +[libraries] +runtime-android = { + module = "androidx.compose.runtime:runtime-android", + version.ref = "runtime-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes AutoboxingStateCreation, + AutoboxingStateValueProperty, ComposableLambdaParameterNaming, + ComposableLambdaParameterPosition, ComposableNaming, + CompositionLocalNaming, CoroutineCreationDuringComposition, + FlowOperatorInvokedInComposition, MutableCollectionMutableState, + OpaqueUnitKey, ProduceStateDoesNotAssignValue, RememberReturnType, + StateFlowValueCalledInComposition, UnrememberedMutableState. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 14| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html b/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html new file mode 100644 index 00000000..762fd407 --- /dev/null +++ b/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html @@ -0,0 +1,75 @@ +(#) androidx.compose.runtime:runtime-saveable-android + +Name +: Compose Saveable +Description +: Compose components that allow saving and restoring the local ui state +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.runtime.saveable +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------|------------------------------------------------------------------------------------------| +|[RememberSaveableSaverParameter](RememberSaveableSaverParameter.md.html)|`Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.runtime-saveable-android) + +# libs.versions.toml +[versions] +runtime-saveable-android = "1.7.0-alpha01" +[libraries] +runtime-saveable-android = { + module = "androidx.compose.runtime:runtime-saveable-android", + version.ref = "runtime-saveable-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes RememberSaveableSaverParameter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-android.md.html b/docs/checks/androidx_compose_ui_ui-android.md.html new file mode 100644 index 00000000..4cf0b1dc --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui-android.md.html @@ -0,0 +1,91 @@ +(#) androidx.compose.ui:ui-android + +Name +: Compose UI +Description +: Compose UI primitives. This library contains the primitives that form +: the Compose UI Toolkit, such as drawing, measurement and layout. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +|[UnnecessaryComposedModifier](UnnecessaryComposedModifier.md.html) |Modifier.composed should only be used for modifiers that invoke @Composable functions | +|[ModifierFactoryExtensionFunction](ModifierFactoryExtensionFunction.md.html) |Modifier factory functions should be extensions on Modifier | +|[ModifierFactoryReturnType](ModifierFactoryReturnType.md.html) |Modifier factory functions should return Modifier | +|[ModifierFactoryUnreferencedReceiver](ModifierFactoryUnreferencedReceiver.md.html) |Modifier factory functions must use the receiver Modifier instance | +|[ModifierNodeInspectableProperties](ModifierNodeInspectableProperties.md.html) |ModifierNodeElement missing inspectableProperties | +|[ModifierParameter](ModifierParameter.md.html) |Guidelines for Modifier parameters in a Composable function | +|[MultipleAwaitPointerEventScopes](MultipleAwaitPointerEventScopes.md.html) |Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.| +|[ReturnFromAwaitPointerEventScope](ReturnFromAwaitPointerEventScope.md.html) |Returning from awaitPointerEventScope may cause some input events to be dropped | +|[SuspiciousCompositionLocalModifierRead](SuspiciousCompositionLocalModifierRead.md.html)|CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-android) + +# libs.versions.toml +[versions] +ui-android = "1.7.0-alpha01" +[libraries] +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes ComposableModifierFactory, + ModifierFactoryExtensionFunction, ModifierFactoryReturnType, + ModifierFactoryUnreferencedReceiver, + ModifierNodeInspectableProperties, ModifierParameter, + MultipleAwaitPointerEventScopes, ReturnFromAwaitPointerEventScope, + SuspiciousCompositionLocalModifierRead, + UnnecessaryComposedModifier. +* 1.6.0: Removes ComposableModifierFactory. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 10| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-graphics-android.md.html b/docs/checks/androidx_compose_ui_ui-graphics-android.md.html new file mode 100644 index 00000000..90410f6d --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui-graphics-android.md.html @@ -0,0 +1,77 @@ +(#) androidx.compose.ui:ui-graphics-android + +Name +: Compose Graphics +Description +: Compose graphics +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui.graphics +Feedback +: https://issuetracker.google.com/issues/new?component=612128 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui-graphics-android:1.7.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------|---------------------------| +|[MissingColorAlphaChannel](MissingColorAlphaChannel.md.html)|Missing Color alpha channel| +|[InvalidColorHexValue](InvalidColorHexValue.md.html) |Invalid Color hex value | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") + +// build.gradle +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-graphics-android) + +# libs.versions.toml +[versions] +ui-graphics-android = "1.7.0-alpha01" +[libraries] +ui-graphics-android = { + module = "androidx.compose.ui:ui-graphics-android", + version.ref = "ui-graphics-android" +} +``` + +1.7.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.5.0: First version includes InvalidColorHexValue, + MissingColorAlphaChannel. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-test-manifest.md.html b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html index acbe2e83..bcde774c 100644 --- a/docs/checks/androidx_compose_ui_ui-test-manifest.md.html +++ b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.ui:ui-test-manifest:1.5.0-beta02 +: androidx.compose.ui:ui-test-manifest:1.7.0-alpha01 (##) Included Issues @@ -35,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-test-manifest:1.5.0-beta02") +implementation("androidx.compose.ui:ui-test-manifest:1.7.0-alpha01") // build.gradle -implementation 'androidx.compose.ui:ui-test-manifest:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.ui-test-manifest) # libs.versions.toml [versions] -ui-test-manifest = "1.5.0-beta02" +ui-test-manifest = "1.7.0-alpha01" [libraries] ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", @@ -53,7 +53,7 @@ } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,12 +66,13 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| +| 1.7.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.0|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.4|2023/10/18| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.3|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.2|2023/09/27| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.1|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.5.0|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| | 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| | 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| diff --git a/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html b/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html index 030ad662..222954cd 100644 --- a/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html +++ b/docs/checks/androidx_constraintlayout_constraintlayout-compose.md.html @@ -18,7 +18,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10 +: androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13 (##) Included Issues @@ -36,17 +36,17 @@ ``` // build.gradle.kts -implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10") +implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13") // build.gradle -implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10' +implementation 'androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13' // build.gradle.kts with version catalogs: implementation(libs.constraintlayout-compose) # libs.versions.toml [versions] -constraintlayout-compose = "1.1.0-alpha10" +constraintlayout-compose = "1.1.0-alpha13" [libraries] constraintlayout-compose = { module = "androidx.constraintlayout:constraintlayout-compose", @@ -54,7 +54,7 @@ } ``` -1.1.0-alpha10 is the version this documentation was generated from; +1.1.0-alpha13 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -69,6 +69,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.1.0-alpha13|2023/10/04| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-alpha12|2023/08/09| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-alpha11|2023/07/26| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.1.0-alpha10|2023/05/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.1.0-alpha09|2023/03/22| 3| No[^1]| 8.0 and 8.1| 7.0| | 1.1.0-alpha08|2023/03/08| 3| No[^1]| 8.0 and 8.1| 7.0| diff --git a/docs/checks/androidx_fragment_fragment-testing-manifest.md.html b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html index 4b836da1..99316c84 100644 --- a/docs/checks/androidx_fragment_fragment-testing-manifest.md.html +++ b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment-testing-manifest:1.7.0-alpha01 +: androidx.fragment:fragment-testing-manifest:1.7.0-alpha09 (##) Included Issues @@ -35,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha01") +implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha01' +implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing-manifest) # libs.versions.toml [versions] -fragment-testing-manifest = "1.7.0-alpha01" +fragment-testing-manifest = "1.7.0-alpha09" [libraries] fragment-testing-manifest = { module = "androidx.fragment:fragment-testing-manifest", @@ -53,7 +53,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,7 +66,17 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha09|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2023/07/26| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_fragment_fragment-testing.md.html b/docs/checks/androidx_fragment_fragment-testing.md.html index 1e34d687..b3fc1fa0 100644 --- a/docs/checks/androidx_fragment_fragment-testing.md.html +++ b/docs/checks/androidx_fragment_fragment-testing.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment-testing:1.7.0-alpha01 +: androidx.fragment:fragment-testing:1.7.0-alpha09 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing:1.7.0-alpha01") +implementation("androidx.fragment:fragment-testing:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment-testing:1.7.0-alpha01' +implementation 'androidx.fragment:fragment-testing:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing) # libs.versions.toml [versions] -fragment-testing = "1.7.0-alpha01" +fragment-testing = "1.7.0-alpha09" [libraries] fragment-testing = { module = "androidx.fragment:fragment-testing", @@ -51,7 +51,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,7 +64,17 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha09|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2023/07/26| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.7|2023/04/19| 1| Yes| 7.3 and 7.4| 7.0| | 1.5.6|2023/03/22| 1| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_fragment_fragment.md.html b/docs/checks/androidx_fragment_fragment.md.html index 7943a657..5567f645 100644 --- a/docs/checks/androidx_fragment_fragment.md.html +++ b/docs/checks/androidx_fragment_fragment.md.html @@ -20,7 +20,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment:1.7.0-alpha01 +: androidx.fragment:fragment:1.7.0-alpha09 (##) Included Issues @@ -44,17 +44,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha01") +implementation("androidx.fragment:fragment:1.7.0-alpha09") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha01' +implementation 'androidx.fragment:fragment:1.7.0-alpha09' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha01" +fragment = "1.7.0-alpha09" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -62,7 +62,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-alpha09 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -80,7 +80,17 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-alpha09|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/01/10| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2023/11/29| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2023/10/04| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2023/09/20| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2023/09/06| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2023/08/23| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2023/08/09| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2023/11/01| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2023/07/26| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.7|2023/04/19| 9| Yes| 7.3 and 7.4| 7.0| | 1.5.6|2023/03/22| 9| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html index 70565773..65c422f5 100644 --- a/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html +++ b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1 +: androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1") +implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01") // build.gradle -implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.6.1' +implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-livedata-core-ktx) # libs.versions.toml [versions] -lifecycle-livedata-core-ktx = "2.6.1" +lifecycle-livedata-core-ktx = "2.8.0-alpha01" [libraries] lifecycle-livedata-core-ktx = { module = "androidx.lifecycle:lifecycle-livedata-core-ktx", @@ -51,7 +51,7 @@ } ``` -2.6.1 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,6 +64,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.6.2|2023/09/06| 1| Yes| 8.0 and 8.1| 7.0| | 2.6.1|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| | 2.6.0|2023/03/08| 1| Yes| 8.0 and 8.1| 7.0| | 2.5.1|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html index e7e6497c..b06363d9 100644 --- a/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html @@ -1,7 +1,7 @@ (#) androidx.lifecycle:lifecycle-runtime-ktx Name -: Android Lifecycle Kotlin Extensions +: Lifecycle Kotlin Extensions Description : Kotlin extensions for 'lifecycle' artifact License @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.lifecycle:lifecycle-runtime-ktx:2.6.1 +: androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1") +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-runtime-ktx) # libs.versions.toml [versions] -lifecycle-runtime-ktx = "2.6.1" +lifecycle-runtime-ktx = "2.8.0-alpha01" [libraries] lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", @@ -52,7 +52,7 @@ } ``` -2.6.1 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,6 +66,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2024/01/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.6.2|2023/09/06| 2| Yes| 8.0 and 8.1| 7.0| | 2.6.1|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| | 2.6.0|2023/03/08| 2| Yes| 8.0 and 8.1| 7.0| | 2.5.1|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html new file mode 100644 index 00000000..9c58576d --- /dev/null +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html @@ -0,0 +1,70 @@ +(#) androidx.lifecycle:lifecycle-runtime-testing + +Name +: Lifecycle Runtime Testing +Description +: Testing utilities for 'lifecycle' artifact +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------| +|[TestLifecycleOwnerInCoroutine](TestLifecycleOwnerInCoroutine.md.html)|Use the suspending function setCurrentState(), rather than directly accessing the currentState property.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-testing) + +# libs.versions.toml +[versions] +lifecycle-runtime-testing = "2.8.0-alpha01" +[libraries] +lifecycle-runtime-testing = { + module = "androidx.lifecycle:lifecycle-runtime-testing", + version.ref = "lifecycle-runtime-testing" +} +``` + +2.8.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 2.7.0: First version includes TestLifecycleOwnerInCoroutine. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-common.md.html b/docs/checks/androidx_navigation_navigation-common.md.html index 4aeed813..6215c5b9 100644 --- a/docs/checks/androidx_navigation_navigation-common.md.html +++ b/docs/checks/androidx_navigation_navigation-common.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-common:2.7.0-beta01 +: androidx.navigation:navigation-common:2.8.0-alpha01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-common:2.7.0-beta01") +implementation("androidx.navigation:navigation-common:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-common:2.7.0-beta01' +implementation 'androidx.navigation:navigation-common:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-common) # libs.versions.toml [versions] -navigation-common = "2.7.0-beta01" +navigation-common = "2.8.0-alpha01" [libraries] navigation-common = { module = "androidx.navigation:navigation-common", @@ -51,7 +51,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,8 +64,14 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 2.7.0-beta01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 2.7.0-alpha01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.6|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.5|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.4|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.3|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.2|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.1|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-compose.md.html b/docs/checks/androidx_navigation_navigation-compose.md.html index 6eb081f6..881687db 100644 --- a/docs/checks/androidx_navigation_navigation-compose.md.html +++ b/docs/checks/androidx_navigation_navigation-compose.md.html @@ -15,7 +15,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-compose:2.7.0-beta01 +: androidx.navigation:navigation-compose:2.8.0-alpha01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.7.0-beta01") +implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.7.0-beta01' +implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.7.0-beta01" +navigation-compose = "2.8.0-alpha01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -51,7 +51,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -65,8 +65,14 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 2.7.0-beta01|2023/06/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| -| 2.7.0-alpha01|2023/05/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha01|2024/01/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.6|2023/12/13| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.5|2023/11/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.4|2023/10/04| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.3|2023/09/20| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.2|2023/09/06| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.1|2023/08/23| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2023/08/09| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.6.0|2023/06/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.5.3|2022/10/24| 3| Yes| 7.3 and 7.4| 7.0| | 2.5.2|2022/09/07| 3| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_navigation_navigation-runtime.md.html b/docs/checks/androidx_navigation_navigation-runtime.md.html index 4eedd536..db73a1d9 100644 --- a/docs/checks/androidx_navigation_navigation-runtime.md.html +++ b/docs/checks/androidx_navigation_navigation-runtime.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-runtime:2.7.0-beta01 +: androidx.navigation:navigation-runtime:2.8.0-alpha01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-runtime:2.7.0-beta01") +implementation("androidx.navigation:navigation-runtime:2.8.0-alpha01") // build.gradle -implementation 'androidx.navigation:navigation-runtime:2.7.0-beta01' +implementation 'androidx.navigation:navigation-runtime:2.8.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.navigation-runtime) # libs.versions.toml [versions] -navigation-runtime = "2.7.0-beta01" +navigation-runtime = "2.8.0-alpha01" [libraries] navigation-runtime = { module = "androidx.navigation:navigation-runtime", @@ -51,7 +51,7 @@ } ``` -2.7.0-beta01 is the version this documentation was generated from; +2.8.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,8 +64,14 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 2.7.0-beta01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 2.7.0-alpha01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.6|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.5|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.4|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.3|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.2|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.1|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.0|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.5.3|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| | 2.5.2|2022/09/07| 1| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_recyclerview_recyclerview.md.html b/docs/checks/androidx_recyclerview_recyclerview.md.html index 05eb6757..a1fd2602 100644 --- a/docs/checks/androidx_recyclerview_recyclerview.md.html +++ b/docs/checks/androidx_recyclerview_recyclerview.md.html @@ -1,7 +1,7 @@ (#) androidx.recyclerview:recyclerview Name -: Android Support RecyclerView +: RecyclerView Description : Android Support RecyclerView License @@ -15,9 +15,9 @@ Min : Lint 7.0 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: androidx.recyclerview:recyclerview:1.3.1-rc01 +: androidx.recyclerview:recyclerview:1.4.0-alpha01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.recyclerview:recyclerview:1.3.1-rc01") +implementation("androidx.recyclerview:recyclerview:1.4.0-alpha01") // build.gradle -implementation 'androidx.recyclerview:recyclerview:1.3.1-rc01' +implementation 'androidx.recyclerview:recyclerview:1.4.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.recyclerview) # libs.versions.toml [versions] -recyclerview = "1.3.1-rc01" +recyclerview = "1.4.0-alpha01" [libraries] recyclerview = { module = "androidx.recyclerview:recyclerview", @@ -52,7 +52,7 @@ } ``` -1.3.1-rc01 is the version this documentation was generated from; +1.4.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -65,7 +65,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.3.1-rc01|2023/05/24| 1| Yes| 7.3 and 7.4| 7.0| +| 1.4.0-alpha01|2023/10/18| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.2|2023/10/18| 1| Yes| 7.3 and 7.4| 7.0| +| 1.3.1|2023/07/26| 1| Yes| 7.3 and 7.4| 7.0| | 1.3.0|2023/03/08| 1| Yes| 7.3 and 7.4| 7.0| | 1.2.1|2021/06/02| 1| Yes| 4.1| 3.3| | 1.2.0|2021/04/07| 1| Yes| 4.1| 3.3| diff --git a/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html b/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html new file mode 100644 index 00000000..1346a42a --- /dev/null +++ b/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html @@ -0,0 +1,71 @@ +(#) androidx.wear.protolayout:protolayout-expression + +Name +: ProtoLayout Expression +Description +: Create dynamic expressions (for late evaluation by a remote evaluator). +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.wear.protolayout:protolayout-expression:1.1.0-rc01 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------|-------------------------------------------------------------------------------| +|[ProtoLayoutMinSchema](ProtoLayoutMinSchema.md.html)|ProtoLayout feature is not guaranteed to be available on the target device API.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-expression:1.1.0-rc01") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-expression:1.1.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-expression) + +# libs.versions.toml +[versions] +protolayout-expression = "1.1.0-rc01" +[libraries] +protolayout-expression = { + module = "androidx.wear.protolayout:protolayout-expression", + version.ref = "protolayout-expression" +} +``` + +1.1.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.1.0-alpha04: First version includes ProtoLayoutMinSchema. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.1.0-rc01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-beta01|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-alpha04|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_wear_protolayout_protolayout.md.html b/docs/checks/androidx_wear_protolayout_protolayout.md.html new file mode 100644 index 00000000..79e7a7e2 --- /dev/null +++ b/docs/checks/androidx_wear_protolayout_protolayout.md.html @@ -0,0 +1,71 @@ +(#) androidx.wear.protolayout:protolayout + +Name +: ProtoLayout +Description +: Create layouts that can be rendered by a remote host. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.wear.protolayout:protolayout:1.1.0-rc01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------|-------------------------------------------------------------------------------| +|[ProtoLayoutMinSchema](ProtoLayoutMinSchema-2.md.html)|ProtoLayout feature is not guaranteed to be available on the target device API.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout:1.1.0-rc01") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout:1.1.0-rc01' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout) + +# libs.versions.toml +[versions] +protolayout = "1.1.0-rc01" +[libraries] +protolayout = { + module = "androidx.wear.protolayout:protolayout", + version.ref = "protolayout" +} +``` + +1.1.0-rc01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.1.0-alpha04: First version includes ProtoLayoutMinSchema. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.1.0-rc01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-beta01|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0-alpha04|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_work_work-runtime.md.html b/docs/checks/androidx_work_work-runtime.md.html index da7ec829..e83fb4fb 100644 --- a/docs/checks/androidx_work_work-runtime.md.html +++ b/docs/checks/androidx_work_work-runtime.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.work:work-runtime:2.9.0-alpha01 +: androidx.work:work-runtime:2.10.0-alpha01 (##) Included Issues @@ -41,17 +41,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.9.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha01") // build.gradle -implementation 'androidx.work:work-runtime:2.9.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha01' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.9.0-alpha01" +work-runtime = "2.10.0-alpha01" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -59,7 +59,7 @@ } ``` -2.9.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -78,7 +78,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 2.9.0-alpha01|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.10.0-alpha01|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.9.0|2023/11/29| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.8.1|2023/03/22| 9| Yes| 7.3 and 7.4| 7.0| | 2.8.0|2023/02/08| 9| Yes| 7.3 and 7.4| 7.0| | 2.7.1|2021/11/17| 9| Yes| 7.1| 4.1| diff --git a/docs/checks/categories.md.html b/docs/checks/categories.md.html index 76dd1adf..36179b73 100644 --- a/docs/checks/categories.md.html +++ b/docs/checks/categories.md.html @@ -3,7 +3,7 @@ Order: [Alphabetical](index.md.html) | By category | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Correctness (463) +* Correctness (490) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) @@ -16,17 +16,25 @@ - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) + - [AppLinkUrlError: URI invalid](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) + - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) + - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) - [CanvasSize: Wrong Canvas Size](CanvasSize.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) @@ -37,7 +45,6 @@ - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) @@ -48,6 +55,7 @@ - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) + - [CredentialDependency: `credentials-play-services-auth` is Required](CredentialDependency.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) - [CutPasteId: Likely cut & paste mistakes](CutPasteId.md.html) @@ -58,6 +66,7 @@ - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) - [Deprecated: Using deprecated resources](Deprecated.md.html) - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) @@ -74,6 +83,7 @@ - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockPlatformTypes: platform types should not be mocked](DoNotMockPlatformTypes.md.html) - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DuplicateActivity: Activity registered more than once](DuplicateActivity.md.html) @@ -92,6 +102,7 @@ - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) + - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) @@ -277,6 +288,7 @@ - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) + - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) @@ -286,6 +298,7 @@ - [NewApi: Calling new methods on older versions](NewApi.md.html) - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) + - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) - [NonResizeableActivity: Activity is set to be non resizeable](NonResizeableActivity.md.html) @@ -315,6 +328,10 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) - [Range: Outside Range](Range.md.html) @@ -323,6 +340,7 @@ - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) - [Registered: Class is not registered in the manifest](Registered.md.html) @@ -356,6 +374,7 @@ - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) + - [SelectedPhotoAccess: Behavior change when requesting photo library access](SelectedPhotoAccess.md.html) - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) @@ -371,6 +390,7 @@ - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - [SpecifyJobSchedulerIdRange: Specify a range of JobScheduler ids](SpecifyJobSchedulerIdRange.md.html) + - [StartActivityAndCollapseDeprecated: TileService.startActivityAndCollapse(Intent) is deprecated](StartActivityAndCollapseDeprecated.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) @@ -387,6 +407,7 @@ - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - [TestAppLink: Unmatched URLs](TestAppLink.md.html) + - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) @@ -401,6 +422,7 @@ - [UnnecessaryComposedModifier: Modifier.composed should only be used for modifiers that invoke @Composable functions](UnnecessaryComposedModifier.md.html) - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) + - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) @@ -411,6 +433,7 @@ - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) + - [UnusedBoxWithConstraintsScope: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) @@ -427,9 +450,11 @@ - [UseGetLayoutInflater: Use getLayoutInflater() to get the LayoutInflater instead of calling LayoutInflater.from(Context).](UseGetLayoutInflater.md.html) - [UseRequireInsteadOfGet: Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null.](UseRequireInsteadOfGet.md.html) - [UseRxSetProgress2: `setProgress` is deprecated. Use `setCompletableProgress` instead.](UseRxSetProgress2.md.html) + - [UseSdkSuppress: Using `@SdkSuppress` instead of `@RequiresApi`](UseSdkSuppress.md.html) - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) - [UseSwitchCompatOrMaterialXml: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialXml.md.html) + - [UsingMaterialAndMaterial3Libraries: material and material3 are separate, incompatible design system libraries](UsingMaterialAndMaterial3Libraries.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) @@ -440,6 +465,7 @@ - [VisibleForTests: Visible Only For Tests](VisibleForTests.md.html) - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) + - [WearMaterialTheme: Using not non-Wear `MaterialTheme` in a Wear OS project](WearMaterialTheme.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableConfigurationAction: Wear configuration action metadata must match an activity](WearableConfigurationAction.md.html) @@ -451,6 +477,7 @@ - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) + - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) @@ -502,7 +529,7 @@ - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) -* Security (57) +* Security (60) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) @@ -527,9 +554,11 @@ - [HardwareIds: Hardware Id Usage](HardwareIds.md.html) - [InsecureBaseConfiguration: Insecure Base Configuration](InsecureBaseConfiguration.md.html) - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) + - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) - [InvalidPermission: Invalid Permission Attribute](InvalidPermission.md.html) - [JavascriptInterface: Missing @JavascriptInterface on methods](JavascriptInterface.md.html) - [KnownPermissionError: Value specified for permission is a known error](KnownPermissionError.md.html) + - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) @@ -538,6 +567,7 @@ - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) - [SSLCertificateSocketFactoryCreateSocket: Insecure call to `SSLCertificateSocketFactory.createSocket()`](SSLCertificateSocketFactoryCreateSocket.md.html) - [SSLCertificateSocketFactoryGetInsecure: Call to `SSLCertificateSocketFactory.getInsecure()`](SSLCertificateSocketFactoryGetInsecure.md.html) + - [SecretInSource: Secret in source code](SecretInSource.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - [SetWorldReadable: `File.setReadable()` used to make file world-readable](SetWorldReadable.md.html) @@ -562,11 +592,12 @@ - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) -* Compliance (5) +* Compliance (6) - [ExpiredTargetSdkVersion: TargetSdkVersion No Longer Supported](ExpiredTargetSdkVersion.md.html) - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) + - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) @@ -631,10 +662,11 @@ - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) + - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) -* Usability: Icons (20) +* Usability: Icons (22) + - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) - [GifUsage: Using `.gif` format for bitmaps is discouraged](GifUsage.md.html) - [IconColors: Icon colors do not follow the recommended visual style](IconColors.md.html) @@ -654,15 +686,14 @@ - [MissingApplicationIcon: Missing application icon](MissingApplicationIcon.md.html) - [MonochromeLauncherIcon: Monochrome icon is not defined](MonochromeLauncherIcon.md.html) - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) + - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [WebpUnsupported: WebP Unsupported](WebpUnsupported.md.html) * Usability (17) - [AlwaysShowAction: Usage of `showAsAction=always`](AlwaysShowAction.md.html) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) - [Autofill: Use Autofill](Autofill.md.html) - [BackButton: Back button](BackButton.md.html) - - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) @@ -675,6 +706,8 @@ - [ViewConstructor: Missing View constructors for XML inflation](ViewConstructor.md.html) - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) + - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) * Productivity (17) diff --git a/docs/checks/com_google_dagger_dagger-lint.md.html b/docs/checks/com_google_dagger_dagger-lint.md.html index e56d8e9f..dedd1bad 100644 --- a/docs/checks/com_google_dagger_dagger-lint.md.html +++ b/docs/checks/com_google_dagger_dagger-lint.md.html @@ -21,7 +21,7 @@ Compiled : Lint 7.1 Artifact -: com.google.dagger:dagger-lint:2.46.1 +: com.google.dagger:dagger-lint:2.50 (##) Included Issues @@ -40,17 +40,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.46.1") +implementation("com.google.dagger:dagger-lint:2.50") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.46.1' +implementation 'com.google.dagger:dagger-lint:2.50' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.46.1" +dagger-lint = "2.50" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -58,12 +58,12 @@ } ``` -2.46.1 is the version this documentation was generated from; +2.50 is the version this documentation was generated from; there may be newer versions available. (##) Changes -* 2.38.1: First version includes FieldSiteTargetOnQualifierAnnotation, +* 2.40.2: First version includes FieldSiteTargetOnQualifierAnnotation, JvmStaticProvidesInObjectDetector, ModuleCompanionObjects, ModuleCompanionObjectsNotInModuleParent. @@ -73,6 +73,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.50|2023/12/19| 4| Yes| 7.1| 7.1| +| 2.49|2023/12/01| 4| Yes| 7.1| 7.1| +| 2.48.1|2023/10/03| 4| Yes| 7.1| 7.1| +| 2.48|2023/08/30| 4| Yes| 7.1| 7.1| +| 2.47|2023/07/13| 4| Yes| 7.1| 7.1| | 2.46.1|2023/05/12| 4| Yes| 7.1| 7.1| | 2.46|2023/04/28| 4| Yes| 7.1| 7.1| | 2.45|2023/02/09| 4| Yes| 7.1| 7.1| @@ -88,14 +93,5 @@ | 2.40.4|2021/12/02| 4| Yes| 4.1| 3.6| | 2.40.3|2021/11/29| 4| Yes| 4.1| 3.6| | 2.40.2|2021/11/24| 4| Yes| 4.1| 3.6| -| 2.40.1|2021/11/11| 4| Yes| 4.1| 3.6| -| 2.40|2021/10/27| 4| Yes| 4.1| 3.6| -| 2.39.1|2021/10/01| 4| No[^1]| 4.1| 3.6| -| 2.39|2021/09/29| 4| No[^1]| 4.1| 3.6| -| 2.38.1|2021/07/27| 4| No[^1]| 4.1| 3.6| - -Compatibility Problems: - -[^1]: org.jetbrains.uast.kotlin.KotlinUClass: org.jetbrains.kotlin.psi.KtClassOrObject getKtClass() is not accessible \ No newline at end of file diff --git a/docs/checks/com_slack_lint_slack-lint-checks.md.html b/docs/checks/com_slack_lint_slack-lint-checks.md.html index 821f2bad..79cf8304 100644 --- a/docs/checks/com_slack_lint_slack-lint-checks.md.html +++ b/docs/checks/com_slack_lint_slack-lint-checks.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: com.slack.lint:slack-lint-checks:0.3.0 +: com.slack.lint:slack-lint-checks:0.7.0 (##) Included Issues @@ -27,7 +27,14 @@ |--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| |[CastingViewContextToActivity](CastingViewContextToActivity.md.html) |Unsafe cast of `Context` to `Activity` | |[ArgInFormattedQuantityStringRes](ArgInFormattedQuantityStringRes.md.html) |Count value in formatted string resource. | -|[BindsCanBeExtensionFunction](BindsCanBeExtensionFunction.md.html) |@Binds-annotated functions can be extension functions. | +|[BindsTypeMismatch](BindsTypeMismatch.md.html) |@Binds function parameters must be type-assignable to their return types. | +|[BindingReturnType](BindingReturnType.md.html) |@Binds/@Provides functions must have a return type. Cannot be void or Unit. | +|[BindingReceiverParameter](BindingReceiverParameter.md.html) |@Binds/@Provides functions cannot be extension functions. | +|[BindsWrongParameterCount](BindsWrongParameterCount.md.html) |@Binds functions require a single parameter as an input to bind. | +|[BindsMustBeAbstract](BindsMustBeAbstract.md.html) |@Binds functions must be abstract and cannot have function bodies. | +|[RedundantBinds](RedundantBinds.md.html) |@Binds functions should return a different type (including annotations) than the input type. | +|[MustBeInModule](MustBeInModule.md.html) |@Binds/@Provides function must be in `@Module`-annotated classes. | +|[ProvidesMustNotBeAbstract](ProvidesMustNotBeAbstract.md.html) |@Provides functions cannot be abstract. | |[KotlinPairNotCreated](KotlinPairNotCreated.md.html) |Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons | |[DoNotCallProviders](DoNotCallProviders.md.html) |Dagger provider methods should not be called directly by user code. | |[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | @@ -41,6 +48,7 @@ |[SubscribeOnMain](SubscribeOnMain.md.html) |subscribeOn called with the main thread scheduler. | |[GuavaChecksUsed](GuavaChecksUsed.md.html) |Use Slack's JavaPreconditions instead of Guava's Preconditions checks | |[GuavaPreconditionsUsedInKotlin](GuavaPreconditionsUsedInKotlin.md.html) |Kotlin precondition checks should use the Kotlin standard library checks | +|[DoNotMockPlatformTypes](DoNotMockPlatformTypes.md.html) |platform types should not be mocked | |[DoNotMockDataClass](DoNotMockDataClass.md.html) |data classes represent pure data classes, so mocking them should not be necessary. | |[DoNotMock](DoNotMock.md.html) | | |[DoNotMockSealedClass](DoNotMockSealedClass.md.html) |sealed classes have a restricted type hierarchy, use a subtype instead | @@ -105,7 +113,9 @@ |[MissingResourceImportAlias](MissingResourceImportAlias.md.html) |Missing import alias for R class. | |[WrongResourceImportAlias](WrongResourceImportAlias.md.html) |Wrong import alias for this R class. | |[DenyListedApi](DenyListedApi.md.html) |Deny-listed API | +|[DenyListedBlockingApi](DenyListedBlockingApi.md.html) |Deny-listed API | |[ParcelizeFunctionProperty](ParcelizeFunctionProperty.md.html) |Function type properties should not be used in Parcelize classes | +|[ExceptionMessage](ExceptionMessage.md.html) |Please provide a string for the lazyMessage parameter | (##) Including @@ -116,17 +126,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.0") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.3.0" +slack-lint-checks = "0.7.0" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -134,7 +144,7 @@ } ``` -0.3.0 is the version this documentation was generated from; +0.7.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -192,6 +202,14 @@ * 0.2.3: Adds ParcelizeFunctionProperty. * 0.3.0: Adds DoNotMockObjectClass, DoNotMockRecordClass, DoNotMockSealedClass. +* 0.4.0: Adds DoNotMockPlatformTypes. +* 0.5.0: Adds BindingReceiverParameter, BindingReturnType, + BindsMustBeAbstract, BindsMustBeInModule, BindsTypeMismatch, + BindsWrongParameterCount, ProvidesMustNotBeAbstract, RedundantBinds. + Removes BindsCanBeExtensionFunction. +* 0.5.1: Adds MustBeInModule. Removes BindsMustBeInModule. +* 0.6.0: Adds ExceptionMessage. +* 0.7.0: Adds DenyListedBlockingApi. (##) Version Compatibility @@ -199,6 +217,12 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.7.0|2023/10/27| 91| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.6.1|2023/10/09| 90| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.6.0|2023/09/26| 90| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.5.1|2023/09/09| 89| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.5.0|2023/09/08| 89| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.4.0|2023/07/20| 82| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.3.0|2023/05/31| 81| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.2.3|2023/02/22| 78| Yes| 8.0 and 8.1| 7.2| | 0.2.2|2023/02/09| 77| Yes| 8.0 and 8.1| 7.2| diff --git a/docs/checks/com_uber_autodispose2_autodispose-lint.md.html b/docs/checks/com_uber_autodispose2_autodispose-lint.md.html index d77bf8b5..ca352a0a 100644 --- a/docs/checks/com_uber_autodispose2_autodispose-lint.md.html +++ b/docs/checks/com_uber_autodispose2_autodispose-lint.md.html @@ -7,7 +7,7 @@ Project : https://github.com/uber/AutoDispose License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +: [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) Vendor : Uber Identifier @@ -15,11 +15,11 @@ Feedback : https://github.com/uber/AutoDispose/issues Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled -: Lint 7.0 +: Lint 8.0 and 8.1 Artifact -: com.uber.autodispose2:autodispose-lint:2.1.1 +: com.uber.autodispose2:autodispose-lint:2.2.1 (##) Included Issues @@ -36,17 +36,17 @@ ``` // build.gradle.kts -lintChecks("com.uber.autodispose2:autodispose-lint:2.1.1") +lintChecks("com.uber.autodispose2:autodispose-lint:2.2.1") // build.gradle -lintChecks 'com.uber.autodispose2:autodispose-lint:2.1.1' +lintChecks 'com.uber.autodispose2:autodispose-lint:2.2.1' // build.gradle.kts with version catalogs: lintChecks(libs.autodispose-lint) # libs.versions.toml [versions] -autodispose-lint = "2.1.1" +autodispose-lint = "2.2.1" [libraries] autodispose-lint = { module = "com.uber.autodispose2:autodispose-lint", @@ -54,7 +54,7 @@ } ``` -2.1.1 is the version this documentation was generated from; +2.2.1 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -67,6 +67,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.2.1|2023/07/26| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.2.0|2023/07/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.1.1|2021/09/07| 1| Yes| 7.0| 7.0| | 2.1.0|2021/08/09| 1| Yes| 7.0| 7.0| diff --git a/docs/checks/com_vanniktech_lint-rules-android.md.html b/docs/checks/com_vanniktech_lint-rules-android.md.html index 528b0867..35ea3971 100644 --- a/docs/checks/com_vanniktech_lint-rules-android.md.html +++ b/docs/checks/com_vanniktech_lint-rules-android.md.html @@ -13,11 +13,11 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: com.vanniktech:lint-rules-android:0.24.0 +: com.vanniktech:lint-rules-android:0.25.0 (##) Included Issues @@ -74,17 +74,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-android:0.24.0") +lintChecks("com.vanniktech:lint-rules-android:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-android:0.24.0' +lintChecks 'com.vanniktech:lint-rules-android:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-android) # libs.versions.toml [versions] -lint-rules-android = "0.24.0" +lint-rules-android = "0.25.0" [libraries] lint-rules-android = { module = "com.vanniktech:lint-rules-android", @@ -92,7 +92,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -121,6 +121,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.25.0|2023/09/17| 41| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.24.0|2023/02/21| 41| Yes| 7.3 and 7.4|7.3 and 7.4| | 0.13.0|2020/03/22| 33| No[^1]| 3.6| 3.6| | 0.12.0|2019/04/29| 33| No[^1]| 3.4| 3.4| diff --git a/docs/checks/com_vanniktech_lint-rules-kotlin.md.html b/docs/checks/com_vanniktech_lint-rules-kotlin.md.html index ec57386d..7a9481a5 100644 --- a/docs/checks/com_vanniktech_lint-rules-kotlin.md.html +++ b/docs/checks/com_vanniktech_lint-rules-kotlin.md.html @@ -13,11 +13,11 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: com.vanniktech:lint-rules-kotlin:0.24.0 +: com.vanniktech:lint-rules-kotlin:0.25.0 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-kotlin:0.24.0") +lintChecks("com.vanniktech:lint-rules-kotlin:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-kotlin:0.24.0' +lintChecks 'com.vanniktech:lint-rules-kotlin:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-kotlin) # libs.versions.toml [versions] -lint-rules-kotlin = "0.24.0" +lint-rules-kotlin = "0.25.0" [libraries] lint-rules-kotlin = { module = "com.vanniktech:lint-rules-kotlin", @@ -52,7 +52,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -65,6 +65,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.25.0|2023/09/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.24.0|2023/02/21| 1| Yes| 7.3 and 7.4|7.3 and 7.4| | 0.23.0|2022/12/20| 1| Yes| 7.3 and 7.4| 7.0| | 0.22.0|2022/08/05| 1| Yes| 7.2| 7.0| diff --git a/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html b/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html index 52bc37b6..9297cba3 100644 --- a/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html +++ b/docs/checks/com_vanniktech_lint-rules-rxjava2.md.html @@ -13,11 +13,11 @@ Feedback : https://github.com/vanniktech/lint-rules/issues Min -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Compiled -: Lint 7.3 and 7.4 +: Lint 8.0 and 8.1 Artifact -: com.vanniktech:lint-rules-rxjava2:0.24.0 +: com.vanniktech:lint-rules-rxjava2:0.25.0 (##) Included Issues @@ -40,17 +40,17 @@ ``` // build.gradle.kts -lintChecks("com.vanniktech:lint-rules-rxjava2:0.24.0") +lintChecks("com.vanniktech:lint-rules-rxjava2:0.25.0") // build.gradle -lintChecks 'com.vanniktech:lint-rules-rxjava2:0.24.0' +lintChecks 'com.vanniktech:lint-rules-rxjava2:0.25.0' // build.gradle.kts with version catalogs: lintChecks(libs.lint-rules-rxjava2) # libs.versions.toml [versions] -lint-rules-rxjava2 = "0.24.0" +lint-rules-rxjava2 = "0.25.0" [libraries] lint-rules-rxjava2 = { module = "com.vanniktech:lint-rules-rxjava2", @@ -58,7 +58,7 @@ } ``` -0.24.0 is the version this documentation was generated from; +0.25.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -75,6 +75,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.25.0|2023/09/17| 7| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.24.0|2023/02/21| 7| Yes| 7.3 and 7.4|7.3 and 7.4| | 0.23.0|2022/12/20| 7| Yes| 7.3 and 7.4| 7.0| | 0.22.0|2022/08/05| 7| Yes| 7.2| 7.0| diff --git a/docs/checks/index.md.html b/docs/checks/index.md.html index 1c34194d..bd29e356 100644 --- a/docs/checks/index.md.html +++ b/docs/checks/index.md.html @@ -6,6 +6,7 @@ - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) + - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) @@ -21,9 +22,10 @@ - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) + - [AppLinkUrlError: URI invalid](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) + - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) @@ -40,11 +42,16 @@ - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) + - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) @@ -62,7 +69,6 @@ - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) @@ -90,6 +96,7 @@ - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) + - [CredentialDependency: `credentials-play-services-auth` is Required](CredentialDependency.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) @@ -104,6 +111,7 @@ - [DefaultLocale: Implied default locale in case conversion](DefaultLocale.md.html) - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) - [Deprecated: Using deprecated resources](Deprecated.md.html) - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) @@ -123,6 +131,7 @@ - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockPlatformTypes: platform types should not be mocked](DoNotMockPlatformTypes.md.html) - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DrawAllocation: Memory allocations within drawing code](DrawAllocation.md.html) @@ -146,6 +155,7 @@ - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) + - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) @@ -169,8 +179,8 @@ - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing:1.7.0-alpha01) - - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing-manifest:1.7.0-alpha01) + - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing:1.7.0-alpha09) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing-manifest:1.7.0-alpha09) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) @@ -224,8 +234,8 @@ - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) - - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.3.0) - - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.3.0) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.0) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.0) - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) @@ -245,6 +255,7 @@ - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) + - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) @@ -400,7 +411,9 @@ - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) + - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) + - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) - [NamingPattern: Names should be well named.](NamingPattern.md.html) @@ -411,6 +424,7 @@ - [NewApi: Calling new methods on older versions](NewApi.md.html) - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) + - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) - [NoOp: NoOp Code](NoOp.md.html) - [NonConstantResourceId: Checks use of resource IDs in places requiring constants](NonConstantResourceId.md.html) @@ -444,6 +458,7 @@ - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) + - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) - [PrivateApi: Using Private APIs](PrivateApi.md.html) @@ -453,8 +468,12 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout:1.1.0-rc01) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) + - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) @@ -465,6 +484,7 @@ - [Recycle: Missing `recycle()` calls](Recycle.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [RedundantNamespace: Redundant namespace](RedundantNamespace.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) @@ -512,8 +532,10 @@ - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) + - [SecretInSource: Secret in source code](SecretInSource.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) + - [SelectedPhotoAccess: Behavior change when requesting photo library access](SelectedPhotoAccess.md.html) - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) @@ -536,6 +558,7 @@ - [SpecifyForegroundServiceType: Specify foreground service type](SpecifyForegroundServiceType.md.html) - [SpecifyJobSchedulerIdRange: Specify a range of JobScheduler ids](SpecifyJobSchedulerIdRange.md.html) - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) + - [StartActivityAndCollapseDeprecated: TileService.startActivityAndCollapse(Intent) is deprecated](StartActivityAndCollapseDeprecated.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - [StaticFieldLeak: Static Field Leaks](StaticFieldLeak.md.html) @@ -561,10 +584,12 @@ - [SyntheticAccessor: Synthetic Accessor](SyntheticAccessor.md.html) - [SystemPermissionTypo: Permission appears to be a standard permission with a typo](SystemPermissionTypo.md.html) - [TestAppLink: Unmatched URLs](TestAppLink.md.html) + - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) - [TestManifestGradleConfiguration: The ui-test-manifest library should be included using the debugImplementation configuration.](TestManifestGradleConfiguration.md.html) - [TextFields: Missing `inputType`](TextFields.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) - [ThrowableNotAtBeginning: Exception in Timber not at the beginning](ThrowableNotAtBeginning.md.html) + - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) @@ -580,7 +605,7 @@ - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) + - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) @@ -593,6 +618,7 @@ - [UnprotectedSMSBroadcastReceiver: Unprotected SMS `BroadcastReceiver`](UnprotectedSMSBroadcastReceiver.md.html) - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) + - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) @@ -611,6 +637,7 @@ - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) - [Untranslatable: Translated Untranslatable](Untranslatable.md.html) - [UnusedAttribute: Attribute unused on older versions](UnusedAttribute.md.html) + - [UnusedBoxWithConstraintsScope: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedIds: Unused id](UnusedIds.md.html) @@ -637,6 +664,7 @@ - [UseOfNonLambdaOffsetOverload: Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.](UseOfNonLambdaOffsetOverload.md.html) - [UseRequireInsteadOfGet: Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null.](UseRequireInsteadOfGet.md.html) - [UseRxSetProgress2: `setProgress` is deprecated. Use `setCompletableProgress` instead.](UseRxSetProgress2.md.html) + - [UseSdkSuppress: Using `@SdkSuppress` instead of `@RequiresApi`](UseSdkSuppress.md.html) - [UseSparseArrays: HashMap can be replaced with SparseArray](UseSparseArrays.md.html) - [UseSupportActionBar: Should not call `Activity.setActionBar` if you extend `AppCompatActivity`](UseSupportActionBar.md.html) - [UseSwitchCompatOrMaterialCode: Replace usage of `Switch` widget](UseSwitchCompatOrMaterialCode.md.html) @@ -647,6 +675,7 @@ - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - [UsingC2DM: Using C2DM](UsingC2DM.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) + - [UsingMaterialAndMaterial3Libraries: material and material3 are separate, incompatible design system libraries](UsingMaterialAndMaterial3Libraries.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [ValidActionsXml: Invalid Action Descriptor](ValidActionsXml.md.html) - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) @@ -664,7 +693,10 @@ - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearMaterialTheme: Using not non-Wear `MaterialTheme` in a Wear OS project](WearMaterialTheme.md.html) - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) + - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) @@ -682,6 +714,7 @@ - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) + - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) - [WrongConstraintLayoutUsage: Marks a wrong usage of the Constraint Layout.](WrongConstraintLayoutUsage.md.html) - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) diff --git a/docs/checks/libraries.md.html b/docs/checks/libraries.md.html index 08aced19..a8bac4b2 100644 --- a/docs/checks/libraries.md.html +++ b/docs/checks/libraries.md.html @@ -10,24 +10,25 @@ * [com.vanniktech:lint-rules-rxjava2](com_vanniktech_lint-rules-rxjava2.md.html) (7 checks) * [com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html) (1 checks) * [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) (41 checks) -* [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) (81 checks) +* [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) (91 checks) * [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) (18 checks) Android archive libraries which also contain bundled lint checks: -* [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) (1 checks) +* [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) (2 checks) * [androidx.activity:activity](androidx_activity_activity.md.html) (1 checks) -* [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) (10 checks) * [androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html) (1 checks) -* [androidx.compose.ui:ui-graphics](androidx_compose_ui_ui-graphics.md.html) (2 checks) -* [androidx.compose.runtime:runtime-saveable](androidx_compose_runtime_runtime-saveable.md.html) (1 checks) -* [androidx.compose.runtime:runtime](androidx_compose_runtime_runtime.md.html) (14 checks) -* [androidx.compose.animation:animation-core](androidx_compose_animation_animation-core.md.html) (2 checks) -* [androidx.compose.animation:animation](androidx_compose_animation_animation.md.html) (2 checks) -* [androidx.compose.foundation:foundation](androidx_compose_foundation_foundation.md.html) (2 checks) -* [androidx.compose.material3:material3](androidx_compose_material3_material3.md.html) (1 checks) -* [androidx.compose.material:material](androidx_compose_material_material.md.html) (2 checks) +* [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) (9 checks) +* [androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html) (2 checks) +* [androidx.compose.runtime:runtime-saveable-android](androidx_compose_runtime_runtime-saveable-android.md.html) (1 checks) +* [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) (14 checks) +* [androidx.compose.animation:animation-core-android](androidx_compose_animation_animation-core-android.md.html) (3 checks) +* [androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html) (2 checks) +* [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) (4 checks) +* [androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html) (2 checks) +* [androidx.compose.material:material-android](androidx_compose_material_material-android.md.html) (2 checks) * [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) (1 checks) +* [androidx.lifecycle:lifecycle-runtime-testing](androidx_lifecycle_lifecycle-runtime-testing.md.html) (1 checks) * [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) (2 checks) * [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) (3 checks) * [androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html) (1 checks) @@ -40,6 +41,8 @@ * [androidx.work:work-runtime](androidx_work_work-runtime.md.html) (9 checks) * [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) (10 checks) * [androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html) (2 checks) +* [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) (1 checks) +* [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) (1 checks) * [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) (3 checks) * [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) (8 checks) diff --git a/docs/checks/severity.md.html b/docs/checks/severity.md.html index 2cea6925..2dfa4985 100644 --- a/docs/checks/severity.md.html +++ b/docs/checks/severity.md.html @@ -60,16 +60,21 @@ - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) -* Error (258) +* Error (280) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - [AppCompatCustomView: Appcompat Custom Widgets](AppCompatCustomView.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) + - [AppLinkUrlError: URI invalid](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) @@ -98,6 +103,7 @@ - [DefaultEncoding: Using Default Character Encoding](DefaultEncoding.md.html) - [DeletedProvider: Using Deleted Provider](DeletedProvider.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) - [DiffUtilEquals: Suspicious DiffUtil Equality](DiffUtilEquals.md.html) - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) @@ -105,6 +111,7 @@ - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockPlatformTypes: platform types should not be mocked](DoNotMockPlatformTypes.md.html) - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [DuplicateDefinition: Duplicate definitions of resources](DuplicateDefinition.md.html) @@ -113,8 +120,8 @@ - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) + - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) - [FontValidation: Validation of font files](FontValidation.md.html) @@ -226,7 +233,10 @@ - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) + - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) + - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [NewApi: Calling new methods on older versions](NewApi.md.html) + - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) - [NotInterpolated: Incorrect Interpolation](NotInterpolated.md.html) - [NotificationId0: Notification Id is 0](NotificationId0.md.html) - [NotificationPermission: Notifications Without Permission](NotificationPermission.md.html) @@ -240,15 +250,20 @@ - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) + - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [ProduceStateDoesNotAssignValue: produceState calls should assign `value` inside the producer lambda](ProduceStateDoesNotAssignValue.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [Range: Outside Range](Range.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) - [RememberReturnType: `remember` calls must not return `Unit`](RememberReturnType.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) @@ -269,6 +284,7 @@ - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) - [SpanMarkPointMissingMask: Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to.](SpanMarkPointMissingMask.md.html) + - [StartActivityAndCollapseDeprecated: TileService.startActivityAndCollapse(Intent) is deprecated](StartActivityAndCollapseDeprecated.md.html) - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [StringFormatInvalid: Invalid format string](StringFormatInvalid.md.html) @@ -279,12 +295,15 @@ - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) + - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) - [TimberArgTypes: Formatting string doesn't match passed arguments](TimberArgTypes.md.html) - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) + - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) @@ -294,6 +313,7 @@ - [UnsupportedChromeOsHardware: Unsupported Chrome OS Hardware Feature](UnsupportedChromeOsHardware.md.html) - [UnsupportedLayoutAttribute: Marks layout attributes which are not supported.](UnsupportedLayoutAttribute.md.html) - [UnsupportedTvHardware: Unsupported TV Hardware Feature](UnsupportedTvHardware.md.html) + - [UnusedBoxWithConstraintsScope: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) @@ -302,10 +322,12 @@ - [UseAndroidAlpha: `android:alpha` attribute missing on `ColorStateList`](UseAndroidAlpha.md.html) - [UseAppTint: `app:tint` attribute should be used on `ImageView` and `ImageButton`](UseAppTint.md.html) - [UseRequireInsteadOfGet: Use the 'require_____()' API rather than 'get____()' API for more descriptive error messages when it's null.](UseRequireInsteadOfGet.md.html) + - [UseSdkSuppress: Using `@SdkSuppress` instead of `@RequiresApi`](UseSdkSuppress.md.html) - [UsingC2DM: Using C2DM](UsingC2DM.md.html) - [ValidFragment: Fragment not instantiatable](ValidFragment.md.html) - [VectorDrawableCompat: Using VectorDrawableCompat](VectorDrawableCompat.md.html) - [ViewBindingType: `tools:viewBindingType` issues](ViewBindingType.md.html) + - [WearMaterialTheme: Using not non-Wear `MaterialTheme` in a Wear OS project](WearMaterialTheme.md.html) - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WebViewLayout: WebViews in wrap_content parents](WebViewLayout.md.html) @@ -321,9 +343,10 @@ - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) -* Warning (378) +* Warning (388) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) + - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) @@ -342,7 +365,6 @@ - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) - [AuthLeak: Code might contain an auth leak](AuthLeak.md.html) - - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [Autofill: Use Autofill](Autofill.md.html) - [BackButton: Back button](BackButton.md.html) @@ -352,6 +374,7 @@ - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) + - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) @@ -365,7 +388,6 @@ - [CommitTransaction: Missing `commit()` calls](CommitTransaction.md.html) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) @@ -374,6 +396,7 @@ - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) + - [CredentialDependency: `credentials-play-services-auth` is Required](CredentialDependency.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) @@ -407,6 +430,7 @@ - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) + - [ExpiringTargetSdkVersion: TargetSdkVersion Soon Expiring](ExpiringTargetSdkVersion.md.html) - [ExportedContentProvider: Content provider does not require permission](ExportedContentProvider.md.html) - [ExportedPreferenceActivity: PreferenceActivity should not be exported](ExportedPreferenceActivity.md.html) - [ExportedReceiver: Receiver does not require permission](ExportedReceiver.md.html) @@ -464,6 +488,7 @@ - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) + - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) - [InvalidAccessibility: Marks invalid accessibility usages.](InvalidAccessibility.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) @@ -553,6 +578,7 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) + - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) - [RawColor: Flags color that are not defined as resource.](RawColor.md.html) @@ -583,8 +609,10 @@ - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) + - [SecretInSource: Secret in source code](SecretInSource.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) + - [SelectedPhotoAccess: Behavior change when requesting photo library access](SelectedPhotoAccess.md.html) - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) @@ -630,7 +658,7 @@ - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) + - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) - [UnknownIdInLayout: Reference to an id that is not in the current layout](UnknownIdInLayout.md.html) @@ -672,6 +700,7 @@ - [UselessLeaf: Unnecessary leaf layout](UselessLeaf.md.html) - [UselessParent: Unnecessary parent layout](UselessParent.md.html) - [UsingHttp: Using HTTP instead of HTTPS](UsingHttp.md.html) + - [UsingMaterialAndMaterial3Libraries: material and material3 are separate, incompatible design system libraries](UsingMaterialAndMaterial3Libraries.md.html) - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [VectorPath: Long vector paths](VectorPath.md.html) - [VectorRaster: Vector Image Generation](VectorRaster.md.html) @@ -684,6 +713,8 @@ - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) + - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableConfigurationAction: Wear configuration action metadata must match an activity](WearableConfigurationAction.md.html) - [WebViewApiAvailability: WebView API Availability](WebViewApiAvailability.md.html) @@ -693,6 +724,7 @@ - [WorldReadableFiles: `openFileOutput()` with `MODE_WORLD_READABLE`](WorldReadableFiles.md.html) - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) - [WrongAnnotationOrder: Checks that Annotations comply with a certain order.](WrongAnnotationOrder.md.html) + - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) - [WrongDrawableName: Drawable names should be prefixed accordingly.](WrongDrawableName.md.html) - [WrongGlobalIconColor: Each icon should have the same global color defined.](WrongGlobalIconColor.md.html) - [WrongLayoutName: Layout names should be prefixed accordingly.](WrongLayoutName.md.html) @@ -702,9 +734,10 @@ - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) -* Information (7) +* Information (8) - - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) + - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) - [MoshiUsageNonMoshiClassCollection: Concrete Collection type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassCollection.md.html) diff --git a/docs/checks/vendors.md.html b/docs/checks/vendors.md.html index f97d43f9..f42c94ea 100644 --- a/docs/checks/vendors.md.html +++ b/docs/checks/vendors.md.html @@ -3,11 +3,12 @@ Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | By vendor | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Built In (448) +* Built In (464) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) + - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AddJavascriptInterface: `addJavascriptInterface` Called](AddJavascriptInterface.md.html) - [AllCaps: Combining textAllCaps and markup](AllCaps.md.html) @@ -22,7 +23,7 @@ - [AppCompatMethod: Using Wrong AppCompat Method](AppCompatMethod.md.html) - [AppCompatResource: Menu namespace](AppCompatResource.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) + - [AppLinkUrlError: URI invalid](AppLinkUrlError.md.html) - [AppLinksAutoVerify: App Links Auto Verification Failure](AppLinksAutoVerify.md.html) - [ApplySharedPref: Use `apply()` on `SharedPreferences`](ApplySharedPref.md.html) - [AssertionSideEffect: Assertions with Side Effects](AssertionSideEffect.md.html) @@ -37,6 +38,7 @@ - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [BrokenIterator: Broken Iterator](BrokenIterator.md.html) + - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) - [ButtonCase: Cancel/OK dialog button capitalization](ButtonCase.md.html) - [ButtonOrder: Button order](ButtonOrder.md.html) - [ButtonStyle: Button should be borderless](ButtonStyle.md.html) @@ -52,6 +54,7 @@ - [ConstantLocale: Constant Locale](ConstantLocale.md.html) - [ContentDescription: Image without `contentDescription`](ContentDescription.md.html) - [ConvertToWebp: Convert to WebP](ConvertToWebp.md.html) + - [CredentialDependency: `credentials-play-services-auth` is Required](CredentialDependency.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [CustomSplashScreen: Application-defined Launch Screen](CustomSplashScreen.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) @@ -161,6 +164,7 @@ - [IntentFilterExportedReceiver: Unspecified `android:exported` in manifest](IntentFilterExportedReceiver.md.html) - [IntentFilterUniqueDataAttributes: Data tags should only declare unique attributes](IntentFilterUniqueDataAttributes.md.html) - [IntentReset: Suspicious mix of `setType` and `setData`](IntentReset.md.html) + - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) - [InternalInsetResource: Using internal inset dimension resource](InternalInsetResource.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - [InvalidId: Invalid ID declaration](InvalidId.md.html) @@ -241,6 +245,7 @@ - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) + - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) - [NegativeMargin: Negative Margins](NegativeMargin.md.html) @@ -280,6 +285,7 @@ - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) + - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) - [PrivateApi: Using Private APIs](PrivateApi.md.html) @@ -290,6 +296,7 @@ - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) + - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) @@ -326,8 +333,10 @@ - [ScrollViewCount: `ScrollView` can have only one child](ScrollViewCount.md.html) - [ScrollViewSize: ScrollView size validation](ScrollViewSize.md.html) - [SdCardPath: Hardcoded reference to `/sdcard`](SdCardPath.md.html) + - [SecretInSource: Secret in source code](SecretInSource.md.html) - [SecureRandom: Using a fixed seed with `SecureRandom`](SecureRandom.md.html) - [SelectableText: Dynamic text should probably be selectable](SelectableText.md.html) + - [SelectedPhotoAccess: Behavior change when requesting photo library access](SelectedPhotoAccess.md.html) - [ServiceCast: Wrong system service casts](ServiceCast.md.html) - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [SetJavaScriptEnabled: Using `setJavaScriptEnabled`](SetJavaScriptEnabled.md.html) @@ -345,6 +354,7 @@ - [SourceLockedOrientationActivity: Incompatible setRequestedOrientation value](SourceLockedOrientationActivity.md.html) - [SpUsage: Using `dp` instead of `sp` for text sizes](SpUsage.md.html) - [SquareAndRoundTilePreviews: TileProvider does not have round and square previews](SquareAndRoundTilePreviews.md.html) + - [StartActivityAndCollapseDeprecated: TileService.startActivityAndCollapse(Intent) is deprecated](StartActivityAndCollapseDeprecated.md.html) - [StateListReachable: Unreachable state in a ``](StateListReachable.md.html) - [StaticFieldLeak: Static Field Leaks](StaticFieldLeak.md.html) - [StopShip: Code contains `STOPSHIP` marker](StopShip.md.html) @@ -364,6 +374,7 @@ - [TestAppLink: Unmatched URLs](TestAppLink.md.html) - [TextFields: Missing `inputType`](TextFields.md.html) - [TextViewEdits: TextView should probably be an EditText instead](TextViewEdits.md.html) + - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) - [TooDeepLayout: Layout hierarchy is too deep](TooDeepLayout.md.html) - [TooManyViews: Layout has too many views](TooManyViews.md.html) @@ -374,7 +385,7 @@ - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) + - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) @@ -406,6 +417,7 @@ - [UseCheckPermission: Using the result of check permission calls](UseCheckPermission.md.html) - [UseCompoundDrawables: Node can be replaced by a `TextView` with compound drawables](UseCompoundDrawables.md.html) - [UseOfBundledGooglePlayServices: Use of bundled version of Google Play services](UseOfBundledGooglePlayServices.md.html) + - [UseSdkSuppress: Using `@SdkSuppress` instead of `@RequiresApi`](UseSdkSuppress.md.html) - [UseSparseArrays: HashMap can be replaced with SparseArray](UseSparseArrays.md.html) - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) - [UseValueOf: Should use `valueOf` instead of `new`](UseValueOf.md.html) @@ -429,7 +441,10 @@ - [WatchFaceEditor: Watch face editor must use launchMode="standard"](WatchFaceEditor.md.html) - [WatchFaceForAndroidX: AndroidX watch faces must use action `WATCH_FACE_EDITOR`](WatchFaceForAndroidX.md.html) - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearMaterialTheme: Using not non-Wear `MaterialTheme` in a Wear OS project](WearMaterialTheme.md.html) - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) + - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) - [WearStandaloneAppFlag: Invalid or missing Wear standalone app flag](WearStandaloneAppFlag.md.html) - [WearableActionDuplicate: Duplicate watch face configuration activities found](WearableActionDuplicate.md.html) - [WearableBindListener: Usage of Android Wear BIND_LISTENER is deprecated](WearableBindListener.md.html) @@ -445,6 +460,7 @@ - [WorldWriteableFiles: `openFileOutput()` with `MODE_WORLD_WRITEABLE`](WorldWriteableFiles.md.html) - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongCase: Wrong case for view tag](WrongCase.md.html) + - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) - [WrongConstant: Incorrect constant](WrongConstant.md.html) - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) @@ -508,10 +524,11 @@ - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) -* Android Open Source Project (androidx.lifecycle) (3) +* Android Open Source Project (androidx.lifecycle) (4) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) * Android Open Source Project (androidx.navigation.common) (1) @@ -532,6 +549,11 @@ - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) +* Android Open Source Project (androidx.wear.protolayout) (2) + + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + * Android Open Source Project (androidx.work) (9) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) @@ -562,23 +584,27 @@ - [TimberExceptionLogging: Exception Logging](TimberExceptionLogging.md.html) - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) -* Jetpack Activity Compose (androidx.activity.compose) (1) +* Jetpack Activity Compose (androidx.activity.compose) (2) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) + - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) * Jetpack Compose (androidx.compose.animation) (2) - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) - [UnusedCrossfadeTargetStateParameter: Crossfade calls should use the provided `T` parameter in the content lambda](UnusedCrossfadeTargetStateParameter.md.html) -* Jetpack Compose (androidx.compose.animation.core) (2) +* Jetpack Compose (androidx.compose.animation.core) (3) + - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [UnrememberedAnimatable: Creating an Animatable during composition without using `remember`](UnrememberedAnimatable.md.html) - [UnusedTransitionTargetStateParameter: Transition.animate* calls should use the provided targetState when defining values](UnusedTransitionTargetStateParameter.md.html) -* Jetpack Compose (androidx.compose.foundation) (2) +* Jetpack Compose (androidx.compose.foundation) (4) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) + - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) + - [UnusedBoxWithConstraintsScope: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) - [UseOfNonLambdaOffsetOverload: Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.](UseOfNonLambdaOffsetOverload.md.html) * Jetpack Compose (androidx.compose.material) (2) @@ -586,9 +612,10 @@ - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) -* Jetpack Compose (androidx.compose.material3) (1) +* Jetpack Compose (androidx.compose.material3) (2) - [UnusedMaterial3ScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterial3ScaffoldPaddingParameter.md.html) + - [UsingMaterialAndMaterial3Libraries: material and material3 are separate, incompatible design system libraries](UsingMaterialAndMaterial3Libraries.md.html) * Jetpack Compose (androidx.compose.runtime) (14) @@ -611,9 +638,8 @@ - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) -* Jetpack Compose (androidx.compose.ui) (10) +* Jetpack Compose (androidx.compose.ui) (9) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) - [ModifierFactoryUnreferencedReceiver: Modifier factory functions must use the receiver Modifier instance](ModifierFactoryUnreferencedReceiver.md.html) @@ -656,12 +682,17 @@ - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) -* slack (slack-lint) (81) +* slack (slack-lint) (91) - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) - [DeprecatedCall: This class or method is deprecated; consider using an alternative.](DeprecatedCall.md.html) - [DeprecatedSqlUsage: Use SqlDelight!](DeprecatedSqlUsage.md.html) - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) @@ -670,9 +701,11 @@ - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockPlatformTypes: platform types should not be mocked](DoNotMockPlatformTypes.md.html) - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) + - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) @@ -730,9 +763,12 @@ - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) + - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) diff --git a/docs/checks/year.md.html b/docs/checks/year.md.html index 4669ac27..f9c1e533 100644 --- a/docs/checks/year.md.html +++ b/docs/checks/year.md.html @@ -3,8 +3,13 @@ Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | By year | [Libraries](libraries.md.html) -* 2023 (28) +* 2024 (1) + - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) + +* 2023 (45) + + - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) @@ -24,23 +29,41 @@ - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) + - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) + - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) + - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) + - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) + - [SecretInSource: Secret in source code](SecretInSource.md.html) + - [StartActivityAndCollapseDeprecated: TileService.startActivityAndCollapse(Intent) is deprecated](StartActivityAndCollapseDeprecated.md.html) - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) + - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) + - [UnusedBoxWithConstraintsScope: BoxWithConstraints content should use the constraints provided via BoxWithConstraintsScope](UnusedBoxWithConstraintsScope.md.html) - [UnusedContentLambdaTargetStateParameter: AnimatedContent calls should use the provided `T` parameter in the content lambda](UnusedContentLambdaTargetStateParameter.md.html) + - [UsingMaterialAndMaterial3Libraries: material and material3 are separate, incompatible design system libraries](UsingMaterialAndMaterial3Libraries.md.html) - [WearBackNavigation: Wear: Disabling Back navigation](WearBackNavigation.md.html) + - [WearMaterialTheme: Using not non-Wear `MaterialTheme` in a Wear OS project](WearMaterialTheme.md.html) - [WearPasswordInput: Wear: Using password input](WearPasswordInput.md.html) + - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) + - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) + - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) -* 2022 (44) +* 2022 (48) + - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) - [CustomPermissionTypo: Permission appears to be a custom permission with a typo](CustomPermissionTypo.md.html) - [DeepLinkInActivityDestination: A should not be attached to an destination](DeepLinkInActivityDestination.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) + - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) - [DeprecatedSinceApi: Using a method deprecated in earlier SDK](DeprecatedSinceApi.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) @@ -68,6 +91,7 @@ - [ReservedSystemPermission: Permission name is a reserved Android permission](ReservedSystemPermission.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [ReturnThis: Method must return `this`](ReturnThis.md.html) + - [SelectedPhotoAccess: Behavior change when requesting photo library access](SelectedPhotoAccess.md.html) - [SetAndClearCommunicationDevice: Clearing communication device](SetAndClearCommunicationDevice.md.html) - [StringEscaping: Invalid string escapes](StringEscaping.md.html) - [SystemPermissionTypo: Permission appears to be a standard permission with a typo](SystemPermissionTypo.md.html) @@ -79,15 +103,20 @@ - [UnusedMaterialScaffoldPaddingParameter: Scaffold content should use the padding provided as a lambda parameter](UnusedMaterialScaffoldPaddingParameter.md.html) - [UnusedTranslation: Unused Translation](UnusedTranslation.md.html) - [UseOfNonLambdaOffsetOverload: Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.](UseOfNonLambdaOffsetOverload.md.html) + - [UseSdkSuppress: Using `@SdkSuppress` instead of `@RequiresApi`](UseSdkSuppress.md.html) - [WrongResourceImportAlias: Wrong import alias for this R class.](WrongResourceImportAlias.md.html) -* 2021 (120) +* 2021 (130) - [AnnotateVersionCheck: Annotate SDK_INT checks](AnnotateVersionCheck.md.html) - [AppBundleLocaleChanges: App Bundle handling of runtime locale changes](AppBundleLocaleChanges.md.html) - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - - [BindsCanBeExtensionFunction: @Binds-annotated functions can be extension functions.](BindsCanBeExtensionFunction.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) @@ -105,6 +134,7 @@ - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) + - [DoNotMockPlatformTypes: platform types should not be mocked](DoNotMockPlatformTypes.md.html) - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) @@ -171,12 +201,15 @@ - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) + - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [NoOp: NoOp Code](NoOp.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) - [ProduceStateDoesNotAssignValue: produceState calls should assign `value` inside the producer lambda](ProduceStateDoesNotAssignValue.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) + - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) @@ -187,6 +220,8 @@ - [StateFlowValueCalledInComposition: StateFlow.value should not be called within composition](StateFlowValueCalledInComposition.md.html) - [SubscribeOnMain: subscribeOn called with the main thread scheduler.](SubscribeOnMain.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) + - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [TileProviderPermissions: TileProvider does not set permission](TileProviderPermissions.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) - [UnnecessaryComposedModifier: Modifier.composed should only be used for modifiers that invoke @Composable functions](UnnecessaryComposedModifier.md.html) @@ -204,14 +239,12 @@ - [WebViewClientOnReceivedSslError: Proceeds with the HTTPS connection despite SSL errors](WebViewClientOnReceivedSslError.md.html) - [WrongRequiresOptIn: Experimental annotations defined in Kotlin must use kotlin.RequiresOptIn](WrongRequiresOptIn.md.html) -* 2020 (56) +* 2020 (54) - [ComposableLambdaParameterNaming: Primary composable lambda parameter not named `content`](ComposableLambdaParameterNaming.md.html) - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - - [ComposableModifierFactory: Modifier factory functions should not be @Composable](ComposableModifierFactory.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) - [FieldSiteTargetOnQualifierAnnotation: Redundant 'field:' used for Dagger qualifier annotation.](FieldSiteTargetOnQualifierAnnotation.md.html) - [IdleBatteryChargingConstraints: Constraints may not be met for some devices](IdleBatteryChargingConstraints.md.html) @@ -324,7 +357,7 @@ * 2017 (31) - - [AppLinkUrlError: URL not supported by app for Firebase App Indexing](AppLinkUrlError.md.html) + - [AppLinkUrlError: URI invalid](AppLinkUrlError.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - [CheckResult: Ignoring results](CheckResult.md.html) - [DiscouragedPrivateApi: Using Discouraged Private API](DiscouragedPrivateApi.md.html) @@ -427,7 +460,7 @@ - [VectorRaster: Vector Image Generation](VectorRaster.md.html) - [VulnerableCordovaVersion: Vulnerable Cordova Version](VulnerableCordovaVersion.md.html) -* 2014 (69) +* 2014 (72) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) @@ -441,6 +474,7 @@ - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [ChromeOsAbiSupport: Missing ABI Support for ChromeOS](ChromeOsAbiSupport.md.html) - [ClickableViewAccessibility: Accessibility in Custom Views](ClickableViewAccessibility.md.html) + - [CredentialDependency: `credentials-play-services-auth` is Required](CredentialDependency.md.html) - [CustomViewStyleable: Mismatched Styleable/Custom View Name](CustomViewStyleable.md.html) - [DataBindingWithoutKapt: Data Binding without Annotation Processing](DataBindingWithoutKapt.md.html) - [DeprecatedProvider: Using BC Provider](DeprecatedProvider.md.html) @@ -477,8 +511,10 @@ - [NewerVersionAvailable: Newer Library Versions Available](NewerVersionAvailable.md.html) - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) - [NotInterpolated: Incorrect Interpolation](NotInterpolated.md.html) + - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) - [OutdatedLibrary: Outdated Library](OutdatedLibrary.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) + - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) @@ -581,7 +617,7 @@ - [WrongCall: Using wrong draw/layout method](WrongCall.md.html) - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) -* 2011 (98) +* 2011 (97) - [AdapterViewChildren: `AdapterView` cannot have children in XML](AdapterViewChildren.md.html) - [AppIndexingService: App Indexing Background Services](AppIndexingService.md.html) @@ -636,7 +672,6 @@ - [NotSibling: Invalid Constraints](NotSibling.md.html) - [NotificationIconCompatibility: Notification Icon Compatibility](NotificationIconCompatibility.md.html) - [ObsoleteLayoutParam: Obsolete layout params](ObsoleteLayoutParam.md.html) - - [OldTargetApi: Target SDK attribute is not targeting latest version](OldTargetApi.md.html) - [Orientation: Missing explicit orientation](Orientation.md.html) - [Overdraw: Overdraw: Painting regions more than once](Overdraw.md.html) - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) @@ -665,7 +700,7 @@ - [TypographyEllipsis: Ellipsis string can be replaced with ellipsis character](TypographyEllipsis.md.html) - [TypographyFractions: Fraction string can be replaced with fraction character](TypographyFractions.md.html) - [TypographyOther: Other typographical problems](TypographyOther.md.html) - - [TypographyQuotes: Straight quotes can be replaced with curvy quotes](TypographyQuotes.md.html) + - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - [UnknownId: Reference to an unknown id](UnknownId.md.html) @@ -682,7 +717,7 @@ - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) -* Unknown (57) +* Unknown (58) - [AlertDialogUsage: Use the support library AlertDialog instead of android.app.AlertDialog.](AlertDialogUsage.md.html) - [AssertjImport: Flags Java 6 incompatible imports.](AssertjImport.md.html) @@ -690,6 +725,7 @@ - [ColorCasing: Raw colors should be defined with uppercase letters.](ColorCasing.md.html) - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) - [DefaultLayoutAttribute: Flags default layout values.](DefaultLayoutAttribute.md.html) + - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [FormalGerman: Marks strings which contain formal German words.](FormalGerman.md.html) - [ImplicitStringPlaceholder: Marks implicit placeholders in strings without an index.](ImplicitStringPlaceholder.md.html) diff --git a/docs/print-command.sh b/docs/print-command.sh index ccdfa70b..c38eab56 100755 --- a/docs/print-command.sh +++ b/docs/print-command.sh @@ -10,6 +10,8 @@ export ANDROID_URI_PREFIX=https://cs.android.com/androidx/platform/frameworks/su # If running the documentation driver directly, omit the # --generate-docs flag +echo "(Also consider including --maven-central --gmaven)" + echo lint \ --generate-docs \ --output $OUTPUT \ From 149982f68a5bf0970dc177b660f2e7a25bf167d6 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Sat, 18 May 2024 02:19:52 -0700 Subject: [PATCH 06/20] Update lint check documentation --- docs/checks/AppLinksAutoVerify.md.html | 22 +- docs/checks/ArcAnimationSpecTypeIssue.md.html | 8 +- .../ArgInFormattedQuantityStringRes.md.html | 8 +- docs/checks/AutoboxingStateCreation.md.html | 8 +- .../AutoboxingStateValueProperty.md.html | 8 +- docs/checks/BadConfigurationProvider.md.html | 8 +- .../BadPeriodicWorkRequestEnqueue.md.html | 8 +- docs/checks/BindingReceiverParameter.md.html | 14 +- docs/checks/BindingReturnType.md.html | 14 +- .../BindsCanBeExtensionFunction.md.html | 249 ------------------ docs/checks/BindsMustBeAbstract.md.html | 14 +- docs/checks/BindsTypeMismatch.md.html | 14 +- docs/checks/BindsWrongParameterCount.md.html | 14 +- .../CastingViewContextToActivity.md.html | 8 +- ...omposableDestinationInComposeScope.md.html | 8 +- .../ComposableLambdaParameterNaming.md.html | 8 +- .../ComposableLambdaParameterPosition.md.html | 8 +- docs/checks/ComposableNaming.md.html | 8 +- .../ComposableNavGraphInComposeScope.md.html | 8 +- docs/checks/ComposeComposableModifier.md.html | 22 +- .../ComposeCompositionLocalGetter.md.html | 199 ++++++++++++++ .../ComposeCompositionLocalUsage.md.html | 12 +- ...mposeContentEmitterReturningValues.md.html | 17 +- docs/checks/ComposeM2Api.md.html | 30 ++- docs/checks/ComposeModifierComposed.md.html | 202 ++++++++++++++ docs/checks/ComposeModifierMissing.md.html | 11 +- docs/checks/ComposeModifierReused.md.html | 17 +- .../ComposeModifierWithoutDefault.md.html | 11 +- .../ComposeMultipleContentEmitters.md.html | 9 +- docs/checks/ComposeMutableParameters.md.html | 16 +- docs/checks/ComposeNamingLowercase.md.html | 16 +- docs/checks/ComposeNamingUppercase.md.html | 16 +- docs/checks/ComposeParameterOrder.md.html | 8 +- docs/checks/ComposePreviewNaming.md.html | 8 +- docs/checks/ComposePreviewPublic.md.html | 32 +-- docs/checks/ComposeRememberMissing.md.html | 8 +- .../checks/ComposeUnstableCollections.md.html | 8 +- docs/checks/ComposeUnstableReceiver.md.html | 246 +++++++++++++++++ .../checks/ComposeViewModelForwarding.md.html | 22 +- docs/checks/ComposeViewModelInjection.md.html | 8 +- docs/checks/CompositionLocalNaming.md.html | 8 +- docs/checks/ConflictingOnColor.md.html | 8 +- ...CoroutineCreationDuringComposition.md.html | 8 +- .../DeepLinkInActivityDestination.md.html | 8 +- docs/checks/DenyListedApi.md.html | 8 +- docs/checks/DenyListedBlockingApi.md.html | 8 +- docs/checks/DeprecatedCall.md.html | 8 +- docs/checks/DeprecatedSqlUsage.md.html | 8 +- .../DetachAndAttachSameFragment.md.html | 8 +- .../DialogFragmentCallbacksDetector.md.html | 8 +- docs/checks/DoNotCallProviders.md.html | 8 +- ...DoNotExposeEitherNetInRepositories.md.html | 8 +- docs/checks/DoNotMock.md.html | 14 +- docs/checks/DoNotMockAnything.md.html | 201 ++++++++++++++ docs/checks/DoNotMockAutoValue.md.html | 14 +- docs/checks/DoNotMockDataClass.md.html | 14 +- docs/checks/DoNotMockObjectClass.md.html | 14 +- docs/checks/DoNotMockPlatformTypes.md.html | 14 +- docs/checks/DoNotMockRecordClass.md.html | 14 +- docs/checks/DoNotMockSealedClass.md.html | 14 +- docs/checks/EmptyNavDeepLink.md.html | 8 +- docs/checks/ErrorProneDoNotMockUsage.md.html | 8 +- docs/checks/ExceptionMessage.md.html | 30 +-- .../ExperimentalAnnotationRetention.md.html | 8 +- ...eldSiteTargetOnQualifierAnnotation.md.html | 8 +- docs/checks/FileEndsWithExt.md.html | 4 +- .../FlowOperatorInvokedInComposition.md.html | 8 +- docs/checks/FragmentAddMenuProvider.md.html | 8 +- .../FragmentBackPressedCallback.md.html | 8 +- .../FragmentConstructorInjection.md.html | 8 +- docs/checks/FragmentFieldInjection.md.html | 8 +- .../FragmentGradleConfiguration-2.md.html | 8 +- .../FragmentGradleConfiguration.md.html | 8 +- docs/checks/FragmentLiveDataObserve.md.html | 8 +- docs/checks/FragmentTagUsage.md.html | 8 +- ...entlyChangedStateReadInComposition.md.html | 8 +- docs/checks/FullyQualifiedResource.md.html | 8 +- docs/checks/GuavaChecksUsed.md.html | 8 +- .../GuavaPreconditionsUsedInKotlin.md.html | 8 +- .../IdleBatteryChargingConstraints.md.html | 8 +- docs/checks/InclusiveNaming.md.html | 12 +- docs/checks/InjectInJava.md.html | 8 +- ...hScopeRequiredLoggedInUserProvider.md.html | 209 --------------- docs/checks/InvalidColorHexValue.md.html | 8 +- ...idFragmentVersionForActivityResult.md.html | 8 +- .../InvalidLanguageTagDelimiter.md.html | 174 ++++++++++++ ...InvalidPeriodicWorkRequestInterval.md.html | 8 +- docs/checks/InvalidUseOfOnBackPressed.md.html | 140 ++++++++++ docs/checks/JavaOnlyDetector.md.html | 8 +- .../JvmStaticProvidesInObjectDetector.md.html | 8 +- docs/checks/KotlinPairNotCreated.md.html | 8 +- docs/checks/LaunchDuringComposition.md.html | 8 +- docs/checks/LintImplIdFormat.md.html | 5 +- docs/checks/LintImplTrimIndent.md.html | 5 +- docs/checks/MainScopeUsage.md.html | 8 +- docs/checks/MissingColorAlphaChannel.md.html | 8 +- .../checks/MissingResourceImportAlias.md.html | 8 +- .../ModifierFactoryExtensionFunction.md.html | 10 +- docs/checks/ModifierFactoryReturnType.md.html | 10 +- ...odifierFactoryUnreferencedReceiver.md.html | 10 +- .../ModifierNodeInspectableProperties.md.html | 10 +- docs/checks/ModifierParameter.md.html | 10 +- docs/checks/ModuleCompanionObjects.md.html | 8 +- ...eCompanionObjectsNotInModuleParent.md.html | 8 +- ...MoshiUsageAdaptedByRequiresAdapter.md.html | 8 +- .../MoshiUsageAdaptedByRequiresKeep.md.html | 8 +- docs/checks/MoshiUsageArray.md.html | 8 +- docs/checks/MoshiUsageBlankGenerator.md.html | 8 +- docs/checks/MoshiUsageBlankJsonName.md.html | 8 +- docs/checks/MoshiUsageBlankTypeLabel.md.html | 8 +- docs/checks/MoshiUsageClassVisibility.md.html | 8 +- .../MoshiUsageDoubleClassAnnotation.md.html | 8 +- docs/checks/MoshiUsageDoubleTypeLabel.md.html | 8 +- .../MoshiUsageDuplicateJsonName.md.html | 8 +- .../MoshiUsageEnumAnnotatedUnknown.md.html | 8 +- docs/checks/MoshiUsageEnumCasing.md.html | 8 +- .../MoshiUsageEnumJsonClassGenerated.md.html | 8 +- .../MoshiUsageEnumMissingJsonClass.md.html | 8 +- .../MoshiUsageEnumMissingUnknown.md.html | 8 +- ...MoshiUsageEnumPropertyCouldBeMoshi.md.html | 8 +- ...shiUsageEnumPropertyDefaultUnknown.md.html | 8 +- ...hiUsageGenerateAdapterShouldBeTrue.md.html | 8 +- .../MoshiUsageGenericSealedSubtype.md.html | 8 +- .../MoshiUsageInappropriateTypeLabel.md.html | 8 +- docs/checks/MoshiUsageMissingPrimary.md.html | 8 +- .../checks/MoshiUsageMissingTypeLabel.md.html | 8 +- .../MoshiUsageMutableCollections.md.html | 8 +- .../MoshiUsageNonMoshiClassCollection.md.html | 8 +- .../MoshiUsageNonMoshiClassExternal.md.html | 8 +- .../MoshiUsageNonMoshiClassInternal.md.html | 8 +- .../checks/MoshiUsageNonMoshiClassMap.md.html | 8 +- .../MoshiUsageNonMoshiClassPlatform.md.html | 8 +- docs/checks/MoshiUsageObject.md.html | 8 +- docs/checks/MoshiUsageParamNeedsInit.md.html | 8 +- .../MoshiUsagePrivateConstructor.md.html | 8 +- ...shiUsagePrivateConstructorProperty.md.html | 8 +- .../MoshiUsageQualifierRetention.md.html | 8 +- docs/checks/MoshiUsageQualifierTarget.md.html | 8 +- .../MoshiUsageRedundantJsonName.md.html | 8 +- .../MoshiUsageRedundantSiteTarget.md.html | 8 +- .../MoshiUsageSealedMustBeSealed.md.html | 8 +- docs/checks/MoshiUsageSerializedName.md.html | 8 +- docs/checks/MoshiUsageSnakeCase.md.html | 8 +- .../MoshiUsageTransientNeedsInit.md.html | 8 +- docs/checks/MoshiUsageUnsupportedType.md.html | 8 +- docs/checks/MoshiUsageUseData.md.html | 8 +- docs/checks/MoshiUsageVarProperty.md.html | 8 +- .../MultipleAwaitPointerEventScopes.md.html | 10 +- docs/checks/MustBeInModule.md.html | 16 +- ...ble.md.html => MustUseNamedParams.md.html} | 95 +++---- .../MutableCollectionMutableState.md.html | 8 +- docs/checks/NoCollectCallFound.md.html | 8 +- docs/checks/NullSafeMutableLiveData-2.md.html | 162 ++++++++++++ docs/checks/NullSafeMutableLiveData.md.html | 30 ++- docs/checks/OpaqueUnitKey.md.html | 8 +- docs/checks/OutdatedLibrary.md.html | 16 +- docs/checks/ParcelizeFunctionProperty.md.html | 14 +- docs/checks/PictureInPictureIssue.md.html | 141 ++++++++++ docs/checks/PlaySdkIndexNonCompliant.md.html | 21 +- .../ProduceStateDoesNotAssignValue.md.html | 8 +- ...ayoutEdgeContentLayoutResponsive-2.md.html | 155 +++++++++++ ...ayoutEdgeContentLayoutResponsive-3.md.html | 155 +++++++++++ ...oLayoutEdgeContentLayoutResponsive.md.html | 155 +++++++++++ docs/checks/ProtoLayoutMinSchema-2.md.html | 25 +- docs/checks/ProtoLayoutMinSchema-3.md.html | 164 ++++++++++++ docs/checks/ProtoLayoutMinSchema.md.html | 13 +- ...otoLayoutPrimaryLayoutResponsive-2.md.html | 153 +++++++++++ ...otoLayoutPrimaryLayoutResponsive-3.md.html | 153 +++++++++++ ...ProtoLayoutPrimaryLayoutResponsive.md.html | 153 +++++++++++ docs/checks/ProvidesMustNotBeAbstract.md.html | 14 +- docs/checks/RawDispatchersUse.md.html | 8 +- docs/checks/RedactedInJavaUsage.md.html | 8 +- docs/checks/RedundantBinds.md.html | 14 +- docs/checks/RememberReturnType.md.html | 8 +- .../RememberSaveableSaverParameter.md.html | 8 +- .../RemoveWorkManagerInitializer.md.html | 8 +- .../RepeatOnLifecycleWrongUsage-2.md.html | 150 +++++++++++ .../RepeatOnLifecycleWrongUsage.md.html | 30 ++- docs/checks/RestrictCallsTo.md.html | 8 +- docs/checks/RetrofitUsage.md.html | 8 +- .../ReturnFromAwaitPointerEventScope.md.html | 10 +- docs/checks/RiskyLibrary.md.html | 7 +- docs/checks/SecretInSource.md.html | 2 +- docs/checks/SerializableUsage.md.html | 8 +- docs/checks/SimilarGradleDependency.md.html | 82 ++++++ docs/checks/SpanMarkPointMissingMask.md.html | 8 +- .../SpecifyForegroundServiceType.md.html | 8 +- .../checks/SpecifyJobSchedulerIdRange.md.html | 8 +- .../StateFlowValueCalledInComposition.md.html | 8 +- docs/checks/SubscribeOnMain.md.html | 8 +- ...iciousCompositionLocalModifierRead.md.html | 10 +- ...md.html => SuspiciousModifierThen.md.html} | 145 +++++----- .../TestLifecycleOwnerInCoroutine.md.html | 8 +- .../TestManifestGradleConfiguration.md.html | 8 +- docs/checks/UastImplementation.md.html | 46 +++- docs/checks/UnclosedTrace.md.html | 238 +++++++++++++++++ .../UnnecessaryComposedModifier.md.html | 10 +- docs/checks/UnrememberedAnimatable.md.html | 8 +- .../UnrememberedGetBackStackEntry.md.html | 8 +- ...rememberedMutableInteractionSource.md.html | 8 +- docs/checks/UnrememberedMutableState.md.html | 8 +- .../checks/UnsafeLifecycleWhenUsage-2.md.html | 159 +++++++++++ docs/checks/UnsafeLifecycleWhenUsage.md.html | 30 ++- docs/checks/UnsafeOptInUsageError.md.html | 8 +- docs/checks/UnsafeOptInUsageWarning.md.html | 8 +- .../UnsafeRepeatOnLifecycleDetector.md.html | 8 +- .../UnusedBoxWithConstraintsScope.md.html | 8 +- ...dContentLambdaTargetStateParameter.md.html | 8 +- ...nusedCrossfadeTargetStateParameter.md.html | 8 +- ...dMaterial3ScaffoldPaddingParameter.md.html | 8 +- ...edMaterialScaffoldPaddingParameter.md.html | 8 +- ...usedTransitionTargetStateParameter.md.html | 8 +- docs/checks/UseAndroidAlpha.md.html | 8 +- docs/checks/UseAppTint.md.html | 8 +- ...UseCompatLoadingForColorStateLists.md.html | 8 +- .../UseCompatLoadingForDrawables.md.html | 8 +- .../UseCompatTextViewDrawableApis.md.html | 8 +- .../UseCompatTextViewDrawableXml.md.html | 8 +- docs/checks/UseGetLayoutInflater.md.html | 8 +- .../UseOfNonLambdaOffsetOverload.md.html | 8 +- docs/checks/UseRequireInsteadOfGet.md.html | 8 +- docs/checks/UseRxSetProgress2.md.html | 8 +- docs/checks/UseSupportActionBar.md.html | 8 +- .../UseSwitchCompatOrMaterialCode.md.html | 10 +- .../UseSwitchCompatOrMaterialXml.md.html | 10 +- ...UsingMaterialAndMaterial3Libraries.md.html | 8 +- docs/checks/UsingOnClickInXml.md.html | 8 +- docs/checks/WearableActionDuplicate.md.html | 2 +- docs/checks/WorkerHasAPublicModifier.md.html | 8 +- docs/checks/WrongRequiresOptIn.md.html | 8 +- docs/checks/WrongResourceImportAlias.md.html | 8 +- ...androidx_activity_activity-compose.md.html | 13 +- .../checks/androidx_activity_activity.md.html | 21 +- ...annotation_annotation-experimental.md.html | 11 +- .../androidx_appcompat_appcompat.md.html | 12 +- ...ompose_animation_animation-android.md.html | 25 +- ...e_animation_animation-core-android.md.html | 25 +- ...x_compose_animation_animation-core.md.html | 95 ------- ...droidx_compose_animation_animation.md.html | 94 ------- ...pose_foundation_foundation-android.md.html | 25 +- ...oidx_compose_foundation_foundation.md.html | 87 ------ ...ompose_material3_material3-android.md.html | 38 ++- ...droidx_compose_material3_material3.md.html | 74 ------ ..._compose_material_material-android.md.html | 25 +- ...androidx_compose_material_material.md.html | 92 ------- ...dx_compose_runtime_runtime-android.md.html | 25 +- ...e_runtime_runtime-saveable-android.md.html | 25 +- ...x_compose_runtime_runtime-saveable.md.html | 92 ------- .../androidx_compose_runtime_runtime.md.html | 114 -------- .../androidx_compose_ui_ui-android.md.html | 29 +- ...idx_compose_ui_ui-graphics-android.md.html | 25 +- .../androidx_compose_ui_ui-graphics.md.html | 94 ------- ...droidx_compose_ui_ui-test-manifest.md.html | 25 +- ...ndroidx_compose_ui_ui-text-android.md.html | 72 +++++ docs/checks/androidx_compose_ui_ui.md.html | 109 -------- ...fragment_fragment-testing-manifest.md.html | 24 +- ...androidx_fragment_fragment-testing.md.html | 24 +- .../checks/androidx_fragment_fragment.md.html | 24 +- ...ecycle_lifecycle-livedata-core-ktx.md.html | 6 +- ..._lifecycle_lifecycle-livedata-core.md.html | 58 ++++ ...ifecycle_lifecycle-runtime-android.md.html | 59 +++++ ...dx_lifecycle_lifecycle-runtime-ktx.md.html | 8 +- ...ifecycle_lifecycle-runtime-testing.md.html | 12 +- ...roidx_navigation_navigation-common.md.html | 19 +- ...oidx_navigation_navigation-compose.md.html | 19 +- ...oidx_navigation_navigation-runtime.md.html | 19 +- ...protolayout_protolayout-expression.md.html | 29 +- ...r_protolayout_protolayout-material.md.html | 74 ++++++ ...roidx_wear_protolayout_protolayout.md.html | 29 +- .../checks/androidx_work_work-runtime.md.html | 11 +- docs/checks/categories.md.html | 53 ++-- .../com_google_dagger_dagger-lint.md.html | 12 +- ...k_lint_compose_compose-lint-checks.md.html | 57 ++-- .../com_slack_lint_slack-lint-checks.md.html | 203 +++++++------- docs/checks/index.md.html | 65 +++-- docs/checks/libraries.md.html | 14 +- docs/checks/severity.md.html | 58 ++-- docs/checks/vendors.md.html | 62 +++-- docs/checks/year.md.html | 59 +++-- 279 files changed, 5318 insertions(+), 2882 deletions(-) delete mode 100644 docs/checks/BindsCanBeExtensionFunction.md.html create mode 100644 docs/checks/ComposeCompositionLocalGetter.md.html create mode 100644 docs/checks/ComposeModifierComposed.md.html create mode 100644 docs/checks/ComposeUnstableReceiver.md.html create mode 100644 docs/checks/DoNotMockAnything.md.html delete mode 100644 docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html create mode 100644 docs/checks/InvalidLanguageTagDelimiter.md.html create mode 100644 docs/checks/InvalidUseOfOnBackPressed.md.html rename docs/checks/{InjectWithTypeMustImplementAnvilInjectable.md.html => MustUseNamedParams.md.html} (60%) create mode 100644 docs/checks/NullSafeMutableLiveData-2.md.html create mode 100644 docs/checks/PictureInPictureIssue.md.html create mode 100644 docs/checks/ProtoLayoutEdgeContentLayoutResponsive-2.md.html create mode 100644 docs/checks/ProtoLayoutEdgeContentLayoutResponsive-3.md.html create mode 100644 docs/checks/ProtoLayoutEdgeContentLayoutResponsive.md.html create mode 100644 docs/checks/ProtoLayoutMinSchema-3.md.html create mode 100644 docs/checks/ProtoLayoutPrimaryLayoutResponsive-2.md.html create mode 100644 docs/checks/ProtoLayoutPrimaryLayoutResponsive-3.md.html create mode 100644 docs/checks/ProtoLayoutPrimaryLayoutResponsive.md.html create mode 100644 docs/checks/RepeatOnLifecycleWrongUsage-2.md.html create mode 100644 docs/checks/SimilarGradleDependency.md.html rename docs/checks/{ComposableModifierFactory.md.html => SuspiciousModifierThen.md.html} (52%) create mode 100644 docs/checks/UnclosedTrace.md.html create mode 100644 docs/checks/UnsafeLifecycleWhenUsage-2.md.html delete mode 100644 docs/checks/androidx_compose_animation_animation-core.md.html delete mode 100644 docs/checks/androidx_compose_animation_animation.md.html delete mode 100644 docs/checks/androidx_compose_foundation_foundation.md.html delete mode 100644 docs/checks/androidx_compose_material3_material3.md.html delete mode 100644 docs/checks/androidx_compose_material_material.md.html delete mode 100644 docs/checks/androidx_compose_runtime_runtime-saveable.md.html delete mode 100644 docs/checks/androidx_compose_runtime_runtime.md.html delete mode 100644 docs/checks/androidx_compose_ui_ui-graphics.md.html create mode 100644 docs/checks/androidx_compose_ui_ui-text-android.md.html delete mode 100644 docs/checks/androidx_compose_ui_ui.md.html create mode 100644 docs/checks/androidx_lifecycle_lifecycle-livedata-core.md.html create mode 100644 docs/checks/androidx_lifecycle_lifecycle-runtime-android.md.html create mode 100644 docs/checks/androidx_wear_protolayout_protolayout-material.md.html diff --git a/docs/checks/AppLinksAutoVerify.md.html b/docs/checks/AppLinksAutoVerify.md.html index a1d6abca..8cacf1cd 100644 --- a/docs/checks/AppLinksAutoVerify.md.html +++ b/docs/checks/AppLinksAutoVerify.md.html @@ -31,9 +31,9 @@ See : https://g.co/appindexing/applinks 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/AppLinksAutoVerifyDetector.java) +: [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/AppLinksAutoVerifyDetector.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/AppLinksAutoVerifyDetectorTest.java) +: [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/AppLinksAutoVerifyDetectorTest.kt) Copyright Year : 2015 @@ -43,12 +43,12 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -AndroidManifest.xml:12:Error: This host does not support app links to -your app. Checks the Digital Asset Links JSON file: -http://example.com/.well-known/assetlinks.json [AppLinksAutoVerify] +AndroidManifest.xml:12:Warning: HTTP request for Digital Asset Links +JSON file https://links.dropbox.com/.well-known/assetlinks.json fails. +HTTP response code: 301 [AppLinksAutoVerify] - android:host="example.com" - -------------------------- + android:host="links.dropbox.com" + -------------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -57,7 +57,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.example.helloworld" > + package="com.dropbox.links" > <application android:allowBackup="true" @@ -66,7 +66,7 @@ <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <data android:scheme="http" - android:host="example.com" + android:host="links.dropbox.com" android:pathPrefix="/gizmos" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> @@ -78,11 +78,11 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/AppLinksAutoVerifyDetectorTest.java) +[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/AppLinksAutoVerifyDetectorTest.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, `AppLinksAutoVerifyDetector.testInvalidPackage`. +found for this lint check, `AppLinksAutoVerifyDetector.testRedirect`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=192708. diff --git a/docs/checks/ArcAnimationSpecTypeIssue.md.html b/docs/checks/ArcAnimationSpecTypeIssue.md.html index 73ba6770..99c1ef09 100644 --- a/docs/checks/ArcAnimationSpecTypeIssue.md.html +++ b/docs/checks/ArcAnimationSpecTypeIssue.md.html @@ -103,17 +103,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-core-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core-android = "1.7.0-alpha01" +animation-core-android = "1.7.0-beta01" [libraries] animation-core-android = { module = "androidx.compose.animation:animation-core-android", @@ -121,7 +121,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ArgInFormattedQuantityStringRes.md.html b/docs/checks/ArgInFormattedQuantityStringRes.md.html index a46b5d1f..810239fe 100644 --- a/docs/checks/ArgInFormattedQuantityStringRes.md.html +++ b/docs/checks/ArgInFormattedQuantityStringRes.md.html @@ -92,17 +92,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -110,7 +110,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/AutoboxingStateCreation.md.html b/docs/checks/AutoboxingStateCreation.md.html index 7c3e2f30..181a9b04 100644 --- a/docs/checks/AutoboxingStateCreation.md.html +++ b/docs/checks/AutoboxingStateCreation.md.html @@ -95,17 +95,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -113,7 +113,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/AutoboxingStateValueProperty.md.html b/docs/checks/AutoboxingStateValueProperty.md.html index 6502536f..66871bae 100644 --- a/docs/checks/AutoboxingStateValueProperty.md.html +++ b/docs/checks/AutoboxingStateValueProperty.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -108,7 +108,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/BadConfigurationProvider.md.html b/docs/checks/BadConfigurationProvider.md.html index f557b1be..2ac6a8f8 100644 --- a/docs/checks/BadConfigurationProvider.md.html +++ b/docs/checks/BadConfigurationProvider.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html index 59912a5a..a3a55a76 100644 --- a/docs/checks/BadPeriodicWorkRequestEnqueue.md.html +++ b/docs/checks/BadPeriodicWorkRequestEnqueue.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/BindingReceiverParameter.md.html b/docs/checks/BindingReceiverParameter.md.html index 15985df0..db50ec84 100644 --- a/docs/checks/BindingReceiverParameter.md.html +++ b/docs/checks/BindingReceiverParameter.md.html @@ -1,13 +1,13 @@ -(#) @Binds/@Provides functions cannot be extension functions. +(#) @Binds/@Provides functions cannot be extensions -!!! ERROR: @Binds/@Provides functions cannot be extension functions. +!!! ERROR: @Binds/@Provides functions cannot be extensions This is an error. Id : `BindingReceiverParameter` Summary -: @Binds/@Provides functions cannot be extension functions. +: @Binds/@Provides functions cannot be extensions Severity : Error Category @@ -169,17 +169,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -187,7 +187,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/BindingReturnType.md.html b/docs/checks/BindingReturnType.md.html index 27b48aa6..8327eafe 100644 --- a/docs/checks/BindingReturnType.md.html +++ b/docs/checks/BindingReturnType.md.html @@ -1,13 +1,13 @@ -(#) @Binds/@Provides functions must have a return type. Cannot be void or Unit. +(#) @Binds/@Provides must have a return type -!!! ERROR: @Binds/@Provides functions must have a return type. Cannot be void or Unit. +!!! ERROR: @Binds/@Provides must have a return type This is an error. Id : `BindingReturnType` Summary -: @Binds/@Provides functions must have a return type. Cannot be void or Unit. +: @Binds/@Provides must have a return type Severity : Error Category @@ -105,17 +105,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -123,7 +123,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/BindsCanBeExtensionFunction.md.html b/docs/checks/BindsCanBeExtensionFunction.md.html deleted file mode 100644 index 7499980e..00000000 --- a/docs/checks/BindsCanBeExtensionFunction.md.html +++ /dev/null @@ -1,249 +0,0 @@ - -(#) @Binds-annotated functions can be extension functions. - -!!! Tip: @Binds-annotated functions can be extension functions. - Advice from this check is just a tip. - -Id -: `BindsCanBeExtensionFunction` -Summary -: @Binds-annotated functions can be extension functions. -Severity -: Information -Category -: Usability -Platform -: Any -Vendor -: slack -Identifier -: slack-lint -Contact -: https://github.com/slackhq/slack-lints -Feedback -: https://github.com/slackhq/slack-lints -Min -: Lint 8.0 and 8.1 -Compiled -: Lint 8.0 and 8.1 -Artifact -: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) - -Affects -: Kotlin and Java files and test sources -Editing -: This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/DaggerKotlinIssuesDetector.kt) -Tests -: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerKotlinIssuesDetectorTest.kt) -Copyright Year -: 2021 - -@Binds-annotated functions can be extension functions to simplify code -readability. - -!!! Tip - This lint check has an associated quickfix available in the IDE. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/foo/MyQualifier.kt:13:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Int): Number - ------------------------------------ - - -src/foo/MyQualifier.kt:14:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Long): Number - ------------------------------------- - - -src/foo/MyQualifier.kt:15:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Double): Number - --------------------------------------- - - -src/foo/MyQualifier.kt:16:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Float): Number - -------------------------------------- - - -src/foo/MyQualifier.kt:17:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Short): Number - -------------------------------------- - - -src/foo/MyQualifier.kt:18:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Byte): Number - ------------------------------------- - - -src/foo/MyQualifier.kt:19:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: Char): Comparable<Char> - ----------------------------------------------- - - -src/foo/MyQualifier.kt:20:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(number: String): Comparable<String> - --------------------------------------------------- - - -src/foo/MyQualifier.kt:21:Information: @Binds-annotated functions can be -extension functions. [BindsCanBeExtensionFunction] - - @Binds fun bind(@MyQualifier number: Boolean): Comparable<Boolean> - ------------------------------------------------------------------ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/foo/MyQualifier.kt`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -package foo -import javax.inject.Inject -import javax.inject.Qualifier -import kotlin.jvm.JvmStatic -import dagger.Binds -import dagger.Module - -@Qualifier -annotation class MyQualifier - -@Module -interface MyModule { - @Binds fun bind(number: Int): Number - @Binds fun bind(number: Long): Number - @Binds fun bind(number: Double): Number - @Binds fun bind(number: Float): Number - @Binds fun bind(number: Short): Number - @Binds fun bind(number: Byte): Number - @Binds fun bind(number: Char): Comparable - @Binds fun bind(number: String): Comparable - @Binds fun bind(@MyQualifier number: Boolean): Comparable -} -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/DaggerKotlinIssuesDetectorTest.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, `DaggerKotlinIssuesDetector.binds can be extension functions`. -To report a problem with this extracted sample, visit -https://github.com/slackhq/slack-lints. - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. This lint check is included in the lint documentation, - but the Android team may or may not agree with its recommendations. - -``` -// build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.3.0") - -// build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.3.0' - -// build.gradle.kts with version catalogs: -lintChecks(libs.slack-lint-checks) - -# libs.versions.toml -[versions] -slack-lint-checks = "0.3.0" -[libraries] -slack-lint-checks = { - module = "com.slack.lint:slack-lint-checks", - version.ref = "slack-lint-checks" -} -``` - -0.3.0 is the version this documentation was generated from; -there may be newer versions available. - -[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). -(##) Suppressing - -You can suppress false positives using one of the following mechanisms: - -* Using a suppression annotation like this on the enclosing - element: - - ```kt - // Kotlin - @Suppress("BindsCanBeExtensionFunction") - fun method() { - problematicStatement() - } - ``` - - or - - ```java - // Java - @SuppressWarnings("BindsCanBeExtensionFunction") - void method() { - problematicStatement(); - } - ``` - -* Using a suppression comment like this on the line above: - - ```kt - //noinspection BindsCanBeExtensionFunction - 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 - <?xml version="1.0" encoding="UTF-8"?> - <lint> - <issue id="BindsCanBeExtensionFunction" severity="ignore" /> - </lint> - ``` - 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 'BindsCanBeExtensionFunction' - } - ``` - In Android projects this should be nested inside an `android { }` - block. - -* For manual invocations of `lint`, using the `--ignore` flag: - ``` - $ lint --ignore BindsCanBeExtensionFunction ...` - ``` - -* Last, but not least, using baselines, as discussed - [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). - - \ No newline at end of file diff --git a/docs/checks/BindsMustBeAbstract.md.html b/docs/checks/BindsMustBeAbstract.md.html index 387aabb7..3debdd19 100644 --- a/docs/checks/BindsMustBeAbstract.md.html +++ b/docs/checks/BindsMustBeAbstract.md.html @@ -1,13 +1,13 @@ -(#) @Binds functions must be abstract and cannot have function bodies. +(#) @Binds functions must be abstract -!!! ERROR: @Binds functions must be abstract and cannot have function bodies. +!!! ERROR: @Binds functions must be abstract This is an error. Id : `BindsMustBeAbstract` Summary -: @Binds functions must be abstract and cannot have function bodies. +: @Binds functions must be abstract Severity : Error Category @@ -104,17 +104,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -122,7 +122,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/BindsTypeMismatch.md.html b/docs/checks/BindsTypeMismatch.md.html index e2133e02..8d4e24ba 100644 --- a/docs/checks/BindsTypeMismatch.md.html +++ b/docs/checks/BindsTypeMismatch.md.html @@ -1,13 +1,13 @@ -(#) @Binds function parameters must be type-assignable to their return types. +(#) @Binds parameter/return must be type-assignable -!!! ERROR: @Binds function parameters must be type-assignable to their return types. +!!! ERROR: @Binds parameter/return must be type-assignable This is an error. Id : `BindsTypeMismatch` Summary -: @Binds function parameters must be type-assignable to their return types. +: @Binds parameter/return must be type-assignable Severity : Error Category @@ -116,17 +116,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -134,7 +134,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/BindsWrongParameterCount.md.html b/docs/checks/BindsWrongParameterCount.md.html index b3015866..39b381b0 100644 --- a/docs/checks/BindsWrongParameterCount.md.html +++ b/docs/checks/BindsWrongParameterCount.md.html @@ -1,13 +1,13 @@ -(#) @Binds functions require a single parameter as an input to bind. +(#) @Binds must have one parameter -!!! ERROR: @Binds functions require a single parameter as an input to bind. +!!! ERROR: @Binds must have one parameter This is an error. Id : `BindsWrongParameterCount` Summary -: @Binds functions require a single parameter as an input to bind. +: @Binds must have one parameter Severity : Error Category @@ -94,17 +94,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -112,7 +112,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/CastingViewContextToActivity.md.html b/docs/checks/CastingViewContextToActivity.md.html index 7526a6ef..4329884a 100644 --- a/docs/checks/CastingViewContextToActivity.md.html +++ b/docs/checks/CastingViewContextToActivity.md.html @@ -54,17 +54,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -72,7 +72,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ComposableDestinationInComposeScope.md.html b/docs/checks/ComposableDestinationInComposeScope.md.html index f9396ed4..2837cb2b 100644 --- a/docs/checks/ComposableDestinationInComposeScope.md.html +++ b/docs/checks/ComposableDestinationInComposeScope.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") +implementation("androidx.navigation:navigation-compose:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-compose:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.8.0-alpha01" +navigation-compose = "2.8.0-beta01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -108,7 +108,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/ComposableLambdaParameterNaming.md.html b/docs/checks/ComposableLambdaParameterNaming.md.html index 9c3351bb..79b606b1 100644 --- a/docs/checks/ComposableLambdaParameterNaming.md.html +++ b/docs/checks/ComposableLambdaParameterNaming.md.html @@ -85,17 +85,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -103,7 +103,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ComposableLambdaParameterPosition.md.html b/docs/checks/ComposableLambdaParameterPosition.md.html index feb9c788..63075854 100644 --- a/docs/checks/ComposableLambdaParameterPosition.md.html +++ b/docs/checks/ComposableLambdaParameterPosition.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -105,7 +105,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ComposableNaming.md.html b/docs/checks/ComposableNaming.md.html index 97342ee4..3e0008c0 100644 --- a/docs/checks/ComposableNaming.md.html +++ b/docs/checks/ComposableNaming.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -105,7 +105,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ComposableNavGraphInComposeScope.md.html b/docs/checks/ComposableNavGraphInComposeScope.md.html index 52dcf6b5..47f38ec5 100644 --- a/docs/checks/ComposableNavGraphInComposeScope.md.html +++ b/docs/checks/ComposableNavGraphInComposeScope.md.html @@ -89,17 +89,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") +implementation("androidx.navigation:navigation-compose:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-compose:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.8.0-alpha01" +navigation-compose = "2.8.0-beta01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -107,7 +107,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/ComposeComposableModifier.md.html b/docs/checks/ComposeComposableModifier.md.html index 4eccedb6..65942a01 100644 --- a/docs/checks/ComposeComposableModifier.md.html +++ b/docs/checks/ComposeComposableModifier.md.html @@ -1,13 +1,13 @@ -(#) Using @Composable builder functions for modifiers is not recommended +(#) Don't use @Composable builder functions for modifiers -!!! ERROR: Using @Composable builder functions for modifiers is not recommended +!!! ERROR: Don't use @Composable builder functions for modifiers This is an error. Id : `ComposeComposableModifier` Summary -: Using @Composable builder functions for modifiers is not recommended +: Don't use @Composable builder functions for modifiers Severity : Error Category @@ -39,11 +39,9 @@ : 2023 Using @Composable builder functions for modifiers is not recommended, as -they cause unnecessary recompositions. -You should use Modifier.composed { ... } instead, as it limits -recomposition to just the modifier instance, rather than the whole -function tree. -See +they cause unnecessary recompositions.You should use the Modifier.Node +API instead, as it limits recomposition to just the modifier instance, +rather than the whole function tree.See https://slackhq.github.io/compose-lints/rules/#avoid-modifier-extension-factory-functions for more information. @@ -104,17 +102,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -122,7 +120,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeCompositionLocalGetter.md.html b/docs/checks/ComposeCompositionLocalGetter.md.html new file mode 100644 index 00000000..799925d0 --- /dev/null +++ b/docs/checks/ComposeCompositionLocalGetter.md.html @@ -0,0 +1,199 @@ + +(#) CompositionLocals should not use getters + +!!! ERROR: CompositionLocals should not use getters + This is an error. + +Id +: `ComposeCompositionLocalGetter` +Summary +: CompositionLocals should not use getters +Severity +: Error +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/CompositionLocalUsageDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/CompositionLocalUsageDetectorTest.kt) +Copyright Year +: 2023 + +`CompositionLocal`s should be singletons and not use getters. Otherwise +a new instance will be returned every call. + +(##) Options + +You can configure this lint checks using the following options: + +(###) allowed-composition-locals + +A comma-separated list of CompositionLocals that should be allowed. +This property should define a comma-separated list of `CompositionLocal`s that should be allowed. + + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeCompositionLocalGetter"> + <option name="allowed-composition-locals" value="some string" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test.kt:2:Error: `CompositionLocal`s should be singletons and not +use getters. Otherwise a new instance will be returned every call. +[ComposeCompositionLocalGetter] + + val LocalBanana get() = compositionLocalOf { "Prune" } + --- + + +src/test.kt:3:Error: `CompositionLocal`s should be singletons and not +use getters. Otherwise a new instance will be returned every call. +[ComposeCompositionLocalGetter] + + val LocalPotato get() { + --- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +val LocalBanana get() = compositionLocalOf { "Prune" } +val LocalPotato get() { + return compositionLocalOf { "Prune" } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/CompositionLocalUsageDetectorTest.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, `CompositionLocalUsageDetector.getter is an error`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.3.1" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.3.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeCompositionLocalGetter") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeCompositionLocalGetter") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeCompositionLocalGetter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeCompositionLocalGetter" severity="ignore" /> + </lint> + ``` + 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 'ComposeCompositionLocalGetter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeCompositionLocalGetter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeCompositionLocalUsage.md.html b/docs/checks/ComposeCompositionLocalUsage.md.html index 83db6997..81405cb0 100644 --- a/docs/checks/ComposeCompositionLocalUsage.md.html +++ b/docs/checks/ComposeCompositionLocalUsage.md.html @@ -39,8 +39,8 @@ : 2023 `CompositionLocal`s are implicit dependencies and creating new ones -should be avoided. -See https://slackhq.github.io/compose-lints/rules/#compositionlocals for +should be avoided. See +https://slackhq.github.io/compose-lints/rules/#compositionlocals for more information. (##) Options @@ -131,17 +131,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -149,7 +149,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeContentEmitterReturningValues.md.html b/docs/checks/ComposeContentEmitterReturningValues.md.html index 303c7bcd..8403a7c8 100644 --- a/docs/checks/ComposeContentEmitterReturningValues.md.html +++ b/docs/checks/ComposeContentEmitterReturningValues.md.html @@ -39,11 +39,10 @@ : 2023 Composable functions should either emit content into the composition or -return a value, but not both. -If a composable should offer additional control surfaces to its caller, -those control surfaces or callbacks should be provided as parameters to -the composable function by the caller. -See +return a value, but not both.If a composable should offer additional +control surfaces to its caller, those control surfaces or callbacks +should be provided as parameters to the composable function by the +caller.See https://slackhq.github.io/compose-lints/rules/#do-not-emit-content-and-return-a-result for more information. @@ -131,17 +130,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -149,7 +148,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeM2Api.md.html b/docs/checks/ComposeM2Api.md.html index a18b199c..1fdd8c28 100644 --- a/docs/checks/ComposeM2Api.md.html +++ b/docs/checks/ComposeM2Api.md.html @@ -41,9 +41,8 @@ : 2022 Compose Material 2 (M2) is succeeded by Material 3 (M3). Please use M3 -APIs. -See https://slackhq.github.io/compose-lints/rules/#use-material-3 for -more information. +APIs.See https://slackhq.github.io/compose-lints/rules/#use-material-3 +for more information. (##) Options @@ -65,6 +64,23 @@ </lint> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +(###) enable-mangling-workaround + +Try to work around name mangling.. +See https://github.com/slackhq/compose-lints/issues/167 + +Default is false. + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="ComposeM2Api"> + <option name="enable-mangling-workaround" value="false" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + (##) Example Here is an example of lint warnings produced by this check: @@ -156,17 +172,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -174,7 +190,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeModifierComposed.md.html b/docs/checks/ComposeModifierComposed.md.html new file mode 100644 index 00000000..6bb24ac8 --- /dev/null +++ b/docs/checks/ComposeModifierComposed.md.html @@ -0,0 +1,202 @@ + +(#) Don't use Modifier.composed {} + +!!! ERROR: Don't use Modifier.composed {} + This is an error. + +Id +: `ComposeModifierComposed` +Summary +: Don't use Modifier.composed {} +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/ModifierComposedDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierComposedDetectorTest.kt) +Copyright Year +: 2023 + +Modifier.composed { ... } is no longer recommended due to performance +issues. + +You should use the Modifier.Node API instead, as it was designed from +the ground up to be far more performant than composed modifiers. + +See +https://slackhq.github.io/compose-lints/rules/#migrate-to-modifiernode +for more information. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/test.kt:6:Error: Modifier.composed { ... } is no longer +recommended due to performance issues. + +You should use the Modifier.Node API instead, as it was designed from +the ground up to be far more performant than composed modifiers. + +See +https://slackhq.github.io/compose-lints/rules/#migrate-to-modifiernode +for more information. [ComposeModifierComposed] + +fun Modifier.something1() = Modifier.composed { } + --------------------- + + +src/test/test.kt:7:Error: Modifier.composed { ... } is no longer +recommended due to performance issues. + +You should use the Modifier.Node API instead, as it was designed from +the ground up to be far more performant than composed modifiers. + +See +https://slackhq.github.io/compose-lints/rules/#migrate-to-modifiernode +for more information. [ComposeModifierComposed] + +fun Modifier.something2() = composed { } + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers + package test + +import androidx.compose.ui.composed +import androidx.compose.ui.Modifier + +fun Modifier.something1() = Modifier.composed { } +fun Modifier.something2() = composed { } +fun Modifier.something3() = somethingElse() +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/ModifierComposedDetectorTest.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, `ModifierComposedDetector.errors when a composable Modifier extension is detected`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.3.1" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.3.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeModifierComposed") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeModifierComposed") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeModifierComposed + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeModifierComposed" severity="ignore" /> + </lint> + ``` + 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 'ComposeModifierComposed' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeModifierComposed ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeModifierMissing.md.html b/docs/checks/ComposeModifierMissing.md.html index f0a4241f..7c7d7f3d 100644 --- a/docs/checks/ComposeModifierMissing.md.html +++ b/docs/checks/ComposeModifierMissing.md.html @@ -39,8 +39,7 @@ : 2023 This @Composable function emits content but doesn't have a modifier -parameter. -See +parameter.See https://slackhq.github.io/compose-lints/rules/#when-should-i-expose-modifier-parameters for more information. @@ -162,17 +161,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -180,7 +179,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeModifierReused.md.html b/docs/checks/ComposeModifierReused.md.html index ce058ff2..5f26df30 100644 --- a/docs/checks/ComposeModifierReused.md.html +++ b/docs/checks/ComposeModifierReused.md.html @@ -40,11 +40,10 @@ Modifiers should only be used once and by the root level layout of a Composable. This is true even if appended to or with other modifiers -e.g. `modifier.fillMaxWidth()`. -Use Modifier (with a capital 'M') to construct a new Modifier that you -can pass to other composables. -See https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers -for more information. +e.g. `modifier.fillMaxWidth()`.Use Modifier (with a capital 'M') to +construct a new Modifier that you can pass to other composables.See +https://slackhq.github.io/compose-lints/rules/#dont-re-use-modifiers for +more information. (##) Options @@ -270,17 +269,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -288,7 +287,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeModifierWithoutDefault.md.html b/docs/checks/ComposeModifierWithoutDefault.md.html index 9845a4ca..c942f2de 100644 --- a/docs/checks/ComposeModifierWithoutDefault.md.html +++ b/docs/checks/ComposeModifierWithoutDefault.md.html @@ -39,8 +39,7 @@ : 2023 This @Composable function has a modifier parameter but it doesn't have a -default value. -See +default value.See https://slackhq.github.io/compose-lints/rules/#modifiers-should-have-default-parameters for more information. @@ -100,17 +99,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -118,7 +117,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeMultipleContentEmitters.md.html b/docs/checks/ComposeMultipleContentEmitters.md.html index d009c847..f742a3e9 100644 --- a/docs/checks/ComposeMultipleContentEmitters.md.html +++ b/docs/checks/ComposeMultipleContentEmitters.md.html @@ -40,6 +40,7 @@ Composable functions should only be emitting content into the composition from one source at their top level. + See https://slackhq.github.io/compose-lints/rules/#do-not-emit-multiple-pieces-of-content for more information. @@ -126,17 +127,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -144,7 +145,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeMutableParameters.md.html b/docs/checks/ComposeMutableParameters.md.html index 591e8bb1..34af6ae0 100644 --- a/docs/checks/ComposeMutableParameters.md.html +++ b/docs/checks/ComposeMutableParameters.md.html @@ -39,11 +39,9 @@ : 2023 Using mutable objects as state in Compose will cause your users to see -incorrect or stale data in your app. -Mutable objects that are not observable, such as `ArrayList` or a -mutable data class, cannot be observed by Compose to trigger -recomposition when they change. -See +incorrect or stale data in your app.Mutable objects that are not +observable, such as `ArrayList` or a mutable data class, cannot be +observed by Compose to trigger recomposition when they change.See https://slackhq.github.io/compose-lints/rules/#do-not-use-inherently-mutable-types-as-parameters for more information. @@ -134,17 +132,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -152,7 +150,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeNamingLowercase.md.html b/docs/checks/ComposeNamingLowercase.md.html index cd28ed4d..4cebd526 100644 --- a/docs/checks/ComposeNamingLowercase.md.html +++ b/docs/checks/ComposeNamingLowercase.md.html @@ -39,11 +39,9 @@ : 2023 Composable functions that return a value should start with a lowercase -letter. -While useful and accepted outside of @Composable functions, this factory -function convention has drawbacks that set inappropriate expectations -for callers when used with @Composable functions. -See +letter.While useful and accepted outside of @Composable functions, this +factory function convention has drawbacks that set inappropriate +expectations for callers when used with @Composable functions.See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly for more information. @@ -106,17 +104,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -124,7 +122,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeNamingUppercase.md.html b/docs/checks/ComposeNamingUppercase.md.html index 6d7d1530..78b04678 100644 --- a/docs/checks/ComposeNamingUppercase.md.html +++ b/docs/checks/ComposeNamingUppercase.md.html @@ -39,11 +39,9 @@ : 2023 Composable functions that return Unit should start with an uppercase -letter. -They are considered declarative entities that can be either present or -absent in a composition and therefore follow the naming rules for -classes. -See +letter.They are considered declarative entities that can be either +present or absent in a composition and therefore follow the naming rules +for classes.See https://slackhq.github.io/compose-lints/rules/#naming-composable-functions-properly for more information. @@ -119,17 +117,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -137,7 +135,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeParameterOrder.md.html b/docs/checks/ComposeParameterOrder.md.html index 22fb09a0..3f3e0702 100644 --- a/docs/checks/ComposeParameterOrder.md.html +++ b/docs/checks/ComposeParameterOrder.md.html @@ -164,17 +164,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -182,7 +182,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposePreviewNaming.md.html b/docs/checks/ComposePreviewNaming.md.html index 4cf920ef..2a46ad12 100644 --- a/docs/checks/ComposePreviewNaming.md.html +++ b/docs/checks/ComposePreviewNaming.md.html @@ -106,17 +106,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -124,7 +124,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposePreviewPublic.md.html b/docs/checks/ComposePreviewPublic.md.html index c4ae8736..f7e56033 100644 --- a/docs/checks/ComposePreviewPublic.md.html +++ b/docs/checks/ComposePreviewPublic.md.html @@ -39,35 +39,13 @@ : 2023 Composables annotated with `@Preview` that are used only for previewing -the UI should not be public. -See +the UI should not be public.See https://slackhq.github.io/compose-lints/rules/#preview-composables-should-not-be-public for more information. !!! Tip This lint check has an associated quickfix available in the IDE. -(##) Options - -You can configure this lint checks using the following options: - -(###) preview-public-only-if-params - -If set to true, this check will only enforce on previews that have no PreviewParameters. -If set to true, this check will only enforce on previews that have no PreviewParameters - -Default is true. - -Example `lint.xml`: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers -<lint> - <issue id="ComposePreviewPublic"> - <option name="preview-public-only-if-params" value="true" /> - </issue> -</lint> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - (##) Example Here is an example of lint warnings produced by this check: @@ -130,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -148,7 +126,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeRememberMissing.md.html b/docs/checks/ComposeRememberMissing.md.html index 0e731ce3..7dcad1c1 100644 --- a/docs/checks/ComposeRememberMissing.md.html +++ b/docs/checks/ComposeRememberMissing.md.html @@ -103,17 +103,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -121,7 +121,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeUnstableCollections.md.html b/docs/checks/ComposeUnstableCollections.md.html index 02022a38..9354fe16 100644 --- a/docs/checks/ComposeUnstableCollections.md.html +++ b/docs/checks/ComposeUnstableCollections.md.html @@ -134,17 +134,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -152,7 +152,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeUnstableReceiver.md.html b/docs/checks/ComposeUnstableReceiver.md.html new file mode 100644 index 00000000..b59cc01f --- /dev/null +++ b/docs/checks/ComposeUnstableReceiver.md.html @@ -0,0 +1,246 @@ + +(#) Unstable receivers will always be recomposed + +!!! WARNING: Unstable receivers will always be recomposed + This is a warning. + +Id +: `ComposeUnstableReceiver` +Summary +: Unstable receivers will always be recomposed +Severity +: Warning +Category +: Productivity +Platform +: Any +Vendor +: slack +Identifier +: com.slack.lint.compose:compose-lints +Feedback +: https://github.com/slackhq/compose-lints/issues +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/main/java/slack/lint/compose/UnstableReceiverDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/UnstableReceiverDetectorTest.kt) +Copyright Year +: 2023 + +Instance composable functions on non-stable classes will always be +recomposed. If possible, make the receiver type stable or refactor this +function if that isn't possible. See +https://slackhq.github.io/compose-lints/rules/#unstable-receivers for +more information. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/ExampleInterface.kt:4:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + + @Composable fun Content() + ------- + + +src/ExampleInterface.kt:8:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + + @Composable fun Content() {} + ------- + + +src/ExampleInterface.kt:12:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + +fun Example.OtherContent() {} + ------- + + +src/ExampleInterface.kt:15:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + +val Example.OtherContentProperty get() {} + ------- + + +src/ExampleInterface.kt:19:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + + @Composable fun present(): T + ------- + + +src/ExampleInterface.kt:23:Warning: Instance composable functions on +non-stable classes will always be recomposed. If possible, make the +receiver type stable or refactor this function if that isn't possible. +See https://slackhq.github.io/compose-lints/rules/#unstable-receivers +for more information. [ComposeUnstableReceiver] + + @Composable override fun present(): String { return "hi" } + ------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/ExampleInterface.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +import androidx.compose.runtime.Composable + +interface ExampleInterface { + @Composable fun Content() +} + +class Example { + @Composable fun Content() {} +} + +@Composable +fun Example.OtherContent() {} + +@get:Composable +val Example.OtherContentProperty get() {} + +// Supertypes +interface Presenter { + @Composable fun present(): T +} + +class HomePresenter : Presenter { + @Composable override fun present(): String { return "hi" } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://github.com/slackhq/compose-lints/tree/main/compose-lint-checks/src/test/java/slack/lint/compose/UnstableReceiverDetectorTest.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, `UnstableReceiverDetector.unstable receiver types report errors`. +To report a problem with this extracted sample, visit +https://github.com/slackhq/compose-lints/issues. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") + +// build.gradle +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' + +// build.gradle.kts with version catalogs: +lintChecks(libs.compose-lint-checks) + +# libs.versions.toml +[versions] +compose-lint-checks = "1.3.1" +[libraries] +compose-lint-checks = { + module = "com.slack.lint.compose:compose-lint-checks", + version.ref = "compose-lint-checks" +} +``` + +1.3.1 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ComposeUnstableReceiver") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ComposeUnstableReceiver") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ComposeUnstableReceiver + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ComposeUnstableReceiver" severity="ignore" /> + </lint> + ``` + 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 'ComposeUnstableReceiver' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ComposeUnstableReceiver ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ComposeViewModelForwarding.md.html b/docs/checks/ComposeViewModelForwarding.md.html index 82778fdb..58cd8468 100644 --- a/docs/checks/ComposeViewModelForwarding.md.html +++ b/docs/checks/ComposeViewModelForwarding.md.html @@ -1,13 +1,13 @@ -(#) Forwarding a ViewModel through multiple @Composable functions should be avoided +(#) Don't forward ViewModels through composables -!!! ERROR: Forwarding a ViewModel through multiple @Composable functions should be avoided +!!! ERROR: Don't forward ViewModels through composables This is an error. Id : `ComposeViewModelForwarding` Summary -: Forwarding a ViewModel through multiple @Composable functions should be avoided +: Don't forward ViewModels through composables Severity : Error Category @@ -38,10 +38,10 @@ Copyright Year : 2023 -Forwarding a ViewModel through multiple @Composable functions should be -avoided. Consider using state hoisting. -See https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things -for more information. +Forwarding a `ViewModel` through multiple `@Composable` functions should +be avoided. Consider using state hoisting.See +https://slackhq.github.io/compose-lints/rules/#hoist-all-the-things for +more information. (##) Example @@ -89,17 +89,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -107,7 +107,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/ComposeViewModelInjection.md.html b/docs/checks/ComposeViewModelInjection.md.html index fc8b5fca..d2d54071 100644 --- a/docs/checks/ComposeViewModelInjection.md.html +++ b/docs/checks/ComposeViewModelInjection.md.html @@ -138,17 +138,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -156,7 +156,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html). diff --git a/docs/checks/CompositionLocalNaming.md.html b/docs/checks/CompositionLocalNaming.md.html index 54f98007..6fb32aba 100644 --- a/docs/checks/CompositionLocalNaming.md.html +++ b/docs/checks/CompositionLocalNaming.md.html @@ -110,17 +110,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -128,7 +128,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ConflictingOnColor.md.html b/docs/checks/ConflictingOnColor.md.html index 98fd2ee5..773c7497 100644 --- a/docs/checks/ConflictingOnColor.md.html +++ b/docs/checks/ConflictingOnColor.md.html @@ -214,17 +214,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material:material-android:1.7.0-alpha01") +implementation("androidx.compose.material:material-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.material:material-android:1.7.0-alpha01' +implementation 'androidx.compose.material:material-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material-android) # libs.versions.toml [versions] -material-android = "1.7.0-alpha01" +material-android = "1.7.0-beta01" [libraries] material-android = { module = "androidx.compose.material:material-android", @@ -232,7 +232,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.material:material-android](androidx_compose_material_material-android.md.html). diff --git a/docs/checks/CoroutineCreationDuringComposition.md.html b/docs/checks/CoroutineCreationDuringComposition.md.html index 570379fa..8c8c0679 100644 --- a/docs/checks/CoroutineCreationDuringComposition.md.html +++ b/docs/checks/CoroutineCreationDuringComposition.md.html @@ -297,17 +297,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -315,7 +315,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/DeepLinkInActivityDestination.md.html b/docs/checks/DeepLinkInActivityDestination.md.html index c9906177..7d09fe85 100644 --- a/docs/checks/DeepLinkInActivityDestination.md.html +++ b/docs/checks/DeepLinkInActivityDestination.md.html @@ -102,17 +102,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-runtime:2.8.0-alpha01") +implementation("androidx.navigation:navigation-runtime:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-runtime:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-runtime:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-runtime) # libs.versions.toml [versions] -navigation-runtime = "2.8.0-alpha01" +navigation-runtime = "2.8.0-beta01" [libraries] navigation-runtime = { module = "androidx.navigation:navigation-runtime", @@ -120,7 +120,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-runtime](androidx_navigation_navigation-runtime.md.html). diff --git a/docs/checks/DenyListedApi.md.html b/docs/checks/DenyListedApi.md.html index 31f52fcd..b240452e 100644 --- a/docs/checks/DenyListedApi.md.html +++ b/docs/checks/DenyListedApi.md.html @@ -89,17 +89,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -107,7 +107,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DenyListedBlockingApi.md.html b/docs/checks/DenyListedBlockingApi.md.html index 4f6fb65b..7cd408bb 100644 --- a/docs/checks/DenyListedBlockingApi.md.html +++ b/docs/checks/DenyListedBlockingApi.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DeprecatedCall.md.html b/docs/checks/DeprecatedCall.md.html index 2024c6f8..0c6d554e 100644 --- a/docs/checks/DeprecatedCall.md.html +++ b/docs/checks/DeprecatedCall.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DeprecatedSqlUsage.md.html b/docs/checks/DeprecatedSqlUsage.md.html index 302f0cff..f58d8f22 100644 --- a/docs/checks/DeprecatedSqlUsage.md.html +++ b/docs/checks/DeprecatedSqlUsage.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DetachAndAttachSameFragment.md.html b/docs/checks/DetachAndAttachSameFragment.md.html index cc5d6e4f..2128693b 100644 --- a/docs/checks/DetachAndAttachSameFragment.md.html +++ b/docs/checks/DetachAndAttachSameFragment.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/DialogFragmentCallbacksDetector.md.html b/docs/checks/DialogFragmentCallbacksDetector.md.html index 32676e18..7b83751b 100644 --- a/docs/checks/DialogFragmentCallbacksDetector.md.html +++ b/docs/checks/DialogFragmentCallbacksDetector.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -112,7 +112,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/DoNotCallProviders.md.html b/docs/checks/DoNotCallProviders.md.html index f869ddb0..e170ebfc 100644 --- a/docs/checks/DoNotCallProviders.md.html +++ b/docs/checks/DoNotCallProviders.md.html @@ -142,17 +142,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -160,7 +160,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotExposeEitherNetInRepositories.md.html b/docs/checks/DoNotExposeEitherNetInRepositories.md.html index 9dff8888..1ad30f69 100644 --- a/docs/checks/DoNotExposeEitherNetInRepositories.md.html +++ b/docs/checks/DoNotExposeEitherNetInRepositories.md.html @@ -91,17 +91,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -109,7 +109,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMock.md.html b/docs/checks/DoNotMock.md.html index 4a351f95..d6d2376e 100644 --- a/docs/checks/DoNotMock.md.html +++ b/docs/checks/DoNotMock.md.html @@ -52,7 +52,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -69,7 +69,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -86,7 +86,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -177,17 +177,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -195,7 +195,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockAnything.md.html b/docs/checks/DoNotMockAnything.md.html new file mode 100644 index 00000000..e23980ad --- /dev/null +++ b/docs/checks/DoNotMockAnything.md.html @@ -0,0 +1,201 @@ + +(#) Do not add new mocks. + +!!! ERROR: Do not add new mocks. + This is an error. + +Id +: `DoNotMockAnything` +Summary +: Do not add new mocks. +Note +: **This issue is disabled by default**; use `--enable DoNotMockAnything` +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: slack +Identifier +: slack-lint +Contact +: https://github.com/slackhq/slack-lints +Feedback +: https://github.com/slackhq/slack-lints +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/mocking/MockDetector.kt) +Tests +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/mocking/DoNotMockMockDetectorTest.kt) +Copyright Year +: 2021 + +Mocking is almost always unnecessary and will make your tests more +brittle. Use real instances (if appropriate) or test fakes instead. This +lint is a catch-all for mocking, and has been enabled in this project to +help prevent new mocking from being added. + +(##) Options + +You can configure this lint checks using the following options: + +(###) mock-annotations + +A comma-separated list of mock annotations.. +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. + +Default is "org.mockito.Mock,org.mockito.Spy". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAnything"> + <option name="mock-annotations" value=""org.mockito.Mock,org.mockito.Spy"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-factories + +A comma-separated list of mock factories (org.mockito.Mockito#methodName).. +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. + +Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAnything"> + <option name="mock-factories" value=""org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(###) mock-report + +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. + +Default is "none". + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="DoNotMockAnything"> + <option name="mock-report" value=""none"" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. This lint check is included in the lint documentation, + but the Android team may or may not agree with its recommendations. + +``` +// build.gradle.kts +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") + +// build.gradle +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' + +// build.gradle.kts with version catalogs: +lintChecks(libs.slack-lint-checks) + +# libs.versions.toml +[versions] +slack-lint-checks = "0.7.3" +[libraries] +slack-lint-checks = { + module = "com.slack.lint:slack-lint-checks", + version.ref = "slack-lint-checks" +} +``` + +0.7.3 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("DoNotMockAnything") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("DoNotMockAnything") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection DoNotMockAnything + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="DoNotMockAnything" severity="ignore" /> + </lint> + ``` + 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 'DoNotMockAnything' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore DoNotMockAnything ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/DoNotMockAutoValue.md.html b/docs/checks/DoNotMockAutoValue.md.html index 5cd088df..f3f1704d 100644 --- a/docs/checks/DoNotMockAutoValue.md.html +++ b/docs/checks/DoNotMockAutoValue.md.html @@ -50,7 +50,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -67,7 +67,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -84,7 +84,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockDataClass.md.html b/docs/checks/DoNotMockDataClass.md.html index 84aae0fe..da67723e 100644 --- a/docs/checks/DoNotMockDataClass.md.html +++ b/docs/checks/DoNotMockDataClass.md.html @@ -50,7 +50,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -67,7 +67,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -84,7 +84,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockObjectClass.md.html b/docs/checks/DoNotMockObjectClass.md.html index 368800fb..48ed023d 100644 --- a/docs/checks/DoNotMockObjectClass.md.html +++ b/docs/checks/DoNotMockObjectClass.md.html @@ -50,7 +50,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -67,7 +67,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -84,7 +84,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockPlatformTypes.md.html b/docs/checks/DoNotMockPlatformTypes.md.html index 525d060c..cd05dd18 100644 --- a/docs/checks/DoNotMockPlatformTypes.md.html +++ b/docs/checks/DoNotMockPlatformTypes.md.html @@ -54,7 +54,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -71,7 +71,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -88,7 +88,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -111,17 +111,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -129,7 +129,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockRecordClass.md.html b/docs/checks/DoNotMockRecordClass.md.html index a90694b3..c81e44d3 100644 --- a/docs/checks/DoNotMockRecordClass.md.html +++ b/docs/checks/DoNotMockRecordClass.md.html @@ -50,7 +50,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -67,7 +67,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -84,7 +84,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/DoNotMockSealedClass.md.html b/docs/checks/DoNotMockSealedClass.md.html index cabd8418..34d73d64 100644 --- a/docs/checks/DoNotMockSealedClass.md.html +++ b/docs/checks/DoNotMockSealedClass.md.html @@ -51,7 +51,7 @@ (###) mock-annotations A comma-separated list of mock annotations.. -This property should define comma-separated list of mock annotation class names (FQCN). +This property should define comma-separated list of mock annotation class names (FQCN). Set this for all issues using this option. Default is "org.mockito.Mock,org.mockito.Spy". @@ -68,7 +68,7 @@ (###) mock-factories A comma-separated list of mock factories (org.mockito.Mockito#methodName).. -A comma-separated list of mock factories (org.mockito.Mockito#methodName). +A comma-separated list of mock factories (org.mockito.Mockito#methodName). Set this for all issues using this option. Default is "org.mockito.Mockito#mock,org.mockito.Mockito#spy,slack.test.mockito.MockitoHelpers#mock,slack.test.mockito.MockitoHelpersKt#mock". @@ -85,7 +85,7 @@ (###) mock-report If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv.. -If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. +If enabled, writes a mock report to /build/reports/mockdetector/mock-report.csv. The format of the file is a csv of (type,isError) of mocked classes. Set this for all issues using this option. Default is "none". @@ -108,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -126,7 +126,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/EmptyNavDeepLink.md.html b/docs/checks/EmptyNavDeepLink.md.html index 25f89628..88453129 100644 --- a/docs/checks/EmptyNavDeepLink.md.html +++ b/docs/checks/EmptyNavDeepLink.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-common:2.8.0-alpha01") +implementation("androidx.navigation:navigation-common:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-common:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-common:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-common) # libs.versions.toml [versions] -navigation-common = "2.8.0-alpha01" +navigation-common = "2.8.0-beta01" [libraries] navigation-common = { module = "androidx.navigation:navigation-common", @@ -101,7 +101,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-common](androidx_navigation_navigation-common.md.html). diff --git a/docs/checks/ErrorProneDoNotMockUsage.md.html b/docs/checks/ErrorProneDoNotMockUsage.md.html index 04146ab7..3de28b09 100644 --- a/docs/checks/ErrorProneDoNotMockUsage.md.html +++ b/docs/checks/ErrorProneDoNotMockUsage.md.html @@ -112,17 +112,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -130,7 +130,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ExceptionMessage.md.html b/docs/checks/ExceptionMessage.md.html index cead9fbc..a6aa12c1 100644 --- a/docs/checks/ExceptionMessage.md.html +++ b/docs/checks/ExceptionMessage.md.html @@ -1,13 +1,13 @@ -(#) Please provide a string for the lazyMessage parameter +(#) Please provide a string for the `lazyMessage` parameter -!!! ERROR: Please provide a string for the lazyMessage parameter +!!! ERROR: Please provide a string for the `lazyMessage` parameter This is an error. Id : `ExceptionMessage` Summary -: Please provide a string for the lazyMessage parameter +: Please provide a string for the `lazyMessage` parameter Severity : Error Category @@ -40,15 +40,15 @@ Copyright Year : 2023 -Calls to check(), checkNotNull(), require() and requireNotNull() should -include a message string that can be used to debug issues experienced -by users. +Calls to `check()`, `checkNotNull()`, `require()` and `requireNotNull()` +should include a message string that can be used to debug issues +experienced by users. -When we read user-supplied logs, the line numbers are sometimes not -sufficient to determine the cause of a bug. Inline functions can -sometimes make it hard to determine which file threw an exception. -Consider supplying a lazyMessage parameter to identify the check() -or require() call. +When we read user-supplied logs, the line numbers are sometimes +notsufficient to determine the cause of a bug. Inline functions +cansometimes make it hard to determine which file threw an +exception.Consider supplying a `lazyMessage` parameter to identify the +`check()`or `require()` call. (##) Example @@ -90,17 +90,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -108,7 +108,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ExperimentalAnnotationRetention.md.html b/docs/checks/ExperimentalAnnotationRetention.md.html index 07d44374..c26b1a25 100644 --- a/docs/checks/ExperimentalAnnotationRetention.md.html +++ b/docs/checks/ExperimentalAnnotationRetention.md.html @@ -50,17 +50,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0") +implementation("androidx.annotation:annotation-experimental:1.4.1") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0' +implementation 'androidx.annotation:annotation-experimental:1.4.1' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0" +annotation-experimental = "1.4.1" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -68,7 +68,7 @@ } ``` -1.4.0 is the version this documentation was generated from; +1.4.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html index 1476fd47..8006add0 100644 --- a/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html +++ b/docs/checks/FieldSiteTargetOnQualifierAnnotation.md.html @@ -185,17 +185,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.50") +implementation("com.google.dagger:dagger-lint:2.51.1") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.50' +implementation 'com.google.dagger:dagger-lint:2.51.1' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.50" +dagger-lint = "2.51.1" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -203,7 +203,7 @@ } ``` -2.50 is the version this documentation was generated from; +2.51.1 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). diff --git a/docs/checks/FileEndsWithExt.md.html b/docs/checks/FileEndsWithExt.md.html index 1ac89eff..f249547e 100644 --- a/docs/checks/FileEndsWithExt.md.html +++ b/docs/checks/FileEndsWithExt.md.html @@ -50,14 +50,14 @@ did you mean "json" ? [FileEndsWithExt] fun File.isJson() = extension == ".json" - ----- + ------- src/test.kt:8:Warning: File.extension does not include the leading dot; did you mean "webp" ? [FileEndsWithExt] fun isWebp(path: File) = path.extension.startsWith(".webp") - ----- + ------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/FlowOperatorInvokedInComposition.md.html b/docs/checks/FlowOperatorInvokedInComposition.md.html index 96b64027..725cea58 100644 --- a/docs/checks/FlowOperatorInvokedInComposition.md.html +++ b/docs/checks/FlowOperatorInvokedInComposition.md.html @@ -296,17 +296,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -314,7 +314,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/FragmentAddMenuProvider.md.html b/docs/checks/FragmentAddMenuProvider.md.html index 0bebdced..26dba717 100644 --- a/docs/checks/FragmentAddMenuProvider.md.html +++ b/docs/checks/FragmentAddMenuProvider.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentBackPressedCallback.md.html b/docs/checks/FragmentBackPressedCallback.md.html index 95b48e39..60eb76ff 100644 --- a/docs/checks/FragmentBackPressedCallback.md.html +++ b/docs/checks/FragmentBackPressedCallback.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentConstructorInjection.md.html b/docs/checks/FragmentConstructorInjection.md.html index 51e6417d..bfe7b883 100644 --- a/docs/checks/FragmentConstructorInjection.md.html +++ b/docs/checks/FragmentConstructorInjection.md.html @@ -139,17 +139,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -157,7 +157,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/FragmentFieldInjection.md.html b/docs/checks/FragmentFieldInjection.md.html index 2ed330e3..f353cbce 100644 --- a/docs/checks/FragmentFieldInjection.md.html +++ b/docs/checks/FragmentFieldInjection.md.html @@ -110,17 +110,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -128,7 +128,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/FragmentGradleConfiguration-2.md.html b/docs/checks/FragmentGradleConfiguration-2.md.html index 5322961b..df3af0d0 100644 --- a/docs/checks/FragmentGradleConfiguration-2.md.html +++ b/docs/checks/FragmentGradleConfiguration-2.md.html @@ -82,17 +82,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha09") +implementation("androidx.fragment:fragment-testing-manifest:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha09' +implementation 'androidx.fragment:fragment-testing-manifest:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing-manifest) # libs.versions.toml [versions] -fragment-testing-manifest = "1.7.0-alpha09" +fragment-testing-manifest = "1.8.0-beta01" [libraries] fragment-testing-manifest = { module = "androidx.fragment:fragment-testing-manifest", @@ -100,7 +100,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment-testing-manifest](androidx_fragment_fragment-testing-manifest.md.html). diff --git a/docs/checks/FragmentGradleConfiguration.md.html b/docs/checks/FragmentGradleConfiguration.md.html index 3fe97919..a8e9d98c 100644 --- a/docs/checks/FragmentGradleConfiguration.md.html +++ b/docs/checks/FragmentGradleConfiguration.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing:1.7.0-alpha09") +implementation("androidx.fragment:fragment-testing:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment-testing:1.7.0-alpha09' +implementation 'androidx.fragment:fragment-testing:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing) # libs.versions.toml [versions] -fragment-testing = "1.7.0-alpha09" +fragment-testing = "1.8.0-beta01" [libraries] fragment-testing = { module = "androidx.fragment:fragment-testing", @@ -101,7 +101,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment-testing](androidx_fragment_fragment-testing.md.html). diff --git a/docs/checks/FragmentLiveDataObserve.md.html b/docs/checks/FragmentLiveDataObserve.md.html index c9a03a35..e7062ad6 100644 --- a/docs/checks/FragmentLiveDataObserve.md.html +++ b/docs/checks/FragmentLiveDataObserve.md.html @@ -55,17 +55,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -73,7 +73,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FragmentTagUsage.md.html b/docs/checks/FragmentTagUsage.md.html index d786508c..43cae509 100644 --- a/docs/checks/FragmentTagUsage.md.html +++ b/docs/checks/FragmentTagUsage.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -108,7 +108,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/FrequentlyChangedStateReadInComposition.md.html b/docs/checks/FrequentlyChangedStateReadInComposition.md.html index d14ed8d4..e13c4efc 100644 --- a/docs/checks/FrequentlyChangedStateReadInComposition.md.html +++ b/docs/checks/FrequentlyChangedStateReadInComposition.md.html @@ -142,17 +142,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") +implementation("androidx.compose.foundation:foundation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation-android = "1.7.0-alpha01" +foundation-android = "1.7.0-beta01" [libraries] foundation-android = { module = "androidx.compose.foundation:foundation-android", @@ -160,7 +160,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). diff --git a/docs/checks/FullyQualifiedResource.md.html b/docs/checks/FullyQualifiedResource.md.html index 2745824f..8ee2d715 100644 --- a/docs/checks/FullyQualifiedResource.md.html +++ b/docs/checks/FullyQualifiedResource.md.html @@ -113,17 +113,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -131,7 +131,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/GuavaChecksUsed.md.html b/docs/checks/GuavaChecksUsed.md.html index 8a04844c..91d2892e 100644 --- a/docs/checks/GuavaChecksUsed.md.html +++ b/docs/checks/GuavaChecksUsed.md.html @@ -121,17 +121,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -139,7 +139,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/GuavaPreconditionsUsedInKotlin.md.html b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html index a5559bed..da67a8eb 100644 --- a/docs/checks/GuavaPreconditionsUsedInKotlin.md.html +++ b/docs/checks/GuavaPreconditionsUsedInKotlin.md.html @@ -122,17 +122,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -140,7 +140,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/IdleBatteryChargingConstraints.md.html b/docs/checks/IdleBatteryChargingConstraints.md.html index 16d82809..19ac30ee 100644 --- a/docs/checks/IdleBatteryChargingConstraints.md.html +++ b/docs/checks/IdleBatteryChargingConstraints.md.html @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -67,7 +67,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/InclusiveNaming.md.html b/docs/checks/InclusiveNaming.md.html index 4bede9e7..b9207dde 100644 --- a/docs/checks/InclusiveNaming.md.html +++ b/docs/checks/InclusiveNaming.md.html @@ -68,8 +68,8 @@ id's must be unique, so you cannot combine these libraries. Also defined in: * InclusiveNaming: Use inclusive naming. (this issue) -* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.0](InclusiveNaming.md.html) -* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.0](InclusiveNaming.md.html) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.3](InclusiveNaming.md.html) +* [InclusiveNaming from com.slack.lint:slack-lint-checks:0.7.3](InclusiveNaming.md.html) (##) Including @@ -81,17 +81,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -99,7 +99,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/InjectInJava.md.html b/docs/checks/InjectInJava.md.html index 6feef522..8cda8394 100644 --- a/docs/checks/InjectInJava.md.html +++ b/docs/checks/InjectInJava.md.html @@ -149,17 +149,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -167,7 +167,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html b/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html deleted file mode 100644 index 369a9513..00000000 --- a/docs/checks/InjectWithScopeRequiredLoggedInUserProvider.md.html +++ /dev/null @@ -1,209 +0,0 @@ - -(#) @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. - -!!! ERROR: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. - This is an error. - -Id -: `InjectWithScopeRequiredLoggedInUserProvider` -Summary -: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope. -Severity -: Error -Category -: Correctness -Platform -: Any -Vendor -: slack -Identifier -: slack-lint -Contact -: https://github.com/slackhq/slack-lints -Feedback -: https://github.com/slackhq/slack-lints -Min -: Lint 8.0 and 8.1 -Compiled -: Lint 8.0 and 8.1 -Artifact -: [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) - -Affects -: Kotlin and Java files and test sources -Editing -: This check runs on the fly in the IDE editor -Implementation -: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/InjectWithUsageDetector.kt) -Tests -: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.kt) -Copyright Year -: 2021 - -`@InjectWith`-annotated classes must implement LoggedInUserProvider (or -extend something that does) if they target UserScope or OrgScope. - -(##) Example - -Here is an example of lint warnings produced by this check: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/BaseInjectableAnnotation.kt:24:Error: @InjectWith-annotated -classes must implement LoggedInUserProvider (or extend something that -does) if they target UserScope or OrgScope. -[InjectWithScopeRequiredLoggedInUserProvider] - -class UserActivityWrong : BaseInjectable() - ----------------- - - -src/test/pkg/BaseInjectableAnnotation.kt:27:Error: @InjectWith-annotated -classes must implement LoggedInUserProvider (or extend something that -does) if they target UserScope or OrgScope. -[InjectWithScopeRequiredLoggedInUserProvider] - -class OrgActivityWrong : BaseInjectable() - ---------------- -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the source file referenced above: - -`src/test/pkg/BaseInjectableAnnotation.kt`: -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -package test.pkg - -import slack.anvil.injection.InjectWith -import slack.anvil.injection.AnvilInjectable -import slack.di.AppScope -import slack.di.UserScope -import slack.di.OrgScope -import slack.foundation.auth.LoggedInUserProvider - -annotation class BaseInjectableAnnotation - -abstract class BaseInjectable : AnvilInjectable - -@InjectWith(AppScope::class) -class AppActivityCorrect : BaseInjectable() - -@InjectWith(UserScope::class) -class UserActivityCorrect : BaseInjectable(), LoggedInUserProvider - -@InjectWith(OrgScope::class) -class OrgActivityCorrect : BaseInjectable(), LoggedInUserProvider - -@InjectWith(UserScope::class) -class UserActivityWrong : BaseInjectable() - -@InjectWith(OrgScope::class) -class OrgActivityWrong : BaseInjectable() - -@InjectWith(AppScope::class) -class MissingAnvilInjectable -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also visit the -[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.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, `InjectWithUsageDetector.smokeTest`. -To report a problem with this extracted sample, visit -https://github.com/slackhq/slack-lints. - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. This lint check is included in the lint documentation, - but the Android team may or may not agree with its recommendations. - -``` -// build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") - -// build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' - -// build.gradle.kts with version catalogs: -lintChecks(libs.slack-lint-checks) - -# libs.versions.toml -[versions] -slack-lint-checks = "0.7.0" -[libraries] -slack-lint-checks = { - module = "com.slack.lint:slack-lint-checks", - version.ref = "slack-lint-checks" -} -``` - -0.7.0 is the version this documentation was generated from; -there may be newer versions available. - -[Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). -(##) Suppressing - -You can suppress false positives using one of the following mechanisms: - -* Using a suppression annotation like this on the enclosing - element: - - ```kt - // Kotlin - @Suppress("InjectWithScopeRequiredLoggedInUserProvider") - fun method() { - problematicStatement() - } - ``` - - or - - ```java - // Java - @SuppressWarnings("InjectWithScopeRequiredLoggedInUserProvider") - void method() { - problematicStatement(); - } - ``` - -* Using a suppression comment like this on the line above: - - ```kt - //noinspection InjectWithScopeRequiredLoggedInUserProvider - 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 - <?xml version="1.0" encoding="UTF-8"?> - <lint> - <issue id="InjectWithScopeRequiredLoggedInUserProvider" severity="ignore" /> - </lint> - ``` - 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 'InjectWithScopeRequiredLoggedInUserProvider' - } - ``` - In Android projects this should be nested inside an `android { }` - block. - -* For manual invocations of `lint`, using the `--ignore` flag: - ``` - $ lint --ignore InjectWithScopeRequiredLoggedInUserProvider ...` - ``` - -* Last, but not least, using baselines, as discussed - [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). - - \ No newline at end of file diff --git a/docs/checks/InvalidColorHexValue.md.html b/docs/checks/InvalidColorHexValue.md.html index cd802313..9787efdc 100644 --- a/docs/checks/InvalidColorHexValue.md.html +++ b/docs/checks/InvalidColorHexValue.md.html @@ -97,17 +97,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-graphics-android) # libs.versions.toml [versions] -ui-graphics-android = "1.7.0-alpha01" +ui-graphics-android = "1.7.0-beta01" [libraries] ui-graphics-android = { module = "androidx.compose.ui:ui-graphics-android", @@ -115,7 +115,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html). diff --git a/docs/checks/InvalidFragmentVersionForActivityResult.md.html b/docs/checks/InvalidFragmentVersionForActivityResult.md.html index dc213d0f..08aef968 100644 --- a/docs/checks/InvalidFragmentVersionForActivityResult.md.html +++ b/docs/checks/InvalidFragmentVersionForActivityResult.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity:1.9.0-alpha02") +implementation("androidx.activity:activity:1.9.0") // build.gradle -implementation 'androidx.activity:activity:1.9.0-alpha02' +implementation 'androidx.activity:activity:1.9.0' // build.gradle.kts with version catalogs: implementation(libs.activity) # libs.versions.toml [versions] -activity = "1.9.0-alpha02" +activity = "1.9.0" [libraries] activity = { module = "androidx.activity:activity", @@ -105,7 +105,7 @@ } ``` -1.9.0-alpha02 is the version this documentation was generated from; +1.9.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.activity:activity](androidx_activity_activity.md.html). diff --git a/docs/checks/InvalidLanguageTagDelimiter.md.html b/docs/checks/InvalidLanguageTagDelimiter.md.html new file mode 100644 index 00000000..d78ef429 --- /dev/null +++ b/docs/checks/InvalidLanguageTagDelimiter.md.html @@ -0,0 +1,174 @@ + +(#) Undercore (_) is an unsupported delimiter for subtags + +!!! ERROR: Undercore (_) is an unsupported delimiter for subtags + This is an error. + +Id +: `InvalidLanguageTagDelimiter` +Summary +: Undercore (_) is an unsupported delimiter for subtags +Severity +: Error +Category +: Correctness +Platform +: Any +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui.text +Feedback +: https://issuetracker.google.com/issues/new?component=779818 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.compose.ui:ui-text-android](androidx_compose_ui_ui-text-android.md.html) + +Affects +: Kotlin and Java files and test sources +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-text-lint/src/main/java/androidx/compose/ui/text/lint/LocaleInvalidLanguageTagDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-text-lint/src/test/java/androidx/compose/ui/text/lint/LocaleInvalidLanguageTagDetectorTest.kt) +Copyright Year +: 2024 + +A language tag must be compliant with IETF BCP47, specifically a +sequence of subtags must be separated by hyphens (-) instead of +underscores (_) + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/test.kt:8:Error: A hyphen (-), not an underscore (_) delimiter +should be used in a language tag [InvalidLanguageTagDelimiter] + + bar(Locale("en_UK")) + ----- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test + +import androidx.compose.ui.text.intl.Locale + +fun bar(locale: Locale) {} +fun foo() { + bar(Locale("en_UK")) +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can also visit the +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-text-lint/src/test/java/androidx/compose/ui/text/lint/LocaleInvalidLanguageTagDetectorTest.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, `LocaleInvalidLanguageTagDetector.underscoreDelimiter_locale_shouldWarn`. +To report a problem with this extracted sample, visit +https://issuetracker.google.com/issues/new?component=779818. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-text-android:1.7.0-beta01") + +// build.gradle +implementation 'androidx.compose.ui:ui-text-android:1.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-text-android) + +# libs.versions.toml +[versions] +ui-text-android = "1.7.0-beta01" +[libraries] +ui-text-android = { + module = "androidx.compose.ui:ui-text-android", + version.ref = "ui-text-android" +} +``` + +1.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.compose.ui:ui-text-android](androidx_compose_ui_ui-text-android.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InvalidLanguageTagDelimiter") + fun method() { + LocaleList(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InvalidLanguageTagDelimiter") + void method() { + new LocaleList(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InvalidLanguageTagDelimiter + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidLanguageTagDelimiter" severity="ignore" /> + </lint> + ``` + 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 'InvalidLanguageTagDelimiter' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidLanguageTagDelimiter ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html index 08127b7d..175e2030 100644 --- a/docs/checks/InvalidPeriodicWorkRequestInterval.md.html +++ b/docs/checks/InvalidPeriodicWorkRequestInterval.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -69,7 +69,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/InvalidUseOfOnBackPressed.md.html b/docs/checks/InvalidUseOfOnBackPressed.md.html new file mode 100644 index 00000000..0d8a1174 --- /dev/null +++ b/docs/checks/InvalidUseOfOnBackPressed.md.html @@ -0,0 +1,140 @@ + +(#) Do not call onBackPressed() within OnBackPressedDisptacher + +!!! WARNING: Do not call onBackPressed() within OnBackPressedDisptacher + This is a warning. + +Id +: `InvalidUseOfOnBackPressed` +Summary +: Do not call onBackPressed() within OnBackPressedDisptacher +Severity +: Warning +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Identifier +: androidx.activity +Feedback +: https://issuetracker.google.com/issues/new?component=527362 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.activity:activity](androidx_activity_activity.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +See +: https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture#ui-logic +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/activity/activity-lint/src/main/java/androidx/activity/lint/OnBackPressedDetector.kt) +Copyright Year +: 2024 + +You should not used OnBackPressedCallback for non-UI cases. If you + |add a callback, you have to handle back completely in +the callback. + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.activity:activity:1.9.0") + +// build.gradle +implementation 'androidx.activity:activity:1.9.0' + +// build.gradle.kts with version catalogs: +implementation(libs.activity) + +# libs.versions.toml +[versions] +activity = "1.9.0" +[libraries] +activity = { + module = "androidx.activity:activity", + version.ref = "activity" +} +``` + +1.9.0 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.activity:activity](androidx_activity_activity.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("InvalidUseOfOnBackPressed") + fun method() { + onBackPressed(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("InvalidUseOfOnBackPressed") + void method() { + onBackPressed(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection InvalidUseOfOnBackPressed + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="InvalidUseOfOnBackPressed" severity="ignore" /> + </lint> + ``` + 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 'InvalidUseOfOnBackPressed' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore InvalidUseOfOnBackPressed ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/JavaOnlyDetector.md.html b/docs/checks/JavaOnlyDetector.md.html index 581ea63a..cf1207df 100644 --- a/docs/checks/JavaOnlyDetector.md.html +++ b/docs/checks/JavaOnlyDetector.md.html @@ -102,17 +102,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -120,7 +120,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/JvmStaticProvidesInObjectDetector.md.html b/docs/checks/JvmStaticProvidesInObjectDetector.md.html index 8ee5f29e..af71fa67 100644 --- a/docs/checks/JvmStaticProvidesInObjectDetector.md.html +++ b/docs/checks/JvmStaticProvidesInObjectDetector.md.html @@ -200,17 +200,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.50") +implementation("com.google.dagger:dagger-lint:2.51.1") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.50' +implementation 'com.google.dagger:dagger-lint:2.51.1' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.50" +dagger-lint = "2.51.1" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -218,7 +218,7 @@ } ``` -2.50 is the version this documentation was generated from; +2.51.1 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). diff --git a/docs/checks/KotlinPairNotCreated.md.html b/docs/checks/KotlinPairNotCreated.md.html index 9573241c..9138578a 100644 --- a/docs/checks/KotlinPairNotCreated.md.html +++ b/docs/checks/KotlinPairNotCreated.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -112,7 +112,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/LaunchDuringComposition.md.html b/docs/checks/LaunchDuringComposition.md.html index 6fda0576..22cf9c27 100644 --- a/docs/checks/LaunchDuringComposition.md.html +++ b/docs/checks/LaunchDuringComposition.md.html @@ -166,17 +166,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity-compose:1.9.0-alpha02") +implementation("androidx.activity:activity-compose:1.9.0") // build.gradle -implementation 'androidx.activity:activity-compose:1.9.0-alpha02' +implementation 'androidx.activity:activity-compose:1.9.0' // build.gradle.kts with version catalogs: implementation(libs.activity-compose) # libs.versions.toml [versions] -activity-compose = "1.9.0-alpha02" +activity-compose = "1.9.0" [libraries] activity-compose = { module = "androidx.activity:activity-compose", @@ -184,7 +184,7 @@ } ``` -1.9.0-alpha02 is the version this documentation was generated from; +1.9.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.activity:activity-compose](androidx_activity_activity-compose.md.html). diff --git a/docs/checks/LintImplIdFormat.md.html b/docs/checks/LintImplIdFormat.md.html index 6c948993..9deaf917 100644 --- a/docs/checks/LintImplIdFormat.md.html +++ b/docs/checks/LintImplIdFormat.md.html @@ -57,7 +57,7 @@ capitalized camel case, such as MyIssueId [LintImplIdFormat] id = "badlyCapitalized id", - ------------------- + --------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: @@ -128,6 +128,9 @@ explanation = """ Some description here. Here's a call: foo.bar.baz(args). + This line continuation is okay. \ + But this one is missing a space.\ + Okay? """.trimIndent(), category = Category.INTEROPERABILITY_KOTLIN, moreInfo = "https://code.google.com/p/android/issues/detail?id=65351", // OBSOLETE diff --git a/docs/checks/LintImplTrimIndent.md.html b/docs/checks/LintImplTrimIndent.md.html index 307d3860..4ac7bce3 100644 --- a/docs/checks/LintImplTrimIndent.md.html +++ b/docs/checks/LintImplTrimIndent.md.html @@ -53,7 +53,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/MyKotlinLintDetector.kt:65:Error: No need to call +src/test/pkg/MyKotlinLintDetector.kt:68:Error: No need to call .trimIndent() in issue registration strings; they are already trimmed by indent by lint when displaying to users [LintImplTrimIndent] @@ -129,6 +129,9 @@ explanation = """ Some description here. Here's a call: foo.bar.baz(args). + This line continuation is okay. \ + But this one is missing a space.\ + Okay? """.trimIndent(), category = Category.INTEROPERABILITY_KOTLIN, moreInfo = "https://code.google.com/p/android/issues/detail?id=65351", // OBSOLETE diff --git a/docs/checks/MainScopeUsage.md.html b/docs/checks/MainScopeUsage.md.html index 1d3e5db0..f5ee5865 100644 --- a/docs/checks/MainScopeUsage.md.html +++ b/docs/checks/MainScopeUsage.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MissingColorAlphaChannel.md.html b/docs/checks/MissingColorAlphaChannel.md.html index bf0ff29e..3704a7af 100644 --- a/docs/checks/MissingColorAlphaChannel.md.html +++ b/docs/checks/MissingColorAlphaChannel.md.html @@ -119,17 +119,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-graphics-android) # libs.versions.toml [versions] -ui-graphics-android = "1.7.0-alpha01" +ui-graphics-android = "1.7.0-beta01" [libraries] ui-graphics-android = { module = "androidx.compose.ui:ui-graphics-android", @@ -137,7 +137,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html). diff --git a/docs/checks/MissingResourceImportAlias.md.html b/docs/checks/MissingResourceImportAlias.md.html index 49418370..432af9f4 100644 --- a/docs/checks/MissingResourceImportAlias.md.html +++ b/docs/checks/MissingResourceImportAlias.md.html @@ -107,17 +107,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -125,7 +125,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ModifierFactoryExtensionFunction.md.html b/docs/checks/ModifierFactoryExtensionFunction.md.html index 89711880..2b826776 100644 --- a/docs/checks/ModifierFactoryExtensionFunction.md.html +++ b/docs/checks/ModifierFactoryExtensionFunction.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -119,17 +119,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -137,7 +137,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ModifierFactoryReturnType.md.html b/docs/checks/ModifierFactoryReturnType.md.html index ddf13b9d..3a77ca21 100644 --- a/docs/checks/ModifierFactoryReturnType.md.html +++ b/docs/checks/ModifierFactoryReturnType.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -85,17 +85,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -103,7 +103,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html index 8f816047..f83d4992 100644 --- a/docs/checks/ModifierFactoryUnreferencedReceiver.md.html +++ b/docs/checks/ModifierFactoryUnreferencedReceiver.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -90,17 +90,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -108,7 +108,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ModifierNodeInspectableProperties.md.html b/docs/checks/ModifierNodeInspectableProperties.md.html index 92f152e3..c1c6c4cc 100644 --- a/docs/checks/ModifierNodeInspectableProperties.md.html +++ b/docs/checks/ModifierNodeInspectableProperties.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -92,17 +92,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -110,7 +110,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ModifierParameter.md.html b/docs/checks/ModifierParameter.md.html index 44f765a9..d8600934 100644 --- a/docs/checks/ModifierParameter.md.html +++ b/docs/checks/ModifierParameter.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -94,17 +94,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -112,7 +112,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ModuleCompanionObjects.md.html b/docs/checks/ModuleCompanionObjects.md.html index 5373ab6d..ca050f75 100644 --- a/docs/checks/ModuleCompanionObjects.md.html +++ b/docs/checks/ModuleCompanionObjects.md.html @@ -200,17 +200,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.50") +implementation("com.google.dagger:dagger-lint:2.51.1") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.50' +implementation 'com.google.dagger:dagger-lint:2.51.1' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.50" +dagger-lint = "2.51.1" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -218,7 +218,7 @@ } ``` -2.50 is the version this documentation was generated from; +2.51.1 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). diff --git a/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html index 74eeb2a0..bde99f84 100644 --- a/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html +++ b/docs/checks/ModuleCompanionObjectsNotInModuleParent.md.html @@ -56,17 +56,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.50") +implementation("com.google.dagger:dagger-lint:2.51.1") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.50' +implementation 'com.google.dagger:dagger-lint:2.51.1' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.50" +dagger-lint = "2.51.1" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -74,7 +74,7 @@ } ``` -2.50 is the version this documentation was generated from; +2.51.1 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). diff --git a/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html index 24d23ae2..bb93e598 100644 --- a/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html +++ b/docs/checks/MoshiUsageAdaptedByRequiresAdapter.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html index 43c4ea42..37952e55 100644 --- a/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html +++ b/docs/checks/MoshiUsageAdaptedByRequiresKeep.md.html @@ -109,17 +109,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -127,7 +127,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageArray.md.html b/docs/checks/MoshiUsageArray.md.html index a7d406aa..1fcb7810 100644 --- a/docs/checks/MoshiUsageArray.md.html +++ b/docs/checks/MoshiUsageArray.md.html @@ -166,17 +166,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -184,7 +184,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankGenerator.md.html b/docs/checks/MoshiUsageBlankGenerator.md.html index 78c75db9..bd3f3b5b 100644 --- a/docs/checks/MoshiUsageBlankGenerator.md.html +++ b/docs/checks/MoshiUsageBlankGenerator.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankJsonName.md.html b/docs/checks/MoshiUsageBlankJsonName.md.html index a2c68eba..b08cb668 100644 --- a/docs/checks/MoshiUsageBlankJsonName.md.html +++ b/docs/checks/MoshiUsageBlankJsonName.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageBlankTypeLabel.md.html b/docs/checks/MoshiUsageBlankTypeLabel.md.html index 1858f020..bb405667 100644 --- a/docs/checks/MoshiUsageBlankTypeLabel.md.html +++ b/docs/checks/MoshiUsageBlankTypeLabel.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageClassVisibility.md.html b/docs/checks/MoshiUsageClassVisibility.md.html index 434d9d2f..9243e444 100644 --- a/docs/checks/MoshiUsageClassVisibility.md.html +++ b/docs/checks/MoshiUsageClassVisibility.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDoubleClassAnnotation.md.html b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html index 5726302e..7ccbaeea 100644 --- a/docs/checks/MoshiUsageDoubleClassAnnotation.md.html +++ b/docs/checks/MoshiUsageDoubleClassAnnotation.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDoubleTypeLabel.md.html b/docs/checks/MoshiUsageDoubleTypeLabel.md.html index 84226b9a..3cee0d79 100644 --- a/docs/checks/MoshiUsageDoubleTypeLabel.md.html +++ b/docs/checks/MoshiUsageDoubleTypeLabel.md.html @@ -97,17 +97,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -115,7 +115,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageDuplicateJsonName.md.html b/docs/checks/MoshiUsageDuplicateJsonName.md.html index 8612f1ef..108a9dce 100644 --- a/docs/checks/MoshiUsageDuplicateJsonName.md.html +++ b/docs/checks/MoshiUsageDuplicateJsonName.md.html @@ -111,17 +111,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -129,7 +129,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html index 3bc494d0..594b958f 100644 --- a/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html +++ b/docs/checks/MoshiUsageEnumAnnotatedUnknown.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumCasing.md.html b/docs/checks/MoshiUsageEnumCasing.md.html index 8bf22881..dcc560c2 100644 --- a/docs/checks/MoshiUsageEnumCasing.md.html +++ b/docs/checks/MoshiUsageEnumCasing.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html index 5e67ef5e..8a873ce3 100644 --- a/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html +++ b/docs/checks/MoshiUsageEnumJsonClassGenerated.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -70,7 +70,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumMissingJsonClass.md.html b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html index 95d10b55..170d4d3a 100644 --- a/docs/checks/MoshiUsageEnumMissingJsonClass.md.html +++ b/docs/checks/MoshiUsageEnumMissingJsonClass.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumMissingUnknown.md.html b/docs/checks/MoshiUsageEnumMissingUnknown.md.html index 58447e23..224f9357 100644 --- a/docs/checks/MoshiUsageEnumMissingUnknown.md.html +++ b/docs/checks/MoshiUsageEnumMissingUnknown.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -71,7 +71,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html index c7ea6776..40920d4c 100644 --- a/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html +++ b/docs/checks/MoshiUsageEnumPropertyCouldBeMoshi.md.html @@ -90,17 +90,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -108,7 +108,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html index a50884f0..ed6d9ca8 100644 --- a/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html +++ b/docs/checks/MoshiUsageEnumPropertyDefaultUnknown.md.html @@ -112,17 +112,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -130,7 +130,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html index e1d0c383..a77a2737 100644 --- a/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html +++ b/docs/checks/MoshiUsageGenerateAdapterShouldBeTrue.md.html @@ -85,17 +85,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -103,7 +103,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageGenericSealedSubtype.md.html b/docs/checks/MoshiUsageGenericSealedSubtype.md.html index e813c13c..fa76e4d2 100644 --- a/docs/checks/MoshiUsageGenericSealedSubtype.md.html +++ b/docs/checks/MoshiUsageGenericSealedSubtype.md.html @@ -95,17 +95,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -113,7 +113,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageInappropriateTypeLabel.md.html b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html index 44191dfd..249667ce 100644 --- a/docs/checks/MoshiUsageInappropriateTypeLabel.md.html +++ b/docs/checks/MoshiUsageInappropriateTypeLabel.md.html @@ -108,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -126,7 +126,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMissingPrimary.md.html b/docs/checks/MoshiUsageMissingPrimary.md.html index 167f47b9..fb030d78 100644 --- a/docs/checks/MoshiUsageMissingPrimary.md.html +++ b/docs/checks/MoshiUsageMissingPrimary.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMissingTypeLabel.md.html b/docs/checks/MoshiUsageMissingTypeLabel.md.html index 2e65f4db..3ebf5d26 100644 --- a/docs/checks/MoshiUsageMissingTypeLabel.md.html +++ b/docs/checks/MoshiUsageMissingTypeLabel.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageMutableCollections.md.html b/docs/checks/MoshiUsageMutableCollections.md.html index c96ecd2c..0297d68e 100644 --- a/docs/checks/MoshiUsageMutableCollections.md.html +++ b/docs/checks/MoshiUsageMutableCollections.md.html @@ -163,17 +163,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -181,7 +181,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassCollection.md.html b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html index b1a273d2..7fb60e5e 100644 --- a/docs/checks/MoshiUsageNonMoshiClassCollection.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassCollection.md.html @@ -153,17 +153,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -171,7 +171,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassExternal.md.html b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html index 654b868d..8815d0b8 100644 --- a/docs/checks/MoshiUsageNonMoshiClassExternal.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassExternal.md.html @@ -167,17 +167,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -185,7 +185,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassInternal.md.html b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html index 9b5cac2f..2cc6f2e3 100644 --- a/docs/checks/MoshiUsageNonMoshiClassInternal.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassInternal.md.html @@ -144,17 +144,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -162,7 +162,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassMap.md.html b/docs/checks/MoshiUsageNonMoshiClassMap.md.html index 2653abba..21acabb0 100644 --- a/docs/checks/MoshiUsageNonMoshiClassMap.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassMap.md.html @@ -143,17 +143,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -161,7 +161,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html index 2c8b958a..07f4e366 100644 --- a/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html +++ b/docs/checks/MoshiUsageNonMoshiClassPlatform.md.html @@ -145,17 +145,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -163,7 +163,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageObject.md.html b/docs/checks/MoshiUsageObject.md.html index ed54aaac..b3193cb8 100644 --- a/docs/checks/MoshiUsageObject.md.html +++ b/docs/checks/MoshiUsageObject.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageParamNeedsInit.md.html b/docs/checks/MoshiUsageParamNeedsInit.md.html index 71dce9fb..46e43e50 100644 --- a/docs/checks/MoshiUsageParamNeedsInit.md.html +++ b/docs/checks/MoshiUsageParamNeedsInit.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsagePrivateConstructor.md.html b/docs/checks/MoshiUsagePrivateConstructor.md.html index c3e2392c..10862dd1 100644 --- a/docs/checks/MoshiUsagePrivateConstructor.md.html +++ b/docs/checks/MoshiUsagePrivateConstructor.md.html @@ -94,17 +94,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -112,7 +112,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsagePrivateConstructorProperty.md.html b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html index 45788498..114d2a39 100644 --- a/docs/checks/MoshiUsagePrivateConstructorProperty.md.html +++ b/docs/checks/MoshiUsagePrivateConstructorProperty.md.html @@ -84,17 +84,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -102,7 +102,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageQualifierRetention.md.html b/docs/checks/MoshiUsageQualifierRetention.md.html index 50c74356..4c71448a 100644 --- a/docs/checks/MoshiUsageQualifierRetention.md.html +++ b/docs/checks/MoshiUsageQualifierRetention.md.html @@ -119,17 +119,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -137,7 +137,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageQualifierTarget.md.html b/docs/checks/MoshiUsageQualifierTarget.md.html index 75ce558f..48baf3c6 100644 --- a/docs/checks/MoshiUsageQualifierTarget.md.html +++ b/docs/checks/MoshiUsageQualifierTarget.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageRedundantJsonName.md.html b/docs/checks/MoshiUsageRedundantJsonName.md.html index 4f96d1b0..87b0df44 100644 --- a/docs/checks/MoshiUsageRedundantJsonName.md.html +++ b/docs/checks/MoshiUsageRedundantJsonName.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -105,7 +105,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageRedundantSiteTarget.md.html b/docs/checks/MoshiUsageRedundantSiteTarget.md.html index 0a642bb5..74b009af 100644 --- a/docs/checks/MoshiUsageRedundantSiteTarget.md.html +++ b/docs/checks/MoshiUsageRedundantSiteTarget.md.html @@ -87,17 +87,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -105,7 +105,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSealedMustBeSealed.md.html b/docs/checks/MoshiUsageSealedMustBeSealed.md.html index 9a7516e0..cc11e4fd 100644 --- a/docs/checks/MoshiUsageSealedMustBeSealed.md.html +++ b/docs/checks/MoshiUsageSealedMustBeSealed.md.html @@ -83,17 +83,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -101,7 +101,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSerializedName.md.html b/docs/checks/MoshiUsageSerializedName.md.html index fe478ca2..6691581b 100644 --- a/docs/checks/MoshiUsageSerializedName.md.html +++ b/docs/checks/MoshiUsageSerializedName.md.html @@ -123,17 +123,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -141,7 +141,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageSnakeCase.md.html b/docs/checks/MoshiUsageSnakeCase.md.html index 0a7119c3..24a0d656 100644 --- a/docs/checks/MoshiUsageSnakeCase.md.html +++ b/docs/checks/MoshiUsageSnakeCase.md.html @@ -89,17 +89,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -107,7 +107,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageTransientNeedsInit.md.html b/docs/checks/MoshiUsageTransientNeedsInit.md.html index 64060a5c..c0bbbdc0 100644 --- a/docs/checks/MoshiUsageTransientNeedsInit.md.html +++ b/docs/checks/MoshiUsageTransientNeedsInit.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageUnsupportedType.md.html b/docs/checks/MoshiUsageUnsupportedType.md.html index db4d9e78..6ff61293 100644 --- a/docs/checks/MoshiUsageUnsupportedType.md.html +++ b/docs/checks/MoshiUsageUnsupportedType.md.html @@ -117,17 +117,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -135,7 +135,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageUseData.md.html b/docs/checks/MoshiUsageUseData.md.html index b9528e53..a56626d0 100644 --- a/docs/checks/MoshiUsageUseData.md.html +++ b/docs/checks/MoshiUsageUseData.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -106,7 +106,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MoshiUsageVarProperty.md.html b/docs/checks/MoshiUsageVarProperty.md.html index 0550ac92..e63c3bef 100644 --- a/docs/checks/MoshiUsageVarProperty.md.html +++ b/docs/checks/MoshiUsageVarProperty.md.html @@ -85,17 +85,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -103,7 +103,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/MultipleAwaitPointerEventScopes.md.html b/docs/checks/MultipleAwaitPointerEventScopes.md.html index e05819c0..6cbb9ca0 100644 --- a/docs/checks/MultipleAwaitPointerEventScopes.md.html +++ b/docs/checks/MultipleAwaitPointerEventScopes.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -70,7 +70,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/MustBeInModule.md.html b/docs/checks/MustBeInModule.md.html index af46b378..a004222d 100644 --- a/docs/checks/MustBeInModule.md.html +++ b/docs/checks/MustBeInModule.md.html @@ -1,13 +1,13 @@ -(#) @Binds/@Provides function must be in `@Module`-annotated classes. +(#) @Binds/@Provides functions must be in modules -!!! ERROR: @Binds/@Provides function must be in `@Module`-annotated classes. +!!! ERROR: @Binds/@Provides functions must be in modules This is an error. Id : `MustBeInModule` Summary -: @Binds/@Provides function must be in `@Module`-annotated classes. +: @Binds/@Provides functions must be in modules Severity : Error Category @@ -40,7 +40,7 @@ Copyright Year : 2021 -@Binds/@Provides function must be in `@Module`-annotated classes. +@Binds/@Provides functions must be in `@Module`-annotated classes. (##) Example @@ -136,17 +136,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -154,7 +154,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html b/docs/checks/MustUseNamedParams.md.html similarity index 60% rename from docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html rename to docs/checks/MustUseNamedParams.md.html index a92aa3b0..74862eed 100644 --- a/docs/checks/InjectWithTypeMustImplementAnvilInjectable.md.html +++ b/docs/checks/MustUseNamedParams.md.html @@ -1,13 +1,13 @@ -(#) @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). +(#) Calls to @MustUseNamedParams-annotated methods must name all parameters. -!!! ERROR: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). +!!! ERROR: Calls to @MustUseNamedParams-annotated methods must name all parameters. This is an error. Id -: `InjectWithTypeMustImplementAnvilInjectable` +: `MustUseNamedParams` Summary -: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). +: Calls to @MustUseNamedParams-annotated methods must name all parameters. Severity : Error Category @@ -34,69 +34,60 @@ Editing : This check runs on the fly in the IDE editor Implementation -: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/InjectWithUsageDetector.kt) +: [Source Code](https://github.com/slackhq/slack-lints/blob/main/slack-lint-checks/src/main/java/slack/lint/MustUseNamedParamsDetector.kt) Tests -: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.kt) +: [Source Code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MustUseNamedParamsDetectorTest.kt) Copyright Year -: 2021 +: 2022 -`@InjectWith`-annotated classes must implement AnvilInjectable (or -extend something that does). +Calls to @MustUseNamedParams-annotated methods must name all +parameters. (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/test/pkg/BaseInjectableAnnotation.kt:30:Error: @InjectWith-annotated -classes must implement AnvilInjectable (or extend something that does). -[InjectWithTypeMustImplementAnvilInjectable] +src/foo/TestFile.kt:16:Error: Calls to @MustUseNamedParams-annotated +methods must name all parameters. [MustUseNamedParams] -class MissingAnvilInjectable - ---------------------- + methodWithAnnotation("Zac") + --------------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: -`src/test/pkg/BaseInjectableAnnotation.kt`: +`src/foo/TestFile.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -package test.pkg +package foo -import slack.anvil.injection.InjectWith -import slack.anvil.injection.AnvilInjectable -import slack.di.AppScope -import slack.di.UserScope -import slack.di.OrgScope -import slack.foundation.auth.LoggedInUserProvider +import slack.lint.annotations.MustUseNamedParams -annotation class BaseInjectableAnnotation - -abstract class BaseInjectable : AnvilInjectable - -@InjectWith(AppScope::class) -class AppActivityCorrect : BaseInjectable() - -@InjectWith(UserScope::class) -class UserActivityCorrect : BaseInjectable(), LoggedInUserProvider - -@InjectWith(OrgScope::class) -class OrgActivityCorrect : BaseInjectable(), LoggedInUserProvider +class TestFile { + @MustUseNamedParams + fun methodWithAnnotation(name: String) { + // Do nothing. + } -@InjectWith(UserScope::class) -class UserActivityWrong : BaseInjectable() + fun methodWithoutAnnotation(name: String) { + // Do nothing. + } -@InjectWith(OrgScope::class) -class OrgActivityWrong : BaseInjectable() + fun useMethod() { + methodWithAnnotation("Zac") + methodWithAnnotation(name = "Sean") -@InjectWith(AppScope::class) -class MissingAnvilInjectable + methodWithoutAnnotation("Yifan") + methodWithoutAnnotation(name = "Sean2") + } +} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the -[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/InjectWithUsageDetectorTest.kt) +[source code](https://github.com/slackhq/slack-lints/tree/main/slack-lint-checks/src/test/java/slack/lint/MustUseNamedParamsDetectorTest.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, `InjectWithUsageDetector.smokeTest`. +found for this lint check, `MustUseNamedParamsDetector.simpleTest`. To report a problem with this extracted sample, visit https://github.com/slackhq/slack-lints. @@ -109,17 +100,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -127,7 +118,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). @@ -140,7 +131,7 @@ ```kt // Kotlin - @Suppress("InjectWithTypeMustImplementAnvilInjectable") + @Suppress("MustUseNamedParams") fun method() { problematicStatement() } @@ -150,7 +141,7 @@ ```java // Java - @SuppressWarnings("InjectWithTypeMustImplementAnvilInjectable") + @SuppressWarnings("MustUseNamedParams") void method() { problematicStatement(); } @@ -159,7 +150,7 @@ * Using a suppression comment like this on the line above: ```kt - //noinspection InjectWithTypeMustImplementAnvilInjectable + //noinspection MustUseNamedParams problematicStatement() ``` @@ -169,7 +160,7 @@ ```xml <?xml version="1.0" encoding="UTF-8"?> <lint> - <issue id="InjectWithTypeMustImplementAnvilInjectable" severity="ignore" /> + <issue id="MustUseNamedParams" severity="ignore" /> </lint> ``` Instead of `ignore` you can also change the severity here, for @@ -182,7 +173,7 @@ example, you can use something like ```gradle lintOptions { - disable 'InjectWithTypeMustImplementAnvilInjectable' + disable 'MustUseNamedParams' } ``` In Android projects this should be nested inside an `android { }` @@ -190,7 +181,7 @@ * For manual invocations of `lint`, using the `--ignore` flag: ``` - $ lint --ignore InjectWithTypeMustImplementAnvilInjectable ...` + $ lint --ignore MustUseNamedParams ...` ``` * Last, but not least, using baselines, as discussed diff --git a/docs/checks/MutableCollectionMutableState.md.html b/docs/checks/MutableCollectionMutableState.md.html index 2eed87ac..dc22391c 100644 --- a/docs/checks/MutableCollectionMutableState.md.html +++ b/docs/checks/MutableCollectionMutableState.md.html @@ -174,17 +174,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -192,7 +192,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/NoCollectCallFound.md.html b/docs/checks/NoCollectCallFound.md.html index d1dd131d..60caf0e6 100644 --- a/docs/checks/NoCollectCallFound.md.html +++ b/docs/checks/NoCollectCallFound.md.html @@ -160,17 +160,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity-compose:1.9.0-alpha02") +implementation("androidx.activity:activity-compose:1.9.0") // build.gradle -implementation 'androidx.activity:activity-compose:1.9.0-alpha02' +implementation 'androidx.activity:activity-compose:1.9.0' // build.gradle.kts with version catalogs: implementation(libs.activity-compose) # libs.versions.toml [versions] -activity-compose = "1.9.0-alpha02" +activity-compose = "1.9.0" [libraries] activity-compose = { module = "androidx.activity:activity-compose", @@ -178,7 +178,7 @@ } ``` -1.9.0-alpha02 is the version this documentation was generated from; +1.9.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.activity:activity-compose](androidx_activity_activity-compose.md.html). diff --git a/docs/checks/NullSafeMutableLiveData-2.md.html b/docs/checks/NullSafeMutableLiveData-2.md.html new file mode 100644 index 00000000..1abd951d --- /dev/null +++ b/docs/checks/NullSafeMutableLiveData-2.md.html @@ -0,0 +1,162 @@ + +(#) LiveData value assignment nullability mismatch + +!!! ERROR: LiveData value assignment nullability mismatch + This is an error, and is also enforced at build time when + supported by the build system. For Android this means it will + run during release builds. + +Id +: `NullSafeMutableLiveData` +Summary +: LiveData value assignment nullability mismatch +Severity +: Fatal +Category +: Interoperability: Kotlin Interoperability +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/livedata/core/lint/NonNullableMutableLiveDataDetectorTest.kt) +Copyright Year +: 2019 + +This check ensures that LiveData values are not null when explicitly + declared as non-nullable. + + Kotlin interoperability does not support enforcing +explicit null-safety when using generic Java type +parameters. Since LiveData is a Java class its value can always + be null even when its type is explicitly declared as +non-nullable. This can lead to runtime exceptions from +reading a null LiveData value that is assumed to be +non-nullable. + +!!! Tip + This lint check has an associated quickfix available in the IDE. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* NullSafeMutableLiveData: LiveData value assignment nullability mismatch (this issue) +* [NullSafeMutableLiveData from androidx.lifecycle:lifecycle-livedata-core:2.8.0](NullSafeMutableLiveData.md.html) +* [NullSafeMutableLiveData from androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01](NullSafeMutableLiveData-2.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-livedata-core-ktx) + +# libs.versions.toml +[versions] +lifecycle-livedata-core-ktx = "2.8.0-alpha01" +[libraries] +lifecycle-livedata-core-ktx = { + module = "androidx.lifecycle:lifecycle-livedata-core-ktx", + version.ref = "lifecycle-livedata-core-ktx" +} +``` + +2.8.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("NullSafeMutableLiveData") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("NullSafeMutableLiveData") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection NullSafeMutableLiveData + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="NullSafeMutableLiveData" severity="ignore" /> + </lint> + ``` + 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 'NullSafeMutableLiveData' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore NullSafeMutableLiveData ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/NullSafeMutableLiveData.md.html b/docs/checks/NullSafeMutableLiveData.md.html index 841c6da9..d66d079b 100644 --- a/docs/checks/NullSafeMutableLiveData.md.html +++ b/docs/checks/NullSafeMutableLiveData.md.html @@ -27,7 +27,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) +: [androidx.lifecycle:lifecycle-livedata-core](androidx_lifecycle_lifecycle-livedata-core.md.html) Affects : Kotlin and Java files @@ -54,6 +54,16 @@ !!! Tip This lint check has an associated quickfix available in the IDE. +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* NullSafeMutableLiveData: LiveData value assignment nullability mismatch (this issue) +* [NullSafeMutableLiveData from androidx.lifecycle:lifecycle-livedata-core:2.8.0](NullSafeMutableLiveData.md.html) +* [NullSafeMutableLiveData from androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01](NullSafeMutableLiveData-2.md.html) + + (##) Including !!! @@ -62,28 +72,28 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01") +implementation("androidx.lifecycle:lifecycle-livedata-core:2.8.0") // build.gradle -implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01' +implementation 'androidx.lifecycle:lifecycle-livedata-core:2.8.0' // build.gradle.kts with version catalogs: -implementation(libs.lifecycle-livedata-core-ktx) +implementation(libs.lifecycle-livedata-core) # libs.versions.toml [versions] -lifecycle-livedata-core-ktx = "2.8.0-alpha01" +lifecycle-livedata-core = "2.8.0" [libraries] -lifecycle-livedata-core-ktx = { - module = "androidx.lifecycle:lifecycle-livedata-core-ktx", - version.ref = "lifecycle-livedata-core-ktx" +lifecycle-livedata-core = { + module = "androidx.lifecycle:lifecycle-livedata-core", + version.ref = "lifecycle-livedata-core" } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html). +[Additional details about androidx.lifecycle:lifecycle-livedata-core](androidx_lifecycle_lifecycle-livedata-core.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/OpaqueUnitKey.md.html b/docs/checks/OpaqueUnitKey.md.html index 46fb0ce1..f7299098 100644 --- a/docs/checks/OpaqueUnitKey.md.html +++ b/docs/checks/OpaqueUnitKey.md.html @@ -99,17 +99,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -117,7 +117,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/OutdatedLibrary.md.html b/docs/checks/OutdatedLibrary.md.html index 717aeb25..ae922319 100644 --- a/docs/checks/OutdatedLibrary.md.html +++ b/docs/checks/OutdatedLibrary.md.html @@ -46,23 +46,29 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:5:Warning: log4j:log4j version 1.2.15 has been marked as +build.gradle:5:Warning: log4j:log4j version 1.2.15 has been reported as outdated by its author [OutdatedLibrary] compile 'log4j:log4j:1.2.15' // Outdated NON_BLOCKING -------------------- -build.gradle:8:Error: log4j:log4j version 1.2.12 has been marked as -outdated by its author and will block publishing of your app to Play -Console [OutdatedLibrary] +build.gradle:8:Error: [Prevents app release in Google Play Console] +log4j:log4j version 1.2.12 has been reported as outdated by its author +and will block publishing of your app to Play Console. +The library author recommends using versions: + - 1.2.17 + - 1.2.18 or higher +These versions have not been reviewed by Google Play. They could contain +vulnerabilities or policy violations. Carefully evaluate any third-party +SDKs before integrating them into your app. [OutdatedLibrary] compile 'log4j:log4j:1.2.12' // OUTDATED BLOCKING -------------------- build.gradle:13:Warning: com.example.ads.third.party:example version -7.2.0 has been marked as outdated by its author [OutdatedLibrary] +7.2.0 has been reported as outdated by its author [OutdatedLibrary] compile 'com.example.ads.third.party:example:7.2.0' // Outdated + Critical + Policy (multiple issues), no severity ------------------------------------------- diff --git a/docs/checks/ParcelizeFunctionProperty.md.html b/docs/checks/ParcelizeFunctionProperty.md.html index df905478..7836574c 100644 --- a/docs/checks/ParcelizeFunctionProperty.md.html +++ b/docs/checks/ParcelizeFunctionProperty.md.html @@ -1,13 +1,13 @@ -(#) Function type properties should not be used in Parcelize classes +(#) Function type properties are not parcelable -!!! ERROR: Function type properties should not be used in Parcelize classes +!!! ERROR: Function type properties are not parcelable This is an error. Id : `ParcelizeFunctionProperty` Summary -: Function type properties should not be used in Parcelize classes +: Function type properties are not parcelable Severity : Error Category @@ -154,17 +154,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -172,7 +172,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/PictureInPictureIssue.md.html b/docs/checks/PictureInPictureIssue.md.html new file mode 100644 index 00000000..863fe47a --- /dev/null +++ b/docs/checks/PictureInPictureIssue.md.html @@ -0,0 +1,141 @@ + +(#) Picture In Picture best practices not followed + +!!! WARNING: Picture In Picture best practices not followed + This is a warning. + +Id +: `PictureInPictureIssue` +Summary +: Picture In Picture best practices not followed +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java files +Editing +: This check can *not* run live in the IDE editor +See +: https://developer.android.com/develop/ui/views/picture-in-picture#smoother-transition +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/PictureInPictureDetector.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/PictureInPictureDetectorTest.kt) +Copyright Year +: 2023 + +Starting in Android 12, the recommended approach for enabling +picture-in-picture (PiP) has changed. If your app does not use the new +approach, your app's transition animations will be of poor quality +compared to other apps. The new approach requires calling +`setAutoEnterEnabled(true)` and `setSourceRectHint(...)`. + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +AndroidManifest.xml:9:Warning: An activity in this app supports +picture-in-picture and the targetSdkVersion is 31 or above; it is +therefore strongly recommended to call both setAutoEnterEnabled(true) +and setSourceRectHint(...) [PictureInPictureIssue] + + <application + ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here are the relevant source files: + +`AndroidManifest.xml`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<manifest + package="test.pkg" + xmlns:android="http://schemas.android.com/apk/res/android"> + + <uses-sdk + android:minSdkVersion="28" + android:targetSdkVersion="31" /> + + <application + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name"> + + <activity + android:name=".TestActivity" + android:exported="true" + android:supportsPictureInPicture="true" + android:configChanges="screenLayout|orientation|screenSize|smallestScreenSize"> + + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + + </activity> + + </application> + +</manifest> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +`src/TestActivity.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.app.Activity + +class TestActivity: Activity { + fun test() { + enterPictureInPictureMode() + } +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/PictureInPictureDetectorTest.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 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="PictureInPictureIssue" severity="ignore" /> + </lint> + ``` + 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 'PictureInPictureIssue' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore PictureInPictureIssue ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/PlaySdkIndexNonCompliant.md.html b/docs/checks/PlaySdkIndexNonCompliant.md.html index 85330230..521305ca 100644 --- a/docs/checks/PlaySdkIndexNonCompliant.md.html +++ b/docs/checks/PlaySdkIndexNonCompliant.md.html @@ -62,9 +62,10 @@ ------------------------------------------- -build.gradle:15:Error: com.example.ads.third.party:example version 7.1.1 -has Device and Network Abuse policy issues that will block publishing of -your app to Play Console [PlaySdkIndexNonCompliant] +build.gradle:15:Error: [Prevents app release in Google Play Console] +com.example.ads.third.party:example version 7.1.1 has Device and Network +Abuse policy issues that will block publishing of your app to Play +Console [PlaySdkIndexNonCompliant] compile 'com.example.ads.third.party:example:7.1.1' // Policy (Device and Network Abuse), blocking ------------------------------------------- @@ -86,9 +87,10 @@ ------------------------------------------- -build.gradle:18:Error: com.example.ads.third.party:example version 7.1.4 -has Permissions policy issues that will block publishing of your app to -Play Console [PlaySdkIndexNonCompliant] +build.gradle:18:Error: [Prevents app release in Google Play Console] +com.example.ads.third.party:example version 7.1.4 has Permissions policy +issues that will block publishing of your app to Play Console +[PlaySdkIndexNonCompliant] compile 'com.example.ads.third.party:example:7.1.4' // Policy (Permissions), blocking ------------------------------------------- @@ -119,9 +121,10 @@ ------------------------------------------- -build.gradle:22:Error: com.example.ads.third.party:example version 7.1.8 -has User Data policy issues that will block publishing of your app to -Play Console [PlaySdkIndexNonCompliant] +build.gradle:22:Error: [Prevents app release in Google Play Console] +com.example.ads.third.party:example version 7.1.8 has User Data policy +issues that will block publishing of your app to Play Console +[PlaySdkIndexNonCompliant] compile 'com.example.ads.third.party:example:7.1.8' // Policy (multiple types), blocking ------------------------------------------- diff --git a/docs/checks/ProduceStateDoesNotAssignValue.md.html b/docs/checks/ProduceStateDoesNotAssignValue.md.html index 16c86dc2..843f9d7f 100644 --- a/docs/checks/ProduceStateDoesNotAssignValue.md.html +++ b/docs/checks/ProduceStateDoesNotAssignValue.md.html @@ -131,17 +131,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -149,7 +149,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-2.md.html b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-2.md.html new file mode 100644 index 00000000..c5a044f2 --- /dev/null +++ b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-2.md.html @@ -0,0 +1,155 @@ + +(#) ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + +!!! WARNING: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + This is a warning. + +Id +: `ProtoLayoutEdgeContentLayoutResponsive` +Summary +: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's EdgeContentLayout. + +This is will take care of all outer margins and inner padding to ensure +that content of +labels doesn't go off the screen (especially with different locales) and +that primary +label is placed in the consistent place. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. (this issue) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-2.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-material:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-material:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-material) + +# libs.versions.toml +[versions] +protolayout-material = "1.2.0-alpha03" +[libraries] +protolayout-material = { + module = "androidx.wear.protolayout:protolayout-material", + version.ref = "protolayout-material" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutEdgeContentLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutEdgeContentLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutEdgeContentLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutEdgeContentLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutEdgeContentLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutEdgeContentLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-3.md.html b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-3.md.html new file mode 100644 index 00000000..4e841ceb --- /dev/null +++ b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive-3.md.html @@ -0,0 +1,155 @@ + +(#) ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + +!!! WARNING: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + This is a warning. + +Id +: `ProtoLayoutEdgeContentLayoutResponsive` +Summary +: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's EdgeContentLayout. + +This is will take care of all outer margins and inner padding to ensure +that content of +labels doesn't go off the screen (especially with different locales) and +that primary +label is placed in the consistent place. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. (this issue) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-2.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout) + +# libs.versions.toml +[versions] +protolayout = "1.2.0-alpha03" +[libraries] +protolayout = { + module = "androidx.wear.protolayout:protolayout", + version.ref = "protolayout" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutEdgeContentLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutEdgeContentLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutEdgeContentLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutEdgeContentLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutEdgeContentLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutEdgeContentLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutEdgeContentLayoutResponsive.md.html b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive.md.html new file mode 100644 index 00000000..6b3b492a --- /dev/null +++ b/docs/checks/ProtoLayoutEdgeContentLayoutResponsive.md.html @@ -0,0 +1,155 @@ + +(#) ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + +!!! WARNING: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. + This is a warning. + +Id +: `ProtoLayoutEdgeContentLayoutResponsive` +Summary +: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's EdgeContentLayout. + +This is will take care of all outer margins and inner padding to ensure +that content of +labels doesn't go off the screen (especially with different locales) and +that primary +label is placed in the consistent place. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales. (this issue) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-2.md.html) +* [ProtoLayoutEdgeContentLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutEdgeContentLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-expression) + +# libs.versions.toml +[versions] +protolayout-expression = "1.2.0-alpha03" +[libraries] +protolayout-expression = { + module = "androidx.wear.protolayout:protolayout-expression", + version.ref = "protolayout-expression" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutEdgeContentLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutEdgeContentLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutEdgeContentLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutEdgeContentLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutEdgeContentLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutEdgeContentLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutMinSchema-2.md.html b/docs/checks/ProtoLayoutMinSchema-2.md.html index 84f6b5be..7fdca5b3 100644 --- a/docs/checks/ProtoLayoutMinSchema-2.md.html +++ b/docs/checks/ProtoLayoutMinSchema-2.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) +: [androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html) Affects : Kotlin and Java files @@ -61,8 +61,9 @@ well. Issue id's must be unique, so you cannot combine these libraries. Also defined in: * ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API. (this issue) -* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01](ProtoLayoutMinSchema.md.html) -* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.1.0-rc01](ProtoLayoutMinSchema-2.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutMinSchema.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutMinSchema-2.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutMinSchema-3.md.html) (##) Including @@ -73,28 +74,28 @@ ``` // build.gradle.kts -implementation("androidx.wear.protolayout:protolayout:1.1.0-rc01") +implementation("androidx.wear.protolayout:protolayout-material:1.2.0-alpha03") // build.gradle -implementation 'androidx.wear.protolayout:protolayout:1.1.0-rc01' +implementation 'androidx.wear.protolayout:protolayout-material:1.2.0-alpha03' // build.gradle.kts with version catalogs: -implementation(libs.protolayout) +implementation(libs.protolayout-material) # libs.versions.toml [versions] -protolayout = "1.1.0-rc01" +protolayout-material = "1.2.0-alpha03" [libraries] -protolayout = { - module = "androidx.wear.protolayout:protolayout", - version.ref = "protolayout" +protolayout-material = { + module = "androidx.wear.protolayout:protolayout-material", + version.ref = "protolayout-material" } ``` -1.1.0-rc01 is the version this documentation was generated from; +1.2.0-alpha03 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html). +[Additional details about androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/ProtoLayoutMinSchema-3.md.html b/docs/checks/ProtoLayoutMinSchema-3.md.html new file mode 100644 index 00000000..ce456047 --- /dev/null +++ b/docs/checks/ProtoLayoutMinSchema-3.md.html @@ -0,0 +1,164 @@ + +(#) ProtoLayout feature is not guaranteed to be available on the target device API. + +!!! ERROR: ProtoLayout feature is not guaranteed to be available on the target device API. + This is an error. + +Id +: `ProtoLayoutMinSchema` +Summary +: ProtoLayout feature is not guaranteed to be available on the target device API. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ProtoLayoutMinSchemaDetector.kt) +Copyright Year +: 2023 + +Using features that are not supported by an older ProtoLayout +renderer/evaluator, can lead to unexpected rendering or invalid results +(for expressions). + +Each Wear OS platform version has a guaranteed minimum ProtoLayout +schema version. +On API 33, all consumers for ProtoLayout support at least Schema version +1.2 (major=1, minor=200). +On API 34, all consumers for ProtoLayout support at least Schema version +1.3 (major=1, minor=300). + +You can use those newer features through conditional Android API checks, +or by increasing the minSdk for your project. +You can also annotate your methods with @RequiresApi or +@RequiresSchemaAnnotation if you know they require the +corresponding version. +Note that @RequiresSchemaVersion annotation on classes are mostly +ignored (except for Builder classes). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API. (this issue) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutMinSchema.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutMinSchema-2.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutMinSchema-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout) + +# libs.versions.toml +[versions] +protolayout = "1.2.0-alpha03" +[libraries] +protolayout = { + module = "androidx.wear.protolayout:protolayout", + version.ref = "protolayout" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutMinSchema") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutMinSchema") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutMinSchema + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutMinSchema" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutMinSchema' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutMinSchema ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutMinSchema.md.html b/docs/checks/ProtoLayoutMinSchema.md.html index f192fe87..484a0f00 100644 --- a/docs/checks/ProtoLayoutMinSchema.md.html +++ b/docs/checks/ProtoLayoutMinSchema.md.html @@ -61,8 +61,9 @@ well. Issue id's must be unique, so you cannot combine these libraries. Also defined in: * ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API. (this issue) -* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01](ProtoLayoutMinSchema.md.html) -* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.1.0-rc01](ProtoLayoutMinSchema-2.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutMinSchema.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutMinSchema-2.md.html) +* [ProtoLayoutMinSchema from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutMinSchema-3.md.html) (##) Including @@ -73,17 +74,17 @@ ``` // build.gradle.kts -implementation("androidx.wear.protolayout:protolayout-expression:1.1.0-rc01") +implementation("androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03") // build.gradle -implementation 'androidx.wear.protolayout:protolayout-expression:1.1.0-rc01' +implementation 'androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.protolayout-expression) # libs.versions.toml [versions] -protolayout-expression = "1.1.0-rc01" +protolayout-expression = "1.2.0-alpha03" [libraries] protolayout-expression = { module = "androidx.wear.protolayout:protolayout-expression", @@ -91,7 +92,7 @@ } ``` -1.1.0-rc01 is the version this documentation was generated from; +1.2.0-alpha03 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html). diff --git a/docs/checks/ProtoLayoutPrimaryLayoutResponsive-2.md.html b/docs/checks/ProtoLayoutPrimaryLayoutResponsive-2.md.html new file mode 100644 index 00000000..bd885536 --- /dev/null +++ b/docs/checks/ProtoLayoutPrimaryLayoutResponsive-2.md.html @@ -0,0 +1,153 @@ + +(#) ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + +!!! WARNING: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + This is a warning. + +Id +: `ProtoLayoutPrimaryLayoutResponsive` +Summary +: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's PrimaryLayout. + +This is will take care of all inner padding to ensure that content of +labels and bottom +chip doesn't go off the screen (especially with different locales). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. (this issue) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-2.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-material:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-material:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-material) + +# libs.versions.toml +[versions] +protolayout-material = "1.2.0-alpha03" +[libraries] +protolayout-material = { + module = "androidx.wear.protolayout:protolayout-material", + version.ref = "protolayout-material" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutPrimaryLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutPrimaryLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutPrimaryLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutPrimaryLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutPrimaryLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutPrimaryLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutPrimaryLayoutResponsive-3.md.html b/docs/checks/ProtoLayoutPrimaryLayoutResponsive-3.md.html new file mode 100644 index 00000000..45cb1c48 --- /dev/null +++ b/docs/checks/ProtoLayoutPrimaryLayoutResponsive-3.md.html @@ -0,0 +1,153 @@ + +(#) ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + +!!! WARNING: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + This is a warning. + +Id +: `ProtoLayoutPrimaryLayoutResponsive` +Summary +: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's PrimaryLayout. + +This is will take care of all inner padding to ensure that content of +labels and bottom +chip doesn't go off the screen (especially with different locales). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. (this issue) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-2.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout) + +# libs.versions.toml +[versions] +protolayout = "1.2.0-alpha03" +[libraries] +protolayout = { + module = "androidx.wear.protolayout:protolayout", + version.ref = "protolayout" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutPrimaryLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutPrimaryLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutPrimaryLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutPrimaryLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutPrimaryLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutPrimaryLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProtoLayoutPrimaryLayoutResponsive.md.html b/docs/checks/ProtoLayoutPrimaryLayoutResponsive.md.html new file mode 100644 index 00000000..218c9850 --- /dev/null +++ b/docs/checks/ProtoLayoutPrimaryLayoutResponsive.md.html @@ -0,0 +1,153 @@ + +(#) ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + +!!! WARNING: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. + This is a warning. + +Id +: `ProtoLayoutPrimaryLayoutResponsive` +Summary +: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/wear/protolayout/protolayout-lint/src/main/java/androidx/wear/protolayout/lint/ResponsiveLayoutDetector.kt) +Copyright Year +: 2024 + +It is highly recommended to use the latest +setResponsiveInsetEnabled(true) when you're +using the ProtoLayout's PrimaryLayout. + +This is will take care of all inner padding to ensure that content of +labels and bottom +chip doesn't go off the screen (especially with different locales). + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. (this issue) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-2.md.html) +* [ProtoLayoutPrimaryLayoutResponsive from androidx.wear.protolayout:protolayout:1.2.0-alpha03](ProtoLayoutPrimaryLayoutResponsive-3.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-expression) + +# libs.versions.toml +[versions] +protolayout-expression = "1.2.0-alpha03" +[libraries] +protolayout-expression = { + module = "androidx.wear.protolayout:protolayout-expression", + version.ref = "protolayout-expression" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("ProtoLayoutPrimaryLayoutResponsive") + fun method() { + Builder(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("ProtoLayoutPrimaryLayoutResponsive") + void method() { + new Builder(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection ProtoLayoutPrimaryLayoutResponsive + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="ProtoLayoutPrimaryLayoutResponsive" severity="ignore" /> + </lint> + ``` + 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 'ProtoLayoutPrimaryLayoutResponsive' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore ProtoLayoutPrimaryLayoutResponsive ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/ProvidesMustNotBeAbstract.md.html b/docs/checks/ProvidesMustNotBeAbstract.md.html index 69ea5618..b8bebcb8 100644 --- a/docs/checks/ProvidesMustNotBeAbstract.md.html +++ b/docs/checks/ProvidesMustNotBeAbstract.md.html @@ -1,13 +1,13 @@ -(#) @Provides functions cannot be abstract. +(#) @Provides functions cannot be abstract -!!! ERROR: @Provides functions cannot be abstract. +!!! ERROR: @Provides functions cannot be abstract This is an error. Id : `ProvidesMustNotBeAbstract` Summary -: @Provides functions cannot be abstract. +: @Provides functions cannot be abstract Severity : Error Category @@ -167,17 +167,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -185,7 +185,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RawDispatchersUse.md.html b/docs/checks/RawDispatchersUse.md.html index 12563b99..c2a1320f 100644 --- a/docs/checks/RawDispatchersUse.md.html +++ b/docs/checks/RawDispatchersUse.md.html @@ -138,17 +138,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -156,7 +156,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RedactedInJavaUsage.md.html b/docs/checks/RedactedInJavaUsage.md.html index 9a3693d1..0e12e4a6 100644 --- a/docs/checks/RedactedInJavaUsage.md.html +++ b/docs/checks/RedactedInJavaUsage.md.html @@ -118,17 +118,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -136,7 +136,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RedundantBinds.md.html b/docs/checks/RedundantBinds.md.html index d142cf28..fb9d5e70 100644 --- a/docs/checks/RedundantBinds.md.html +++ b/docs/checks/RedundantBinds.md.html @@ -1,13 +1,13 @@ -(#) @Binds functions should return a different type (including annotations) than the input type. +(#) @Binds functions should return a different type -!!! ERROR: @Binds functions should return a different type (including annotations) than the input type. +!!! ERROR: @Binds functions should return a different type This is an error. Id : `RedundantBinds` Summary -: @Binds functions should return a different type (including annotations) than the input type. +: @Binds functions should return a different type Severity : Error Category @@ -100,17 +100,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -118,7 +118,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RememberReturnType.md.html b/docs/checks/RememberReturnType.md.html index 7d08d8cd..b352a346 100644 --- a/docs/checks/RememberReturnType.md.html +++ b/docs/checks/RememberReturnType.md.html @@ -302,17 +302,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -320,7 +320,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/RememberSaveableSaverParameter.md.html b/docs/checks/RememberSaveableSaverParameter.md.html index 947d44c9..3d6aafff 100644 --- a/docs/checks/RememberSaveableSaverParameter.md.html +++ b/docs/checks/RememberSaveableSaverParameter.md.html @@ -152,17 +152,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-saveable-android) # libs.versions.toml [versions] -runtime-saveable-android = "1.7.0-alpha01" +runtime-saveable-android = "1.7.0-beta01" [libraries] runtime-saveable-android = { module = "androidx.compose.runtime:runtime-saveable-android", @@ -170,7 +170,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.runtime:runtime-saveable-android](androidx_compose_runtime_runtime-saveable-android.md.html). diff --git a/docs/checks/RemoveWorkManagerInitializer.md.html b/docs/checks/RemoveWorkManagerInitializer.md.html index b9b2dfdc..e52c4c0f 100644 --- a/docs/checks/RemoveWorkManagerInitializer.md.html +++ b/docs/checks/RemoveWorkManagerInitializer.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -104,7 +104,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/RepeatOnLifecycleWrongUsage-2.md.html b/docs/checks/RepeatOnLifecycleWrongUsage-2.md.html new file mode 100644 index 00000000..d1bd1689 --- /dev/null +++ b/docs/checks/RepeatOnLifecycleWrongUsage-2.md.html @@ -0,0 +1,150 @@ + +(#) Wrong usage of repeatOnLifecycle. + +!!! ERROR: Wrong usage of repeatOnLifecycle. + This is an error. + +Id +: `RepeatOnLifecycleWrongUsage` +Summary +: Wrong usage of repeatOnLifecycle. +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/RepeatOnLifecycleDetector.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/RepeatOnLifecycleDetectorTest.kt) +Copyright Year +: 2021 + +The repeatOnLifecycle APIs should be used when the View is created, + that is in the `onCreate` lifecycle method for Activities, or +`onViewCreated` in case you're using Fragments. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle. (this issue) +* [RepeatOnLifecycleWrongUsage from androidx.lifecycle:lifecycle-runtime-android:2.8.0](RepeatOnLifecycleWrongUsage.md.html) +* [RepeatOnLifecycleWrongUsage from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01](RepeatOnLifecycleWrongUsage-2.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-ktx) + +# libs.versions.toml +[versions] +lifecycle-runtime-ktx = "2.8.0-alpha01" +[libraries] +lifecycle-runtime-ktx = { + module = "androidx.lifecycle:lifecycle-runtime-ktx", + version.ref = "lifecycle-runtime-ktx" +} +``` + +2.8.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("RepeatOnLifecycleWrongUsage") + fun method() { + problematicStatement() + } + ``` + + or + + ```java + // Java + @SuppressWarnings("RepeatOnLifecycleWrongUsage") + void method() { + problematicStatement(); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection RepeatOnLifecycleWrongUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="RepeatOnLifecycleWrongUsage" severity="ignore" /> + </lint> + ``` + 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 'RepeatOnLifecycleWrongUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore RepeatOnLifecycleWrongUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/RepeatOnLifecycleWrongUsage.md.html b/docs/checks/RepeatOnLifecycleWrongUsage.md.html index 3369897d..911efb47 100644 --- a/docs/checks/RepeatOnLifecycleWrongUsage.md.html +++ b/docs/checks/RepeatOnLifecycleWrongUsage.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) +: [androidx.lifecycle:lifecycle-runtime-android](androidx_lifecycle_lifecycle-runtime-android.md.html) Affects : Kotlin and Java files @@ -42,6 +42,16 @@ that is in the `onCreate` lifecycle method for Activities, or `onViewCreated` in case you're using Fragments. +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle. (this issue) +* [RepeatOnLifecycleWrongUsage from androidx.lifecycle:lifecycle-runtime-android:2.8.0](RepeatOnLifecycleWrongUsage.md.html) +* [RepeatOnLifecycleWrongUsage from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01](RepeatOnLifecycleWrongUsage-2.md.html) + + (##) Including !!! @@ -50,28 +60,28 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") +implementation("androidx.lifecycle:lifecycle-runtime-android:2.8.0") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' +implementation 'androidx.lifecycle:lifecycle-runtime-android:2.8.0' // build.gradle.kts with version catalogs: -implementation(libs.lifecycle-runtime-ktx) +implementation(libs.lifecycle-runtime-android) # libs.versions.toml [versions] -lifecycle-runtime-ktx = "2.8.0-alpha01" +lifecycle-runtime-android = "2.8.0" [libraries] -lifecycle-runtime-ktx = { - module = "androidx.lifecycle:lifecycle-runtime-ktx", - version.ref = "lifecycle-runtime-ktx" +lifecycle-runtime-android = { + module = "androidx.lifecycle:lifecycle-runtime-android", + version.ref = "lifecycle-runtime-android" } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). +[Additional details about androidx.lifecycle:lifecycle-runtime-android](androidx_lifecycle_lifecycle-runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/RestrictCallsTo.md.html b/docs/checks/RestrictCallsTo.md.html index f2ac8762..ece75b77 100644 --- a/docs/checks/RestrictCallsTo.md.html +++ b/docs/checks/RestrictCallsTo.md.html @@ -124,17 +124,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -142,7 +142,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/RetrofitUsage.md.html b/docs/checks/RetrofitUsage.md.html index cd155d54..b445bce4 100644 --- a/docs/checks/RetrofitUsage.md.html +++ b/docs/checks/RetrofitUsage.md.html @@ -117,17 +117,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -135,7 +135,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/ReturnFromAwaitPointerEventScope.md.html b/docs/checks/ReturnFromAwaitPointerEventScope.md.html index 93a17737..c0646b5d 100644 --- a/docs/checks/ReturnFromAwaitPointerEventScope.md.html +++ b/docs/checks/ReturnFromAwaitPointerEventScope.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -70,7 +70,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/RiskyLibrary.md.html b/docs/checks/RiskyLibrary.md.html index 29c9cb36..c60c5ac5 100644 --- a/docs/checks/RiskyLibrary.md.html +++ b/docs/checks/RiskyLibrary.md.html @@ -52,9 +52,10 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -build.gradle:7:Error: log4j:log4j version 1.2.13 has been reported as -problematic by its author and will block publishing of your app to Play -Console [RiskyLibrary] +build.gradle:7:Error: [Prevents app release in Google Play Console] +log4j:log4j version 1.2.13 has been reported as problematic by its +author and will block publishing of your app to Play Console +[RiskyLibrary] compile 'log4j:log4j:1.2.13' // Critical BLOCKING -------------------- diff --git a/docs/checks/SecretInSource.md.html b/docs/checks/SecretInSource.md.html index c8e1b2b3..8cfb136c 100644 --- a/docs/checks/SecretInSource.md.html +++ b/docs/checks/SecretInSource.md.html @@ -52,7 +52,7 @@ source code [SecretInSource] val model2 = GenerativeModel("name", "AIzadGhpcyBpcyBhbm90aGVy_IHQ-akd==") - ---------------------------------- + ------------------------------------ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: diff --git a/docs/checks/SerializableUsage.md.html b/docs/checks/SerializableUsage.md.html index bf16ccd8..fad5f3d9 100644 --- a/docs/checks/SerializableUsage.md.html +++ b/docs/checks/SerializableUsage.md.html @@ -86,17 +86,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -104,7 +104,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/SimilarGradleDependency.md.html b/docs/checks/SimilarGradleDependency.md.html new file mode 100644 index 00000000..f312d89b --- /dev/null +++ b/docs/checks/SimilarGradleDependency.md.html @@ -0,0 +1,82 @@ + +(#) Multiple Versions Gradle Dependency + +!!! Tip: Multiple Versions Gradle Dependency + Advice from this check is just a tip. + +Id +: `SimilarGradleDependency` +Summary +: Multiple Versions Gradle Dependency +Severity +: Information +Category +: Correctness +Platform +: Any +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Gradle build files and TOML 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/GradleDetector.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/GradleDetectorTest.kt) +Copyright Year +: 2014 + +This detector looks for usages of libraries when name and group are the +same but versions are different. Using multiple versions in big project +is fine, and there are cases where you deliberately want to stick with +such approach. However, you may simply not be aware that this situation +happens, and that is what this lint check helps find. + +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection SimilarGradleDependency + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="SimilarGradleDependency" severity="ignore" /> + </lint> + ``` + 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 'SimilarGradleDependency' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore SimilarGradleDependency ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/SpanMarkPointMissingMask.md.html b/docs/checks/SpanMarkPointMissingMask.md.html index 066cf11d..a5c95985 100644 --- a/docs/checks/SpanMarkPointMissingMask.md.html +++ b/docs/checks/SpanMarkPointMissingMask.md.html @@ -92,17 +92,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -110,7 +110,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/SpecifyForegroundServiceType.md.html b/docs/checks/SpecifyForegroundServiceType.md.html index 24409e64..25c52df6 100644 --- a/docs/checks/SpecifyForegroundServiceType.md.html +++ b/docs/checks/SpecifyForegroundServiceType.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/SpecifyJobSchedulerIdRange.md.html b/docs/checks/SpecifyJobSchedulerIdRange.md.html index 6a155fff..b03c1632 100644 --- a/docs/checks/SpecifyJobSchedulerIdRange.md.html +++ b/docs/checks/SpecifyJobSchedulerIdRange.md.html @@ -53,17 +53,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -71,7 +71,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/StateFlowValueCalledInComposition.md.html b/docs/checks/StateFlowValueCalledInComposition.md.html index 172f404f..6d8a8dec 100644 --- a/docs/checks/StateFlowValueCalledInComposition.md.html +++ b/docs/checks/StateFlowValueCalledInComposition.md.html @@ -136,17 +136,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -154,7 +154,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/SubscribeOnMain.md.html b/docs/checks/SubscribeOnMain.md.html index cdbea0b0..24a84b77 100644 --- a/docs/checks/SubscribeOnMain.md.html +++ b/docs/checks/SubscribeOnMain.md.html @@ -98,17 +98,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -116,7 +116,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/SuspiciousCompositionLocalModifierRead.md.html b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html index 3411e0fc..1d98c479 100644 --- a/docs/checks/SuspiciousCompositionLocalModifierRead.md.html +++ b/docs/checks/SuspiciousCompositionLocalModifierRead.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -120,17 +120,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -138,7 +138,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/ComposableModifierFactory.md.html b/docs/checks/SuspiciousModifierThen.md.html similarity index 52% rename from docs/checks/ComposableModifierFactory.md.html rename to docs/checks/SuspiciousModifierThen.md.html index 59e26b4d..7da9b986 100644 --- a/docs/checks/ComposableModifierFactory.md.html +++ b/docs/checks/SuspiciousModifierThen.md.html @@ -1,15 +1,15 @@ -(#) Modifier factory functions should not be @Composable +(#) Using Modifier.then with a Modifier factory function with an implicit receiver -!!! WARNING: Modifier factory functions should not be @Composable - This is a warning. +!!! ERROR: Using Modifier.then with a Modifier factory function with an implicit receiver + This is an error. Id -: `ComposableModifierFactory` +: `SuspiciousModifierThen` Summary -: Modifier factory functions should not be @Composable +: Using Modifier.then with a Modifier factory function with an implicit receiver Severity -: Warning +: Error Category : Correctness Platform @@ -21,106 +21,87 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.compose.ui:ui](androidx_compose_ui_ui.md.html) +: [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) Affects : Kotlin and Java files and test sources Editing : This check runs on the fly in the IDE editor Implementation -: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/ModifierDeclarationDetector.kt) +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/main/java/androidx/compose/ui/lint/SuspiciousModifierThenDetector.kt) Tests -: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/ModifierDeclarationDetectorTest.kt) +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/SuspiciousModifierThenDetectorTest.kt) Copyright Year -: 2020 - -Modifier factory functions that need to be aware of the composition -should use androidx.compose.ui.composed {} in their implementation -instead of being marked as @Composable. This allows Modifiers to be -referenced in top level variables and constructed outside of the -composition. +: 2024 + +Calling a Modifier factory function with an implicit receiver inside +Modifier.then will result in the receiver (`this`) being added twice to +the chain. For example, fun Modifier.myModifier() = +this.then(otherModifier()) - the implementation of factory functions +such as Modifier.otherModifier() will internally call this.then(...) to +chain the provided modifier with their implementation. When you expand +this.then(otherModifier()), it becomes: +this.then(this.then(OtherModifierImplementation)) - so you can see that +`this` is included twice in the chain, which results in modifiers such +as padding being applied twice, for example. Instead, you should either +remove the then() and directly chain the factory function on the +receiver, this.otherModifier(), or add the empty Modifier as the +receiver for the factory, such as this.then(Modifier.otherModifier()) (##) Example Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/androidx/compose/ui/foo/TestModifier.kt:13:Warning: Modifier factory -functions should not be marked as @Composable, and should use composed -instead [ComposableModifierFactory] - - fun Modifier.fooModifier1(): Modifier { - ------------ - +src/test/TestModifier.kt:10:Error: Using Modifier.then with a Modifier +factory function with an implicit receiver [SuspiciousModifierThen] -src/androidx/compose/ui/foo/TestModifier.kt:19:Warning: Modifier factory -functions should not be marked as @Composable, and should use composed -instead [ComposableModifierFactory] + fun Modifier.test2() = this.then(test()) + ---- - fun Modifier.fooModifier2(): Modifier = - ------------ +src/test/TestModifier.kt:12:Error: Using Modifier.then with a Modifier +factory function with an implicit receiver [SuspiciousModifierThen] -src/androidx/compose/ui/foo/TestModifier.kt:23:Warning: Modifier factory -functions should not be marked as @Composable, and should use composed -instead [ComposableModifierFactory] + fun Modifier.test3() = this.then(with(1) { test() }) + ---- - val Modifier.fooModifier3: Modifier get() { - ------------ +src/test/TestModifier.kt:14:Error: Using Modifier.then with a Modifier +factory function with an implicit receiver [SuspiciousModifierThen] -src/androidx/compose/ui/foo/TestModifier.kt:29:Warning: Modifier factory -functions should not be marked as @Composable, and should use composed -instead [ComposableModifierFactory] - - val Modifier.fooModifier4: Modifier get() = - ------------ + fun Modifier.test4() = this.then(if (true) test() else TestModifier) + ---- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here is the source file referenced above: -`src/androidx/compose/ui/foo/TestModifier.kt`: +`src/test/TestModifier.kt`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -package androidx.compose.ui.foo +package test -import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -class TestModifier(val value: Int) : Modifier.Element - -@Composable -fun someComposableCall(int: Int) = 5 +object TestModifier : Modifier.Element -@Composable -fun Modifier.fooModifier1(): Modifier { - val value = someComposableCall(3) - return this.then(TestModifier(value)) -} +fun Modifier.test(): Modifier = this.then(TestModifier) -@Composable -fun Modifier.fooModifier2(): Modifier = - this.then(TestModifier(someComposableCall(3))) +fun Modifier.test2() = this.then(test()) -@get:Composable -val Modifier.fooModifier3: Modifier get() { - val value = someComposableCall(3) - return this.then(TestModifier(value)) -} +fun Modifier.test3() = this.then(with(1) { test() }) -@get:Composable -val Modifier.fooModifier4: Modifier get() = - this.then(TestModifier(someComposableCall(3))) +fun Modifier.test4() = this.then(if (true) test() else TestModifier) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can also visit the -[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/ModifierDeclarationDetectorTest.kt) +[source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/compose/ui/ui-lint/src/test/java/androidx/compose/ui/lint/SuspiciousModifierThenDetectorTest.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, `ModifierDeclarationDetector.composableModifierFactories`. +found for this lint check, `SuspiciousModifierThenDetector.errors`. To report a problem with this extracted sample, visit https://issuetracker.google.com/issues/new?component=612128. @@ -132,28 +113,28 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: -implementation(libs.ui) +implementation(libs.ui-android) # libs.versions.toml [versions] -ui = "1.5.0-beta02" +ui-android = "1.7.0-beta01" [libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" +ui-android = { + module = "androidx.compose.ui:ui-android", + version.ref = "ui-android" } ``` -1.5.0-beta02 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.compose.ui:ui](androidx_compose_ui_ui.md.html). +[Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: @@ -163,9 +144,9 @@ ```kt // Kotlin - @Suppress("ComposableModifierFactory") + @Suppress("SuspiciousModifierThen") fun method() { - problematicStatement() + then(...) } ``` @@ -173,16 +154,16 @@ ```java // Java - @SuppressWarnings("ComposableModifierFactory") + @SuppressWarnings("SuspiciousModifierThen") void method() { - problematicStatement(); + then(...); } ``` * Using a suppression comment like this on the line above: ```kt - //noinspection ComposableModifierFactory + //noinspection SuspiciousModifierThen problematicStatement() ``` @@ -192,7 +173,7 @@ ```xml <?xml version="1.0" encoding="UTF-8"?> <lint> - <issue id="ComposableModifierFactory" severity="ignore" /> + <issue id="SuspiciousModifierThen" severity="ignore" /> </lint> ``` Instead of `ignore` you can also change the severity here, for @@ -205,7 +186,7 @@ example, you can use something like ```gradle lintOptions { - disable 'ComposableModifierFactory' + disable 'SuspiciousModifierThen' } ``` In Android projects this should be nested inside an `android { }` @@ -213,7 +194,7 @@ * For manual invocations of `lint`, using the `--ignore` flag: ``` - $ lint --ignore ComposableModifierFactory ...` + $ lint --ignore SuspiciousModifierThen ...` ``` * Last, but not least, using baselines, as discussed diff --git a/docs/checks/TestLifecycleOwnerInCoroutine.md.html b/docs/checks/TestLifecycleOwnerInCoroutine.md.html index 82cc641a..0f39d110 100644 --- a/docs/checks/TestLifecycleOwnerInCoroutine.md.html +++ b/docs/checks/TestLifecycleOwnerInCoroutine.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01") +implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01' +implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-runtime-testing) # libs.versions.toml [versions] -lifecycle-runtime-testing = "2.8.0-alpha01" +lifecycle-runtime-testing = "2.8.0" [libraries] lifecycle-runtime-testing = { module = "androidx.lifecycle:lifecycle-runtime-testing", @@ -69,7 +69,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.lifecycle:lifecycle-runtime-testing](androidx_lifecycle_lifecycle-runtime-testing.md.html). diff --git a/docs/checks/TestManifestGradleConfiguration.md.html b/docs/checks/TestManifestGradleConfiguration.md.html index d1b87847..7f736642 100644 --- a/docs/checks/TestManifestGradleConfiguration.md.html +++ b/docs/checks/TestManifestGradleConfiguration.md.html @@ -130,17 +130,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-test-manifest:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-test-manifest) # libs.versions.toml [versions] -ui-test-manifest = "1.7.0-alpha01" +ui-test-manifest = "1.7.0-beta01" [libraries] ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", @@ -148,7 +148,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html). diff --git a/docs/checks/UastImplementation.md.html b/docs/checks/UastImplementation.md.html index abfcea18..fbd7b938 100644 --- a/docs/checks/UastImplementation.md.html +++ b/docs/checks/UastImplementation.md.html @@ -68,12 +68,21 @@ ----------------------------------------------------------------- +src/test/pkg/UastImplementationDetectorTestInput.kt:21:Warning: +org.jetbrains.uast.kotlin.KotlinUastResolveProviderService is UAST +implementation. Consider using one of its corresponding UAST interfaces: +BaseKotlinUastResolveProviderService [UastImplementation] + +import org.jetbrains.uast.kotlin.KotlinUastResolveProviderService // ERROR 4 +---------------------------------------------------------------------------- + + src/test/pkg/UastImplementationDetectorTestInput.kt:22:Warning: org.jetbrains.uast.kotlin.UnknownKotlinExpression is UAST implementation. Consider using one of its corresponding UAST interfaces: UExpression, UAnnotated, UUnknownExpression [UastImplementation] -import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 4 +import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 5 ------------------------------------------------------------------- @@ -83,7 +92,7 @@ UDeclaration, UAnnotated, UDeclarationEx, UAnchorOwner, UFieldEx, UField [UastImplementation] - val delegateType = (field as? KotlinUField)?.type // ERROR 5 + val delegateType = (field as? KotlinUField)?.type // ERROR 6 ------------ @@ -92,7 +101,7 @@ Consider using one of its corresponding UAST interfaces: UImportStatement, UResolvable [UastImplementation] - val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 6 + val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 7 ---------------------- @@ -102,7 +111,7 @@ UAnnotated, UThisExpression, UInstanceExpression, ULabeled, UResolvable [UastImplementation] - class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 7 + class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 8 ---------------------------- @@ -112,16 +121,25 @@ UAnnotated, UThisExpression, UInstanceExpression, ULabeled, UResolvable [UastImplementation] - firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 8 + firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 9 --------------------- +src/test/pkg/UastImplementationDetectorTestInput.kt:87:Warning: +org.jetbrains.uast.kotlin.KotlinUastResolveProviderService is UAST +implementation. Consider using one of its corresponding UAST interfaces: +BaseKotlinUastResolveProviderService [UastImplementation] + + ServiceManager.getService(this.project, KotlinUastResolveProviderService::class.java) // ERROR 10 + --------------------------------------- + + src/test/pkg/UastImplementationDetectorTestInput.kt:93:Warning: org.jetbrains.uast.kotlin.UnknownKotlinExpression is UAST implementation. Consider using one of its corresponding UAST interfaces: UExpression, UAnnotated, UUnknownExpression [UastImplementation] - return if (this !is UnknownKotlinExpression) this else null // ERROR 9 + return if (this !is UnknownKotlinExpression) this else null // ERROR 11 ----------------------- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -149,8 +167,8 @@ import org.jetbrains.uast.kotlin.KotlinUField // ERROR 1 import org.jetbrains.uast.kotlin.KotlinUImportStatement // ERROR 2 import org.jetbrains.uast.kotlin.KotlinUThisExpression // ERROR 3 -import org.jetbrains.uast.kotlin.KotlinUastResolveProviderService -import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 4 +import org.jetbrains.uast.kotlin.KotlinUastResolveProviderService // ERROR 4 +import org.jetbrains.uast.kotlin.UnknownKotlinExpression // ERROR 5 class UastImplementationDetectorTestInput { @@ -173,7 +191,7 @@ private fun checkFieldSafety(field: UField) { if (field.name.endsWith("delegate")) { - val delegateType = (field as? KotlinUField)?.type // ERROR 5 + val delegateType = (field as? KotlinUField)?.type // ERROR 6 assert (delegateType != null) } } @@ -185,13 +203,13 @@ override fun createUastHandler(context: JavaContext): UElementHandler? { return object : UElementHandler() { override fun visitImportStatement(node: UImportStatement) { - val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 6 + val alias = (node as? KotlinUImportStatement)?.sourcePsi?.alias // ERROR 7 } } } } - class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 7 + class MockKtThisChecker : AbstractDetector(KotlinUThisExpression::class) { // ERROR 8 override fun createUastHandler(context: JavaContext): UElementHandler? { return object : UElementHandler() { override fun visitElement(node: UElement) { @@ -204,7 +222,7 @@ var firstElement = expr return when { - firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 8 + firstElement is KotlinUThisExpression && firstElement.label != null -> { // ERROR 9 expr } firstElement is UThisExpression -> null @@ -215,13 +233,13 @@ fun KtElement.getBindingContext(): BindingContext { // OK for now to retrieve a service. Won't be allowed after switching to K2 UAST val service = - ServiceManager.getService(this.project, KotlinUastResolveProviderService::class.java) // OK 1 + ServiceManager.getService(this.project, KotlinUastResolveProviderService::class.java) // ERROR 10 return service?.getBindingContext(this) ?: BindingContext.EMPTY } internal val UElement.realUastParent: UElement? get() { - return if (this !is UnknownKotlinExpression) this else null // ERROR 9 + return if (this !is UnknownKotlinExpression) this else null // ERROR 11 } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/checks/UnclosedTrace.md.html b/docs/checks/UnclosedTrace.md.html new file mode 100644 index 00000000..4f693131 --- /dev/null +++ b/docs/checks/UnclosedTrace.md.html @@ -0,0 +1,238 @@ + +(#) Incorrect trace section usage + +!!! WARNING: Incorrect trace section usage + This is a warning. + +Id +: `UnclosedTrace` +Summary +: Incorrect trace section usage +Severity +: Warning +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Feedback +: https://issuetracker.google.com/issues/new?component=192708 +Affects +: Kotlin and Java 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/TraceSectionDetector.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/TraceSectionDetectorTest.kt) +Copyright Year +: 2024 + +Calls to begin trace sections must be followed by corresponding calls to +end those trace sections. Care must be taken to ensure that +begin-section / end-section pairs are properly nested, and that +functions do not return when there are still unclosed trace sections. +The easiest way to ensure begin-section / end-section pairs are properly +closed is to use a try-finally block as follows: + +```kotlin +try { + Trace.beginSection("OK") + return true +} finally { + Trace.endSection() +} +``` + +This lint check may result in false-positives if trace sections are +guarded by conditionals. For example, it may erroneously say the +following has unclosed trace sections: + +```kotlin +try { + Trace.beginSection("Wrong") + if (a == b) { + Trace.beginSection("OK") + blockingCall() + } +} finally { + // Even though this is technically correct, the lint check isn't capable of detecting + // that the two conditionals are the same + if (a == b) Trace.endSection() + Trace.endSection() +} +``` + +To fix the code snippet above, you could add a nested try-finally as +follows: + +```kotlin +try { + Trace.beginSection("OK") + if (a == b) { + try { + Trace.beginSection("OK") + blockingCall() + } finally { + Trace.endSection() + } + } +} finally { + Trace.endSection() +} +``` + +(##) Options + +You can configure this lint checks using the following options: + +(###) strict + +Whether to assume any method call could throw an exception. +In strict mode, this check assumes that any method call in between begin-section and end-section pairs could potentially throw an exception. Strict mode is useful for situations where unchecked Java exceptions are caught and do not necessarily result in a crash. + +If strict mode is off, this check will still consider the flow of exceptions in Kotlin, but it will ignore unchecked exceptions (`RuntimeException` and its subclasses) in Java unless the method declares explicitly that it `throws` them. If strict mode is enabled, all Java method calls need to be guarded using a finally block so ensure the trace is always ended. + +Default is false. + +Example `lint.xml`: + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~xml linenumbers +<lint> + <issue id="UnclosedTrace"> + <option name="strict" value="false" /> + </issue> +</lint> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +(##) Example + +Here is an example of lint warnings produced by this check: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text +src/test/pkg/test.kt:12:Warning: The beginSection() call is not always +closed with a matching endSection() because the code in between may +suspend [UnclosedTrace] + + Trace.beginSection("Wrong-1") + ------------ + + +src/test/pkg/test.kt:18:Warning: The beginSection() call is not always +closed with a matching endSection() because the code in between may +throw an exception [UnclosedTrace] + + Trace.beginSection("Wrong-2") + ------------ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Here is the source file referenced above: + +`src/test/pkg/test.kt`: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers +package test.pkg + +import android.os.Trace + +fun okay1(foo: Int, bar: Int) { + Trace.beginSection("OK-1") + val foobar = foo + bar + Trace.endSection() +} + +suspend fun wrong1() { + Trace.beginSection("Wrong-1") + suspendingCall() + Trace.endSection() +} + +fun wrong2(foo: String, bar: String) { + Trace.beginSection("Wrong-2") + // Kotlin does not have checked exceptions. Any function could throw. + // Adding strings is a function, and therefore could throw an exception + val foobar = foo + bar + Trace.endSection() +} + +fun okay2(foo: String, bar: String) { + Trace.beginSection("OK-2") + try { + val foobar = foo + bar + } finally { + Trace.endSection() + } +} + +suspend fun suspendingCall() { } +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +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/TraceSectionDetectorTest.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 annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnclosedTrace") + fun method() { + beginSection(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnclosedTrace") + void method() { + beginSection(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnclosedTrace + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnclosedTrace" severity="ignore" /> + </lint> + ``` + 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 'UnclosedTrace' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnclosedTrace ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnnecessaryComposedModifier.md.html b/docs/checks/UnnecessaryComposedModifier.md.html index 47170011..a14bee50 100644 --- a/docs/checks/UnnecessaryComposedModifier.md.html +++ b/docs/checks/UnnecessaryComposedModifier.md.html @@ -21,7 +21,7 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact @@ -122,17 +122,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -140,7 +140,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html). diff --git a/docs/checks/UnrememberedAnimatable.md.html b/docs/checks/UnrememberedAnimatable.md.html index 64422dd6..d835d9c1 100644 --- a/docs/checks/UnrememberedAnimatable.md.html +++ b/docs/checks/UnrememberedAnimatable.md.html @@ -319,17 +319,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-core-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core-android = "1.7.0-alpha01" +animation-core-android = "1.7.0-beta01" [libraries] animation-core-android = { module = "androidx.compose.animation:animation-core-android", @@ -337,7 +337,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/UnrememberedGetBackStackEntry.md.html b/docs/checks/UnrememberedGetBackStackEntry.md.html index c736e754..d6fa10c3 100644 --- a/docs/checks/UnrememberedGetBackStackEntry.md.html +++ b/docs/checks/UnrememberedGetBackStackEntry.md.html @@ -191,17 +191,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") +implementation("androidx.navigation:navigation-compose:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-compose:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.8.0-alpha01" +navigation-compose = "2.8.0-beta01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -209,7 +209,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html). diff --git a/docs/checks/UnrememberedMutableInteractionSource.md.html b/docs/checks/UnrememberedMutableInteractionSource.md.html index 3e3ea4d8..97ae1186 100644 --- a/docs/checks/UnrememberedMutableInteractionSource.md.html +++ b/docs/checks/UnrememberedMutableInteractionSource.md.html @@ -182,17 +182,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") +implementation("androidx.compose.foundation:foundation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation-android = "1.7.0-alpha01" +foundation-android = "1.7.0-beta01" [libraries] foundation-android = { module = "androidx.compose.foundation:foundation-android", @@ -200,7 +200,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). diff --git a/docs/checks/UnrememberedMutableState.md.html b/docs/checks/UnrememberedMutableState.md.html index dd5f3ccf..82bfaa87 100644 --- a/docs/checks/UnrememberedMutableState.md.html +++ b/docs/checks/UnrememberedMutableState.md.html @@ -364,17 +364,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -382,7 +382,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/UnsafeLifecycleWhenUsage-2.md.html b/docs/checks/UnsafeLifecycleWhenUsage-2.md.html new file mode 100644 index 00000000..c1c5d212 --- /dev/null +++ b/docs/checks/UnsafeLifecycleWhenUsage-2.md.html @@ -0,0 +1,159 @@ + +(#) Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method + +!!! ERROR: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method + This is an error. + +Id +: `UnsafeLifecycleWhenUsage` +Summary +: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method +Severity +: Error +Category +: Correctness +Platform +: Android +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) + +Affects +: Kotlin and Java files +Editing +: This check runs on the fly in the IDE editor +Implementation +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/main/java/androidx/lifecycle/lint/LifecycleWhenChecks.kt) +Tests +: [Source Code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:/lifecycle/lifecycle-runtime-ktx-lint/src/test/java/androidx/lifecycle/runtime/lint/LifecycleWhenChecksTest.kt) +Copyright Year +: 2019 + +If the `Lifecycle` is destroyed within the block of +`Lifecycle.whenStarted` or any similar `Lifecycle.when` method is +suspended, the block will be cancelled, which will +also cancel any child coroutine launched inside the +block. As as a result, If you have a try finally block + in your code, the finally might run after the Lifecycle moves outside + the desired state. It is recommended to check the +`Lifecycle.isAtLeast` before accessing UI in finally +block. Similarly, if you have a catch statement that +might catch `CancellationException`, you should +check the `Lifecycle.isAtLeast` before accessing the UI. See + documentation of `Lifecycle.whenStateAtLeast` for more details. + +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method (this issue) +* [UnsafeLifecycleWhenUsage from androidx.lifecycle:lifecycle-runtime-android:2.8.0](UnsafeLifecycleWhenUsage.md.html) +* [UnsafeLifecycleWhenUsage from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01](UnsafeLifecycleWhenUsage-2.md.html) + + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-ktx) + +# libs.versions.toml +[versions] +lifecycle-runtime-ktx = "2.8.0-alpha01" +[libraries] +lifecycle-runtime-ktx = { + module = "androidx.lifecycle:lifecycle-runtime-ktx", + version.ref = "lifecycle-runtime-ktx" +} +``` + +2.8.0-alpha01 is the version this documentation was generated from; +there may be newer versions available. + +[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). +(##) Suppressing + +You can suppress false positives using one of the following mechanisms: + +* Using a suppression annotation like this on the enclosing + element: + + ```kt + // Kotlin + @Suppress("UnsafeLifecycleWhenUsage") + fun method() { + whenCreated(...) + } + ``` + + or + + ```java + // Java + @SuppressWarnings("UnsafeLifecycleWhenUsage") + void method() { + whenCreated(...); + } + ``` + +* Using a suppression comment like this on the line above: + + ```kt + //noinspection UnsafeLifecycleWhenUsage + 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 + <?xml version="1.0" encoding="UTF-8"?> + <lint> + <issue id="UnsafeLifecycleWhenUsage" severity="ignore" /> + </lint> + ``` + 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 'UnsafeLifecycleWhenUsage' + } + ``` + In Android projects this should be nested inside an `android { }` + block. + +* For manual invocations of `lint`, using the `--ignore` flag: + ``` + $ lint --ignore UnsafeLifecycleWhenUsage ...` + ``` + +* Last, but not least, using baselines, as discussed + [here](https://googlesamples.github.io/android-custom-lint-rules/usage/baselines.md.html). + + \ No newline at end of file diff --git a/docs/checks/UnsafeLifecycleWhenUsage.md.html b/docs/checks/UnsafeLifecycleWhenUsage.md.html index 264c4029..97252931 100644 --- a/docs/checks/UnsafeLifecycleWhenUsage.md.html +++ b/docs/checks/UnsafeLifecycleWhenUsage.md.html @@ -25,7 +25,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) +: [androidx.lifecycle:lifecycle-runtime-android](androidx_lifecycle_lifecycle-runtime-android.md.html) Affects : Kotlin and Java files @@ -51,6 +51,16 @@ check the `Lifecycle.isAtLeast` before accessing the UI. See documentation of `Lifecycle.whenStateAtLeast` for more details. +(##) Repackaged + +This lint check appears to have been packaged in other artifacts as +well. Issue id's must be unique, so you cannot combine these libraries. +Also defined in: +* UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method (this issue) +* [UnsafeLifecycleWhenUsage from androidx.lifecycle:lifecycle-runtime-android:2.8.0](UnsafeLifecycleWhenUsage.md.html) +* [UnsafeLifecycleWhenUsage from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01](UnsafeLifecycleWhenUsage-2.md.html) + + (##) Including !!! @@ -59,28 +69,28 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01") +implementation("androidx.lifecycle:lifecycle-runtime-android:2.8.0") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01' +implementation 'androidx.lifecycle:lifecycle-runtime-android:2.8.0' // build.gradle.kts with version catalogs: -implementation(libs.lifecycle-runtime-ktx) +implementation(libs.lifecycle-runtime-android) # libs.versions.toml [versions] -lifecycle-runtime-ktx = "2.8.0-alpha01" +lifecycle-runtime-android = "2.8.0" [libraries] -lifecycle-runtime-ktx = { - module = "androidx.lifecycle:lifecycle-runtime-ktx", - version.ref = "lifecycle-runtime-ktx" +lifecycle-runtime-android = { + module = "androidx.lifecycle:lifecycle-runtime-android", + version.ref = "lifecycle-runtime-android" } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0 is the version this documentation was generated from; there may be newer versions available. -[Additional details about androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html). +[Additional details about androidx.lifecycle:lifecycle-runtime-android](androidx_lifecycle_lifecycle-runtime-android.md.html). (##) Suppressing You can suppress false positives using one of the following mechanisms: diff --git a/docs/checks/UnsafeOptInUsageError.md.html b/docs/checks/UnsafeOptInUsageError.md.html index f684525a..7c4d7c77 100644 --- a/docs/checks/UnsafeOptInUsageError.md.html +++ b/docs/checks/UnsafeOptInUsageError.md.html @@ -70,17 +70,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0") +implementation("androidx.annotation:annotation-experimental:1.4.1") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0' +implementation 'androidx.annotation:annotation-experimental:1.4.1' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0" +annotation-experimental = "1.4.1" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -88,7 +88,7 @@ } ``` -1.4.0 is the version this documentation was generated from; +1.4.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/UnsafeOptInUsageWarning.md.html b/docs/checks/UnsafeOptInUsageWarning.md.html index ec71e816..d79ac4d7 100644 --- a/docs/checks/UnsafeOptInUsageWarning.md.html +++ b/docs/checks/UnsafeOptInUsageWarning.md.html @@ -70,17 +70,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0") +implementation("androidx.annotation:annotation-experimental:1.4.1") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0' +implementation 'androidx.annotation:annotation-experimental:1.4.1' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0" +annotation-experimental = "1.4.1" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -88,7 +88,7 @@ } ``` -1.4.0 is the version this documentation was generated from; +1.4.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html index 14dde395..4e68d8c8 100644 --- a/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html +++ b/docs/checks/UnsafeRepeatOnLifecycleDetector.md.html @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UnusedBoxWithConstraintsScope.md.html b/docs/checks/UnusedBoxWithConstraintsScope.md.html index a5b8d44a..1b12074d 100644 --- a/docs/checks/UnusedBoxWithConstraintsScope.md.html +++ b/docs/checks/UnusedBoxWithConstraintsScope.md.html @@ -111,17 +111,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") +implementation("androidx.compose.foundation:foundation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation-android = "1.7.0-alpha01" +foundation-android = "1.7.0-beta01" [libraries] foundation-android = { module = "androidx.compose.foundation:foundation-android", @@ -129,7 +129,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). diff --git a/docs/checks/UnusedContentLambdaTargetStateParameter.md.html b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html index 06216ed4..9de93485 100644 --- a/docs/checks/UnusedContentLambdaTargetStateParameter.md.html +++ b/docs/checks/UnusedContentLambdaTargetStateParameter.md.html @@ -179,17 +179,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-android) # libs.versions.toml [versions] -animation-android = "1.7.0-alpha01" +animation-android = "1.7.0-beta01" [libraries] animation-android = { module = "androidx.compose.animation:animation-android", @@ -197,7 +197,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html). diff --git a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html index 713535e1..bbeb043c 100644 --- a/docs/checks/UnusedCrossfadeTargetStateParameter.md.html +++ b/docs/checks/UnusedCrossfadeTargetStateParameter.md.html @@ -131,17 +131,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-android) # libs.versions.toml [versions] -animation-android = "1.7.0-alpha01" +animation-android = "1.7.0-beta01" [libraries] animation-android = { module = "androidx.compose.animation:animation-android", @@ -149,7 +149,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.animation:animation-android](androidx_compose_animation_animation-android.md.html). diff --git a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html index 991a6a37..f1bd226f 100644 --- a/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterial3ScaffoldPaddingParameter.md.html @@ -127,17 +127,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material3:material3-android:1.2.0-rc01") +implementation("androidx.compose.material3:material3-android:1.3.0-beta01") // build.gradle -implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' +implementation 'androidx.compose.material3:material3-android:1.3.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material3-android) # libs.versions.toml [versions] -material3-android = "1.2.0-rc01" +material3-android = "1.3.0-beta01" [libraries] material3-android = { module = "androidx.compose.material3:material3-android", @@ -145,7 +145,7 @@ } ``` -1.2.0-rc01 is the version this documentation was generated from; +1.3.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html). diff --git a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html index f8448097..765362ef 100644 --- a/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html +++ b/docs/checks/UnusedMaterialScaffoldPaddingParameter.md.html @@ -127,17 +127,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material:material-android:1.7.0-alpha01") +implementation("androidx.compose.material:material-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.material:material-android:1.7.0-alpha01' +implementation 'androidx.compose.material:material-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material-android) # libs.versions.toml [versions] -material-android = "1.7.0-alpha01" +material-android = "1.7.0-beta01" [libraries] material-android = { module = "androidx.compose.material:material-android", @@ -145,7 +145,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.material:material-android](androidx_compose_material_material-android.md.html). diff --git a/docs/checks/UnusedTransitionTargetStateParameter.md.html b/docs/checks/UnusedTransitionTargetStateParameter.md.html index 7d1b4a83..deac888b 100644 --- a/docs/checks/UnusedTransitionTargetStateParameter.md.html +++ b/docs/checks/UnusedTransitionTargetStateParameter.md.html @@ -134,17 +134,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-core-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core-android = "1.7.0-alpha01" +animation-core-android = "1.7.0-beta01" [libraries] animation-core-android = { module = "androidx.compose.animation:animation-core-android", @@ -152,7 +152,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 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). diff --git a/docs/checks/UseAndroidAlpha.md.html b/docs/checks/UseAndroidAlpha.md.html index c2249a2e..bc9b1bcb 100644 --- a/docs/checks/UseAndroidAlpha.md.html +++ b/docs/checks/UseAndroidAlpha.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -69,7 +69,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseAppTint.md.html b/docs/checks/UseAppTint.md.html index 7c6468aa..91911e54 100644 --- a/docs/checks/UseAppTint.md.html +++ b/docs/checks/UseAppTint.md.html @@ -51,17 +51,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -69,7 +69,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatLoadingForColorStateLists.md.html b/docs/checks/UseCompatLoadingForColorStateLists.md.html index 64590f2e..83d0b131 100644 --- a/docs/checks/UseCompatLoadingForColorStateLists.md.html +++ b/docs/checks/UseCompatLoadingForColorStateLists.md.html @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatLoadingForDrawables.md.html b/docs/checks/UseCompatLoadingForDrawables.md.html index 613287a1..f1298f57 100644 --- a/docs/checks/UseCompatLoadingForDrawables.md.html +++ b/docs/checks/UseCompatLoadingForDrawables.md.html @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatTextViewDrawableApis.md.html b/docs/checks/UseCompatTextViewDrawableApis.md.html index 00a68bf4..d833d515 100644 --- a/docs/checks/UseCompatTextViewDrawableApis.md.html +++ b/docs/checks/UseCompatTextViewDrawableApis.md.html @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseCompatTextViewDrawableXml.md.html b/docs/checks/UseCompatTextViewDrawableXml.md.html index e11d2453..fd60f04f 100644 --- a/docs/checks/UseCompatTextViewDrawableXml.md.html +++ b/docs/checks/UseCompatTextViewDrawableXml.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -70,7 +70,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseGetLayoutInflater.md.html b/docs/checks/UseGetLayoutInflater.md.html index dccb1b9c..6f397bef 100644 --- a/docs/checks/UseGetLayoutInflater.md.html +++ b/docs/checks/UseGetLayoutInflater.md.html @@ -100,17 +100,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -118,7 +118,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UseOfNonLambdaOffsetOverload.md.html b/docs/checks/UseOfNonLambdaOffsetOverload.md.html index 27c41c60..73da3dcc 100644 --- a/docs/checks/UseOfNonLambdaOffsetOverload.md.html +++ b/docs/checks/UseOfNonLambdaOffsetOverload.md.html @@ -50,17 +50,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") +implementation("androidx.compose.foundation:foundation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation-android = "1.7.0-alpha01" +foundation-android = "1.7.0-beta01" [libraries] foundation-android = { module = "androidx.compose.foundation:foundation-android", @@ -68,7 +68,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html). diff --git a/docs/checks/UseRequireInsteadOfGet.md.html b/docs/checks/UseRequireInsteadOfGet.md.html index eb1a544c..fe830ce4 100644 --- a/docs/checks/UseRequireInsteadOfGet.md.html +++ b/docs/checks/UseRequireInsteadOfGet.md.html @@ -169,17 +169,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -187,7 +187,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.fragment:fragment](androidx_fragment_fragment.md.html). diff --git a/docs/checks/UseRxSetProgress2.md.html b/docs/checks/UseRxSetProgress2.md.html index e206cd67..dccf0b30 100644 --- a/docs/checks/UseRxSetProgress2.md.html +++ b/docs/checks/UseRxSetProgress2.md.html @@ -54,17 +54,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -72,7 +72,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/UseSupportActionBar.md.html b/docs/checks/UseSupportActionBar.md.html index c5291d1e..2281753d 100644 --- a/docs/checks/UseSupportActionBar.md.html +++ b/docs/checks/UseSupportActionBar.md.html @@ -48,17 +48,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -66,7 +66,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseSwitchCompatOrMaterialCode.md.html b/docs/checks/UseSwitchCompatOrMaterialCode.md.html index 6558578a..11ce6d0b 100644 --- a/docs/checks/UseSwitchCompatOrMaterialCode.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialCode.md.html @@ -38,7 +38,7 @@ Copyright Year : 2020 -Use `SwitchCompat` from AppCompat or `SwitchMaterial` from Material +Use `SwitchCompat` from AppCompat or `MaterialSwitch` from Material library. (##) Including @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UseSwitchCompatOrMaterialXml.md.html b/docs/checks/UseSwitchCompatOrMaterialXml.md.html index 554b6cf3..a48e5dba 100644 --- a/docs/checks/UseSwitchCompatOrMaterialXml.md.html +++ b/docs/checks/UseSwitchCompatOrMaterialXml.md.html @@ -38,7 +38,7 @@ Copyright Year : 2020 -Use `SwitchCompat` from AppCompat or `SwitchMaterial` from Material +Use `SwitchCompat` from AppCompat or `MaterialSwitch` from Material library. (##) Including @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/UsingMaterialAndMaterial3Libraries.md.html b/docs/checks/UsingMaterialAndMaterial3Libraries.md.html index 615f49ca..d9c19797 100644 --- a/docs/checks/UsingMaterialAndMaterial3Libraries.md.html +++ b/docs/checks/UsingMaterialAndMaterial3Libraries.md.html @@ -88,17 +88,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material3:material3-android:1.2.0-rc01") +implementation("androidx.compose.material3:material3-android:1.3.0-beta01") // build.gradle -implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' +implementation 'androidx.compose.material3:material3-android:1.3.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material3-android) # libs.versions.toml [versions] -material3-android = "1.2.0-rc01" +material3-android = "1.3.0-beta01" [libraries] material3-android = { module = "androidx.compose.material3:material3-android", @@ -106,7 +106,7 @@ } ``` -1.2.0-rc01 is the version this documentation was generated from; +1.3.0-beta01 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html). diff --git a/docs/checks/UsingOnClickInXml.md.html b/docs/checks/UsingOnClickInXml.md.html index 0c14f262..e1ad2d52 100644 --- a/docs/checks/UsingOnClickInXml.md.html +++ b/docs/checks/UsingOnClickInXml.md.html @@ -49,17 +49,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -67,7 +67,7 @@ } ``` -1.7.0-alpha03 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.appcompat:appcompat](androidx_appcompat_appcompat.md.html). diff --git a/docs/checks/WearableActionDuplicate.md.html b/docs/checks/WearableActionDuplicate.md.html index efd7fecd..61287745 100644 --- a/docs/checks/WearableActionDuplicate.md.html +++ b/docs/checks/WearableActionDuplicate.md.html @@ -42,7 +42,7 @@ Here is an example of lint warnings produced by this check: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~text -src/main/AndroidManifest.xml:20:Warning: Duplicate watch face +src/main/AndroidManifest.xml:36:Warning: Duplicate watch face configuration activities found [WearableActionDuplicate] <action android:name="androidx.wear.watchface.editor.action.WATCH_FACE_EDITOR" /> diff --git a/docs/checks/WorkerHasAPublicModifier.md.html b/docs/checks/WorkerHasAPublicModifier.md.html index 1605745f..e4600389 100644 --- a/docs/checks/WorkerHasAPublicModifier.md.html +++ b/docs/checks/WorkerHasAPublicModifier.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -70,7 +70,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.work:work-runtime](androidx_work_work-runtime.md.html). diff --git a/docs/checks/WrongRequiresOptIn.md.html b/docs/checks/WrongRequiresOptIn.md.html index 01f91baa..7c1a5d38 100644 --- a/docs/checks/WrongRequiresOptIn.md.html +++ b/docs/checks/WrongRequiresOptIn.md.html @@ -52,17 +52,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0") +implementation("androidx.annotation:annotation-experimental:1.4.1") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0' +implementation 'androidx.annotation:annotation-experimental:1.4.1' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0" +annotation-experimental = "1.4.1" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -70,7 +70,7 @@ } ``` -1.4.0 is the version this documentation was generated from; +1.4.1 is the version this documentation was generated from; there may be newer versions available. [Additional details about androidx.annotation:annotation-experimental](androidx_annotation_annotation-experimental.md.html). diff --git a/docs/checks/WrongResourceImportAlias.md.html b/docs/checks/WrongResourceImportAlias.md.html index ed3a3a75..279b781d 100644 --- a/docs/checks/WrongResourceImportAlias.md.html +++ b/docs/checks/WrongResourceImportAlias.md.html @@ -108,17 +108,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -126,7 +126,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. [Additional details about com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html). diff --git a/docs/checks/androidx_activity_activity-compose.md.html b/docs/checks/androidx_activity_activity-compose.md.html index efcf4e92..382dee0e 100644 --- a/docs/checks/androidx_activity_activity-compose.md.html +++ b/docs/checks/androidx_activity_activity-compose.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.activity:activity-compose:1.9.0-alpha02 +: androidx.activity:activity-compose:1.9.0 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity-compose:1.9.0-alpha02") +implementation("androidx.activity:activity-compose:1.9.0") // build.gradle -implementation 'androidx.activity:activity-compose:1.9.0-alpha02' +implementation 'androidx.activity:activity-compose:1.9.0' // build.gradle.kts with version catalogs: implementation(libs.activity-compose) # libs.versions.toml [versions] -activity-compose = "1.9.0-alpha02" +activity-compose = "1.9.0" [libraries] activity-compose = { module = "androidx.activity:activity-compose", @@ -52,7 +52,7 @@ } ``` -1.9.0-alpha02 is the version this documentation was generated from; +1.9.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,8 +66,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.9.0-alpha02|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.9.0-alpha01|2023/11/29| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.9.0|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.2|2023/12/13| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.1|2023/11/15| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.0|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_activity_activity.md.html b/docs/checks/androidx_activity_activity.md.html index 9f7c7d7e..ca5d46ee 100644 --- a/docs/checks/androidx_activity_activity.md.html +++ b/docs/checks/androidx_activity_activity.md.html @@ -18,13 +18,14 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.activity:activity:1.9.0-alpha02 +: androidx.activity:activity:1.9.0 (##) Included Issues -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------------|---------------------------------------------------| -|[InvalidFragmentVersionForActivityResult](InvalidFragmentVersionForActivityResult.md.html)|Update to Fragment 1.3.0 to use ActivityResult APIs| +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|----------------------------------------------------------| +|[InvalidFragmentVersionForActivityResult](InvalidFragmentVersionForActivityResult.md.html)|Update to Fragment 1.3.0 to use ActivityResult APIs | +|[InvalidUseOfOnBackPressed](InvalidUseOfOnBackPressed.md.html) |Do not call onBackPressed() within OnBackPressedDisptacher| (##) Including @@ -34,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.activity:activity:1.9.0-alpha02") +implementation("androidx.activity:activity:1.9.0") // build.gradle -implementation 'androidx.activity:activity:1.9.0-alpha02' +implementation 'androidx.activity:activity:1.9.0' // build.gradle.kts with version catalogs: implementation(libs.activity) # libs.versions.toml [versions] -activity = "1.9.0-alpha02" +activity = "1.9.0" [libraries] activity = { module = "androidx.activity:activity", @@ -52,13 +53,14 @@ } ``` -1.9.0-alpha02 is the version this documentation was generated from; +1.9.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes * 1.2.0: First version includes InvalidFragmentVersionForActivityResult. +* 1.9.0: Adds InvalidUseOfOnBackPressed. (##) Version Compatibility @@ -66,8 +68,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.9.0-alpha02|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.9.0-alpha01|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.9.0|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.2|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.1|2023/11/15| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.8.0|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_annotation_annotation-experimental.md.html b/docs/checks/androidx_annotation_annotation-experimental.md.html index b8ce3623..150091cc 100644 --- a/docs/checks/androidx_annotation_annotation-experimental.md.html +++ b/docs/checks/androidx_annotation_annotation-experimental.md.html @@ -20,7 +20,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.annotation:annotation-experimental:1.4.0 +: androidx.annotation:annotation-experimental:1.4.1 (##) Included Issues @@ -39,17 +39,17 @@ ``` // build.gradle.kts -implementation("androidx.annotation:annotation-experimental:1.4.0") +implementation("androidx.annotation:annotation-experimental:1.4.1") // build.gradle -implementation 'androidx.annotation:annotation-experimental:1.4.0' +implementation 'androidx.annotation:annotation-experimental:1.4.1' // build.gradle.kts with version catalogs: implementation(libs.annotation-experimental) # libs.versions.toml [versions] -annotation-experimental = "1.4.0" +annotation-experimental = "1.4.1" [libraries] annotation-experimental = { module = "androidx.annotation:annotation-experimental", @@ -57,7 +57,7 @@ } ``` -1.4.0 is the version this documentation was generated from; +1.4.1 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -75,6 +75,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.4.1|2024/04/03| 4| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.4.0|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.3.1|2023/06/21| 4| Yes| 7.3 and 7.4| 7.0| | 1.3.0|2022/09/07| 3| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_appcompat_appcompat.md.html b/docs/checks/androidx_appcompat_appcompat.md.html index 3ff62280..f5cc7bce 100644 --- a/docs/checks/androidx_appcompat_appcompat.md.html +++ b/docs/checks/androidx_appcompat_appcompat.md.html @@ -18,7 +18,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.appcompat:appcompat:1.7.0-alpha03 +: androidx.appcompat:appcompat:1.7.0-rc01 (##) Included Issues @@ -43,17 +43,17 @@ ``` // build.gradle.kts -implementation("androidx.appcompat:appcompat:1.7.0-alpha03") +implementation("androidx.appcompat:appcompat:1.7.0-rc01") // build.gradle -implementation 'androidx.appcompat:appcompat:1.7.0-alpha03' +implementation 'androidx.appcompat:appcompat:1.7.0-rc01' // build.gradle.kts with version catalogs: implementation(libs.appcompat) # libs.versions.toml [versions] -appcompat = "1.7.0-alpha03" +appcompat = "1.7.0-rc01" [libraries] appcompat = { module = "androidx.appcompat:appcompat", @@ -61,7 +61,7 @@ } ``` -1.7.0-alpha03 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. (##) Changes @@ -78,6 +78,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-rc01|2024/05/14| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-beta01|2024/05/01| 10| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha03|2023/07/26| 10| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha02|2023/02/08| 10| Yes| 7.3 and 7.4| 7.0| | 1.7.0-alpha01|2022/10/05| 10| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/androidx_compose_animation_animation-android.md.html b/docs/checks/androidx_compose_animation_animation-android.md.html index c160b67b..49022080 100644 --- a/docs/checks/androidx_compose_animation_animation-android.md.html +++ b/docs/checks/androidx_compose_animation_animation-android.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.animation:animation-android:1.7.0-alpha01 +: androidx.compose.animation:animation-android:1.7.0-beta01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-android) # libs.versions.toml [versions] -animation-android = "1.7.0-alpha01" +animation-android = "1.7.0-beta01" [libraries] animation-android = { module = "androidx.compose.animation:animation-android", @@ -52,7 +52,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,7 +66,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_animation_animation-core-android.md.html b/docs/checks/androidx_compose_animation_animation-core-android.md.html index 32af25f1..9343da08 100644 --- a/docs/checks/androidx_compose_animation_animation-core-android.md.html +++ b/docs/checks/androidx_compose_animation_animation-core-android.md.html @@ -18,7 +18,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.animation:animation-core-android:1.7.0-alpha01 +: androidx.compose.animation:animation-core-android:1.7.0-beta01 (##) Included Issues @@ -36,17 +36,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.animation:animation-core-android:1.7.0-alpha01") +implementation("androidx.compose.animation:animation-core-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.animation:animation-core-android:1.7.0-alpha01' +implementation 'androidx.compose.animation:animation-core-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.animation-core-android) # libs.versions.toml [versions] -animation-core-android = "1.7.0-alpha01" +animation-core-android = "1.7.0-beta01" [libraries] animation-core-android = { module = "androidx.compose.animation:animation-core-android", @@ -54,7 +54,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -69,7 +69,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_animation_animation-core.md.html b/docs/checks/androidx_compose_animation_animation-core.md.html deleted file mode 100644 index 1418d0dd..00000000 --- a/docs/checks/androidx_compose_animation_animation-core.md.html +++ /dev/null @@ -1,95 +0,0 @@ -(#) androidx.compose.animation:animation-core - -Name -: Compose Animation Core -Description -: Animation engine and animation primitives that are the building blocks -: of the Compose animation library -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.animation.core -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.animation:animation-core:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| -|[UnusedTransitionTargetStateParameter](UnusedTransitionTargetStateParameter.md.html)|Transition.animate* calls should use the provided targetState when defining values| -|[UnrememberedAnimatable](UnrememberedAnimatable.md.html) |Creating an Animatable during composition without using `remember` | - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.animation:animation-core:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.animation:animation-core:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.animation-core) - -# libs.versions.toml -[versions] -animation-core = "1.5.0-beta02" -[libraries] -animation-core = { - module = "androidx.compose.animation:animation-core", - version.ref = "animation-core" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes UnrememberedAnimatable, - UnusedTransitionTargetStateParameter. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 2| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 2| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 2| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 2| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 2| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 2| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 2| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 2| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_animation_animation.md.html b/docs/checks/androidx_compose_animation_animation.md.html deleted file mode 100644 index 0840577f..00000000 --- a/docs/checks/androidx_compose_animation_animation.md.html +++ /dev/null @@ -1,94 +0,0 @@ -(#) androidx.compose.animation:animation - -Name -: Compose Animation -Description -: Compose animation library -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.animation -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.animation:animation:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| -|[UnusedCrossfadeTargetStateParameter](UnusedCrossfadeTargetStateParameter.md.html) |Crossfade calls should use the provided `T` parameter in the content lambda | -|[UnusedContentLambdaTargetStateParameter](UnusedContentLambdaTargetStateParameter.md.html)|AnimatedContent calls should use the provided `T` parameter in the content lambda| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.animation:animation:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.animation:animation:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.animation) - -# libs.versions.toml -[versions] -animation = "1.5.0-beta02" -[libraries] -animation = { - module = "androidx.compose.animation:animation", - version.ref = "animation" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes UnusedCrossfadeTargetStateParameter. -* 1.5.0-alpha04: Adds UnusedContentLambdaTargetStateParameter. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_foundation_foundation-android.md.html b/docs/checks/androidx_compose_foundation_foundation-android.md.html index dbfd3b0c..22be33d6 100644 --- a/docs/checks/androidx_compose_foundation_foundation-android.md.html +++ b/docs/checks/androidx_compose_foundation_foundation-android.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.foundation:foundation-android:1.7.0-alpha01 +: androidx.compose.foundation:foundation-android:1.7.0-beta01 (##) Included Issues @@ -38,17 +38,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.foundation:foundation-android:1.7.0-alpha01") +implementation("androidx.compose.foundation:foundation-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.foundation:foundation-android:1.7.0-alpha01' +implementation 'androidx.compose.foundation:foundation-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.foundation-android) # libs.versions.toml [versions] -foundation-android = "1.7.0-alpha01" +foundation-android = "1.7.0-beta01" [libraries] foundation-android = { module = "androidx.compose.foundation:foundation-android", @@ -56,7 +56,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -72,7 +72,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 4| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 4| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 4| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 4| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_foundation_foundation.md.html b/docs/checks/androidx_compose_foundation_foundation.md.html deleted file mode 100644 index b5ad6c3d..00000000 --- a/docs/checks/androidx_compose_foundation_foundation.md.html +++ /dev/null @@ -1,87 +0,0 @@ -(#) androidx.compose.foundation:foundation - -Name -: Compose Foundation -Description -: Higher level abstractions of the Compose UI primitives. This library is -: design system agnostic, providing the high-level building blocks for -: both application and design-system developers -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.foundation -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.foundation:foundation:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------| -|[FrequentlyChangedStateReadInComposition](FrequentlyChangedStateReadInComposition.md.html)|Frequently changing state should not be directly read in composable function | -|[UseOfNonLambdaOffsetOverload](UseOfNonLambdaOffsetOverload.md.html) |Modifier.offset{ } is preferred over Modifier.offset() for `State` backed arguments.| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.foundation:foundation:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.foundation:foundation:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.foundation) - -# libs.versions.toml -[versions] -foundation = "1.5.0-beta02" -[libraries] -foundation = { - module = "androidx.compose.foundation:foundation", - version.ref = "foundation" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.2.0: First version includes - FrequentlyChangedStateReadInComposition. -* 1.3.0: Adds UseOfNonLambdaOffsetOverload. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_material3_material3-android.md.html b/docs/checks/androidx_compose_material3_material3-android.md.html index cffa9469..e0096318 100644 --- a/docs/checks/androidx_compose_material3_material3-android.md.html +++ b/docs/checks/androidx_compose_material3_material3-android.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.material3:material3-android:1.2.0-rc01 +: androidx.compose.material3:material3-android:1.3.0-beta01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material3:material3-android:1.2.0-rc01") +implementation("androidx.compose.material3:material3-android:1.3.0-beta01") // build.gradle -implementation 'androidx.compose.material3:material3-android:1.2.0-rc01' +implementation 'androidx.compose.material3:material3-android:1.3.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material3-android) # libs.versions.toml [versions] -material3-android = "1.2.0-rc01" +material3-android = "1.3.0-beta01" [libraries] material3-android = { module = "androidx.compose.material3:material3-android", @@ -52,14 +52,13 @@ } ``` -1.2.0-rc01 is the version this documentation was generated from; +1.3.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes -* 1.2.0-alpha02: First version includes - UnusedMaterial3ScaffoldPaddingParameter. -* 1.2.0-alpha04: Adds UsingMaterialAndMaterial3Libraries. +* 1.2.0: First version includes UnusedMaterial3ScaffoldPaddingParameter, + UsingMaterialAndMaterial3Libraries. (##) Version Compatibility @@ -67,19 +66,14 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.2.0-rc01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-beta02|2024/01/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-beta01|2023/12/13| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha12|2023/11/29| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha11|2023/11/15| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha10|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha09|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha08|2023/09/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha07|2023/09/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha06|2023/08/23| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha05|2023/08/09| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha04|2023/07/26| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha03|2023/06/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha02|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-beta01|2024/05/14| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha06|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha05|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha04|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha03|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha02|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0-alpha01|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.1|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_compose_material3_material3.md.html b/docs/checks/androidx_compose_material3_material3.md.html deleted file mode 100644 index 94539747..00000000 --- a/docs/checks/androidx_compose_material3_material3.md.html +++ /dev/null @@ -1,74 +0,0 @@ -(#) androidx.compose.material3:material3 - -Name -: Compose Material3 Components -Description -: Compose Material You Design Components library -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.material3 -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.material3:material3:1.2.0-alpha02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------------|----------------------------------------------------------------------| -|[UnusedMaterial3ScaffoldPaddingParameter](UnusedMaterial3ScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.material3:material3:1.2.0-alpha02") - -// build.gradle -implementation 'androidx.compose.material3:material3:1.2.0-alpha02' - -// build.gradle.kts with version catalogs: -implementation(libs.material3) - -# libs.versions.toml -[versions] -material3 = "1.2.0-alpha02" -[libraries] -material3 = { - module = "androidx.compose.material3:material3", - version.ref = "material3" -} -``` - -1.2.0-alpha02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes - UnusedMaterial3ScaffoldPaddingParameter. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.2.0-alpha02|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.2.0-alpha01|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.1.0|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.0.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| -| 1.0.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_material_material-android.md.html b/docs/checks/androidx_compose_material_material-android.md.html index 84ff2e7b..5a65e691 100644 --- a/docs/checks/androidx_compose_material_material-android.md.html +++ b/docs/checks/androidx_compose_material_material-android.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.material:material-android:1.7.0-alpha01 +: androidx.compose.material:material-android:1.7.0-beta01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.material:material-android:1.7.0-alpha01") +implementation("androidx.compose.material:material-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.material:material-android:1.7.0-alpha01' +implementation 'androidx.compose.material:material-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.material-android) # libs.versions.toml [versions] -material-android = "1.7.0-alpha01" +material-android = "1.7.0-beta01" [libraries] material-android = { module = "androidx.compose.material:material-android", @@ -52,7 +52,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,7 +66,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_material_material.md.html b/docs/checks/androidx_compose_material_material.md.html deleted file mode 100644 index fcab90a3..00000000 --- a/docs/checks/androidx_compose_material_material.md.html +++ /dev/null @@ -1,92 +0,0 @@ -(#) androidx.compose.material:material - -Name -: Compose Material Components -Description -: Compose Material Design Components library -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.material -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.material:material:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|----------------------------------------------------------------------------------------|----------------------------------------------------------------------| -|[ConflictingOnColor](ConflictingOnColor.md.html) |Background colors with the same value should have the same 'on' color | -|[UnusedMaterialScaffoldPaddingParameter](UnusedMaterialScaffoldPaddingParameter.md.html)|Scaffold content should use the padding provided as a lambda parameter| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.material:material:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.material:material:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.material) - -# libs.versions.toml -[versions] -material = "1.5.0-beta02" -[libraries] -material = { - module = "androidx.compose.material:material", - version.ref = "material" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes ConflictingOnColor. -* 1.2.0: Adds UnusedMaterialScaffoldPaddingParameter. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime-android.md.html b/docs/checks/androidx_compose_runtime_runtime-android.md.html index 2487b44b..a0f0f137 100644 --- a/docs/checks/androidx_compose_runtime_runtime-android.md.html +++ b/docs/checks/androidx_compose_runtime_runtime-android.md.html @@ -18,7 +18,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.runtime:runtime-android:1.7.0-alpha01 +: androidx.compose.runtime:runtime-android:1.7.0-beta01 (##) Included Issues @@ -47,17 +47,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-android) # libs.versions.toml [versions] -runtime-android = "1.7.0-alpha01" +runtime-android = "1.7.0-beta01" [libraries] runtime-android = { module = "androidx.compose.runtime:runtime-android", @@ -65,7 +65,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -84,7 +84,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 14| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 14| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 14| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 14| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 14| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html b/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html index 762fd407..263560f7 100644 --- a/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html +++ b/docs/checks/androidx_compose_runtime_runtime-saveable-android.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01 +: androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01") +implementation("androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-alpha01' +implementation 'androidx.compose.runtime:runtime-saveable-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.runtime-saveable-android) # libs.versions.toml [versions] -runtime-saveable-android = "1.7.0-alpha01" +runtime-saveable-android = "1.7.0-beta01" [libraries] runtime-saveable-android = { module = "androidx.compose.runtime:runtime-saveable-android", @@ -51,7 +51,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,7 +64,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_runtime_runtime-saveable.md.html b/docs/checks/androidx_compose_runtime_runtime-saveable.md.html deleted file mode 100644 index 7632523b..00000000 --- a/docs/checks/androidx_compose_runtime_runtime-saveable.md.html +++ /dev/null @@ -1,92 +0,0 @@ -(#) androidx.compose.runtime:runtime-saveable - -Name -: Compose Saveable -Description -: Compose components that allow saving and restoring the local ui state -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.runtime.saveable -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.runtime:runtime-saveable:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------------------|------------------------------------------------------------------------------------------| -|[RememberSaveableSaverParameter](RememberSaveableSaverParameter.md.html)|`Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.runtime:runtime-saveable:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.runtime:runtime-saveable:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.runtime-saveable) - -# libs.versions.toml -[versions] -runtime-saveable = "1.5.0-beta02" -[libraries] -runtime-saveable = { - module = "androidx.compose.runtime:runtime-saveable", - version.ref = "runtime-saveable" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes RememberSaveableSaverParameter. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 1| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 1| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 1| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 1| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 1| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 1| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 1| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 1| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 1| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 1| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 1| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 1| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 1| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 1| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_runtime_runtime.md.html b/docs/checks/androidx_compose_runtime_runtime.md.html deleted file mode 100644 index d0315578..00000000 --- a/docs/checks/androidx_compose_runtime_runtime.md.html +++ /dev/null @@ -1,114 +0,0 @@ -(#) androidx.compose.runtime:runtime - -Name -: Compose Runtime -Description -: Tree composition support for code generated by the Compose compiler -: plugin and corresponding public API -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.runtime -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.runtime:runtime:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| -|[AutoboxingStateValueProperty](AutoboxingStateValueProperty.md.html) |State access causes value to be autoboxed | -|[AutoboxingStateCreation](AutoboxingStateCreation.md.html) |`State` will autobox values assigned to this state. Use a specialized state type instead.| -|[CoroutineCreationDuringComposition](CoroutineCreationDuringComposition.md.html)|Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition | -|[FlowOperatorInvokedInComposition](FlowOperatorInvokedInComposition.md.html) |Flow operator functions should not be invoked within composition | -|[ComposableLambdaParameterNaming](ComposableLambdaParameterNaming.md.html) |Primary composable lambda parameter not named `content` | -|[ComposableLambdaParameterPosition](ComposableLambdaParameterPosition.md.html) |Non-trailing primary composable lambda parameter | -|[ComposableNaming](ComposableNaming.md.html) |Incorrect naming for @Composable functions | -|[StateFlowValueCalledInComposition](StateFlowValueCalledInComposition.md.html) |StateFlow.value should not be called within composition | -|[CompositionLocalNaming](CompositionLocalNaming.md.html) |CompositionLocal properties should be prefixed with `Local` | -|[MutableCollectionMutableState](MutableCollectionMutableState.md.html) |Creating a MutableState object with a mutable collection type | -|[ProduceStateDoesNotAssignValue](ProduceStateDoesNotAssignValue.md.html) |produceState calls should assign `value` inside the producer lambda | -|[RememberReturnType](RememberReturnType.md.html) |`remember` calls must not return `Unit` | -|[OpaqueUnitKey](OpaqueUnitKey.md.html) |Passing an expression which always returns `Unit` as a key argument | -|[UnrememberedMutableState](UnrememberedMutableState.md.html) |Creating a state object during composition without using `remember` | - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.runtime:runtime:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.runtime:runtime:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.runtime) - -# libs.versions.toml -[versions] -runtime = "1.5.0-beta02" -[libraries] -runtime = { - module = "androidx.compose.runtime:runtime", - version.ref = "runtime" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes ComposableLambdaParameterNaming, - ComposableLambdaParameterPosition, ComposableNaming, - CompositionLocalNaming, CoroutineCreationDuringComposition, - RememberReturnType, UnrememberedMutableState. -* 1.1.0: Adds FlowOperatorInvokedInComposition, - MutableCollectionMutableState, ProduceStateDoesNotAssignValue, - StateFlowValueCalledInComposition. -* 1.5.0-alpha04: Adds AutoboxingStateValueProperty. -* 1.5.0-beta01: Adds AutoboxingStateCreation, OpaqueUnitKey. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 14| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 14| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 12| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 11| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 11| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 11| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 11| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 11| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 11| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 11| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 11| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 11| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 11| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 11| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 11| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 11| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 11| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 11| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 7| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 7| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 7| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 7| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 7| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 7| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-android.md.html b/docs/checks/androidx_compose_ui_ui-android.md.html index 4cf0b1dc..ff870cce 100644 --- a/docs/checks/androidx_compose_ui_ui-android.md.html +++ b/docs/checks/androidx_compose_ui_ui-android.md.html @@ -14,11 +14,11 @@ Feedback : https://issuetracker.google.com/issues/new?component=612128 Min -: Lint 7.0 +: Lint 8.0 and 8.1 Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.ui:ui-android:1.7.0-alpha01 +: androidx.compose.ui:ui-android:1.7.0-beta01 (##) Included Issues @@ -33,6 +33,7 @@ |[MultipleAwaitPointerEventScopes](MultipleAwaitPointerEventScopes.md.html) |Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.| |[ReturnFromAwaitPointerEventScope](ReturnFromAwaitPointerEventScope.md.html) |Returning from awaitPointerEventScope may cause some input events to be dropped | |[SuspiciousCompositionLocalModifierRead](SuspiciousCompositionLocalModifierRead.md.html)|CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() | +|[SuspiciousModifierThen](SuspiciousModifierThen.md.html) |Using Modifier.then with a Modifier factory function with an implicit receiver | (##) Including @@ -42,17 +43,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-android) # libs.versions.toml [versions] -ui-android = "1.7.0-alpha01" +ui-android = "1.7.0-beta01" [libraries] ui-android = { module = "androidx.compose.ui:ui-android", @@ -60,7 +61,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -73,6 +74,7 @@ SuspiciousCompositionLocalModifierRead, UnnecessaryComposedModifier. * 1.6.0: Removes ComposableModifierFactory. +* 1.7.0-alpha02: Adds SuspiciousModifierThen. (##) Version Compatibility @@ -80,7 +82,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 10| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 10| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 10| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 10| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_ui_ui-graphics-android.md.html b/docs/checks/androidx_compose_ui_ui-graphics-android.md.html index 90410f6d..ab66787e 100644 --- a/docs/checks/androidx_compose_ui_ui-graphics-android.md.html +++ b/docs/checks/androidx_compose_ui_ui-graphics-android.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.ui:ui-graphics-android:1.7.0-alpha01 +: androidx.compose.ui:ui-graphics-android:1.7.0-beta01 (##) Included Issues @@ -34,17 +34,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-graphics-android:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-graphics-android:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-graphics-android:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-graphics-android) # libs.versions.toml [versions] -ui-graphics-android = "1.7.0-alpha01" +ui-graphics-android = "1.7.0-beta01" [libraries] ui-graphics-android = { module = "androidx.compose.ui:ui-graphics-android", @@ -52,7 +52,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,7 +66,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07| | 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 2| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 2| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 2| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_ui_ui-graphics.md.html b/docs/checks/androidx_compose_ui_ui-graphics.md.html deleted file mode 100644 index 3b37b136..00000000 --- a/docs/checks/androidx_compose_ui_ui-graphics.md.html +++ /dev/null @@ -1,94 +0,0 @@ -(#) androidx.compose.ui:ui-graphics - -Name -: Compose Graphics -Description -: Compose graphics -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.ui.graphics -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.ui:ui-graphics:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|------------------------------------------------------------|---------------------------| -|[MissingColorAlphaChannel](MissingColorAlphaChannel.md.html)|Missing Color alpha channel| -|[InvalidColorHexValue](InvalidColorHexValue.md.html) |Invalid Color hex value | - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.ui:ui-graphics:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.ui:ui-graphics:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.ui-graphics) - -# libs.versions.toml -[versions] -ui-graphics = "1.5.0-beta02" -[libraries] -ui-graphics = { - module = "androidx.compose.ui:ui-graphics", - version.ref = "ui-graphics" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes InvalidColorHexValue, - MissingColorAlphaChannel. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 2| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 2| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 2| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 2| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 2| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 2| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 2| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 2| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 2| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 2| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 2| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 2| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 2| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 2| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui-test-manifest.md.html b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html index bcde774c..89c4e4bb 100644 --- a/docs/checks/androidx_compose_ui_ui-test-manifest.md.html +++ b/docs/checks/androidx_compose_ui_ui-test-manifest.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.compose.ui:ui-test-manifest:1.7.0-alpha01 +: androidx.compose.ui:ui-test-manifest:1.7.0-beta01 (##) Included Issues @@ -35,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.compose.ui:ui-test-manifest:1.7.0-alpha01") +implementation("androidx.compose.ui:ui-test-manifest:1.7.0-beta01") // build.gradle -implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-alpha01' +implementation 'androidx.compose.ui:ui-test-manifest:1.7.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.ui-test-manifest) # libs.versions.toml [versions] -ui-test-manifest = "1.7.0-alpha01" +ui-test-manifest = "1.7.0-beta01" [libraries] ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", @@ -53,7 +53,7 @@ } ``` -1.7.0-alpha01 is the version this documentation was generated from; +1.7.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,7 +66,22 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha05|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha04|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha03|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha02|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.7.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.7|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.6|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.5|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.4|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.3|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.2|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.6.1|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.4|2023/10/18| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.5.3|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_compose_ui_ui-text-android.md.html b/docs/checks/androidx_compose_ui_ui-text-android.md.html new file mode 100644 index 00000000..6199c991 --- /dev/null +++ b/docs/checks/androidx_compose_ui_ui-text-android.md.html @@ -0,0 +1,72 @@ +(#) androidx.compose.ui:ui-text-android + +Name +: Compose UI Text +Description +: Compose Text primitives and utilities +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Jetpack Compose +Identifier +: androidx.compose.ui.text +Feedback +: https://issuetracker.google.com/issues/new?component=779818 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.compose.ui:ui-text-android:1.7.0-beta01 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------|-----------------------------------------------------| +|[InvalidLanguageTagDelimiter](InvalidLanguageTagDelimiter.md.html)|Undercore (_) is an unsupported delimiter for subtags| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.compose.ui:ui-text-android:1.7.0-beta01") + +// build.gradle +implementation 'androidx.compose.ui:ui-text-android:1.7.0-beta01' + +// build.gradle.kts with version catalogs: +implementation(libs.ui-text-android) + +# libs.versions.toml +[versions] +ui-text-android = "1.7.0-beta01" +[libraries] +ui-text-android = { + module = "androidx.compose.ui:ui-text-android", + version.ref = "ui-text-android" +} +``` + +1.7.0-beta01 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.7.0-alpha06: First version includes InvalidLanguageTagDelimiter. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.7.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha08|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha07|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0-alpha06|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_compose_ui_ui.md.html b/docs/checks/androidx_compose_ui_ui.md.html deleted file mode 100644 index 88db9302..00000000 --- a/docs/checks/androidx_compose_ui_ui.md.html +++ /dev/null @@ -1,109 +0,0 @@ -(#) androidx.compose.ui:ui - -Name -: Compose UI -Description -: Compose UI primitives. This library contains the primitives that form -: the Compose UI Toolkit, such as drawing, measurement and layout. -License -: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -Vendor -: Jetpack Compose -Identifier -: androidx.compose.ui -Feedback -: https://issuetracker.google.com/issues/new?component=612128 -Min -: Lint 7.0 -Compiled -: Lint 8.0 and 8.1 -Artifact -: androidx.compose.ui:ui:1.5.0-beta02 - -(##) Included Issues - -|Issue Id |Issue Description | -|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------| -|[UnnecessaryComposedModifier](UnnecessaryComposedModifier.md.html) |Modifier.composed should only be used for modifiers that invoke @Composable functions | -|[ComposableModifierFactory](ComposableModifierFactory.md.html) |Modifier factory functions should not be @Composable | -|[ModifierFactoryExtensionFunction](ModifierFactoryExtensionFunction.md.html) |Modifier factory functions should be extensions on Modifier | -|[ModifierFactoryReturnType](ModifierFactoryReturnType.md.html) |Modifier factory functions should return Modifier | -|[ModifierFactoryUnreferencedReceiver](ModifierFactoryUnreferencedReceiver.md.html) |Modifier factory functions must use the receiver Modifier instance | -|[ModifierNodeInspectableProperties](ModifierNodeInspectableProperties.md.html) |ModifierNodeElement missing inspectableProperties | -|[ModifierParameter](ModifierParameter.md.html) |Guidelines for Modifier parameters in a Composable function | -|[ReturnFromAwaitPointerEventScope](ReturnFromAwaitPointerEventScope.md.html) |Returning from awaitPointerEventScope may cause some input events to be dropped | -|[SuspiciousCompositionLocalModifierRead](SuspiciousCompositionLocalModifierRead.md.html)|CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach() | -|[MultipleAwaitPointerEventScopes](MultipleAwaitPointerEventScopes.md.html) |Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.| - -(##) Including - -!!! - This is not a built-in check. To include it, add the below dependency - to your project. - -``` -// build.gradle.kts -implementation("androidx.compose.ui:ui:1.5.0-beta02") - -// build.gradle -implementation 'androidx.compose.ui:ui:1.5.0-beta02' - -// build.gradle.kts with version catalogs: -implementation(libs.ui) - -# libs.versions.toml -[versions] -ui = "1.5.0-beta02" -[libraries] -ui = { - module = "androidx.compose.ui:ui", - version.ref = "ui" -} -``` - -1.5.0-beta02 is the version this documentation was generated from; -there may be newer versions available. - -(##) Changes - -* 1.0.0: First version includes ComposableModifierFactory, - ModifierFactoryExtensionFunction, ModifierFactoryReturnType, - ModifierFactoryUnreferencedReceiver, ModifierParameter, - UnnecessaryComposedModifier. -* 1.3.0: Adds MultipleAwaitPointerEventScopes, - ReturnFromAwaitPointerEventScope. -* 1.4.0: Adds ModifierNodeInspectableProperties. -* 1.5.0-alpha01: Adds SuspiciousCompositionLocalModifierRead. - -(##) Version Compatibility - -There are multiple older versions available of this library: - -| Version | Date | Issues | Compatible | Compiled | Requires | -|-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.5.0-beta02|2023/06/07| 10| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-beta01|2023/05/24| 10| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha04|2023/05/10| 10| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha03|2023/04/19| 10| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.5.0-alpha02|2023/04/05| 10| Yes| 8.0 and 8.1| 7.0| -| 1.5.0-alpha01|2023/03/22| 10| Yes| 8.0 and 8.1| 7.0| -| 1.4.3|2023/05/03| 9| Yes| 8.0 and 8.1| 7.0| -| 1.4.2|2023/04/19| 9| Yes| 8.0 and 8.1| 7.0| -| 1.4.1|2023/04/05| 9| Yes| 8.0 and 8.1| 7.0| -| 1.4.0|2023/03/22| 9| Yes| 8.0 and 8.1| 7.0| -| 1.3.3|2023/01/11| 8| Yes| 7.3 and 7.4| 7.0| -| 1.3.2|2022/12/07| 8| Yes| 7.3 and 7.4| 7.0| -| 1.3.1|2022/11/09| 8| Yes| 7.3 and 7.4| 7.0| -| 1.3.0|2022/10/24| 8| Yes| 7.3 and 7.4| 7.0| -| 1.2.1|2022/08/10| 6| Yes| 7.3 and 7.4| 7.0| -| 1.2.0|2022/07/27| 6| Yes| 7.3 and 7.4| 7.0| -| 1.1.1|2022/02/23| 6| Yes| 7.1| 7.0| -| 1.1.0|2022/02/09| 6| Yes| 7.1| 7.0| -| 1.0.5|2021/11/03| 6| Yes| 7.0| 7.0| -| 1.0.4|2021/10/13| 6| Yes| 7.0| 7.0| -| 1.0.3|2021/09/29| 6| Yes| 7.0| 7.0| -| 1.0.2|2021/09/01| 6| Yes| 7.0| 7.0| -| 1.0.1|2021/08/04| 6| Yes| 7.0| 7.0| -| 1.0.0|2021/07/28| 6| Yes| 7.0| 7.0| - - \ No newline at end of file diff --git a/docs/checks/androidx_fragment_fragment-testing-manifest.md.html b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html index 99316c84..6a4c1d34 100644 --- a/docs/checks/androidx_fragment_fragment-testing-manifest.md.html +++ b/docs/checks/androidx_fragment_fragment-testing-manifest.md.html @@ -19,7 +19,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment-testing-manifest:1.7.0-alpha09 +: androidx.fragment:fragment-testing-manifest:1.8.0-beta01 (##) Included Issues @@ -35,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing-manifest:1.7.0-alpha09") +implementation("androidx.fragment:fragment-testing-manifest:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment-testing-manifest:1.7.0-alpha09' +implementation 'androidx.fragment:fragment-testing-manifest:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing-manifest) # libs.versions.toml [versions] -fragment-testing-manifest = "1.7.0-alpha09" +fragment-testing-manifest = "1.8.0-beta01" [libraries] fragment-testing-manifest = { module = "androidx.fragment:fragment-testing-manifest", @@ -53,7 +53,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -66,15 +66,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.7.0-alpha09|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha08|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha07|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha06|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha05|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha04|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha03|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha02|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha02|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha01|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.1|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.2|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.1|2023/07/26| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_fragment_fragment-testing.md.html b/docs/checks/androidx_fragment_fragment-testing.md.html index b3fc1fa0..c123e537 100644 --- a/docs/checks/androidx_fragment_fragment-testing.md.html +++ b/docs/checks/androidx_fragment_fragment-testing.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment-testing:1.7.0-alpha09 +: androidx.fragment:fragment-testing:1.8.0-beta01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment-testing:1.7.0-alpha09") +implementation("androidx.fragment:fragment-testing:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment-testing:1.7.0-alpha09' +implementation 'androidx.fragment:fragment-testing:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment-testing) # libs.versions.toml [versions] -fragment-testing = "1.7.0-alpha09" +fragment-testing = "1.8.0-beta01" [libraries] fragment-testing = { module = "androidx.fragment:fragment-testing", @@ -51,7 +51,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,15 +64,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.7.0-alpha09|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha08|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha07|2023/11/29| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha06|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha05|2023/09/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha04|2023/09/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha03|2023/08/23| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha02|2023/08/09| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha01|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha02|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha01|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.1|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.2|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.1|2023/07/26| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_fragment_fragment.md.html b/docs/checks/androidx_fragment_fragment.md.html index 5567f645..ad16d23b 100644 --- a/docs/checks/androidx_fragment_fragment.md.html +++ b/docs/checks/androidx_fragment_fragment.md.html @@ -20,7 +20,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.fragment:fragment:1.7.0-alpha09 +: androidx.fragment:fragment:1.8.0-beta01 (##) Included Issues @@ -44,17 +44,17 @@ ``` // build.gradle.kts -implementation("androidx.fragment:fragment:1.7.0-alpha09") +implementation("androidx.fragment:fragment:1.8.0-beta01") // build.gradle -implementation 'androidx.fragment:fragment:1.7.0-alpha09' +implementation 'androidx.fragment:fragment:1.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.fragment) # libs.versions.toml [versions] -fragment = "1.7.0-alpha09" +fragment = "1.8.0-beta01" [libraries] fragment = { module = "androidx.fragment:fragment", @@ -62,7 +62,7 @@ } ``` -1.7.0-alpha09 is the version this documentation was generated from; +1.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -80,15 +80,11 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.7.0-alpha09|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha08|2024/01/10| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha07|2023/11/29| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha06|2023/10/04| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha05|2023/09/20| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha04|2023/09/06| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha03|2023/08/23| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha02|2023/08/09| 9| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.7.0-alpha01|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-beta01|2024/05/14| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha02|2024/04/17| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.8.0-alpha01|2024/04/03| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.1|2024/05/14| 9| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.7.0|2024/05/01| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.2|2023/11/01| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.1|2023/07/26| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.6.0|2023/06/07| 9| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html index 65c422f5..7bcae9cc 100644 --- a/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html +++ b/docs/checks/androidx_lifecycle_lifecycle-livedata-core-ktx.md.html @@ -21,9 +21,9 @@ (##) Included Issues -|Issue Id |Issue Description | -|----------------------------------------------------------|----------------------------------------------| -|[NullSafeMutableLiveData](NullSafeMutableLiveData.md.html)|LiveData value assignment nullability mismatch| +|Issue Id |Issue Description | +|------------------------------------------------------------|----------------------------------------------| +|[NullSafeMutableLiveData](NullSafeMutableLiveData-2.md.html)|LiveData value assignment nullability mismatch| (##) Including diff --git a/docs/checks/androidx_lifecycle_lifecycle-livedata-core.md.html b/docs/checks/androidx_lifecycle_lifecycle-livedata-core.md.html new file mode 100644 index 00000000..033a31fa --- /dev/null +++ b/docs/checks/androidx_lifecycle_lifecycle-livedata-core.md.html @@ -0,0 +1,58 @@ +(#) androidx.lifecycle:lifecycle-livedata-core + +Name +: Lifecycle LiveData Core +Description +: Android Lifecycle LiveData Core +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.lifecycle:lifecycle-livedata-core:2.8.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|----------------------------------------------------------|----------------------------------------------| +|[NullSafeMutableLiveData](NullSafeMutableLiveData.md.html)|LiveData value assignment nullability mismatch| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-livedata-core:2.8.0") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-livedata-core:2.8.0' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-livedata-core) + +# libs.versions.toml +[versions] +lifecycle-livedata-core = "2.8.0" +[libraries] +lifecycle-livedata-core = { + module = "androidx.lifecycle:lifecycle-livedata-core", + version.ref = "lifecycle-livedata-core" +} +``` + +2.8.0 is the version this documentation was generated from; +there may be newer versions available. + + + \ No newline at end of file diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-android.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-android.md.html new file mode 100644 index 00000000..53fd2f25 --- /dev/null +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-android.md.html @@ -0,0 +1,59 @@ +(#) androidx.lifecycle:lifecycle-runtime-android + +Name +: Lifecycle Runtime +Description +: Android Lifecycle Runtime +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.lifecycle +Feedback +: https://issuetracker.google.com/issues/new?component=413132 +Min +: Lint 7.0 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.lifecycle:lifecycle-runtime-android:2.8.0 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------|-------------------------------------------------------------------------------| +|[UnsafeLifecycleWhenUsage](UnsafeLifecycleWhenUsage.md.html) |Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method| +|[RepeatOnLifecycleWrongUsage](RepeatOnLifecycleWrongUsage.md.html)|Wrong usage of repeatOnLifecycle. | + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.lifecycle:lifecycle-runtime-android:2.8.0") + +// build.gradle +implementation 'androidx.lifecycle:lifecycle-runtime-android:2.8.0' + +// build.gradle.kts with version catalogs: +implementation(libs.lifecycle-runtime-android) + +# libs.versions.toml +[versions] +lifecycle-runtime-android = "2.8.0" +[libraries] +lifecycle-runtime-android = { + module = "androidx.lifecycle:lifecycle-runtime-android", + version.ref = "lifecycle-runtime-android" +} +``` + +2.8.0 is the version this documentation was generated from; +there may be newer versions available. + + + \ No newline at end of file diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html index b06363d9..02d65f16 100644 --- a/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-ktx.md.html @@ -21,10 +21,10 @@ (##) Included Issues -|Issue Id |Issue Description | -|------------------------------------------------------------------|-------------------------------------------------------------------------------| -|[UnsafeLifecycleWhenUsage](UnsafeLifecycleWhenUsage.md.html) |Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method| -|[RepeatOnLifecycleWrongUsage](RepeatOnLifecycleWrongUsage.md.html)|Wrong usage of repeatOnLifecycle. | +|Issue Id |Issue Description | +|--------------------------------------------------------------------|-------------------------------------------------------------------------------| +|[UnsafeLifecycleWhenUsage](UnsafeLifecycleWhenUsage-2.md.html) |Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method| +|[RepeatOnLifecycleWrongUsage](RepeatOnLifecycleWrongUsage-2.md.html)|Wrong usage of repeatOnLifecycle. | (##) Including diff --git a/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html b/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html index 9c58576d..e3cde88a 100644 --- a/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html +++ b/docs/checks/androidx_lifecycle_lifecycle-runtime-testing.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01 +: androidx.lifecycle:lifecycle-runtime-testing:2.8.0 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01") +implementation("androidx.lifecycle:lifecycle-runtime-testing:2.8.0") // build.gradle -implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0-alpha01' +implementation 'androidx.lifecycle:lifecycle-runtime-testing:2.8.0' // build.gradle.kts with version catalogs: implementation(libs.lifecycle-runtime-testing) # libs.versions.toml [versions] -lifecycle-runtime-testing = "2.8.0-alpha01" +lifecycle-runtime-testing = "2.8.0" [libraries] lifecycle-runtime-testing = { module = "androidx.lifecycle:lifecycle-runtime-testing", @@ -51,7 +51,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,7 +64,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.0|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_navigation_navigation-common.md.html b/docs/checks/androidx_navigation_navigation-common.md.html index 6215c5b9..ca3d05c8 100644 --- a/docs/checks/androidx_navigation_navigation-common.md.html +++ b/docs/checks/androidx_navigation_navigation-common.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-common:2.8.0-alpha01 +: androidx.navigation:navigation-common:2.8.0-beta01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-common:2.8.0-alpha01") +implementation("androidx.navigation:navigation-common:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-common:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-common:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-common) # libs.versions.toml [versions] -navigation-common = "2.8.0-alpha01" +navigation-common = "2.8.0-beta01" [libraries] navigation-common = { module = "androidx.navigation:navigation-common", @@ -51,7 +51,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,7 +64,16 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha08|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha07|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha06|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha05|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha04|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha03|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha02|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.7|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.6|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.5|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.4|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_navigation_navigation-compose.md.html b/docs/checks/androidx_navigation_navigation-compose.md.html index 881687db..dc7ef63b 100644 --- a/docs/checks/androidx_navigation_navigation-compose.md.html +++ b/docs/checks/androidx_navigation_navigation-compose.md.html @@ -15,7 +15,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-compose:2.8.0-alpha01 +: androidx.navigation:navigation-compose:2.8.0-beta01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-compose:2.8.0-alpha01") +implementation("androidx.navigation:navigation-compose:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-compose:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-compose:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-compose) # libs.versions.toml [versions] -navigation-compose = "2.8.0-alpha01" +navigation-compose = "2.8.0-beta01" [libraries] navigation-compose = { module = "androidx.navigation:navigation-compose", @@ -51,7 +51,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -65,7 +65,16 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-beta01|2024/05/14| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha08|2024/05/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha07|2024/04/17| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha06|2024/04/03| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha05|2024/03/20| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha04|2024/03/06| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha03|2024/02/21| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha02|2024/02/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.8.0-alpha01|2024/01/24| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.7|2024/02/07| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.6|2023/12/13| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.5|2023/11/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.4|2023/10/04| 3| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_navigation_navigation-runtime.md.html b/docs/checks/androidx_navigation_navigation-runtime.md.html index db73a1d9..614c3ca8 100644 --- a/docs/checks/androidx_navigation_navigation-runtime.md.html +++ b/docs/checks/androidx_navigation_navigation-runtime.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.navigation:navigation-runtime:2.8.0-alpha01 +: androidx.navigation:navigation-runtime:2.8.0-beta01 (##) Included Issues @@ -33,17 +33,17 @@ ``` // build.gradle.kts -implementation("androidx.navigation:navigation-runtime:2.8.0-alpha01") +implementation("androidx.navigation:navigation-runtime:2.8.0-beta01") // build.gradle -implementation 'androidx.navigation:navigation-runtime:2.8.0-alpha01' +implementation 'androidx.navigation:navigation-runtime:2.8.0-beta01' // build.gradle.kts with version catalogs: implementation(libs.navigation-runtime) # libs.versions.toml [versions] -navigation-runtime = "2.8.0-alpha01" +navigation-runtime = "2.8.0-beta01" [libraries] navigation-runtime = { module = "androidx.navigation:navigation-runtime", @@ -51,7 +51,7 @@ } ``` -2.8.0-alpha01 is the version this documentation was generated from; +2.8.0-beta01 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -64,7 +64,16 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.8.0-beta01|2024/05/14| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha08|2024/05/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha07|2024/04/17| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha06|2024/04/03| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha05|2024/03/20| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha04|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha03|2024/02/21| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.8.0-alpha02|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.8.0-alpha01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 2.7.7|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.6|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.5|2023/11/01| 1| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.7.4|2023/10/04| 1| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html b/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html index 1346a42a..6efb88e3 100644 --- a/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html +++ b/docs/checks/androidx_wear_protolayout_protolayout-expression.md.html @@ -17,13 +17,15 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.wear.protolayout:protolayout-expression:1.1.0-rc01 +: androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03 (##) Included Issues -|Issue Id |Issue Description | -|----------------------------------------------------|-------------------------------------------------------------------------------| -|[ProtoLayoutMinSchema](ProtoLayoutMinSchema.md.html)|ProtoLayout feature is not guaranteed to be available on the target device API.| +|Issue Id |Issue Description | +|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +|[ProtoLayoutMinSchema](ProtoLayoutMinSchema.md.html) |ProtoLayout feature is not guaranteed to be available on the target device API. | +|[ProtoLayoutPrimaryLayoutResponsive](ProtoLayoutPrimaryLayoutResponsive.md.html) |ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. | +|[ProtoLayoutEdgeContentLayoutResponsive](ProtoLayoutEdgeContentLayoutResponsive.md.html)|ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.| (##) Including @@ -33,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.wear.protolayout:protolayout-expression:1.1.0-rc01") +implementation("androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03") // build.gradle -implementation 'androidx.wear.protolayout:protolayout-expression:1.1.0-rc01' +implementation 'androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.protolayout-expression) # libs.versions.toml [versions] -protolayout-expression = "1.1.0-rc01" +protolayout-expression = "1.2.0-alpha03" [libraries] protolayout-expression = { module = "androidx.wear.protolayout:protolayout-expression", @@ -51,12 +53,14 @@ } ``` -1.1.0-rc01 is the version this documentation was generated from; +1.2.0-alpha03 is the version this documentation was generated from; there may be newer versions available. (##) Changes -* 1.1.0-alpha04: First version includes ProtoLayoutMinSchema. +* 1.1.0: First version includes ProtoLayoutMinSchema. +* 1.2.0-alpha02: Adds ProtoLayoutEdgeContentLayoutResponsive, + ProtoLayoutPrimaryLayoutResponsive. (##) Version Compatibility @@ -64,8 +68,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.1.0-rc01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.1.0-beta01|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.1.0-alpha04|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha03|2024/05/14| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha02|2024/05/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha01|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_wear_protolayout_protolayout-material.md.html b/docs/checks/androidx_wear_protolayout_protolayout-material.md.html new file mode 100644 index 00000000..e0738af2 --- /dev/null +++ b/docs/checks/androidx_wear_protolayout_protolayout-material.md.html @@ -0,0 +1,74 @@ +(#) androidx.wear.protolayout:protolayout-material + +Name +: androidx.wear.protolayout:protolayout-material +Description +: Material components library for ProtoLayout. +License +: [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +Vendor +: Android Open Source Project +Identifier +: androidx.wear.protolayout +Feedback +: https://issuetracker.google.com/issues/new?component=1112273 +Min +: Lint 8.0 and 8.1 +Compiled +: Lint 8.0 and 8.1 +Artifact +: androidx.wear.protolayout:protolayout-material:1.2.0-alpha03 + +(##) Included Issues + +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +|[ProtoLayoutMinSchema](ProtoLayoutMinSchema-2.md.html) |ProtoLayout feature is not guaranteed to be available on the target device API. | +|[ProtoLayoutPrimaryLayoutResponsive](ProtoLayoutPrimaryLayoutResponsive-2.md.html) |ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. | +|[ProtoLayoutEdgeContentLayoutResponsive](ProtoLayoutEdgeContentLayoutResponsive-2.md.html)|ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.| + +(##) Including + +!!! + This is not a built-in check. To include it, add the below dependency + to your project. + +``` +// build.gradle.kts +implementation("androidx.wear.protolayout:protolayout-material:1.2.0-alpha03") + +// build.gradle +implementation 'androidx.wear.protolayout:protolayout-material:1.2.0-alpha03' + +// build.gradle.kts with version catalogs: +implementation(libs.protolayout-material) + +# libs.versions.toml +[versions] +protolayout-material = "1.2.0-alpha03" +[libraries] +protolayout-material = { + module = "androidx.wear.protolayout:protolayout-material", + version.ref = "protolayout-material" +} +``` + +1.2.0-alpha03 is the version this documentation was generated from; +there may be newer versions available. + +(##) Changes + +* 1.2.0-alpha02: First version includes + ProtoLayoutEdgeContentLayoutResponsive, ProtoLayoutMinSchema, + ProtoLayoutPrimaryLayoutResponsive. + +(##) Version Compatibility + +There are multiple older versions available of this library: + +| Version | Date | Issues | Compatible | Compiled | Requires | +|-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.2.0-alpha03|2024/05/14| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha02|2024/05/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| + + \ No newline at end of file diff --git a/docs/checks/androidx_wear_protolayout_protolayout.md.html b/docs/checks/androidx_wear_protolayout_protolayout.md.html index 79e7a7e2..56b0394d 100644 --- a/docs/checks/androidx_wear_protolayout_protolayout.md.html +++ b/docs/checks/androidx_wear_protolayout_protolayout.md.html @@ -17,13 +17,15 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.wear.protolayout:protolayout:1.1.0-rc01 +: androidx.wear.protolayout:protolayout:1.2.0-alpha03 (##) Included Issues -|Issue Id |Issue Description | -|------------------------------------------------------|-------------------------------------------------------------------------------| -|[ProtoLayoutMinSchema](ProtoLayoutMinSchema-2.md.html)|ProtoLayout feature is not guaranteed to be available on the target device API.| +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------| +|[ProtoLayoutMinSchema](ProtoLayoutMinSchema-3.md.html) |ProtoLayout feature is not guaranteed to be available on the target device API. | +|[ProtoLayoutPrimaryLayoutResponsive](ProtoLayoutPrimaryLayoutResponsive-3.md.html) |ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales. | +|[ProtoLayoutEdgeContentLayoutResponsive](ProtoLayoutEdgeContentLayoutResponsive-3.md.html)|ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.| (##) Including @@ -33,17 +35,17 @@ ``` // build.gradle.kts -implementation("androidx.wear.protolayout:protolayout:1.1.0-rc01") +implementation("androidx.wear.protolayout:protolayout:1.2.0-alpha03") // build.gradle -implementation 'androidx.wear.protolayout:protolayout:1.1.0-rc01' +implementation 'androidx.wear.protolayout:protolayout:1.2.0-alpha03' // build.gradle.kts with version catalogs: implementation(libs.protolayout) # libs.versions.toml [versions] -protolayout = "1.1.0-rc01" +protolayout = "1.2.0-alpha03" [libraries] protolayout = { module = "androidx.wear.protolayout:protolayout", @@ -51,12 +53,14 @@ } ``` -1.1.0-rc01 is the version this documentation was generated from; +1.2.0-alpha03 is the version this documentation was generated from; there may be newer versions available. (##) Changes -* 1.1.0-alpha04: First version includes ProtoLayoutMinSchema. +* 1.1.0: First version includes ProtoLayoutMinSchema. +* 1.2.0-alpha02: Adds ProtoLayoutEdgeContentLayoutResponsive, + ProtoLayoutPrimaryLayoutResponsive. (##) Version Compatibility @@ -64,8 +68,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| -| 1.1.0-rc01|2024/01/24| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.1.0-beta01|2024/01/10| 1| Yes| 8.0 and 8.1|8.0 and 8.1| -| 1.1.0-alpha04|2023/12/13| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha03|2024/05/14| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha02|2024/05/01| 3| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.2.0-alpha01|2024/03/06| 1| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.1.0|2024/02/07| 1| Yes| 8.0 and 8.1|8.0 and 8.1| \ No newline at end of file diff --git a/docs/checks/androidx_work_work-runtime.md.html b/docs/checks/androidx_work_work-runtime.md.html index e83fb4fb..b73e1653 100644 --- a/docs/checks/androidx_work_work-runtime.md.html +++ b/docs/checks/androidx_work_work-runtime.md.html @@ -17,7 +17,7 @@ Compiled : Lint 8.0 and 8.1 Artifact -: androidx.work:work-runtime:2.10.0-alpha01 +: androidx.work:work-runtime:2.10.0-alpha02 (##) Included Issues @@ -41,17 +41,17 @@ ``` // build.gradle.kts -implementation("androidx.work:work-runtime:2.10.0-alpha01") +implementation("androidx.work:work-runtime:2.10.0-alpha02") // build.gradle -implementation 'androidx.work:work-runtime:2.10.0-alpha01' +implementation 'androidx.work:work-runtime:2.10.0-alpha02' // build.gradle.kts with version catalogs: implementation(libs.work-runtime) # libs.versions.toml [versions] -work-runtime = "2.10.0-alpha01" +work-runtime = "2.10.0-alpha02" [libraries] work-runtime = { module = "androidx.work:work-runtime", @@ -59,7 +59,7 @@ } ``` -2.10.0-alpha01 is the version this documentation was generated from; +2.10.0-alpha02 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -78,6 +78,7 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.10.0-alpha02|2024/04/17| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.10.0-alpha01|2024/01/24| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.9.0|2023/11/29| 9| Yes| 8.0 and 8.1|8.0 and 8.1| | 2.8.1|2023/03/22| 9| Yes| 7.3 and 7.4| 7.0| diff --git a/docs/checks/categories.md.html b/docs/checks/categories.md.html index 36179b73..b5de36f8 100644 --- a/docs/checks/categories.md.html +++ b/docs/checks/categories.md.html @@ -3,7 +3,7 @@ Order: [Alphabetical](index.md.html) | By category | [By vendor](vendors.md.html) | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Correctness (490) +* Correctness (506) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) @@ -25,11 +25,11 @@ - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) - [BadPeriodicWorkRequestEnqueue: Use `enqueueUniquePeriodicWork()` instead of `enqueue()`](BadPeriodicWorkRequestEnqueue.md.html) - [BatteryLife: Battery Life Issues](BatteryLife.md.html) - - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) - - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) - - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) - - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) - - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extensions](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides must have a return type](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds parameter/return must be type-assignable](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds must have one parameter](BindsWrongParameterCount.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) @@ -47,9 +47,10 @@ - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeComposableModifier: Don't use @Composable builder functions for modifiers](ComposeComposableModifier.md.html) - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) - - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeModifierComposed: Don't use Modifier.composed {}](ComposeModifierComposed.md.html) + - [ComposeViewModelForwarding: Don't forward ViewModels through composables](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) @@ -80,6 +81,7 @@ - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAnything: Do not add new mocks.](DoNotMockAnything.md.html) - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) @@ -102,7 +104,7 @@ - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) + - [ExceptionMessage: Please provide a string for the `lazyMessage` parameter](ExceptionMessage.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) @@ -159,8 +161,6 @@ - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) - - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) - - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) - [InnerclassSeparator: Inner classes should use `$` rather than `.`](InnerclassSeparator.md.html) - [InstantApps: Instant App Issues](InstantApps.md.html) @@ -175,6 +175,7 @@ - [InvalidId: Invalid ID declaration](InvalidId.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) + - [InvalidLanguageTagDelimiter: Undercore (_) is an unsupported delimiter for subtags](InvalidLanguageTagDelimiter.md.html) - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) @@ -183,6 +184,7 @@ a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [InvalidUseOfOnBackPressed: Do not call onBackPressed() within OnBackPressedDisptacher](InvalidUseOfOnBackPressed.md.html) - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) @@ -288,7 +290,8 @@ - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) - - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) + - [MustBeInModule: @Binds/@Provides functions must be in modules](MustBeInModule.md.html) + - [MustUseNamedParams: Calls to @MustUseNamedParams-annotated methods must name all parameters.](MustUseNamedParams.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) - [NamespaceTypo: Misspelled namespace declaration](NamespaceTypo.md.html) @@ -317,9 +320,10 @@ - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) - - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ParcelizeFunctionProperty: Function type properties are not parcelable](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) + - [PictureInPictureIssue: Picture In Picture best practices not followed](PictureInPictureIssue.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) - [PrivateApi: Using Private APIs](PrivateApi.md.html) - [PrivateResource: Using private resources](PrivateResource.md.html) @@ -328,9 +332,16 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract](ProvidesMustNotBeAbstract.md.html) - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) - [QueryPermissionsNeeded: Using APIs affected by query permissions](QueryPermissionsNeeded.md.html) @@ -340,7 +351,7 @@ - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) + - [RedundantBinds: @Binds functions should return a different type](RedundantBinds.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) - [Registered: Class is not registered in the manifest](Registered.md.html) @@ -349,6 +360,7 @@ - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) - [RemoveWorkManagerInitializer: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.](RemoveWorkManagerInitializer.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - [RequiresFeature: Requires Feature](RequiresFeature.md.html) - [ResAuto: Hardcoded Package in Namespace](ResAuto.md.html) @@ -382,6 +394,7 @@ - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) + - [SimilarGradleDependency: Multiple Versions Gradle Dependency](SimilarGradleDependency.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - [Slices: Slices](Slices.md.html) - [SoonBlockedPrivateApi: Using Soon-to-Be Blocked Private API](SoonBlockedPrivateApi.md.html) @@ -405,6 +418,7 @@ - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [SuspiciousModifierThen: Using Modifier.then with a Modifier factory function with an implicit receiver](SuspiciousModifierThen.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - [TestAppLink: Unmatched URLs](TestAppLink.md.html) - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) @@ -414,6 +428,7 @@ - [TimberTagLength: Too Long Log Tags](TimberTagLength.md.html) - [Todo: Marks todos in any given file.](Todo.md.html) - [TranslucentOrientation: Mixing screenOrientation and translucency](TranslucentOrientation.md.html) + - [UnclosedTrace: Incorrect trace section usage](UnclosedTrace.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - [UnknownId: Reference to an unknown id](UnknownId.md.html) @@ -425,6 +440,7 @@ - [UnrememberedMutableInteractionSource: Creating a MutableInteractionSource during composition without using `remember`](UnrememberedMutableInteractionSource.md.html) - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) @@ -709,8 +725,9 @@ - [WearRecents: Wear OS: Recents and app resume](WearRecents.md.html) - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) -* Productivity (17) +* Productivity (19) + - [ComposeCompositionLocalGetter: CompositionLocals should not use getters](ComposeCompositionLocalGetter.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) @@ -725,6 +742,7 @@ - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) + - [ComposeUnstableReceiver: Unstable receivers will always be recomposed](ComposeUnstableReceiver.md.html) - [KtxExtensionAvailable: KTX Extension Available](KtxExtensionAvailable.md.html) - [ModifierNodeInspectableProperties: ModifierNodeElement missing inspectableProperties](ModifierNodeInspectableProperties.md.html) - [UseTomlInstead: Use TOML Version Catalog Instead](UseTomlInstead.md.html) @@ -763,13 +781,14 @@ - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) -* Interoperability: Kotlin Interoperability (6) +* Interoperability: Kotlin Interoperability (7) - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) - [KotlinPropertyAccess: Kotlin Property Access](KotlinPropertyAccess.md.html) - [LambdaLast: Lambda Parameters Last](LambdaLast.md.html) - [NoHardKeywords: No Hard Kotlin Keywords](NoHardKeywords.md.html) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - [UnknownNullness: Unknown nullness](UnknownNullness.md.html) * Lint Implementation Issues (12) diff --git a/docs/checks/com_google_dagger_dagger-lint.md.html b/docs/checks/com_google_dagger_dagger-lint.md.html index dedd1bad..35246bd5 100644 --- a/docs/checks/com_google_dagger_dagger-lint.md.html +++ b/docs/checks/com_google_dagger_dagger-lint.md.html @@ -21,7 +21,7 @@ Compiled : Lint 7.1 Artifact -: com.google.dagger:dagger-lint:2.50 +: com.google.dagger:dagger-lint:2.51.1 (##) Included Issues @@ -40,17 +40,17 @@ ``` // build.gradle.kts -implementation("com.google.dagger:dagger-lint:2.50") +implementation("com.google.dagger:dagger-lint:2.51.1") // build.gradle -implementation 'com.google.dagger:dagger-lint:2.50' +implementation 'com.google.dagger:dagger-lint:2.51.1' // build.gradle.kts with version catalogs: implementation(libs.dagger-lint) # libs.versions.toml [versions] -dagger-lint = "2.50" +dagger-lint = "2.51.1" [libraries] dagger-lint = { module = "com.google.dagger:dagger-lint", @@ -58,7 +58,7 @@ } ``` -2.50 is the version this documentation was generated from; +2.51.1 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -73,6 +73,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 2.51.1|2024/03/29| 4| Yes| 7.1| 7.1| +| 2.51|2024/02/27| 4| Yes| 7.1| 7.1| | 2.50|2023/12/19| 4| Yes| 7.1| 7.1| | 2.49|2023/12/01| 4| Yes| 7.1| 7.1| | 2.48.1|2023/10/03| 4| Yes| 7.1| 7.1| diff --git a/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html b/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html index c639c39e..107c7443 100644 --- a/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html +++ b/docs/checks/com_slack_lint_compose_compose-lint-checks.md.html @@ -17,30 +17,33 @@ Compiled : Lint 8.0 and 8.1 Artifact -: com.slack.lint.compose:compose-lint-checks:1.2.0 +: com.slack.lint.compose:compose-lint-checks:1.3.1 (##) Included Issues -|Issue Id |Issue Description | -|------------------------------------------------------------------------------------|-------------------------------------------------------------------------------| -|[ComposeNamingUppercase](ComposeNamingUppercase.md.html) |Unit Composables should be uppercase | -|[ComposeNamingLowercase](ComposeNamingLowercase.md.html) |Value-returning Composables should be lowercase | -|[ComposeCompositionLocalUsage](ComposeCompositionLocalUsage.md.html) |CompositionLocals are discouraged | -|[ComposeContentEmitterReturningValues](ComposeContentEmitterReturningValues.md.html)|Composable functions should emit XOR return | -|[ComposeComposableModifier](ComposeComposableModifier.md.html) |Using @Composable builder functions for modifiers is not recommended | -|[ComposeModifierMissing](ComposeModifierMissing.md.html) |Missing modifier parameter | -|[ComposeModifierReused](ComposeModifierReused.md.html) |Modifiers should only be used once | -|[ComposeModifierWithoutDefault](ComposeModifierWithoutDefault.md.html) |Missing Modifier default value | -|[ComposeM2Api](ComposeM2Api.md.html) |Using a Compose M2 API is not recommended | -|[ComposeMultipleContentEmitters](ComposeMultipleContentEmitters.md.html) |Composables should only be emit from one source | -|[ComposeMutableParameters](ComposeMutableParameters.md.html) |Mutable objects in Compose will break state | -|[ComposeParameterOrder](ComposeParameterOrder.md.html) |Composable function parameters should be ordered | -|[ComposePreviewNaming](ComposePreviewNaming.md.html) |Preview annotations require certain suffixes | -|[ComposePreviewPublic](ComposePreviewPublic.md.html) |Preview composables should be private | -|[ComposeRememberMissing](ComposeRememberMissing.md.html) |State values should be remembered | -|[ComposeUnstableCollections](ComposeUnstableCollections.md.html) |Immutable collections should ideally be used in Composables | -|[ComposeViewModelForwarding](ComposeViewModelForwarding.md.html) |Forwarding a ViewModel through multiple @Composable functions should be avoided| -|[ComposeViewModelInjection](ComposeViewModelInjection.md.html) |Implicit dependencies of composables should be made explicit | +|Issue Id |Issue Description | +|------------------------------------------------------------------------------------|------------------------------------------------------------| +|[ComposeNamingUppercase](ComposeNamingUppercase.md.html) |Unit Composables should be uppercase | +|[ComposeNamingLowercase](ComposeNamingLowercase.md.html) |Value-returning Composables should be lowercase | +|[ComposeCompositionLocalUsage](ComposeCompositionLocalUsage.md.html) |CompositionLocals are discouraged | +|[ComposeCompositionLocalGetter](ComposeCompositionLocalGetter.md.html) |CompositionLocals should not use getters | +|[ComposeContentEmitterReturningValues](ComposeContentEmitterReturningValues.md.html)|Composable functions should emit XOR return | +|[ComposeComposableModifier](ComposeComposableModifier.md.html) |Don't use @Composable builder functions for modifiers | +|[ComposeModifierMissing](ComposeModifierMissing.md.html) |Missing modifier parameter | +|[ComposeModifierReused](ComposeModifierReused.md.html) |Modifiers should only be used once | +|[ComposeModifierWithoutDefault](ComposeModifierWithoutDefault.md.html) |Missing Modifier default value | +|[ComposeM2Api](ComposeM2Api.md.html) |Using a Compose M2 API is not recommended | +|[ComposeMultipleContentEmitters](ComposeMultipleContentEmitters.md.html) |Composables should only be emit from one source | +|[ComposeMutableParameters](ComposeMutableParameters.md.html) |Mutable objects in Compose will break state | +|[ComposeParameterOrder](ComposeParameterOrder.md.html) |Composable function parameters should be ordered | +|[ComposePreviewNaming](ComposePreviewNaming.md.html) |Preview annotations require certain suffixes | +|[ComposePreviewPublic](ComposePreviewPublic.md.html) |Preview composables should be private | +|[ComposeRememberMissing](ComposeRememberMissing.md.html) |State values should be remembered | +|[ComposeUnstableCollections](ComposeUnstableCollections.md.html) |Immutable collections should ideally be used in Composables | +|[ComposeViewModelForwarding](ComposeViewModelForwarding.md.html) |Don't forward ViewModels through composables | +|[ComposeViewModelInjection](ComposeViewModelInjection.md.html) |Implicit dependencies of composables should be made explicit| +|[ComposeModifierComposed](ComposeModifierComposed.md.html) |Don't use Modifier.composed {} | +|[ComposeUnstableReceiver](ComposeUnstableReceiver.md.html) |Unstable receivers will always be recomposed | (##) Including @@ -51,17 +54,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint.compose:compose-lint-checks:1.2.0") +lintChecks("com.slack.lint.compose:compose-lint-checks:1.3.1") // build.gradle -lintChecks 'com.slack.lint.compose:compose-lint-checks:1.2.0' +lintChecks 'com.slack.lint.compose:compose-lint-checks:1.3.1' // build.gradle.kts with version catalogs: lintChecks(libs.compose-lint-checks) # libs.versions.toml [versions] -compose-lint-checks = "1.2.0" +compose-lint-checks = "1.3.1" [libraries] compose-lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", @@ -69,7 +72,7 @@ } ``` -1.2.0 is the version this documentation was generated from; +1.3.1 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -84,6 +87,8 @@ ComposeUnstableCollections, ComposeViewModelForwarding, ComposeViewModelInjection. * 1.1.0: Adds ComposeM2Api. +* 1.3.0: Adds ComposeCompositionLocalGetter, ComposeModifierComposed, + ComposeUnstableReceiver. (##) Version Compatibility @@ -91,6 +96,8 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 1.3.1|2024/01/25| 21| Yes| 8.0 and 8.1|8.0 and 8.1| +| 1.3.0|2024/01/25| 21| Yes| 8.2+| 8.2+| | 1.2.0|2023/04/19| 18| Yes| 8.0 and 8.1|8.0 and 8.1| | 1.1.1|2023/03/08| 18| Yes| 7.3 and 7.4|7.3 and 7.4| | 1.1.0|2023/03/07| 18| Yes| 7.3 and 7.4|7.3 and 7.4| diff --git a/docs/checks/com_slack_lint_slack-lint-checks.md.html b/docs/checks/com_slack_lint_slack-lint-checks.md.html index 79cf8304..95a355ff 100644 --- a/docs/checks/com_slack_lint_slack-lint-checks.md.html +++ b/docs/checks/com_slack_lint_slack-lint-checks.md.html @@ -19,103 +19,103 @@ Compiled : Lint 8.0 and 8.1 Artifact -: com.slack.lint:slack-lint-checks:0.7.0 +: com.slack.lint:slack-lint-checks:0.7.3 (##) Included Issues -|Issue Id |Issue Description | -|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| -|[CastingViewContextToActivity](CastingViewContextToActivity.md.html) |Unsafe cast of `Context` to `Activity` | -|[ArgInFormattedQuantityStringRes](ArgInFormattedQuantityStringRes.md.html) |Count value in formatted string resource. | -|[BindsTypeMismatch](BindsTypeMismatch.md.html) |@Binds function parameters must be type-assignable to their return types. | -|[BindingReturnType](BindingReturnType.md.html) |@Binds/@Provides functions must have a return type. Cannot be void or Unit. | -|[BindingReceiverParameter](BindingReceiverParameter.md.html) |@Binds/@Provides functions cannot be extension functions. | -|[BindsWrongParameterCount](BindsWrongParameterCount.md.html) |@Binds functions require a single parameter as an input to bind. | -|[BindsMustBeAbstract](BindsMustBeAbstract.md.html) |@Binds functions must be abstract and cannot have function bodies. | -|[RedundantBinds](RedundantBinds.md.html) |@Binds functions should return a different type (including annotations) than the input type. | -|[MustBeInModule](MustBeInModule.md.html) |@Binds/@Provides function must be in `@Module`-annotated classes. | -|[ProvidesMustNotBeAbstract](ProvidesMustNotBeAbstract.md.html) |@Provides functions cannot be abstract. | -|[KotlinPairNotCreated](KotlinPairNotCreated.md.html) |Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons | -|[DoNotCallProviders](DoNotCallProviders.md.html) |Dagger provider methods should not be called directly by user code. | -|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | -|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | -|[DeprecatedCall](DeprecatedCall.md.html) |This class or method is deprecated; consider using an alternative. | -|[DeprecatedSqlUsage](DeprecatedSqlUsage.md.html) |Use SqlDelight! | -|[JavaOnlyDetector](JavaOnlyDetector.md.html) |Using @JavaOnly elements in Kotlin code. | -|[SerializableUsage](SerializableUsage.md.html) |Don't use Serializable. | -|[RawDispatchersUse](RawDispatchersUse.md.html) |Use SlackDispatchers. | -|[MainScopeUsage](MainScopeUsage.md.html) |Use slack.foundation.coroutines.android.MainScope. | -|[SubscribeOnMain](SubscribeOnMain.md.html) |subscribeOn called with the main thread scheduler. | -|[GuavaChecksUsed](GuavaChecksUsed.md.html) |Use Slack's JavaPreconditions instead of Guava's Preconditions checks | -|[GuavaPreconditionsUsedInKotlin](GuavaPreconditionsUsedInKotlin.md.html) |Kotlin precondition checks should use the Kotlin standard library checks | -|[DoNotMockPlatformTypes](DoNotMockPlatformTypes.md.html) |platform types should not be mocked | -|[DoNotMockDataClass](DoNotMockDataClass.md.html) |data classes represent pure data classes, so mocking them should not be necessary. | -|[DoNotMock](DoNotMock.md.html) | | -|[DoNotMockSealedClass](DoNotMockSealedClass.md.html) |sealed classes have a restricted type hierarchy, use a subtype instead | -|[DoNotMockAutoValue](DoNotMockAutoValue.md.html) |AutoValue classes represent pure data classes, so mocking them should not be necessary. | -|[DoNotMockObjectClass](DoNotMockObjectClass.md.html) |object classes are singletons, so mocking them should not be necessary | -|[DoNotMockRecordClass](DoNotMockRecordClass.md.html) |record classes represent pure data classes, so mocking them should not be necessary. | -|[ErrorProneDoNotMockUsage](ErrorProneDoNotMockUsage.md.html) |Use Slack's internal `@DoNotMock` annotation. | -|[MoshiUsageAdaptedByRequiresAdapter](MoshiUsageAdaptedByRequiresAdapter.md.html) |@AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. | -|[MoshiUsageAdaptedByRequiresKeep](MoshiUsageAdaptedByRequiresKeep.md.html) |Adapters targeted by @AdaptedBy must have @Keep. | -|[MoshiUsageArray](MoshiUsageArray.md.html) |Prefer List over Array. | -|[MoshiUsageBlankGenerator](MoshiUsageBlankGenerator.md.html) |Don't use blank JsonClass.generator values. | -|[MoshiUsageBlankJsonName](MoshiUsageBlankJsonName.md.html) |Don't use blank names in `@Json`. | -|[MoshiUsageBlankTypeLabel](MoshiUsageBlankTypeLabel.md.html) |Moshi-sealed requires a type label specified after the 'sealed:' prefix. | -|[MoshiUsageDoubleClassAnnotation](MoshiUsageDoubleClassAnnotation.md.html) |Only use one of @AdaptedBy or @JsonClass. | -|[MoshiUsageDoubleTypeLabel](MoshiUsageDoubleTypeLabel.md.html) |Only use one of @TypeLabel or @DefaultObject. | -|[MoshiUsageDuplicateJsonName](MoshiUsageDuplicateJsonName.md.html) |Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. | -|[MoshiUsageEnumAnnotatedUnknown](MoshiUsageEnumAnnotatedUnknown.md.html) |UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json | -|[MoshiUsageEnumCasing](MoshiUsageEnumCasing.md.html) |Consider using `@Json(name = ...)` rather than lower casing. | -|[MoshiUsageEnumJsonClassGenerated](MoshiUsageEnumJsonClassGenerated.md.html) |Enums annotated with @JsonClass must not set `generateAdapter` to true. | -|[MoshiUsageEnumMissingJsonClass](MoshiUsageEnumMissingJsonClass.md.html) |Enums serialized with Moshi should be annotated with @JsonClass. | -|[MoshiUsageEnumPropertyCouldBeMoshi](MoshiUsageEnumPropertyCouldBeMoshi.md.html) |Consider making enum properties also use Moshi. | -|[MoshiUsageEnumPropertyDefaultUnknown](MoshiUsageEnumPropertyDefaultUnknown.md.html) |Suspicious default value to 'UNKNOWN' for a Moshi enum. | -|[MoshiUsageEnumMissingUnknown](MoshiUsageEnumMissingUnknown.md.html) |Enums serialized with Moshi must reserve the first member as UNKNOWN. | -|[MoshiUsageGenerateAdapterShouldBeTrue](MoshiUsageGenerateAdapterShouldBeTrue.md.html) |JsonClass.generateAdapter must be true in order for Moshi code gen to run. | -|[MoshiUsageGenericSealedSubtype](MoshiUsageGenericSealedSubtype.md.html) |Sealed subtypes used with moshi-sealed cannot be generic. | -|[MoshiUsageInappropriateTypeLabel](MoshiUsageInappropriateTypeLabel.md.html) |Inappropriate @TypeLabel or @DefaultObject annotation. | -|[MoshiUsageRedundantSiteTarget](MoshiUsageRedundantSiteTarget.md.html) |Use of site-targets on @Json are redundant. | -|[MoshiUsageMissingPrimary](MoshiUsageMissingPrimary.md.html) |@JsonClass-annotated types must have a primary constructor or be sealed. | -|[MoshiUsageMissingTypeLabel](MoshiUsageMissingTypeLabel.md.html) |Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. | -|[MoshiUsageMutableCollections](MoshiUsageMutableCollections.md.html) |Use immutable collections rather than mutable versions. | -|[MoshiUsageQualifierRetention](MoshiUsageQualifierRetention.md.html) |JsonQualifiers must have RUNTIME retention. | -|[MoshiUsageQualifierTarget](MoshiUsageQualifierTarget.md.html) |JsonQualifiers must include FIELD targeting. | -|[MoshiUsageNonMoshiClassCollection](MoshiUsageNonMoshiClassCollection.md.html) |Concrete Collection type '%HINT%' is not natively supported by Moshi. | -|[MoshiUsageNonMoshiClassExternal](MoshiUsageNonMoshiClassExternal.md.html) |External type '%HINT%' is not natively supported by Moshi. | -|[MoshiUsageNonMoshiClassInternal](MoshiUsageNonMoshiClassInternal.md.html) |Non-Moshi internal type '%HINT%' is not natively supported by Moshi. | -|[MoshiUsageNonMoshiClassMap](MoshiUsageNonMoshiClassMap.md.html) |Concrete Map type '%HINT%' is not natively supported by Moshi. | -|[MoshiUsageNonMoshiClassPlatform](MoshiUsageNonMoshiClassPlatform.md.html) |Platform type '%HINT%' is not natively supported by Moshi. | -|[MoshiUsageObject](MoshiUsageObject.md.html) |Object types cannot be annotated with @JsonClass. | -|[MoshiUsageParamNeedsInit](MoshiUsageParamNeedsInit.md.html) |Constructor non-property parameters in Moshi classes must have default values. | -|[MoshiUsagePrivateConstructor](MoshiUsagePrivateConstructor.md.html) |Constructors in Moshi classes cannot be private. | -|[MoshiUsagePrivateConstructorProperty](MoshiUsagePrivateConstructorProperty.md.html) |Constructor parameter properties in Moshi classes cannot be private. | -|[MoshiUsageRedundantJsonName](MoshiUsageRedundantJsonName.md.html) |Json.name with the same value as the property/enum member name is redundant. | -|[MoshiUsageSealedMustBeSealed](MoshiUsageSealedMustBeSealed.md.html) |Moshi-sealed can only be applied to 'sealed' types. | -|[MoshiUsageSerializedName](MoshiUsageSerializedName.md.html) |Use Moshi's @Json rather than Gson's @SerializedName. | -|[MoshiUsageSnakeCase](MoshiUsageSnakeCase.md.html) |Consider using `@Json(name = ...)` rather than direct snake casing. | -|[MoshiUsageTransientNeedsInit](MoshiUsageTransientNeedsInit.md.html) |Transient constructor properties must have default values. | -|[MoshiUsageUnsupportedType](MoshiUsageUnsupportedType.md.html) |This type cannot be annotated with @JsonClass. | -|[MoshiUsageUseData](MoshiUsageUseData.md.html) |Model classes should be immutable data classes. | -|[MoshiUsageVarProperty](MoshiUsageVarProperty.md.html) |Moshi properties should be immutable. | -|[MoshiUsageClassVisibility](MoshiUsageClassVisibility.md.html) |@JsonClass-annotated types must be public, package-private, or internal. | -|[FragmentConstructorInjection](FragmentConstructorInjection.md.html) |Fragment dependencies should be injected using constructor injections only. | -|[FragmentFieldInjection](FragmentFieldInjection.md.html) |Fragment dependencies should be injected using the Fragment's constructor. | -|[InjectWithScopeRequiredLoggedInUserProvider](InjectWithScopeRequiredLoggedInUserProvider.md.html)|@InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.| -|[InjectWithTypeMustImplementAnvilInjectable](InjectWithTypeMustImplementAnvilInjectable.md.html) |@InjectWith-annotated classes must implement AnvilInjectable (or extend something that does). | -|[RedactedInJavaUsage](RedactedInJavaUsage.md.html) |@Redacted is only supported in Kotlin classes! | -|[InjectInJava](InjectInJava.md.html) |Only Kotlin classes should be injected in order for Anvil to work. | -|[RetrofitUsage](RetrofitUsage.md.html) |This is replaced by the caller. | -|[RestrictCallsTo](RestrictCallsTo.md.html) |Methods annotated with @RestrictedCallsTo should only be called from the specified scope. | -|[SpanMarkPointMissingMask](SpanMarkPointMissingMask.md.html) |Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. | -|[DoNotExposeEitherNetInRepositories](DoNotExposeEitherNetInRepositories.md.html) |Repository APIs should not expose EitherNet types directly. | -|[FullyQualifiedResource](FullyQualifiedResource.md.html) |Resources should use an import alias instead of being fully qualified. | -|[MissingResourceImportAlias](MissingResourceImportAlias.md.html) |Missing import alias for R class. | -|[WrongResourceImportAlias](WrongResourceImportAlias.md.html) |Wrong import alias for this R class. | -|[DenyListedApi](DenyListedApi.md.html) |Deny-listed API | -|[DenyListedBlockingApi](DenyListedBlockingApi.md.html) |Deny-listed API | -|[ParcelizeFunctionProperty](ParcelizeFunctionProperty.md.html) |Function type properties should not be used in Parcelize classes | -|[ExceptionMessage](ExceptionMessage.md.html) |Please provide a string for the lazyMessage parameter | +|Issue Id |Issue Description | +|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------| +|[CastingViewContextToActivity](CastingViewContextToActivity.md.html) |Unsafe cast of `Context` to `Activity` | +|[ArgInFormattedQuantityStringRes](ArgInFormattedQuantityStringRes.md.html) |Count value in formatted string resource. | +|[BindsTypeMismatch](BindsTypeMismatch.md.html) |@Binds parameter/return must be type-assignable | +|[BindingReturnType](BindingReturnType.md.html) |@Binds/@Provides must have a return type | +|[BindingReceiverParameter](BindingReceiverParameter.md.html) |@Binds/@Provides functions cannot be extensions | +|[BindsWrongParameterCount](BindsWrongParameterCount.md.html) |@Binds must have one parameter | +|[BindsMustBeAbstract](BindsMustBeAbstract.md.html) |@Binds functions must be abstract | +|[RedundantBinds](RedundantBinds.md.html) |@Binds functions should return a different type | +|[MustBeInModule](MustBeInModule.md.html) |@Binds/@Provides functions must be in modules | +|[ProvidesMustNotBeAbstract](ProvidesMustNotBeAbstract.md.html) |@Provides functions cannot be abstract | +|[KotlinPairNotCreated](KotlinPairNotCreated.md.html) |Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons| +|[DoNotCallProviders](DoNotCallProviders.md.html) |Dagger provider methods should not be called directly by user code. | +|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | +|[InclusiveNaming](InclusiveNaming.md.html) |Use inclusive naming. | +|[DeprecatedCall](DeprecatedCall.md.html) |This class or method is deprecated; consider using an alternative. | +|[DeprecatedSqlUsage](DeprecatedSqlUsage.md.html) |Use SqlDelight! | +|[JavaOnlyDetector](JavaOnlyDetector.md.html) |Using @JavaOnly elements in Kotlin code. | +|[SerializableUsage](SerializableUsage.md.html) |Don't use Serializable. | +|[RawDispatchersUse](RawDispatchersUse.md.html) |Use SlackDispatchers. | +|[MainScopeUsage](MainScopeUsage.md.html) |Use slack.foundation.coroutines.android.MainScope. | +|[SubscribeOnMain](SubscribeOnMain.md.html) |subscribeOn called with the main thread scheduler. | +|[GuavaChecksUsed](GuavaChecksUsed.md.html) |Use Slack's JavaPreconditions instead of Guava's Preconditions checks | +|[GuavaPreconditionsUsedInKotlin](GuavaPreconditionsUsedInKotlin.md.html) |Kotlin precondition checks should use the Kotlin standard library checks | +|[DoNotMockAnything](DoNotMockAnything.md.html) |Do not add new mocks. | +|[DoNotMockPlatformTypes](DoNotMockPlatformTypes.md.html) |platform types should not be mocked | +|[DoNotMockDataClass](DoNotMockDataClass.md.html) |data classes represent pure data classes, so mocking them should not be necessary. | +|[DoNotMock](DoNotMock.md.html) | | +|[DoNotMockSealedClass](DoNotMockSealedClass.md.html) |sealed classes have a restricted type hierarchy, use a subtype instead | +|[DoNotMockAutoValue](DoNotMockAutoValue.md.html) |AutoValue classes represent pure data classes, so mocking them should not be necessary. | +|[DoNotMockObjectClass](DoNotMockObjectClass.md.html) |object classes are singletons, so mocking them should not be necessary | +|[DoNotMockRecordClass](DoNotMockRecordClass.md.html) |record classes represent pure data classes, so mocking them should not be necessary. | +|[ErrorProneDoNotMockUsage](ErrorProneDoNotMockUsage.md.html) |Use Slack's internal `@DoNotMock` annotation. | +|[MoshiUsageAdaptedByRequiresAdapter](MoshiUsageAdaptedByRequiresAdapter.md.html) |@AdaptedBy.adapter must be a JsonAdapter or JsonAdapter.Factory. | +|[MoshiUsageAdaptedByRequiresKeep](MoshiUsageAdaptedByRequiresKeep.md.html) |Adapters targeted by @AdaptedBy must have @Keep. | +|[MoshiUsageArray](MoshiUsageArray.md.html) |Prefer List over Array. | +|[MoshiUsageBlankGenerator](MoshiUsageBlankGenerator.md.html) |Don't use blank JsonClass.generator values. | +|[MoshiUsageBlankJsonName](MoshiUsageBlankJsonName.md.html) |Don't use blank names in `@Json`. | +|[MoshiUsageBlankTypeLabel](MoshiUsageBlankTypeLabel.md.html) |Moshi-sealed requires a type label specified after the 'sealed:' prefix. | +|[MoshiUsageDoubleClassAnnotation](MoshiUsageDoubleClassAnnotation.md.html) |Only use one of @AdaptedBy or @JsonClass. | +|[MoshiUsageDoubleTypeLabel](MoshiUsageDoubleTypeLabel.md.html) |Only use one of @TypeLabel or @DefaultObject. | +|[MoshiUsageDuplicateJsonName](MoshiUsageDuplicateJsonName.md.html) |Duplicate JSON names are errors as JSON does not allow duplicate keys in objects. | +|[MoshiUsageEnumAnnotatedUnknown](MoshiUsageEnumAnnotatedUnknown.md.html) |UNKNOWN members in @JsonClass-annotated enums should not be annotated with @Json | +|[MoshiUsageEnumCasing](MoshiUsageEnumCasing.md.html) |Consider using `@Json(name = ...)` rather than lower casing. | +|[MoshiUsageEnumJsonClassGenerated](MoshiUsageEnumJsonClassGenerated.md.html) |Enums annotated with @JsonClass must not set `generateAdapter` to true. | +|[MoshiUsageEnumMissingJsonClass](MoshiUsageEnumMissingJsonClass.md.html) |Enums serialized with Moshi should be annotated with @JsonClass. | +|[MoshiUsageEnumPropertyCouldBeMoshi](MoshiUsageEnumPropertyCouldBeMoshi.md.html) |Consider making enum properties also use Moshi. | +|[MoshiUsageEnumPropertyDefaultUnknown](MoshiUsageEnumPropertyDefaultUnknown.md.html) |Suspicious default value to 'UNKNOWN' for a Moshi enum. | +|[MoshiUsageEnumMissingUnknown](MoshiUsageEnumMissingUnknown.md.html) |Enums serialized with Moshi must reserve the first member as UNKNOWN. | +|[MoshiUsageGenerateAdapterShouldBeTrue](MoshiUsageGenerateAdapterShouldBeTrue.md.html)|JsonClass.generateAdapter must be true in order for Moshi code gen to run. | +|[MoshiUsageGenericSealedSubtype](MoshiUsageGenericSealedSubtype.md.html) |Sealed subtypes used with moshi-sealed cannot be generic. | +|[MoshiUsageInappropriateTypeLabel](MoshiUsageInappropriateTypeLabel.md.html) |Inappropriate @TypeLabel or @DefaultObject annotation. | +|[MoshiUsageRedundantSiteTarget](MoshiUsageRedundantSiteTarget.md.html) |Use of site-targets on @Json are redundant. | +|[MoshiUsageMissingPrimary](MoshiUsageMissingPrimary.md.html) |@JsonClass-annotated types must have a primary constructor or be sealed. | +|[MoshiUsageMissingTypeLabel](MoshiUsageMissingTypeLabel.md.html) |Sealed Moshi subtypes must be annotated with @TypeLabel or @DefaultObject. | +|[MoshiUsageMutableCollections](MoshiUsageMutableCollections.md.html) |Use immutable collections rather than mutable versions. | +|[MoshiUsageQualifierRetention](MoshiUsageQualifierRetention.md.html) |JsonQualifiers must have RUNTIME retention. | +|[MoshiUsageQualifierTarget](MoshiUsageQualifierTarget.md.html) |JsonQualifiers must include FIELD targeting. | +|[MoshiUsageNonMoshiClassCollection](MoshiUsageNonMoshiClassCollection.md.html) |Concrete Collection type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassExternal](MoshiUsageNonMoshiClassExternal.md.html) |External type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassInternal](MoshiUsageNonMoshiClassInternal.md.html) |Non-Moshi internal type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassMap](MoshiUsageNonMoshiClassMap.md.html) |Concrete Map type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageNonMoshiClassPlatform](MoshiUsageNonMoshiClassPlatform.md.html) |Platform type '%HINT%' is not natively supported by Moshi. | +|[MoshiUsageObject](MoshiUsageObject.md.html) |Object types cannot be annotated with @JsonClass. | +|[MoshiUsageParamNeedsInit](MoshiUsageParamNeedsInit.md.html) |Constructor non-property parameters in Moshi classes must have default values. | +|[MoshiUsagePrivateConstructor](MoshiUsagePrivateConstructor.md.html) |Constructors in Moshi classes cannot be private. | +|[MoshiUsagePrivateConstructorProperty](MoshiUsagePrivateConstructorProperty.md.html) |Constructor parameter properties in Moshi classes cannot be private. | +|[MoshiUsageRedundantJsonName](MoshiUsageRedundantJsonName.md.html) |Json.name with the same value as the property/enum member name is redundant. | +|[MoshiUsageSealedMustBeSealed](MoshiUsageSealedMustBeSealed.md.html) |Moshi-sealed can only be applied to 'sealed' types. | +|[MoshiUsageSerializedName](MoshiUsageSerializedName.md.html) |Use Moshi's @Json rather than Gson's @SerializedName. | +|[MoshiUsageSnakeCase](MoshiUsageSnakeCase.md.html) |Consider using `@Json(name = ...)` rather than direct snake casing. | +|[MoshiUsageTransientNeedsInit](MoshiUsageTransientNeedsInit.md.html) |Transient constructor properties must have default values. | +|[MoshiUsageUnsupportedType](MoshiUsageUnsupportedType.md.html) |This type cannot be annotated with @JsonClass. | +|[MoshiUsageUseData](MoshiUsageUseData.md.html) |Model classes should be immutable data classes. | +|[MoshiUsageVarProperty](MoshiUsageVarProperty.md.html) |Moshi properties should be immutable. | +|[MoshiUsageClassVisibility](MoshiUsageClassVisibility.md.html) |@JsonClass-annotated types must be public, package-private, or internal. | +|[FragmentConstructorInjection](FragmentConstructorInjection.md.html) |Fragment dependencies should be injected using constructor injections only. | +|[FragmentFieldInjection](FragmentFieldInjection.md.html) |Fragment dependencies should be injected using the Fragment's constructor. | +|[RedactedInJavaUsage](RedactedInJavaUsage.md.html) |@Redacted is only supported in Kotlin classes! | +|[InjectInJava](InjectInJava.md.html) |Only Kotlin classes should be injected in order for Anvil to work. | +|[RetrofitUsage](RetrofitUsage.md.html) |This is replaced by the caller. | +|[RestrictCallsTo](RestrictCallsTo.md.html) |Methods annotated with @RestrictedCallsTo should only be called from the specified scope. | +|[SpanMarkPointMissingMask](SpanMarkPointMissingMask.md.html) |Check that Span flags use the bitwise mask SPAN_POINT_MARK_MASK when being compared to. | +|[DoNotExposeEitherNetInRepositories](DoNotExposeEitherNetInRepositories.md.html) |Repository APIs should not expose EitherNet types directly. | +|[FullyQualifiedResource](FullyQualifiedResource.md.html) |Resources should use an import alias instead of being fully qualified. | +|[MissingResourceImportAlias](MissingResourceImportAlias.md.html) |Missing import alias for R class. | +|[WrongResourceImportAlias](WrongResourceImportAlias.md.html) |Wrong import alias for this R class. | +|[DenyListedApi](DenyListedApi.md.html) |Deny-listed API | +|[DenyListedBlockingApi](DenyListedBlockingApi.md.html) |Deny-listed API | +|[ParcelizeFunctionProperty](ParcelizeFunctionProperty.md.html) |Function type properties are not parcelable | +|[ExceptionMessage](ExceptionMessage.md.html) |Please provide a string for the `lazyMessage` parameter | +|[MustUseNamedParams](MustUseNamedParams.md.html) |Calls to @MustUseNamedParams-annotated methods must name all parameters. | (##) Including @@ -126,17 +126,17 @@ ``` // build.gradle.kts -lintChecks("com.slack.lint:slack-lint-checks:0.7.0") +lintChecks("com.slack.lint:slack-lint-checks:0.7.3") // build.gradle -lintChecks 'com.slack.lint:slack-lint-checks:0.7.0' +lintChecks 'com.slack.lint:slack-lint-checks:0.7.3' // build.gradle.kts with version catalogs: lintChecks(libs.slack-lint-checks) # libs.versions.toml [versions] -slack-lint-checks = "0.7.0" +slack-lint-checks = "0.7.3" [libraries] slack-lint-checks = { module = "com.slack.lint:slack-lint-checks", @@ -144,7 +144,7 @@ } ``` -0.7.0 is the version this documentation was generated from; +0.7.3 is the version this documentation was generated from; there may be newer versions available. (##) Changes @@ -210,6 +210,10 @@ * 0.5.1: Adds MustBeInModule. Removes BindsMustBeInModule. * 0.6.0: Adds ExceptionMessage. * 0.7.0: Adds DenyListedBlockingApi. +* 0.7.1: Adds MustUseNamedParams. Removes + InjectWithScopeRequiredLoggedInUserProvider, + InjectWithTypeMustImplementAnvilInjectable. +* 0.7.2: Adds DoNotMockAnything. (##) Version Compatibility @@ -217,6 +221,9 @@ | Version | Date | Issues | Compatible | Compiled | Requires | |-------------------:|----------|-------:|------------|--------------:|---------:| +| 0.7.3|2024/05/03| 91| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.7.2|2024/05/02| 91| Yes| 8.0 and 8.1|8.0 and 8.1| +| 0.7.1|2024/03/27| 90| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.7.0|2023/10/27| 91| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.6.1|2023/10/09| 90| Yes| 8.0 and 8.1|8.0 and 8.1| | 0.6.0|2023/09/26| 90| Yes| 8.0 and 8.1|8.0 and 8.1| diff --git a/docs/checks/index.md.html b/docs/checks/index.md.html index bd29e356..d3c4efdb 100644 --- a/docs/checks/index.md.html +++ b/docs/checks/index.md.html @@ -42,11 +42,11 @@ - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - [BinaryOperationInTimber: Use String#format()](BinaryOperationInTimber.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) - - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) - - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) - - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) - - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extensions](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides must have a return type](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds parameter/return must be type-assignable](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds must have one parameter](BindsWrongParameterCount.md.html) - [BlockedPrivateApi: Using Blocked Private API](BlockedPrivateApi.md.html) - [BomWithoutPlatform: Using a BOM without platform call](BomWithoutPlatform.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) @@ -71,10 +71,12 @@ - [ComposableLambdaParameterPosition: Non-trailing primary composable lambda parameter](ComposableLambdaParameterPosition.md.html) - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeComposableModifier: Don't use @Composable builder functions for modifiers](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalGetter: CompositionLocals should not use getters](ComposeCompositionLocalGetter.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierComposed: Don't use Modifier.composed {}](ComposeModifierComposed.md.html) - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) @@ -87,7 +89,8 @@ - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeUnstableReceiver: Unstable receivers will always be recomposed](ComposeUnstableReceiver.md.html) + - [ComposeViewModelForwarding: Don't forward ViewModels through composables](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) @@ -128,6 +131,7 @@ - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAnything: Do not add new mocks.](DoNotMockAnything.md.html) - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) @@ -155,7 +159,7 @@ - [ErroneousLayoutAttribute: Layout attribute that's not applicable to a particular view.](ErroneousLayoutAttribute.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) + - [ExceptionMessage: Please provide a string for the `lazyMessage` parameter](ExceptionMessage.md.html) - [ExifInterface: Using `android.media.ExifInterface`](ExifInterface.md.html) - [ExpensiveAssertion: Expensive Assertions](ExpensiveAssertion.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) @@ -179,8 +183,8 @@ - [FragmentBackPressedCallback: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance.](FragmentBackPressedCallback.md.html) - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing:1.7.0-alpha09) - - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing-manifest:1.7.0-alpha09) + - [FragmentGradleConfiguration: Include the fragment-testing library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing:1.8.0-beta01) + - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) (from androidx.fragment:fragment-testing-manifest:1.8.0-beta01) - [FragmentLiveDataObserve: Use getViewLifecycleOwner() as the LifecycleOwner instead of a Fragment instance when observing a LiveData object.](FragmentLiveDataObserve.md.html) - [FragmentTagUsage: Use FragmentContainerView instead of the tag](FragmentTagUsage.md.html) - [FrequentlyChangedStateReadInComposition: Frequently changing state should not be directly read in composable function](FrequentlyChangedStateReadInComposition.md.html) @@ -234,8 +238,8 @@ - [ImpliedTouchscreenHardware: Touchscreen not optional](ImpliedTouchscreenHardware.md.html) - [InOrMmUsage: Using `mm` or `in` dimensions](InOrMmUsage.md.html) - [IncludeLayoutParam: Ignored layout params on include](IncludeLayoutParam.md.html) - - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.0) - - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.0) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.3) + - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) (from com.slack.lint:slack-lint-checks:0.7.3) - [IncompatibleMediaBrowserServiceCompatVersion: Obsolete version of MediaBrowserServiceCompat](IncompatibleMediaBrowserServiceCompatVersion.md.html) - [InconsistentArrays: Inconsistencies in array element counts](InconsistentArrays.md.html) - [InconsistentLayout: Inconsistent Layouts](InconsistentLayout.md.html) @@ -245,8 +249,6 @@ - [InefficientWeight: Inefficient layout weight](InefficientWeight.md.html) - [InflateParams: Layout Inflation without a Parent](InflateParams.md.html) - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) - - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) - - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InlinedApi: Using inlined constants on older versions](InlinedApi.md.html) - [InnerclassSeparator: Inner classes should use `$` rather than `.`](InnerclassSeparator.md.html) - [InsecureBaseConfiguration: Insecure Base Configuration](InsecureBaseConfiguration.md.html) @@ -264,6 +266,7 @@ - [InvalidId: Invalid ID declaration](InvalidId.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) - [InvalidImport: Flags invalid imports.](InvalidImport.md.html) + - [InvalidLanguageTagDelimiter: Undercore (_) is an unsupported delimiter for subtags](InvalidLanguageTagDelimiter.md.html) - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - [InvalidPeriodicWorkRequestInterval: Invalid interval duration](InvalidPeriodicWorkRequestInterval.md.html) @@ -273,6 +276,7 @@ a value for `size` in the scrolling direction.](InvalidSetHasFixedSize.md.html) - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [InvalidUseOfOnBackPressed: Do not call onBackPressed() within OnBackPressedDisptacher](InvalidUseOfOnBackPressed.md.html) - [InvalidUsesTagAttribute: Invalid `name` attribute for `uses` element](InvalidUsesTagAttribute.md.html) - [InvalidVectorPath: Invalid vector paths](InvalidVectorPath.md.html) - [InvalidWakeLockTag: Invalid Wake Lock Tag](InvalidWakeLockTag.md.html) @@ -411,7 +415,8 @@ - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [MultipleUsesSdk: Multiple `` elements in the manifest](MultipleUsesSdk.md.html) - - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) + - [MustBeInModule: @Binds/@Provides functions must be in modules](MustBeInModule.md.html) + - [MustUseNamedParams: Calls to @MustUseNamedParams-annotated methods must name all parameters.](MustUseNamedParams.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [MutatingSharedPrefs: Mutating an Immutable SharedPrefs Set](MutatingSharedPrefs.md.html) @@ -437,7 +442,8 @@ - [NotificationPermission: Notifications Without Permission](NotificationPermission.md.html) - [NotificationTrampoline: Notification Trampolines](NotificationTrampoline.md.html) - [NotifyDataSetChanged: Invalidating All RecyclerView Data](NotifyDataSetChanged.md.html) - - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) (from androidx.lifecycle:lifecycle-livedata-core:2.8.0) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) (from androidx.lifecycle:lifecycle-livedata-core-ktx:2.8.0-alpha01) - [ObjectAnimatorBinding: Incorrect ObjectAnimator Property](ObjectAnimatorBinding.md.html) - [ObsoleteLayoutParam: Obsolete layout params](ObsoleteLayoutParam.md.html) - [ObsoleteSdkInt: Obsolete SDK_INT Version Check](ObsoleteSdkInt.md.html) @@ -452,11 +458,12 @@ - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) - - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ParcelizeFunctionProperty: Function type properties are not parcelable](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) + - [PictureInPictureIssue: Picture In Picture best practices not followed](PictureInPictureIssue.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) @@ -468,10 +475,17 @@ - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) - [PropertyEscape: Incorrect property escapes](PropertyEscape.md.html) - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) - - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout-expression:1.1.0-rc01) - - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout:1.1.0-rc01) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout:1.2.0-alpha03) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) (from androidx.wear.protolayout:protolayout:1.2.0-alpha03) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout-expression:1.2.0-alpha03) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout-material:1.2.0-alpha03) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) (from androidx.wear.protolayout:protolayout:1.2.0-alpha03) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract](ProvidesMustNotBeAbstract.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) - [PxUsage: Using 'px' dimension](PxUsage.md.html) @@ -484,7 +498,7 @@ - [Recycle: Missing `recycle()` calls](Recycle.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) + - [RedundantBinds: @Binds functions should return a different type](RedundantBinds.md.html) - [RedundantLabel: Redundant label on activity](RedundantLabel.md.html) - [RedundantNamespace: Redundant namespace](RedundantNamespace.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) @@ -494,7 +508,8 @@ - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) - [RemoveWorkManagerInitializer: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.](RemoveWorkManagerInitializer.md.html) - - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) (from androidx.lifecycle:lifecycle-runtime-android:2.8.0) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) (from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01) - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - [RequiresFeature: Requires Feature](RequiresFeature.md.html) @@ -548,6 +563,7 @@ - [ShouldUseStaticImport: Flags declarations that should be statically imported.](ShouldUseStaticImport.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) + - [SimilarGradleDependency: Multiple Versions Gradle Dependency](SimilarGradleDependency.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - [Slices: Slices](Slices.md.html) - [SmallSp: Text size is too small](SmallSp.md.html) @@ -580,6 +596,7 @@ - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousImport: '`import android.R`' statement](SuspiciousImport.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [SuspiciousModifierThen: Using Modifier.then with a Modifier factory function with an implicit receiver](SuspiciousModifierThen.md.html) - [SwitchIntDef: Missing @IntDef in Switch](SwitchIntDef.md.html) - [SyntheticAccessor: Synthetic Accessor](SyntheticAccessor.md.html) - [SystemPermissionTypo: Permission appears to be a standard permission with a typo](SystemPermissionTypo.md.html) @@ -608,6 +625,7 @@ - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) + - [UnclosedTrace: Incorrect trace section usage](UnclosedTrace.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - [UnknownId: Reference to an unknown id](UnknownId.md.html) @@ -623,7 +641,8 @@ - [UnsafeDynamicallyLoadedCode: `load` used to dynamically load code](UnsafeDynamicallyLoadedCode.md.html) - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) - [UnsafeIntentLaunch: Launched Unsafe Intent](UnsafeIntentLaunch.md.html) - - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) (from androidx.lifecycle:lifecycle-runtime-android:2.8.0) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) (from androidx.lifecycle:lifecycle-runtime-ktx:2.8.0-alpha01) - [UnsafeNativeCodeLocation: Native code outside library directory](UnsafeNativeCodeLocation.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) diff --git a/docs/checks/libraries.md.html b/docs/checks/libraries.md.html index a8bac4b2..1ad59c00 100644 --- a/docs/checks/libraries.md.html +++ b/docs/checks/libraries.md.html @@ -11,14 +11,15 @@ * [com.vanniktech:lint-rules-kotlin](com_vanniktech_lint-rules-kotlin.md.html) (1 checks) * [com.vanniktech:lint-rules-android](com_vanniktech_lint-rules-android.md.html) (41 checks) * [com.slack.lint:slack-lint-checks](com_slack_lint_slack-lint-checks.md.html) (91 checks) -* [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) (18 checks) +* [com.slack.lint.compose:compose-lint-checks](com_slack_lint_compose_compose-lint-checks.md.html) (21 checks) Android archive libraries which also contain bundled lint checks: * [androidx.activity:activity-compose](androidx_activity_activity-compose.md.html) (2 checks) -* [androidx.activity:activity](androidx_activity_activity.md.html) (1 checks) +* [androidx.activity:activity](androidx_activity_activity.md.html) (2 checks) * [androidx.compose.ui:ui-test-manifest](androidx_compose_ui_ui-test-manifest.md.html) (1 checks) -* [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) (9 checks) +* [androidx.compose.ui:ui-android](androidx_compose_ui_ui-android.md.html) (10 checks) +* [androidx.compose.ui:ui-text-android](androidx_compose_ui_ui-text-android.md.html) (1 checks) * [androidx.compose.ui:ui-graphics-android](androidx_compose_ui_ui-graphics-android.md.html) (2 checks) * [androidx.compose.runtime:runtime-saveable-android](androidx_compose_runtime_runtime-saveable-android.md.html) (1 checks) * [androidx.compose.runtime:runtime-android](androidx_compose_runtime_runtime-android.md.html) (14 checks) @@ -27,7 +28,9 @@ * [androidx.compose.foundation:foundation-android](androidx_compose_foundation_foundation-android.md.html) (4 checks) * [androidx.compose.material3:material3-android](androidx_compose_material3_material3-android.md.html) (2 checks) * [androidx.compose.material:material-android](androidx_compose_material_material-android.md.html) (2 checks) +* [androidx.lifecycle:lifecycle-livedata-core](androidx_lifecycle_lifecycle-livedata-core.md.html) (1 checks) * [androidx.lifecycle:lifecycle-livedata-core-ktx](androidx_lifecycle_lifecycle-livedata-core-ktx.md.html) (1 checks) +* [androidx.lifecycle:lifecycle-runtime-android](androidx_lifecycle_lifecycle-runtime-android.md.html) (2 checks) * [androidx.lifecycle:lifecycle-runtime-testing](androidx_lifecycle_lifecycle-runtime-testing.md.html) (1 checks) * [androidx.lifecycle:lifecycle-runtime-ktx](androidx_lifecycle_lifecycle-runtime-ktx.md.html) (2 checks) * [androidx.navigation:navigation-compose](androidx_navigation_navigation-compose.md.html) (3 checks) @@ -41,8 +44,9 @@ * [androidx.work:work-runtime](androidx_work_work-runtime.md.html) (9 checks) * [androidx.appcompat:appcompat](androidx_appcompat_appcompat.md.html) (10 checks) * [androidx.startup:startup-runtime](androidx_startup_startup-runtime.md.html) (2 checks) -* [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) (1 checks) -* [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) (1 checks) +* [androidx.wear.protolayout:protolayout-expression](androidx_wear_protolayout_protolayout-expression.md.html) (3 checks) +* [androidx.wear.protolayout:protolayout-material](androidx_wear_protolayout_protolayout-material.md.html) (3 checks) +* [androidx.wear.protolayout:protolayout](androidx_wear_protolayout_protolayout.md.html) (3 checks) * [androidx.constraintlayout:constraintlayout-compose](androidx_constraintlayout_constraintlayout-compose.md.html) (3 checks) * [com.jakewharton.timber:timber](com_jakewharton_timber_timber.md.html) (8 checks) diff --git a/docs/checks/severity.md.html b/docs/checks/severity.md.html index 2dfa4985..2165e1ad 100644 --- a/docs/checks/severity.md.html +++ b/docs/checks/severity.md.html @@ -3,7 +3,7 @@ Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | By severity | [By year](year.md.html) | [Libraries](libraries.md.html) -* Fatal (53) +* Fatal (54) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) @@ -37,6 +37,7 @@ - [NfcTechWhitespace: Whitespace in NFC tech lists](NfcTechWhitespace.md.html) - [NotSibling: Invalid Constraints](NotSibling.md.html) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - [PackagedPrivateKey: Packaged private key](PackagedPrivateKey.md.html) - [Proguard: Using obsolete ProGuard configuration](Proguard.md.html) - [ReferenceType: Incorrect reference types](ReferenceType.md.html) @@ -60,7 +61,7 @@ - [WrongFolder: Resource file in the wrong `res` folder](WrongFolder.md.html) - [WrongManifestParent: Wrong manifest parent](WrongManifestParent.md.html) -* Error (280) +* Error (287) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) - [AppCompatCustomView: Appcompat Custom Widgets](AppCompatCustomView.md.html) @@ -70,20 +71,22 @@ - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) - - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) - - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) - - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) - - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) - - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extensions](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides must have a return type](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds parameter/return must be type-assignable](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds must have one parameter](BindsWrongParameterCount.md.html) - [BottomAppBar: BottomAppBar Problems](BottomAppBar.md.html) - [ByteOrderMark: Byte order mark inside files](ByteOrderMark.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeComposableModifier: Don't use @Composable builder functions for modifiers](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalGetter: CompositionLocals should not use getters](ComposeCompositionLocalGetter.md.html) - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierComposed: Don't use Modifier.composed {}](ComposeModifierComposed.md.html) - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) @@ -95,7 +98,7 @@ - [ComposePreviewNaming: Preview annotations require certain suffixes](ComposePreviewNaming.md.html) - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) - - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeViewModelForwarding: Don't forward ViewModels through composables](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - [ConflictingOnColor: Background colors with the same value should have the same 'on' color](ConflictingOnColor.md.html) - [CoroutineCreationDuringComposition: Calls to `async` or `launch` should happen inside a LaunchedEffect and not composition](CoroutineCreationDuringComposition.md.html) @@ -108,6 +111,7 @@ - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAnything: Do not add new mocks.](DoNotMockAnything.md.html) - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) @@ -120,7 +124,7 @@ - [EmptyNavDeepLink: NavDeepLink must define an uri, action, and/or mimetype to be valid.](EmptyNavDeepLink.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - [ExactAlarm: Invalid Usage of Exact Alarms](ExactAlarm.md.html) - - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) + - [ExceptionMessage: Please provide a string for the `lazyMessage` parameter](ExceptionMessage.md.html) - [ExperimentalAnnotationRetention: Experimental annotation with incorrect retention](ExperimentalAnnotationRetention.md.html) - [ExtraText: Extraneous text in resource files](ExtraText.md.html) - [FlowOperatorInvokedInComposition: Flow operator functions should not be invoked within composition](FlowOperatorInvokedInComposition.md.html) @@ -151,10 +155,9 @@ - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [IncorrectReferencesDeclaration: `createRefsFor(vararg ids: Any)` should have at least one argument and match assigned variables](IncorrectReferencesDeclaration.md.html) - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) - - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) - - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InvalidAnalyticsName: Invalid Analytics Name](InvalidAnalyticsName.md.html) - [InvalidImeActionId: Invalid imeActionId declaration](InvalidImeActionId.md.html) + - [InvalidLanguageTagDelimiter: Undercore (_) is an unsupported delimiter for subtags](InvalidLanguageTagDelimiter.md.html) - [InvalidPackage: Package not included in Android](InvalidPackage.md.html) - [InvalidPermission: Invalid Permission Attribute](InvalidPermission.md.html) - [InvalidResourceFolder: Invalid Resource Folder](InvalidResourceFolder.md.html) @@ -233,7 +236,8 @@ - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) + - [MustBeInModule: @Binds/@Provides functions must be in modules](MustBeInModule.md.html) + - [MustUseNamedParams: Calls to @MustUseNamedParams-annotated methods must name all parameters.](MustUseNamedParams.md.html) - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [NewApi: Calling new methods on older versions](NewApi.md.html) - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) @@ -247,7 +251,7 @@ - [Orientation: Missing explicit orientation](Orientation.md.html) - [OverrideAbstract: Not overriding abstract methods on older platforms](OverrideAbstract.md.html) - [ParcelCreator: Missing Parcelable `CREATOR` field](ParcelCreator.md.html) - - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ParcelizeFunctionProperty: Function type properties are not parcelable](ParcelizeFunctionProperty.md.html) - [PendingBindings: Missing Pending Bindings](PendingBindings.md.html) - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) @@ -257,17 +261,19 @@ - [ProtectedPermissions: Using system app permission](ProtectedPermissions.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract](ProvidesMustNotBeAbstract.md.html) - [QueryAllPackagesPermission: Using the QUERY_ALL_PACKAGES permission](QueryAllPackagesPermission.md.html) - [Range: Outside Range](Range.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RecyclerView: RecyclerView Problems](RecyclerView.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) + - [RedundantBinds: @Binds functions should return a different type](RedundantBinds.md.html) - [RememberReturnType: `remember` calls must not return `Unit`](RememberReturnType.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RemoteViewLayout: Unsupported View in RemoteView](RemoteViewLayout.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [RequiredSize: Missing `layout_width` or `layout_height` attributes](RequiredSize.md.html) - [ReservedSystemPermission: Permission name is a reserved Android permission](ReservedSystemPermission.md.html) - [ResourceAsColor: Should pass resolved color instead of resource id](ResourceAsColor.md.html) @@ -295,6 +301,7 @@ - [Suspicious0dp: Suspicious 0dp dimension](Suspicious0dp.md.html) - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) - [SuspiciousIndentation: Suspicious indentation](SuspiciousIndentation.md.html) + - [SuspiciousModifierThen: Using Modifier.then with a Modifier factory function with an implicit receiver](SuspiciousModifierThen.md.html) - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) - [TilePreviewImageFormat: Tile preview is not compliant with standards](TilePreviewImageFormat.md.html) - [TimberArgCount: Formatting argument types incomplete or inconsistent](TimberArgCount.md.html) @@ -307,6 +314,7 @@ - [UnrememberedMutableState: Creating a state object during composition without using `remember`](UnrememberedMutableState.md.html) - [UnsafeImplicitIntentLaunch: Implicit intent matches an internal non-exported component](UnsafeImplicitIntentLaunch.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeRepeatOnLifecycleDetector: RepeatOnLifecycle should be used with viewLifecycleOwner in Fragments.](UnsafeRepeatOnLifecycleDetector.md.html) - [UnspecifiedRegisterReceiverFlag: Missing `registerReceiver()` exported flag](UnspecifiedRegisterReceiverFlag.md.html) @@ -343,7 +351,7 @@ - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) -* Warning (388) +* Warning (398) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) @@ -391,6 +399,7 @@ - [ComposableNaming: Incorrect naming for @Composable functions](ComposableNaming.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) + - [ComposeUnstableReceiver: Unstable receivers will always be recomposed](ComposeUnstableReceiver.md.html) - [CompositionLocalNaming: CompositionLocal properties should be prefixed with `Local`](CompositionLocalNaming.md.html) - [ConstantLocale: Constant Locale](ConstantLocale.md.html) - [ConstraintLayoutToolsEditorAttribute: Flags tools:layout_editor xml properties.](ConstraintLayoutToolsEditorAttribute.md.html) @@ -496,6 +505,7 @@ - [InvalidNavigation: No start destination specified](InvalidNavigation.md.html) - [InvalidSingleLineComment: Marks single line comments that are not sentences.](InvalidSingleLineComment.md.html) - [InvalidString: Marks invalid translation strings.](InvalidString.md.html) + - [InvalidUseOfOnBackPressed: Do not call onBackPressed() within OnBackPressedDisptacher](InvalidUseOfOnBackPressed.md.html) - [JCenter: Marks usage of the jcenter() repository.](JCenter.md.html) - [JavaPluginLanguageLevel: No Explicit Java Language Level Given](JavaPluginLanguageLevel.md.html) - [JcenterRepositoryObsolete: JCenter Maven repository is read-only](JcenterRepositoryObsolete.md.html) @@ -571,11 +581,18 @@ - [ParcelClassLoader: Default Parcel Class Loader](ParcelClassLoader.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) + - [PictureInPictureIssue: Picture In Picture best practices not followed](PictureInPictureIssue.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) - [PluralsCandidate: Potential Plurals](PluralsCandidate.md.html) - [PrivateApi: Using Private APIs](PrivateApi.md.html) - [PrivateResource: Using private resources](PrivateResource.md.html) - [ProguardSplit: Proguard.cfg file contains generic Android rules](ProguardSplit.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) - [ProviderReadPermissionOnly: Provider with readPermission only and implemented write APIs](ProviderReadPermissionOnly.md.html) - [ProxyPassword: Proxy Password in Cleartext](ProxyPassword.md.html) - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) @@ -661,6 +678,7 @@ - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) + - [UnclosedTrace: Incorrect trace section usage](UnclosedTrace.md.html) - [UnknownIdInLayout: Reference to an id that is not in the current layout](UnknownIdInLayout.md.html) - [UnknownNullness: Unknown nullness](UnknownNullness.md.html) - [UnlocalizedSms: SMS phone number missing country code](UnlocalizedSms.md.html) @@ -734,7 +752,7 @@ - [WrongViewIdFormat: Flag view ids that are not in lowerCamelCase Format.](WrongViewIdFormat.md.html) - [XmlSpacing: XML files should not contain any new lines.](XmlSpacing.md.html) -* Information (8) +* Information (9) - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) @@ -744,8 +762,9 @@ - [MoshiUsageNonMoshiClassInternal: Non-Moshi internal type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassInternal.md.html) - [MoshiUsageNonMoshiClassMap: Concrete Map type '%HINT%' is not natively supported by Moshi.](MoshiUsageNonMoshiClassMap.md.html) - [ReportShortcutUsage: Report shortcut usage](ReportShortcutUsage.md.html) + - [SimilarGradleDependency: Multiple Versions Gradle Dependency](SimilarGradleDependency.md.html) -* Disabled By Default (42) +* Disabled By Default (43) - [AppCompatMethod](AppCompatMethod.md.html) - [AppLinksAutoVerify](AppLinksAutoVerify.md.html) @@ -756,6 +775,7 @@ - [ConvertToWebp](ConvertToWebp.md.html) - [DalvikOverride](DalvikOverride.md.html) - [DefaultEncoding](DefaultEncoding.md.html) + - [DoNotMockAnything](DoNotMockAnything.md.html) - [DuplicateStrings](DuplicateStrings.md.html) - [EasterEgg](EasterEgg.md.html) - [ExpensiveAssertion](ExpensiveAssertion.md.html) diff --git a/docs/checks/vendors.md.html b/docs/checks/vendors.md.html index f42c94ea..52752edf 100644 --- a/docs/checks/vendors.md.html +++ b/docs/checks/vendors.md.html @@ -3,7 +3,7 @@ Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | By vendor | [By severity](severity.md.html) | [By year](year.md.html) | [Libraries](libraries.md.html) -* Built In (464) +* Built In (467) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AcceptsUserCertificates: Allowing User Certificates](AcceptsUserCertificates.md.html) @@ -284,6 +284,7 @@ - [PermissionImpliesUnsupportedChromeOsHardware: Permission Implies Unsupported Chrome OS Hardware](PermissionImpliesUnsupportedChromeOsHardware.md.html) - [PermissionImpliesUnsupportedHardware: Permission Implies Unsupported Hardware](PermissionImpliesUnsupportedHardware.md.html) - [PermissionNamingConvention: Permission name does not follow recommended convention](PermissionNamingConvention.md.html) + - [PictureInPictureIssue: Picture In Picture best practices not followed](PictureInPictureIssue.md.html) - [PinSetExpiry: Validate `` expiration attribute](PinSetExpiry.md.html) - [PlaySdkIndexGenericIssues: Library has issues in SDK Index](PlaySdkIndexGenericIssues.md.html) - [PlaySdkIndexNonCompliant: Library has policy issues in SDK Index](PlaySdkIndexNonCompliant.md.html) @@ -347,6 +348,7 @@ - [ShortAlarm: Short or Frequent Alarm](ShortAlarm.md.html) - [ShowToast: Toast created but not shown](ShowToast.md.html) - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) + - [SimilarGradleDependency: Multiple Versions Gradle Dependency](SimilarGradleDependency.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - [Slices: Slices](Slices.md.html) - [SmallSp: Text size is too small](SmallSp.md.html) @@ -388,6 +390,7 @@ - [TypographyQuotes: Straight quotes can be replaced with curvy quotes, and apostrophes with typographic apostrophes.](TypographyQuotes.md.html) - [Typos: Spelling error](Typos.md.html) - [UastImplementation: Avoid using UAST implementation](UastImplementation.md.html) + - [UnclosedTrace: Incorrect trace section usage](UnclosedTrace.md.html) - [UniqueConstants: Overlapping Enumeration Constants](UniqueConstants.md.html) - [UniquePermission: Permission names are not unique](UniquePermission.md.html) - [UnknownId: Reference to an unknown id](UnknownId.md.html) @@ -470,9 +473,10 @@ - [WrongViewCast: Mismatched view type](WrongViewCast.md.html) - [XmlEscapeNeeded: Missing XML Escape](XmlEscapeNeeded.md.html) -* Android Open Source Project (androidx.activity) (1) +* Android Open Source Project (androidx.activity) (2) - [InvalidFragmentVersionForActivityResult: Update to Fragment 1.3.0 to use ActivityResult APIs](InvalidFragmentVersionForActivityResult.md.html) + - [InvalidUseOfOnBackPressed: Do not call onBackPressed() within OnBackPressedDisptacher](InvalidUseOfOnBackPressed.md.html) * Android Open Source Project (androidx.annotation.experimental) (4) @@ -524,12 +528,15 @@ - [FragmentGradleConfiguration: Include the fragment-testing-manifest library using the debugImplementation configuration.](FragmentGradleConfiguration.md.html) -* Android Open Source Project (androidx.lifecycle) (4) +* Android Open Source Project (androidx.lifecycle) (7) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [TestLifecycleOwnerInCoroutine: Use the suspending function setCurrentState(), rather than directly accessing the currentState property.](TestLifecycleOwnerInCoroutine.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) * Android Open Source Project (androidx.navigation.common) (1) @@ -549,10 +556,17 @@ - [EnsureInitializerMetadata: Every Initializer needs to be accompanied by a corresponding entry in the AndroidManifest.xml file.](EnsureInitializerMetadata.md.html) - [EnsureInitializerNoArgConstr: Missing Initializer no-arg constructor](EnsureInitializerNoArgConstr.md.html) -* Android Open Source Project (androidx.wear.protolayout) (2) +* Android Open Source Project (androidx.wear.protolayout) (9) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) * Android Open Source Project (androidx.work) (9) @@ -638,7 +652,7 @@ - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) -* Jetpack Compose (androidx.compose.ui) (9) +* Jetpack Compose (androidx.compose.ui) (10) - [ModifierFactoryExtensionFunction: Modifier factory functions should be extensions on Modifier](ModifierFactoryExtensionFunction.md.html) - [ModifierFactoryReturnType: Modifier factory functions should return Modifier](ModifierFactoryReturnType.md.html) @@ -648,6 +662,7 @@ - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) - [ReturnFromAwaitPointerEventScope: Returning from awaitPointerEventScope may cause some input events to be dropped](ReturnFromAwaitPointerEventScope.md.html) - [SuspiciousCompositionLocalModifierRead: CompositionLocals should not be read in Modifier.onAttach() or Modifier.onDetach()](SuspiciousCompositionLocalModifierRead.md.html) + - [SuspiciousModifierThen: Using Modifier.then with a Modifier factory function with an implicit receiver](SuspiciousModifierThen.md.html) - [UnnecessaryComposedModifier: Modifier.composed should only be used for modifiers that invoke @Composable functions](UnnecessaryComposedModifier.md.html) * Jetpack Compose (androidx.compose.ui.graphics) (2) @@ -655,18 +670,24 @@ - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) - [MissingColorAlphaChannel: Missing Color alpha channel](MissingColorAlphaChannel.md.html) +* Jetpack Compose (androidx.compose.ui.text) (1) + + - [InvalidLanguageTagDelimiter: Undercore (_) is an unsupported delimiter for subtags](InvalidLanguageTagDelimiter.md.html) + * Jetpack Navigation Compose (androidx.navigation.compose) (3) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) - [ComposableNavGraphInComposeScope: Building navigation graph in compose scope](ComposableNavGraphInComposeScope.md.html) - [UnrememberedGetBackStackEntry: Calling getBackStackEntry during composition without using `remember`with a NavBackStackEntry key](UnrememberedGetBackStackEntry.md.html) -* slack (com.slack.lint.compose:compose-lints) (18) +* slack (com.slack.lint.compose:compose-lints) (21) - - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeComposableModifier: Don't use @Composable builder functions for modifiers](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalGetter: CompositionLocals should not use getters](ComposeCompositionLocalGetter.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) - [ComposeM2Api: Using a Compose M2 API is not recommended](ComposeM2Api.md.html) + - [ComposeModifierComposed: Don't use Modifier.composed {}](ComposeModifierComposed.md.html) - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) @@ -679,17 +700,18 @@ - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeUnstableReceiver: Unstable receivers will always be recomposed](ComposeUnstableReceiver.md.html) + - [ComposeViewModelForwarding: Don't forward ViewModels through composables](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) * slack (slack-lint) (91) - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) - - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) - - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) - - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) - - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extensions](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides must have a return type](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds parameter/return must be type-assignable](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds must have one parameter](BindsWrongParameterCount.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [DenyListedApi: Deny-listed API](DenyListedApi.md.html) - [DenyListedBlockingApi: Deny-listed API](DenyListedBlockingApi.md.html) @@ -698,6 +720,7 @@ - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotExposeEitherNetInRepositories: Repository APIs should not expose EitherNet types directly.](DoNotExposeEitherNetInRepositories.md.html) - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAnything: Do not add new mocks.](DoNotMockAnything.md.html) - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) @@ -705,7 +728,7 @@ - [DoNotMockRecordClass: record classes represent pure data classes, so mocking them should not be necessary.](DoNotMockRecordClass.md.html) - [DoNotMockSealedClass: sealed classes have a restricted type hierarchy, use a subtype instead](DoNotMockSealedClass.md.html) - [ErrorProneDoNotMockUsage: Use Slack's internal `@DoNotMock` annotation.](ErrorProneDoNotMockUsage.md.html) - - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) + - [ExceptionMessage: Please provide a string for the `lazyMessage` parameter](ExceptionMessage.md.html) - [FragmentConstructorInjection: Fragment dependencies should be injected using constructor injections only.](FragmentConstructorInjection.md.html) - [FragmentFieldInjection: Fragment dependencies should be injected using the Fragment's constructor.](FragmentFieldInjection.md.html) - [FullyQualifiedResource: Resources should use an import alias instead of being fully qualified.](FullyQualifiedResource.md.html) @@ -714,8 +737,6 @@ - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) - - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) - - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [JavaOnlyDetector: Using @JavaOnly elements in Kotlin code.](JavaOnlyDetector.md.html) - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) - [MainScopeUsage: Use slack.foundation.coroutines.android.MainScope.](MainScopeUsage.md.html) @@ -763,12 +784,13 @@ - [MoshiUsageUnsupportedType: This type cannot be annotated with @JsonClass.](MoshiUsageUnsupportedType.md.html) - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) - - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) - - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [MustBeInModule: @Binds/@Provides functions must be in modules](MustBeInModule.md.html) + - [MustUseNamedParams: Calls to @MustUseNamedParams-annotated methods must name all parameters.](MustUseNamedParams.md.html) + - [ParcelizeFunctionProperty: Function type properties are not parcelable](ParcelizeFunctionProperty.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract](ProvidesMustNotBeAbstract.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) + - [RedundantBinds: @Binds functions should return a different type](RedundantBinds.md.html) - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) diff --git a/docs/checks/year.md.html b/docs/checks/year.md.html index f9c1e533..7efc4e7e 100644 --- a/docs/checks/year.md.html +++ b/docs/checks/year.md.html @@ -3,18 +3,30 @@ Order: [Alphabetical](index.md.html) | [By category](categories.md.html) | [By vendor](vendors.md.html) | [By severity](severity.md.html) | By year | [Libraries](libraries.md.html) -* 2024 (1) +* 2024 (11) - [BuildListAdds: Missing `add` call in `buildList`](BuildListAdds.md.html) - -* 2023 (45) + - [InvalidLanguageTagDelimiter: Undercore (_) is an unsupported delimiter for subtags](InvalidLanguageTagDelimiter.md.html) + - [InvalidUseOfOnBackPressed: Do not call onBackPressed() within OnBackPressedDisptacher](InvalidUseOfOnBackPressed.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutEdgeContentLayoutResponsive: ProtoLayout Material EdgeContentLayout should be used with responsivebehaviour to ensure the best behaviour across different screen sizes andlocales.](ProtoLayoutEdgeContentLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [ProtoLayoutPrimaryLayoutResponsive: ProtoLayout Material PrimaryLayout should be used with responsive behaviourto ensure the best behaviour across different screen sizes and locales.](ProtoLayoutPrimaryLayoutResponsive.md.html) + - [SuspiciousModifierThen: Using Modifier.then with a Modifier factory function with an implicit receiver](SuspiciousModifierThen.md.html) + - [UnclosedTrace: Incorrect trace section usage](UnclosedTrace.md.html) + +* 2023 (50) - [ArcAnimationSpecTypeIssue: ArcAnimationSpec is designed for 2D values. Particularly, for positional values such as Offset.](ArcAnimationSpecTypeIssue.md.html) - [AutoboxingStateCreation: `State` will autobox values assigned to this state. Use a specialized state type instead.](AutoboxingStateCreation.md.html) - [AutoboxingStateValueProperty: State access causes value to be autoboxed](AutoboxingStateValueProperty.md.html) - - [ComposeComposableModifier: Using @Composable builder functions for modifiers is not recommended](ComposeComposableModifier.md.html) + - [ComposeComposableModifier: Don't use @Composable builder functions for modifiers](ComposeComposableModifier.md.html) + - [ComposeCompositionLocalGetter: CompositionLocals should not use getters](ComposeCompositionLocalGetter.md.html) - [ComposeCompositionLocalUsage: CompositionLocals are discouraged](ComposeCompositionLocalUsage.md.html) - [ComposeContentEmitterReturningValues: Composable functions should emit XOR return](ComposeContentEmitterReturningValues.md.html) + - [ComposeModifierComposed: Don't use Modifier.composed {}](ComposeModifierComposed.md.html) - [ComposeModifierMissing: Missing modifier parameter](ComposeModifierMissing.md.html) - [ComposeModifierReused: Modifiers should only be used once](ComposeModifierReused.md.html) - [ComposeModifierWithoutDefault: Missing Modifier default value](ComposeModifierWithoutDefault.md.html) @@ -27,9 +39,10 @@ - [ComposePreviewPublic: Preview composables should be private](ComposePreviewPublic.md.html) - [ComposeRememberMissing: State values should be remembered](ComposeRememberMissing.md.html) - [ComposeUnstableCollections: Immutable collections should ideally be used in Composables](ComposeUnstableCollections.md.html) - - [ComposeViewModelForwarding: Forwarding a ViewModel through multiple @Composable functions should be avoided](ComposeViewModelForwarding.md.html) + - [ComposeUnstableReceiver: Unstable receivers will always be recomposed](ComposeUnstableReceiver.md.html) + - [ComposeViewModelForwarding: Don't forward ViewModels through composables](ComposeViewModelForwarding.md.html) - [ComposeViewModelInjection: Implicit dependencies of composables should be made explicit](ComposeViewModelInjection.md.html) - - [ExceptionMessage: Please provide a string for the lazyMessage parameter](ExceptionMessage.md.html) + - [ExceptionMessage: Please provide a string for the `lazyMessage` parameter](ExceptionMessage.md.html) - [ForegroundServicePermission: Missing permissions required by foregroundServiceType](ForegroundServicePermission.md.html) - [ForegroundServiceType: Missing `foregroundServiceType` attribute in manifest](ForegroundServiceType.md.html) - [IntentWithNullActionLaunch: Unsafe intent launched with no action set](IntentWithNullActionLaunch.md.html) @@ -37,7 +50,9 @@ - [MutableImplicitPendingIntent: Mutable Implicit PendingIntent is disallowed](MutableImplicitPendingIntent.md.html) - [NoCollectCallFound: You must call collect on the given progress flow when using PredictiveBackHandler](NoCollectCallFound.md.html) - [OpaqueUnitKey: Passing an expression which always returns `Unit` as a key argument](OpaqueUnitKey.md.html) - - [ParcelizeFunctionProperty: Function type properties should not be used in Parcelize classes](ParcelizeFunctionProperty.md.html) + - [ParcelizeFunctionProperty: Function type properties are not parcelable](ParcelizeFunctionProperty.md.html) + - [PictureInPictureIssue: Picture In Picture best practices not followed](PictureInPictureIssue.md.html) + - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [ProtoLayoutMinSchema: ProtoLayout feature is not guaranteed to be available on the target device API.](ProtoLayoutMinSchema.md.html) - [PublicKeyCredential: Creating public key credential](PublicKeyCredential.md.html) @@ -55,7 +70,7 @@ - [WearSplashScreen: Wear: Use `SplashScreen` library](WearSplashScreen.md.html) - [WrongCommentType: Wrong Comment Type](WrongCommentType.md.html) -* 2022 (48) +* 2022 (49) - [ActivityIconColor: Ongoing activity icon is not white](ActivityIconColor.md.html) - [BinderGetCallingInMainThread: Incorrect usage of getCallingUid() or getCallingPid()](BinderGetCallingInMainThread.md.html) @@ -82,6 +97,7 @@ - [MissingResourceImportAlias: Missing import alias for R class.](MissingResourceImportAlias.md.html) - [MonochromeLauncherIcon: Monochrome icon is not defined](MonochromeLauncherIcon.md.html) - [MultipleAwaitPointerEventScopes: Suspicious use of multiple awaitPointerEventScope blocks. Using multiple awaitPointerEventScope blocks may cause some input events to be dropped.](MultipleAwaitPointerEventScopes.md.html) + - [MustUseNamedParams: Calls to @MustUseNamedParams-annotated methods must name all parameters.](MustUseNamedParams.md.html) - [NotificationId0: Notification Id is 0](NotificationId0.md.html) - [NotificationPermission: Notifications Without Permission](NotificationPermission.md.html) - [OpenForTesting: Extending API only allowed from tests](OpenForTesting.md.html) @@ -112,11 +128,11 @@ - [AppBundleLocaleChanges: App Bundle handling of runtime locale changes](AppBundleLocaleChanges.md.html) - [ArgInFormattedQuantityStringRes: Count value in formatted string resource.](ArgInFormattedQuantityStringRes.md.html) - [BidiSpoofing: Bidirectional text spoofing](BidiSpoofing.md.html) - - [BindingReceiverParameter: @Binds/@Provides functions cannot be extension functions.](BindingReceiverParameter.md.html) - - [BindingReturnType: @Binds/@Provides functions must have a return type. Cannot be void or Unit.](BindingReturnType.md.html) - - [BindsMustBeAbstract: @Binds functions must be abstract and cannot have function bodies.](BindsMustBeAbstract.md.html) - - [BindsTypeMismatch: @Binds function parameters must be type-assignable to their return types.](BindsTypeMismatch.md.html) - - [BindsWrongParameterCount: @Binds functions require a single parameter as an input to bind.](BindsWrongParameterCount.md.html) + - [BindingReceiverParameter: @Binds/@Provides functions cannot be extensions](BindingReceiverParameter.md.html) + - [BindingReturnType: @Binds/@Provides must have a return type](BindingReturnType.md.html) + - [BindsMustBeAbstract: @Binds functions must be abstract](BindsMustBeAbstract.md.html) + - [BindsTypeMismatch: @Binds parameter/return must be type-assignable](BindsTypeMismatch.md.html) + - [BindsWrongParameterCount: @Binds must have one parameter](BindsWrongParameterCount.md.html) - [CastingViewContextToActivity: Unsafe cast of `Context` to `Activity`](CastingViewContextToActivity.md.html) - [CoarseFineLocation: Cannot use `ACCESS_FINE_LOCATION` without `ACCESS_COARSE_LOCATION`](CoarseFineLocation.md.html) - [ComposableDestinationInComposeScope: Building composable destination in compose scope](ComposableDestinationInComposeScope.md.html) @@ -131,6 +147,7 @@ - [DiscouragedApi: Using discouraged APIs](DiscouragedApi.md.html) - [DoNotCallProviders: Dagger provider methods should not be called directly by user code.](DoNotCallProviders.md.html) - [DoNotMock: ](DoNotMock.md.html) + - [DoNotMockAnything: Do not add new mocks.](DoNotMockAnything.md.html) - [DoNotMockAutoValue: AutoValue classes represent pure data classes, so mocking them should not be necessary.](DoNotMockAutoValue.md.html) - [DoNotMockDataClass: data classes represent pure data classes, so mocking them should not be necessary.](DoNotMockDataClass.md.html) - [DoNotMockObjectClass: object classes are singletons, so mocking them should not be necessary](DoNotMockObjectClass.md.html) @@ -149,8 +166,6 @@ - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [InclusiveNaming: Use inclusive naming.](InclusiveNaming.md.html) - [InjectInJava: Only Kotlin classes should be injected in order for Anvil to work.](InjectInJava.md.html) - - [InjectWithScopeRequiredLoggedInUserProvider: @InjectWith-annotated classes must implement LoggedInUserProvider (or extend something that does) if they target UserScope or OrgScope.](InjectWithScopeRequiredLoggedInUserProvider.md.html) - - [InjectWithTypeMustImplementAnvilInjectable: @InjectWith-annotated classes must implement AnvilInjectable (or extend something that does).](InjectWithTypeMustImplementAnvilInjectable.md.html) - [InvalidColorHexValue: Invalid Color hex value](InvalidColorHexValue.md.html) - [KotlinPairNotCreated: Use Kotlin's kotlin.Pair instead of other Pair types from other libraries like AndroidX and Slack commons](KotlinPairNotCreated.md.html) - [LaunchDuringComposition: Calls to `launch` should happen inside of a SideEffect and not during composition](LaunchDuringComposition.md.html) @@ -201,17 +216,18 @@ - [MoshiUsageUseData: Model classes should be immutable data classes.](MoshiUsageUseData.md.html) - [MoshiUsageVarProperty: Moshi properties should be immutable.](MoshiUsageVarProperty.md.html) - [MotionLayoutMissingId: Views inside `MotionLayout` require an `android:id`](MotionLayoutMissingId.md.html) - - [MustBeInModule: @Binds/@Provides function must be in `@Module`-annotated classes.](MustBeInModule.md.html) + - [MustBeInModule: @Binds/@Provides functions must be in modules](MustBeInModule.md.html) - [MutableCollectionMutableState: Creating a MutableState object with a mutable collection type](MutableCollectionMutableState.md.html) - [NoOp: NoOp Code](NoOp.md.html) - [NotConstructor: Not a Constructor](NotConstructor.md.html) - [ProduceStateDoesNotAssignValue: produceState calls should assign `value` inside the producer lambda](ProduceStateDoesNotAssignValue.md.html) - - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract.](ProvidesMustNotBeAbstract.md.html) + - [ProvidesMustNotBeAbstract: @Provides functions cannot be abstract](ProvidesMustNotBeAbstract.md.html) - [RawDispatchersUse: Use SlackDispatchers.](RawDispatchersUse.md.html) - [RedactedInJavaUsage: @Redacted is only supported in Kotlin classes!](RedactedInJavaUsage.md.html) - - [RedundantBinds: @Binds functions should return a different type (including annotations) than the input type.](RedundantBinds.md.html) + - [RedundantBinds: @Binds functions should return a different type](RedundantBinds.md.html) - [RememberSaveableSaverParameter: `Saver` objects should be passed to the saver parameter, not the vararg `inputs` parameter](RememberSaveableSaverParameter.md.html) - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) + - [RepeatOnLifecycleWrongUsage: Wrong usage of repeatOnLifecycle.](RepeatOnLifecycleWrongUsage.md.html) - [RestrictCallsTo: Methods annotated with @RestrictedCallsTo should only be called from the specified scope.](RestrictCallsTo.md.html) - [RetrofitUsage: This is replaced by the caller.](RetrofitUsage.md.html) - [SerializableUsage: Don't use Serializable.](SerializableUsage.md.html) @@ -297,7 +313,7 @@ - [UsingOnClickInXml: Using `android:onClick` on older version of the platform is broken](UsingOnClickInXml.md.html) - [WorkerHasAPublicModifier: ListenableWorkers constructed using the default WorkerFactories need to be public](WorkerHasAPublicModifier.md.html) -* 2019 (21) +* 2019 (23) - [AutoDispose: Missing Disposable handling: Apply AutoDispose or cache the Disposable instance manually and enable lenient mode.](AutoDispose.md.html) - [BadConfigurationProvider: Invalid WorkManager Configuration Provider](BadConfigurationProvider.md.html) @@ -313,8 +329,10 @@ - [MotionLayoutInvalidSceneFileReference: layoutDescription must specify a scene file](MotionLayoutInvalidSceneFileReference.md.html) - [MotionSceneFileValidationError: Validation errors in `MotionScene` files](MotionSceneFileValidationError.md.html) - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) + - [NullSafeMutableLiveData: LiveData value assignment nullability mismatch](NullSafeMutableLiveData.md.html) - [RemoveWorkManagerInitializer: Remove androidx.work.WorkManagerInitializer from your AndroidManifest.xml when using on-demand initialization.](RemoveWorkManagerInitializer.md.html) - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) + - [UnsafeLifecycleWhenUsage: Unsafe UI operation in finally/catch of Lifecycle.whenStarted of similar method](UnsafeLifecycleWhenUsage.md.html) - [UnsafeOptInUsageError: Unsafe opt-in usage intended to be error-level severity](UnsafeOptInUsageError.md.html) - [UnsafeOptInUsageWarning: Unsafe opt-in usage intended to be warning-level severity](UnsafeOptInUsageWarning.md.html) - [UseAndroidAlpha: `android:alpha` attribute missing on `ColorStateList`](UseAndroidAlpha.md.html) @@ -460,7 +478,7 @@ - [VectorRaster: Vector Image Generation](VectorRaster.md.html) - [VulnerableCordovaVersion: Vulnerable Cordova Version](VulnerableCordovaVersion.md.html) -* 2014 (72) +* 2014 (73) - [AaptCrash: Potential AAPT crash](AaptCrash.md.html) - [AccidentalOctal: Accidental Octal](AccidentalOctal.md.html) @@ -524,6 +542,7 @@ - [RiskyLibrary: Libraries with Privacy or Security Risks](RiskyLibrary.md.html) - [SetTextI18n: TextView Internationalization](SetTextI18n.md.html) - [SignatureOrSystemPermissions: Declaring signatureOrSystem permissions](SignatureOrSystemPermissions.md.html) + - [SimilarGradleDependency: Multiple Versions Gradle Dependency](SimilarGradleDependency.md.html) - [SimpleDateFormat: Implied locale in date format](SimpleDateFormat.md.html) - [StringShouldBeInt: String should be int](StringShouldBeInt.md.html) - [UseAlpha2: Using 3-letter Codes](UseAlpha2.md.html) From 8714d26a2e3ce9b45a3d971e94acf6788cd7b625 Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Sat, 18 May 2024 02:22:03 -0700 Subject: [PATCH 07/20] Update lint documentation snapshot. --- docs/api-guide/annotations.md.html | 4 +- docs/api-guide/basics.md.html | 64 ++++++++++++------------ docs/api-guide/dataflow-analyzer.md.html | 6 +-- docs/api-guide/faq.md.html | 10 ++-- docs/api-guide/messages.md.html | 2 +- docs/api-guide/partial-analysis.md.html | 8 +-- docs/api-guide/publishing.md.html | 4 +- docs/api-guide/terminology.md.html | 6 +-- docs/api-guide/test-modes.md.html | 6 +-- docs/api-guide/unit-testing.md.html | 6 +-- docs/usage/baselines.md.html | 21 ++++---- docs/usage/lintxml.md.html | 53 ++++++++++---------- docs/usage/performance-tuning.md.html | 16 +++--- docs/usage/suppressing.md.html | 4 +- 14 files changed, 105 insertions(+), 105 deletions(-) diff --git a/docs/api-guide/annotations.md.html b/docs/api-guide/annotations.md.html index 9fe6b2c8..fbc82659 100644 --- a/docs/api-guide/annotations.md.html +++ b/docs/api-guide/annotations.md.html @@ -106,7 +106,7 @@ The second case shows a similar situation where the array syntax will end up calling our extension method, `get()`. -And the third case shows the most common scenario: a straight forward +And the third case shows the most common scenario: a straightforward method call to an annotated method. In many cases, the above detector implementation is nearly all you have @@ -322,7 +322,7 @@ The `fileStack.push` call on line 4 also resolves to the same method as the call on line 2 (even though the concrete type is a `FileStack` -instead of a `Stack), so like on line 2, this call is taken to be +instead of a `Stack`), so like on line 2, this call is taken to be thread safe. However, the `fileStack.pop` call on line 6 resolves to the API method diff --git a/docs/api-guide/basics.md.html b/docs/api-guide/basics.md.html index fde07c99..3886e044 100644 --- a/docs/api-guide/basics.md.html +++ b/docs/api-guide/basics.md.html @@ -169,13 +169,13 @@ Many detector methods will pass in a `Context`, or a more specific subclass of `Context` such as `JavaContext` or `XmlContext`. This -allows lint to provide access to the detectors information they may -need, without passing in a lot of parameters (and allowing lint to add -additional data over time without breaking signatures). +allows lint to give the detectors information they may need, without +passing in a lot of parameters. It also allows lint to add additional data +over time without breaking signatures. The `Context` classes also provide many convenience APIs. For example, for `XmlContext` there are methods for creating locations for XML tags, -XML attributes, just the name part of an XML attribute and just the +XML attributes, just the name part of an XML attribute, and just the value part of an XML attribute. For a `JavaContext` there are also methods for creating locations, such as for a method call, including whether to include the receiver and/or the argument list. @@ -204,7 +204,7 @@ Lint's API has two halves: - The **Client API**: “Integrate (and run) lint from within a tool”. - For example, both the IDE and the build system uses this API to embed + For example, both the IDE and the build system use this API to embed and invoke lint to analyze the code in the project or editor. - The **Detector API**: “Implement a new lint check”. This is the API @@ -213,12 +213,12 @@ The class in the Client API which represents lint running in a tool is called `LintClient`. This class is responsible for, among other things: -* Reporting incidents found by detectors. For example, in the IDE, it +* **Reporting incidents found by detectors**. For example, in the IDE, it will place error markers into the source editor, and in a build system, it may write warnings to the console or generate a report or even fail the build. -* Handling I/O. Detectors should never read files from disk directly. +* **Handling I/O**. Detectors should never read files from disk directly. This allows lint checks to work smoothly in for example the IDE. When lint runs on the fly, and a lint check asks for the source file contents (or other supporting files), the `LintClient` in the IDE @@ -226,14 +226,13 @@ editors and if the requested file is being edited, it will return the current (often unsaved!) contents. -* Handling network traffic. Lint checks should never open - URLConnections themselves. By going through the lint API to request - data for a URL, not only can the LintClient for example use any - configured IDE proxy settings which is done in the IntelliJ - integration of lint, but even the lint check's own unit tests can - easily be tested because the special unit test implementation of a - `LintClient` provides a simple way to provide exact responses for - specific URLs: +* **Handling network traffic**. Lint checks should never open + URLConnections themselves. Instead, they should go through the lint API + to request data for URLs. Among other things, this allows the + `LintClient` to use configured IDE proxy settings (as is done in the + IntelliJ integration of lint). This is also good for testing, because + the special unit test implementation of a `LintClient` has a simple way + to provide exact responses for specific URLs: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lint() @@ -256,8 +255,8 @@ And much, much, more. **However, most of the implementation of `LintClient` is intended for integration of lint itself, and as a check -author you don't need to worry about it.** It's the detector API that -matters, and is also less likely to change than the client API. +author you don't need to worry about it.** The detector API will matter +more, and it's also less likely to change than the client API. !!! Tip The division between the two halves is not perfect; some classes @@ -273,8 +272,8 @@ for internal lint usage have been made `public` such that lint's code in one package can access it from the other. There's normally a comment explaining that this is for internal use only, but be aware - that just because something is `public` or not `final` it's a good - idea to call or override it. + that even when something is `public` or not `final`, it might not be a + good idea to call or override it. ## Creating an Issue @@ -283,7 +282,7 @@ [publishing](publishing.md.html) chapters. `Issue` is a final class, so unlike `Detector`, you don't subclass -it, you instantiate it via `Issue.create`. +it; you instantiate it via `Issue.create`. By convention, issues are registered inside the companion object of the corresponding detector, but that is not required. @@ -631,16 +630,16 @@ * When implementing **`SourceCodeScanner`**, in Kotlin and Java files you can be called back - - When a method of a given name is invoked (`getApplicableMethodNames` + - when a method of a given name is invoked (`getApplicableMethodNames` and `visitMethodCall`) - - When a class of the given type is instantiated + - when a class of the given type is instantiated (`getApplicableConstructorTypes` and `visitConstructor`) - - When a new class is declared which extends (possibly indirectly) + - when a new class is declared which extends (possibly indirectly) a given class or interface (`applicableSuperClasses` and `visitClass`) - - When annotated elements are referenced or combined + - when annotated elements are referenced or combined (`applicableAnnotations` and `visitAnnotationUsage`) - - When any AST nodes of given types appear (`getApplicableUastTypes` + - when any AST nodes of given types appear (`getApplicableUastTypes` and `createUastHandler`) * When implementing a **`ClassScanner`**, in `.class` and `.jar` files @@ -650,7 +649,7 @@ - when a given bytecode instruction occurs (`getApplicableAsmNodeTypes` and `checkInstruction`) - like with XmlScanner's `visitDocument`, you can perform your own - ASM bytecode iteration via `checkClass`. + ASM bytecode iteration via `checkClass` * There are various other scanners too, for example `GradleScanner` which lets you visit `build.gradle` and `build.gradle.kts` DSL @@ -677,9 +676,9 @@ the detector in fields and accumulate information for analysis at the end. -There are some callbacks both before each individual file is analyzed -(`beforeCheckFile` and `afterCheckFile`), as well as before and after -analysis of all the modules (`beforeCheckRootProject` and +There are some callbacks both before and after each individual file is +analyzed (`beforeCheckFile` and `afterCheckFile`), as well as before and +after analysis of all the modules (`beforeCheckRootProject` and `afterCheckRootProject`). This is for example how the ”unused resources“ check works: we store @@ -764,8 +763,7 @@ like the `ResourceRepository` and the `ResourceEvaluator`. * Finally, there are a number of utility methods; for example there is - an `editDistance` method used to find likely typos used by a number - of checks. + an `editDistance` method used to find likely typos. ## Scanner Example @@ -807,7 +805,7 @@ } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The second, older form, may seem simpler, but the new API allows a lot +The second (older) form may seem simpler, but the new API allows a lot more metadata to be attached to the report, such as an override severity. You don't have to convert to the builder syntax to do this; you could also have written the second form as @@ -1003,7 +1001,7 @@ !!! Warning Resolving only works if lint has a correct classpath such that the - referenced method, field or class are actually present. If it is + referenced method, field, or class is actually present. If it is not, resolve will return null, and various lint callbacks will not be invoked. This is a common source of questions for lint checks ”not working“; it frequently comes up in lint unit tests where a diff --git a/docs/api-guide/dataflow-analyzer.md.html b/docs/api-guide/dataflow-analyzer.md.html index 39b0c56a..1af02645 100644 --- a/docs/api-guide/dataflow-analyzer.md.html +++ b/docs/api-guide/dataflow-analyzer.md.html @@ -83,7 +83,7 @@ } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Aas you can see, the `DataFlowAnalyzer` is a visitor, so when we find a +As you can see, the `DataFlowAnalyzer` is a visitor, so when we find a call we're interested in, we construct a `DataFlowAnalyzer` and initialize it with the instance we want to track, and then we visit the surrounding method with this visitor. @@ -254,8 +254,8 @@ call. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin linenumbers -fun test) { - val transaction = getFragmentManager().beginTransaction() +fun test() { + val transaction = getFragmentManager().beginTransaction() process(transaction) } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/api-guide/faq.md.html b/docs/api-guide/faq.md.html index 83e3ca13..a785efc5 100644 --- a/docs/api-guide/faq.md.html +++ b/docs/api-guide/faq.md.html @@ -110,14 +110,14 @@ ### How do I get the `UMethod` for a `PsiMethod` ? -Call `psiMethod.toUElementOfType()`. Note that this may return +Call `psiMethod.toUElementOfType<UMethod>()`. Note that this may return null if UAST cannot find valid Java or Kotlin source code for the method. For `PsiField` and `PsiClass` instances use the equivalent `toUElementOfType` type arguments. -### How do get a `JavaEvaluator` ? +### How do get a `JavaEvaluator`? The `Context` passed into most of the `Detector` callback methods relevant to Kotlin and Java analysis is of type `JavaContext`, and it @@ -173,7 +173,7 @@ abstract fun getTypeClass(psiType: PsiType?): PsiClass? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -### How do I look up hierarhcy annotations for an element? +### How do I look up hierarchy annotations for an element? You can directly look up annotations via the modified list of PsiElement or the annotations for a `UAnnotated` element, @@ -254,7 +254,7 @@ open fun computeArgumentMapping( call: UCallExpression, method: PsiMethod - ): Map { /* ... */ + ): Map<UExpression, PsiParameter> { /* ... */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This returns a map from UAST expressions (each argument to a UAST call @@ -290,7 +290,7 @@ ### Why are overloaded operators not handled? Kotlin supports overloaded operators, but these are not handled as -calls in the AST - instead, an implicit `get` or `set` method from an +calls in the AST -- instead, an implicit `get` or `set` method from an array access will show up as a `UArrayAccessExpression`. Lint has specific support to help handling these scenarios; see the “Implicit Calls” section in the [basics chapter](basics.md.html). diff --git a/docs/api-guide/messages.md.html b/docs/api-guide/messages.md.html index 986955b2..42725571 100644 --- a/docs/api-guide/messages.md.html +++ b/docs/api-guide/messages.md.html @@ -41,7 +41,7 @@ ## Punctuation -One line error messages should not be punctuated - e.g. the error message +One line error messages should not be punctuated -- e.g. the error message should be “Unused import foo”, not “Unused import foo.” However, if there are multiple sentences in the error message, all sentences diff --git a/docs/api-guide/partial-analysis.md.html b/docs/api-guide/partial-analysis.md.html index 68553443..4db4ea75 100644 --- a/docs/api-guide/partial-analysis.md.html +++ b/docs/api-guide/partial-analysis.md.html @@ -308,8 +308,8 @@ represents it. To report an incident you simply call `context.report(incident)`. There are several ways to create these incidents. The easiest is to simply edit your existing call above by -adding `Incident(` (or from Java, `new Incident(`) inside the -`context.report` block like this: +putting it inside `Incident(...)` (in Java, `new Incident(...)`) inside +the `context.report` block like this: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin context.report(Incident( @@ -390,7 +390,7 @@ from the `Constraints` class. Recording an incident with a constraint is easy; first construct the -`Incident` as before, and then report them via +`Incident` as before, and then report it via `context.report(incident, constraint)`: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~java @@ -403,7 +403,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Finally, note that you can combine constraints; there are both “and” -and “or” operators defined for the `Constraint` class. so the following +and “or” operators defined for the `Constraint` class, so the following is valid: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kotlin diff --git a/docs/api-guide/publishing.md.html b/docs/api-guide/publishing.md.html index dcac1562..cfa3f4aa 100644 --- a/docs/api-guide/publishing.md.html +++ b/docs/api-guide/publishing.md.html @@ -126,7 +126,7 @@ * and is no longer registered, any existing mentions of the issue * id in baselines, lint.xml files etc are gracefully handled. */ -open val deletedIssues: List = emptyList() +open val deletedIssues: List<String> = emptyList() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The reason you'll want to do this is listed right there in the doc: If @@ -136,7 +136,7 @@ is done to catch issue id typos. And if the user has a baseline file listing incidents from your check, then if your issue id is not registered as deleted, lint will think this is an issue that has been -"fixed“ since it's no longer reported, and lint will issue an +“fixed” since it's no longer reported, and lint will issue an informational message that the baseline contains issues no longer reported (which is done such that users can update their baseline files, to ensure that the fixed issues aren't reintroduced again.) diff --git a/docs/api-guide/terminology.md.html b/docs/api-guide/terminology.md.html index b9cf4347..477f4675 100644 --- a/docs/api-guide/terminology.md.html +++ b/docs/api-guide/terminology.md.html @@ -9,7 +9,7 @@ Configuration : A configuration provides extra information or parameters to lint on a - per project, or even per directory basis. For example, the `lint.xml` + per-project, or even per-directory, basis. For example, the `lint.xml` files can change the severity for issues, or list incidents to ignore (matched for example by a regular expression), or even provide values for options read by a specific detector. @@ -17,7 +17,7 @@ Context : An object passed into detectors in many APIs, providing data about (for example) which file is being analyzed (and in which project), - and for specific types of analysis additional information; for + and (for specific types of analysis) additional information; for example, an XmlContext points to the DOM document, a JavaContext includes the AST, and so on. @@ -97,7 +97,7 @@ Java and Kotlin files, there is a scope for .class files, and so on. Typically lint cares about which **set** of scopes apply, - so most of the APIs take an `EnumSet< Scope>`, but we'll often + so most of the APIs take an `EnumSet<Scope>`, but we'll often refer to this as just “the scope” instead of the “scope set”. Severity diff --git a/docs/api-guide/test-modes.md.html b/docs/api-guide/test-modes.md.html index 698ef2e0..fc8e3c66 100644 --- a/docs/api-guide/test-modes.md.html +++ b/docs/api-guide/test-modes.md.html @@ -9,7 +9,7 @@ There are a number of built-in test modes: -* Test modes which makes small tweaks to the source files which +* Test modes which make small tweaks to the source files which should be compatible, such as * Inserting unnecessary parentheses * Replacing imported symbols with fully qualified names @@ -36,7 +36,7 @@ `skipTestModes` DSL method, as described below. You can also add in your own test modes. For example, lint adds its own -internal test mode for making sure the built-in annotation checks works +internal test mode for making sure the built-in annotation checks work with Android platform annotations in the following test mode: [](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/AndroidPlatformAnnotationsTestMode.kt) @@ -322,7 +322,7 @@ last argument is a literal expression such as a number or a String. You *can't* just use `if (call.valueArguments.lastOrNull() is ULiteralExpression)`, because that first argument could be a -`UParenthesizedExpression`, as in `call(1, true, ("hello")), so you'd +`UParenthesizedExpression`, as in `call(1, true, ("hello"))`, so you'd need to look inside the parentheses. UAST comes with two functions to help you handle this correctly: diff --git a/docs/api-guide/unit-testing.md.html b/docs/api-guide/unit-testing.md.html index f4a54e31..1915e7f3 100644 --- a/docs/api-guide/unit-testing.md.html +++ b/docs/api-guide/unit-testing.md.html @@ -174,7 +174,7 @@ ## Trimming indents? Notice how in the above Kotlin unit tests we used raw strings, **and** -we indented the sources to be flush with the opening “”“ string +we indented the sources to be flush with the opening `"""` string delimiter. You might be tempted to call `.trimIndent()` on the raw string. @@ -412,7 +412,7 @@ "BwAAAAIAAQAIAAkAAQAKAAAAHQABAAEAAAAFKrcAAbEAAAABAAsAAAAGAAEA" + "AAAEAAgADAAJAAEACgAAAB4AAQAAAAAABhICswADsQAAAAEACwAAAAYAAQAA" + "AAUAAQANAAAAAgAO" - )` + ) ).run().expect( ``` @@ -450,7 +450,7 @@ and emit the full test file registration. This isn't just a convenience; lint's test infrastructure also uses -this to test some additional scenarios (for example, in a multi- module +this to test some additional scenarios (for example, in a multi-module project it will only provide the binaries, not the sources, for upstream modules.) diff --git a/docs/usage/baselines.md.html b/docs/usage/baselines.md.html index 681727b1..25d36d21 100644 --- a/docs/usage/baselines.md.html +++ b/docs/usage/baselines.md.html @@ -2,7 +2,7 @@ # Baselines -# Creating a Baseline +## Creating a Baseline You can take a snapshot of your project's current set of warnings, and then use the snapshot as a baseline for future inspection runs @@ -10,7 +10,7 @@ start using lint to fail the build without having to go back and address all existing issues first. -To create a baseline snapshot, modify your project's `build.gradle``` +To create a baseline snapshot, modify your project's `build.gradle` file as follows. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -28,7 +28,7 @@ Then, run lint from the IDE (**Analyze > Inspect Code**) or from the command line as follows. The output prints the location of the -lint-baseline.xml file. The file location for your setup might be +`lint-baseline.xml` file. The file location for your setup might be different from what is shown here. ```shell @@ -40,7 +40,7 @@ Running lint records all of the current issues in the `lint-baseline.xml` file. The set of current issues is called the -baseline, and you can check the lint-baseline.xml file into version +baseline, and you can check the `lint-baseline.xml` file into version control if you want to share it with others. ## Customize the baseline @@ -75,12 +75,13 @@ if you have actually fixed issues, so you can optionally re-create the baseline to prevent the error from coming back undetected. -!!! Note: Baselines are enabled when you run inspections in batch - mode in the IDE, but they are ignored for the in-editor checks that - run in the background when you are editing a file. The reason is that - baselines are intended for the case where a codebase has a massive - number of existing warnings, but you do want to fix issues locally - while you touch the code. +!!! Note + Baselines are enabled when you run inspections in batch mode in the + IDE, but they are ignored for the in-editor checks that run in the + background when you are editing a file. The reason is that baselines + are intended for the case where a codebase has a massive number of + existing warnings, but you do want to fix issues locally while you + touch the code. [Official documentation](https://developer.android.com/studio/write/lint#snapshot) diff --git a/docs/usage/lintxml.md.html b/docs/usage/lintxml.md.html index f019bf8b..157652ac 100644 --- a/docs/usage/lintxml.md.html +++ b/docs/usage/lintxml.md.html @@ -17,46 +17,47 @@ The root tag is always ``, and it can contain one or more `` elements. Each can specify the following -attributes: `id`: The issue id the following configuration applies -to. Note that this can be a comma separated list of multiple id's, in -which case the configuration applies to all of them. It can also be -the special value “all”, which will match all issue id's. And when -configuring severity, the id is also allowed to be a category, such -as “Security”. - -`in`: Specifies that this configuration only applies when lint -runs in the given hosts. There are predefined names for various -integrations of lint; “gradle” refers to lint running in the Gradle -plugin; “studio” refers to lint running in the IDE, “cli” refers to -lint running from the command line tools “lint” binary, etc. Like -with id's, this can be a comma separated list, which makes the rule -match if the lint host is any of the listed hosts. Finally, note that -you can also add a “!” in front of each host to negate the check. For -example, to enable a check anywhere except when running in Studio, -use `in="!studio"`. +attributes: + +- `id`: The issue id the following configuration applies + to. Note that this can be a comma separated list of multiple id's, in + which case the configuration applies to all of them. It can also be + the special value “all”, which will match all issue id's. And when + configuring severity, the id is also allowed to be a category, such + as “Security”. +- `in`: Specifies that this configuration only applies when lint + runs in the given hosts. There are predefined names for various + integrations of lint; “gradle” refers to lint running in the Gradle + plugin; “studio” refers to lint running in the IDE, “cli” refers to + lint running from the command line tools “lint” binary, etc. Like + with id's, this can be a comma separated list, which makes the rule + match if the lint host is any of the listed hosts. Finally, note that + you can also add a “!” in front of each host to negate the check. For + example, to enable a check anywhere except when running in Studio, + use `in="!studio"`. In addition, the element can specify one or more children: -``: Specifies a path to ignore. Can contain the -globbing character “*” to match any substring in the path. ``: Specifies either a regular expression to ignore. The -regular expression is matched against both the location of the error -and the error message itself. `