Remove deprecation warnings introduced > 2 years ago (#4972)

This commit is contained in:
Danny Mösch 2023-05-10 20:05:28 +02:00 committed by GitHub
parent fa32fbc4f0
commit 9c1678968f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 21 deletions

View File

@ -1,6 +1,3 @@
// swiftlint:disable:next blanket_disable_command
// swiftlint:disable inclusive_language - To ease migration from `whitelist_rules`
extension Configuration { extension Configuration {
// MARK: - Subtypes // MARK: - Subtypes
internal enum Key: String, CaseIterable { internal enum Key: String, CaseIterable {
@ -12,10 +9,8 @@ extension Configuration {
case optInRules = "opt_in_rules" case optInRules = "opt_in_rules"
case reporter = "reporter" case reporter = "reporter"
case swiftlintVersion = "swiftlint_version" case swiftlintVersion = "swiftlint_version"
case useNestedConfigs = "use_nested_configs" // deprecated, always enabled
case warningThreshold = "warning_threshold" case warningThreshold = "warning_threshold"
case onlyRules = "only_rules" case onlyRules = "only_rules"
case whitelistRules = "whitelist_rules" // deprecated in favor of onlyRules
case indentation = "indentation" case indentation = "indentation"
case analyzerRules = "analyzer_rules" case analyzerRules = "analyzer_rules"
case allowZeroLintableFiles = "allow_zero_lintable_files" case allowZeroLintableFiles = "allow_zero_lintable_files"
@ -49,8 +44,7 @@ extension Configuration {
let optInRules = defaultStringArray(dict[Key.optInRules.rawValue] ?? dict[Key.enabledRules.rawValue]) let optInRules = defaultStringArray(dict[Key.optInRules.rawValue] ?? dict[Key.enabledRules.rawValue])
let disabledRules = defaultStringArray(dict[Key.disabledRules.rawValue]) let disabledRules = defaultStringArray(dict[Key.disabledRules.rawValue])
// Use either the new 'only_rules' or fallback to the deprecated 'whitelist_rules' let onlyRules = defaultStringArray(dict[Key.onlyRules.rawValue])
let onlyRules = defaultStringArray(dict[Key.onlyRules.rawValue] ?? dict[Key.whitelistRules.rawValue])
let analyzerRules = defaultStringArray(dict[Key.analyzerRules.rawValue]) let analyzerRules = defaultStringArray(dict[Key.analyzerRules.rawValue])
Self.warnAboutInvalidKeys(configurationDictionary: dict, ruleList: ruleList) Self.warnAboutInvalidKeys(configurationDictionary: dict, ruleList: ruleList)
@ -130,20 +124,6 @@ extension Configuration {
"future release.") "future release.")
} }
// Deprecation warning for "use_nested_configs"
if dict[Key.useNestedConfigs.rawValue] != nil {
queuedPrintError("warning: Support for '\(Key.useNestedConfigs.rawValue)' has " +
"been deprecated and its value is now ignored. Nested configuration files are " +
"now always considered.")
}
// Deprecation warning for "whitelist_rules"
if dict[Key.whitelistRules.rawValue] != nil {
queuedPrintError("warning: '\(Key.whitelistRules.rawValue)' has been renamed to " +
"'\(Key.onlyRules.rawValue)' and will be completely removed in a " +
"future release.")
}
// Deprecation warning for rules // Deprecation warning for rules
let deprecatedRulesIdentifiers = ruleList.list.flatMap { identifier, rule -> [(String, String)] in let deprecatedRulesIdentifiers = ruleList.list.flatMap { identifier, rule -> [(String, String)] in
return rule.description.deprecatedAliases.map { ($0, identifier) } return rule.description.deprecatedAliases.map { ($0, identifier) }