getLintAnalysisConfig static method
Creates a lint config from given raw config.
Implementation
static LintAnalysisConfig getLintAnalysisConfig(
LintConfig config,
String rootFolder, {
Iterable<Metric>? classMetrics,
Iterable<Metric>? fileMetrics,
Iterable<Metric>? functionMetrics,
}) {
final patterns = getPatternsById(config);
final patternsDependencies = patterns
.map((pattern) => pattern.dependentMetricIds)
.expand((e) => e)
.toSet();
return LintAnalysisConfig(
createAbsolutePatterns(config.excludePatterns, rootFolder),
getRulesById(config.rules),
createAbsolutePatterns(config.excludeForRulesPatterns, rootFolder),
patterns,
classMetrics ??
getMetrics(
config: config.metrics,
patternsDependencies: patternsDependencies,
measuredType: EntityType.classEntity,
),
fileMetrics ??
getMetrics(
config: config.metrics,
patternsDependencies: patternsDependencies,
measuredType: EntityType.fileEntity,
),
functionMetrics ??
getMetrics(
config: config.metrics,
patternsDependencies: patternsDependencies,
measuredType: EntityType.methodEntity,
),
createAbsolutePatterns(config.excludeForMetricsPatterns, rootFolder),
config.metrics,
rootFolder,
config.analysisOptionsPath,
);
}