Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ec8baf6 authored by Thiébaud Weksteen's avatar Thiébaud Weksteen Committed by Android (Google) Code Review
Browse files

Merge "Enable EnforcePermission linters for test sources"

parents a9edba73 d16e1002
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -40,6 +40,8 @@ import org.jetbrains.uast.UElement
import org.jetbrains.uast.UMethod
import org.jetbrains.uast.toUElement

import java.util.EnumSet

/**
 * Lint Detector that ensures that any method overriding a method annotated
 * with @EnforcePermission is also annotated with the exact same annotation.
@@ -206,7 +208,7 @@ class EnforcePermissionDetector : Detector(), SourceCodeScanner {
            severity = Severity.ERROR,
            implementation = Implementation(
                    EnforcePermissionDetector::class.java,
                    Scope.JAVA_FILE_SCOPE
                    EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
            )
        )

@@ -219,7 +221,7 @@ class EnforcePermissionDetector : Detector(), SourceCodeScanner {
            severity = Severity.ERROR,
            implementation = Implementation(
                    EnforcePermissionDetector::class.java,
                    Scope.JAVA_FILE_SCOPE
                    EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
            )
        )
    }
+4 −2
Original line number Diff line number Diff line
@@ -34,6 +34,8 @@ import org.jetbrains.uast.UExpression
import org.jetbrains.uast.UMethod
import org.jetbrains.uast.skipParenthesizedExprDown

import java.util.EnumSet

class EnforcePermissionHelperDetector : Detector(), SourceCodeScanner {
    override fun getApplicableUastTypes(): List<Class<out UElement?>> =
            listOf(UMethod::class.java)
@@ -117,7 +119,7 @@ class EnforcePermissionHelperDetector : Detector(), SourceCodeScanner {
                severity = Severity.ERROR,
                implementation = Implementation(
                        EnforcePermissionHelperDetector::class.java,
                        Scope.JAVA_FILE_SCOPE
                        EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
                )
        )

@@ -130,7 +132,7 @@ class EnforcePermissionHelperDetector : Detector(), SourceCodeScanner {
                severity = Severity.ERROR,
                implementation = Implementation(
                        EnforcePermissionDetector::class.java,
                        Scope.JAVA_FILE_SCOPE
                        EnumSet.of(Scope.JAVA_FILE, Scope.TEST_SOURCES)
                )
        )