mirror of
https://github.com/ankidroid/Anki-Android.git
synced 2024-09-20 03:52:15 +02:00
refactor: ignore "UnstableApiUsage" lint warnings
We're aware that these classes are using `@Beta` functionality Removes a lot of IDE lint warnings
This commit is contained in:
parent
a145c032fd
commit
330854683f
@ -1,3 +1,4 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint
|
||||
|
||||
import com.android.tools.lint.client.api.IssueRegistry
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.Implementation
|
||||
@ -30,8 +31,6 @@ import java.util.*
|
||||
* https://github.com/ankidroid/Anki-Android/wiki/Code-style#constant-final-variables-names-must-be-all-uppercase-using-underscore-to-separate-words
|
||||
* Constant (final variables) names must be all uppercase using underscore to separate words.
|
||||
*/
|
||||
@KotlinCleanup("IDE warnings")
|
||||
@KotlinCleanup("Ignore unstable API warning")
|
||||
@KotlinCleanup("Remove after all are converted")
|
||||
class ConstantJavaFieldDetector : JavaFieldNamingPatternDetector() {
|
||||
override fun isApplicable(variable: UVariable): Boolean {
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -1,3 +1,4 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -1,3 +1,4 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -1,16 +1,15 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.resources.ResourceFolderType
|
||||
import com.android.tools.lint.detector.api.*
|
||||
import com.google.common.annotations.VisibleForTesting
|
||||
import com.ichi2.anki.lint.utils.Constants
|
||||
import com.ichi2.anki.lint.utils.KotlinCleanup
|
||||
import org.w3c.dom.Element
|
||||
|
||||
/**
|
||||
* A Lint check to prevent using the same string for the title and summary of a preference.
|
||||
*/
|
||||
@KotlinCleanup("IDe lint")
|
||||
class DuplicateTextInPreferencesXml : ResourceXmlDetector() {
|
||||
|
||||
companion object {
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.resources.ResourceFolderType
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
@ -22,7 +23,7 @@ import com.ichi2.anki.lint.utils.ImportStatementDetector
|
||||
import com.ichi2.anki.lint.utils.KotlinCleanup
|
||||
import org.jetbrains.uast.UImportStatement
|
||||
|
||||
@KotlinCleanup("IDE lint - ignore 'Beta'")
|
||||
@KotlinCleanup("IDE lint")
|
||||
class InconsistentAnnotationUsage : ImportStatementDetector(), SourceCodeScanner {
|
||||
|
||||
companion object {
|
||||
|
@ -14,6 +14,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.SdkConstants.*
|
||||
|
@ -14,6 +14,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -13,17 +13,16 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.client.api.UElementHandler
|
||||
import com.android.tools.lint.detector.api.Detector
|
||||
import com.android.tools.lint.detector.api.JavaContext
|
||||
import com.ichi2.anki.lint.utils.KotlinCleanup
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UField
|
||||
import org.jetbrains.uast.UVariable
|
||||
|
||||
@KotlinCleanup("IDE Lint")
|
||||
abstract class JavaFieldNamingPatternDetector : Detector(), Detector.UastScanner {
|
||||
override fun createUastHandler(context: JavaContext): UElementHandler? {
|
||||
return VariableNamingHandler(context)
|
||||
|
@ -14,6 +14,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -15,6 +15,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -14,6 +14,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.SdkConstants
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.Implementation
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.client.api.UElementHandler
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.detector.api.*
|
||||
|
@ -14,6 +14,7 @@
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.rules
|
||||
|
||||
import com.android.tools.lint.client.api.UElementHandler
|
||||
|
@ -1,3 +1,4 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.utils
|
||||
|
||||
import com.android.tools.lint.detector.api.Category
|
||||
@ -7,7 +8,6 @@ import com.android.tools.lint.detector.api.Severity
|
||||
/**
|
||||
* Hold some constants applicable to all lint issues.
|
||||
*/
|
||||
@KotlinCleanup("IDE Lint")
|
||||
object Constants {
|
||||
/**
|
||||
* A special [Category] which groups the Lint issues related to the usage of the new SystemTime class as a
|
||||
|
@ -13,6 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
package com.ichi2.anki.lint.utils
|
||||
|
||||
import com.android.tools.lint.client.api.UElementHandler
|
||||
@ -21,7 +22,6 @@ import com.android.tools.lint.detector.api.JavaContext
|
||||
import org.jetbrains.uast.UElement
|
||||
import org.jetbrains.uast.UImportStatement
|
||||
|
||||
@KotlinCleanup("IDE lint")
|
||||
abstract class ImportStatementDetector : Detector() {
|
||||
abstract fun visitImportStatement(context: JavaContext, node: UImportStatement)
|
||||
override fun getApplicableUastTypes(): List<Class<out UElement?>>? {
|
||||
|
Loading…
Reference in New Issue
Block a user