We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
checkForUnrecognizedRules
1 parent 31916d4 commit 6ebdff1Copy full SHA for 6ebdff1
Sources/swift-format/Frontend/ConfigurationProvider.swift
@@ -40,9 +40,11 @@ final class ConfigurationProvider {
40
// emit them into the diagnosticsEngine as warnings.
41
// That way they will be printed out, but we'll continue execution on the valid rules.
42
43
- let invalidRules = configuration.rules.filter { !RuleRegistry.rules.keys.contains($0.key) }
44
- for rule in invalidRules {
45
- diagnosticsEngine.emitWarning("Configuration contains an unrecognized rule: \(rule.key)", location: nil)
+ for (key, _) in configuration.rules {
+ if RuleRegistry.rules.keys.contains(key) {
+ continue
46
+ }
47
+ diagnosticsEngine.emitWarning("Configuration contains an unrecognized rule: \(key)", location: nil)
48
}
49
50
0 commit comments