merge method
Merges two configs into a single one
Config coming from overrides
has a higher priority
and overrides conflicting entries.
Implementation
LintConfig merge(LintConfig overrides) => LintConfig(
shouldPrintConfig: shouldPrintConfig || overrides.shouldPrintConfig,
excludePatterns: {...excludePatterns, ...overrides.excludePatterns},
excludeForMetricsPatterns: {
...excludeForMetricsPatterns,
...overrides.excludeForMetricsPatterns,
},
metrics: mergeMaps(defaults: metrics, overrides: overrides.metrics),
rules: mergeMaps(defaults: rules, overrides: overrides.rules)
.cast<String, Map<String, Object>>(),
excludeForRulesPatterns: {
...excludeForRulesPatterns,
...overrides.excludeForRulesPatterns,
},
antiPatterns:
mergeMaps(defaults: antiPatterns, overrides: overrides.antiPatterns)
.cast<String, Map<String, Object>>(),
analysisOptionsPath:
analysisOptionsPath ?? overrides.analysisOptionsPath,
);