diff options
author | Tor Norbye <tnorbye@google.com> | 2021-11-30 12:15:53 -0800 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2021-12-06 22:49:03 +0000 |
commit | 6526af1fb1d18d741bc3c7e599aaea9a399164c3 (patch) | |
tree | 12523b9a452328a8f4e1e82ede6221abdee8db51 /lint/src | |
parent | 75fbd4dc8f976dade99a97e4fe500c8f94f79921 (diff) | |
download | idea-6526af1fb1d18d741bc3c7e599aaea9a399164c3.tar.gz |
Register the "not a constructor" lint check as an inspection
Test: N/A; Automatically generated registration code, actual
lint check is tested in the lint repo
Fixes: 207144026
Change-Id: Ic26123272427ffc1252889df9739c7d4fba2dfc4
Diffstat (limited to 'lint/src')
-rw-r--r-- | lint/src/META-INF/lint-plugin.xml | 1 | ||||
-rw-r--r-- | lint/src/com/android/tools/idea/lint/common/AndroidLintNotConstructorInspection.kt | 23 |
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 904afaa0841..64f3ae23a11 100644 --- a/lint/src/META-INF/lint-plugin.xml +++ b/lint/src/META-INF/lint-plugin.xml @@ -61,6 +61,7 @@ <globalInspection hasStaticDescription="true" shortName="AndroidLintMissingSuperCall" displayName="Missing Super Call" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintMissingSuperCallInspection"/> <globalInspection hasStaticDescription="true" shortName="AndroidLintNewerVersionAvailable" displayName="Newer Library Versions Available" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintNewerVersionAvailableInspection"/> <globalInspection hasStaticDescription="true" shortName="AndroidLintNoHardKeywords" displayName="No Hard Kotlin Keywords" bundle="messages.LintBundle" enabledByDefault="false" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintNoHardKeywordsInspection"/> + <globalInspection hasStaticDescription="true" shortName="AndroidLintNotConstructor" displayName="Not a Constructor" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintNotConstructorInspection"/> <globalInspection hasStaticDescription="true" shortName="AndroidLintNotInterpolated" displayName="Incorrect Interpolation" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintNotInterpolatedInspection"/> <globalInspection hasStaticDescription="true" shortName="AndroidLintPropertyEscape" displayName="Incorrect property escapes" bundle="messages.LintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.common.AndroidLintPropertyEscapeInspection"/> <globalInspection hasStaticDescription="true" shortName="AndroidLintProxyPassword" displayName="Proxy Password in Cleartext" bundle="messages.LintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.common.AndroidLintProxyPasswordInspection"/> diff --git a/lint/src/com/android/tools/idea/lint/common/AndroidLintNotConstructorInspection.kt b/lint/src/com/android/tools/idea/lint/common/AndroidLintNotConstructorInspection.kt new file mode 100644 index 00000000000..95f6c6d226f --- /dev/null +++ b/lint/src/com/android/tools/idea/lint/common/AndroidLintNotConstructorInspection.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.WrongConstructorDetector + +class AndroidLintNotConstructorInspection : AndroidLintInspectionBase( + message("android.lint.inspections.not.constructor"), WrongConstructorDetector.ISSUE +)
\ No newline at end of file |