summaryrefslogtreecommitdiff
path: root/lint/src
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2021-06-09 13:20:27 -0700
committerTor Norbye <tnorbye@google.com>2021-06-09 22:35:16 +0000
commit395c5b924ee0b40b66a94376c1a04f0766e2e2f6 (patch)
tree4666505266ad4aa8e3b83a9b0dd77f678b0fe257 /lint/src
parent4d2d1a271f104ce1313eeeec7cf03384ef86cdf9 (diff)
downloadidea-395c5b924ee0b40b66a94376c1a04f0766e2e2f6.tar.gz
Register File.endsWith lint check as an IDE inspection
Test: None, this is generated code (LintInspectionRegistrationTest) Bug: None Change-Id: I70303dab07eb621281990dc443fe996e26d06238
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/AndroidLintFileEndsWithExtInspection.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 f298dbca24b..bd574b98088 100644
--- a/lint/src/META-INF/lint-plugin.xml
+++ b/lint/src/META-INF/lint-plugin.xml
@@ -41,6 +41,7 @@
<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"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintEasterEgg" displayName="Code contains easter egg" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintEasterEggInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintExpensiveAssertion" displayName="Expensive Assertions" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintExpensiveAssertionInspection"/>
+ <globalInspection hasStaticDescription="true" shortName="AndroidLintFileEndsWithExt" displayName="File endsWith on file extensions" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintFileEndsWithExtInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintGradleDependency" displayName="Obsolete Gradle Dependency" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintGradleDependencyInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintGradleDeprecatedConfiguration" displayName="Deprecated Gradle Configuration" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintGradleDeprecatedConfigurationInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintGradleDynamicVersion" displayName="Gradle Dynamic Version" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintGradleDynamicVersionInspection"/>
diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintFileEndsWithExtInspection.kt b/lint/src/com/android/tools/idea/lint/common/AndroidLintFileEndsWithExtInspection.kt
new file mode 100644
index 00000000000..5e48ebabe6e
--- /dev/null
+++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintFileEndsWithExtInspection.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.FileEndsWithDetector
+
+class AndroidLintFileEndsWithExtInspection : AndroidLintInspectionBase(
+ message("android.lint.inspections.file.ends.with.ext"), FileEndsWithDetector.ISSUE
+) \ No newline at end of file