diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a222d6d..77fddc3f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,11 @@ [Julien Baillon](https://github.com/julien-baillon) [#5372](https://github.com/realm/SwiftLint/issues/5372) +* Allow to set the severity of rules (if they have one) in the short form + `rule_name: warning|error` provided that no other attributes need to be + configured. + [SimplyDanny](https://github.com/SimplyDanny) + * Add new `ignore_one_liners` option to `switch_case_alignment` rule to ignore switch statements written in a single line. [tonell-m](https://github.com/tonell-m) diff --git a/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift b/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift index 776706345..029d449f0 100644 --- a/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift +++ b/Source/SwiftLintCoreMacros/RuleConfigurationMacros.swift @@ -35,9 +35,27 @@ enum AutoApply: MemberMacro { let elementNames = annotatedVarDecls.compactMap { $0.0.bindings.first?.pattern.as(IdentifierPatternSyntax.self)?.identifier.text } + let nonInlinedOptions = elementNames[..(.warning)