summaryrefslogtreecommitdiff
path: root/lint/src
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2021-09-13 08:31:04 -0700
committerTor Norbye <tnorbye@google.com>2021-09-14 18:07:06 +0000
commitde5711ece6bf9c009dbabe3b1993a41eb573d8e0 (patch)
tree35b899b3d62140dfae8ccf56bed7f1fc8e51b7eb /lint/src
parentd49c7ba0fdd3f86b739097c15e3a319335474aaf (diff)
downloadidea-de5711ece6bf9c009dbabe3b1993a41eb573d8e0.tar.gz
Register IDE inspection for new lint check
Test: N/A, this is automatically generated registration code Bug: None Change-Id: Ib78ff65eec469ed12d183af0f2dd534d0b074e76
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/AndroidLintAssertionSideEffectInspection.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 7ba89d5b739..574e4146143 100644
--- a/lint/src/META-INF/lint-plugin.xml
+++ b/lint/src/META-INF/lint-plugin.xml
@@ -36,6 +36,7 @@
<externalAnnotator language="Properties" implementationClass="com.android.tools.idea.lint.common.LintExternalAnnotator"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintAccidentalOctal" displayName="Accidental Octal" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintAccidentalOctalInspection"/>
+ <globalInspection hasStaticDescription="true" shortName="AndroidLintAssertionSideEffect" displayName="Assertions with Side Effects" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintAssertionSideEffectInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintBadHostnameVerifier" displayName="Insecure HostnameVerifier" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintBadHostnameVerifierInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintCheckResult" displayName="Ignoring results" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintCheckResultInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDefaultLocale" displayName="Implied default locale in case conversion" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintDefaultLocaleInspection"/>
diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintAssertionSideEffectInspection.kt b/lint/src/com/android/tools/idea/lint/common/AndroidLintAssertionSideEffectInspection.kt
new file mode 100644
index 00000000000..048f19eb5ad
--- /dev/null
+++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintAssertionSideEffectInspection.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.AssertDetector
+
+class AndroidLintAssertionSideEffectInspection : AndroidLintInspectionBase(
+ message("android.lint.inspections.assertion.side.effect"), AssertDetector.SIDE_EFFECT
+) \ No newline at end of file