summaryrefslogtreecommitdiff
path: root/android-lint/src
diff options
context:
space:
mode:
authorAmr Afifiy <amrmahmoud@google.com>2021-11-18 18:47:01 +0000
committerAmr Afifiy <amrmahmoud@google.com>2021-11-19 20:48:22 +0000
commit9191429a727d82f04539c55e42ed222e5b691b56 (patch)
treef6678c4079c28b7ba2aba6ec721d20b9e5b96b6f /android-lint/src
parentdf17a35297c1d4e8f993b51aef7dd13b713c362f (diff)
downloadidea-9191429a727d82f04539c55e42ed222e5b691b56.tar.gz
Add dsl to exclude testFixtures sources from lint analysis
Bug: 139438142 Test: Model snapshot tests Change-Id: Idecf520a0c4ff96a71c8b91ddca08d512059d4c9
Diffstat (limited to 'android-lint/src')
-rw-r--r--android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt47
1 files changed, 2 insertions, 45 deletions
diff --git a/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt b/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt
index 90cf4d9d41b..f9b85aa2a60 100644
--- a/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt
+++ b/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt
@@ -641,6 +641,7 @@ class LintModelFactory : LintModelModuleLoader {
ignoreWarnings = options.isIgnoreWarnings,
warningsAsErrors = options.isWarningsAsErrors,
ignoreTestSources = options.isIgnoreTestSources,
+ ignoreTestFixturesSources = options.isIgnoreTestFixturesSources,
checkGeneratedSources = options.isCheckGeneratedSources,
explainIssues = options.isExplainIssues,
showAll = options.isShowAll,
@@ -836,6 +837,7 @@ class LintModelFactory : LintModelModuleLoader {
}
companion object {
+
/**
* Returns the [LintModelModuleType] for the given [typeId]. Type ids must be one of the values defined by
* AndroidProjectTypes.PROJECT_TYPE_*.
@@ -879,50 +881,5 @@ class LintModelFactory : LintModelModuleLoader {
LintOptions.SEVERITY_DEFAULT_ENABLED -> LintModelSeverity.WARNING
else -> LintModelSeverity.IGNORE
}
-
- @Suppress("unused") // Used from the lint-gradle module in AGP
- @JvmStatic
- fun getLintOptions(options: LintOptions): DefaultLintModelLintOptions {
- val severityOverrides = options.severityOverrides?.let { source ->
- val map = LinkedHashMap<String, LintModelSeverity>()
- for ((id, severityInt) in source.entries) {
- map[id] = getSeverity(severityInt)
- }
- map
- }
-
- return DefaultLintModelLintOptions(
- // Not all DSL LintOptions; only some are actually accessed from outside
- // the Gradle/CLI configuration currently
- baselineFile = options.baselineFile,
- lintConfig = options.lintConfig,
- severityOverrides = severityOverrides,
- checkTestSources = options.isCheckTestSources,
- checkDependencies = options.isCheckDependencies,
- disable = options.disable,
- enable = options.enable,
- check = options.check,
- abortOnError = options.isAbortOnError,
- absolutePaths = options.isAbsolutePaths,
- noLines = options.isNoLines,
- quiet = options.isQuiet,
- checkAllWarnings = options.isCheckAllWarnings,
- ignoreWarnings = options.isIgnoreWarnings,
- warningsAsErrors = options.isWarningsAsErrors,
- ignoreTestSources = options.isIgnoreTestSources,
- checkGeneratedSources = options.isCheckGeneratedSources,
- explainIssues = options.isExplainIssues,
- showAll = options.isShowAll,
- textReport = options.textReport,
- textOutput = options.textOutput,
- htmlReport = options.htmlReport,
- htmlOutput = options.htmlOutput,
- xmlReport = options.xmlReport,
- xmlOutput = options.xmlOutput,
- sarifReport = options.sarifReport,
- sarifOutput = options.sarifOutput,
- checkReleaseBuilds = options.isCheckReleaseBuilds
- )
- }
}
} \ No newline at end of file