summaryrefslogtreecommitdiff
path: root/lint/src
diff options
context:
space:
mode:
authorJinseong Jeon <jsjeon@google.com>2021-10-28 22:33:27 -0700
committerJinseong Jeon <jsjeon@google.com>2021-11-02 20:14:08 +0000
commit8623d48cd5b9b9f19ed8b0bb135beae6f17acbd4 (patch)
tree670856293ba93e8759bbe9ca71f7eb37f8994e06 /lint/src
parent12e465a04c54b6b44da674abbf34337fdbd3eafb (diff)
downloadidea-8623d48cd5b9b9f19ed8b0bb135beae6f17acbd4.tar.gz
Register UAST implementation detector
Bug: 200061619 Test: N/A Change-Id: I3b3ef2a53561c3f08b9db442132d1d03d532b42e
Diffstat (limited to 'lint/src')
-rw-r--r--lint/src/META-INF/lint-plugin.xml1
-rw-r--r--lint/src/com/android/tools/idea/lint/common/AndroidLintUastImplementationInspection.kt23
2 files changed, 24 insertions, 0 deletions
diff --git a/lint/src/META-INF/lint-plugin.xml b/lint/src/META-INF/lint-plugin.xml
index 574e4146143..58d5c8461ad 100644
--- a/lint/src/META-INF/lint-plugin.xml
+++ b/lint/src/META-INF/lint-plugin.xml
@@ -71,6 +71,7 @@
<globalInspection hasStaticDescription="true" shortName="AndroidLintSQLiteString" displayName="Using STRING instead of TEXT" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintSQLiteStringInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintStopShip" displayName="Code contains STOPSHIP marker" bundle="messages.LintBundle" enabledByDefault="false" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintStopShipInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintSupportAnnotationUsage" displayName="Incorrect support annotation usage" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintSupportAnnotationUsageInspection"/>
+ <globalInspection hasStaticDescription="true" shortName="AndroidLintUastImplementation" displayName="Avoid using UAST implementation" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintUastImplementationInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintUnknownNullness" displayName="Unknown nullness" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintUnknownNullnessInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintUnspecifiedImmutableFlag" displayName="Missing PendingIntent mutability flag" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintUnspecifiedImmutableFlagInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintUseValueOf" displayName="Should use valueOf instead of new" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintUseValueOfInspection"/>
diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintUastImplementationInspection.kt b/lint/src/com/android/tools/idea/lint/common/AndroidLintUastImplementationInspection.kt
new file mode 100644
index 00000000000..a5878d1cb49
--- /dev/null
+++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintUastImplementationInspection.kt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+package com.android.tools.idea.lint.common
+
+import com.android.tools.idea.lint.common.LintBundle.Companion.message
+import com.android.tools.lint.checks.UastImplementationDetector
+
+class AndroidLintUastImplementationInspection : AndroidLintInspectionBase(
+ message("android.lint.inspections.uast.implementation"), UastImplementationDetector.ISSUE
+)