prepareLintAnalysis method
(LintAnalysisConfig, Set<String> , LintFileReport?)
prepareLintAnalysis(
- AnalysisContext context,
- Iterable<
String> folders, - String rootFolder,
- LintConfig config,
- AnalysisContextCollection collection,
Implementation
(
LintAnalysisConfig lintAnalysisConfig,
Set<String> analyzedFiles,
LintFileReport? report,
) prepareLintAnalysis(
AnalysisContext context,
Iterable<String> folders,
String rootFolder,
LintConfig config,
AnalysisContextCollection collection,
) {
final lintAnalysisConfig = _getAnalysisConfig(context, rootFolder, config);
final report = LintAnalysisOptionsValidator.validateOptions(
lintAnalysisConfig,
rootFolder,
);
if (config.shouldPrintConfig) {
_logger?.printConfig(lintAnalysisConfig.toJson());
}
final filePaths = getFilePaths(
folders,
context,
rootFolder,
lintAnalysisConfig.globalExcludes,
);
final analyzedFiles =
filePaths.intersection(context.contextRoot.analyzedFiles().toSet());
final contextsLength = collection.contexts.length;
final filesLength = analyzedFiles.length;
final updateMessage = contextsLength == 1
? 'Processing $filesLength file(s)'
: 'Processing ${collection.contexts.indexOf(context) + 1}/$contextsLength contexts with $filesLength file(s)';
_logger?.progress.update(updateMessage);
return (lintAnalysisConfig, analyzedFiles, report);
}