From 6ec46a058f5cde4e02356c0f21fa924e7c112b01 Mon Sep 17 00:00:00 2001 From: Martin Redington Date: Sun, 11 Aug 2024 23:59:26 +0100 Subject: [PATCH] Added more detail --- .../Rules/Style/AttributesRule.swift | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/SwiftLintBuiltInRules/Rules/Style/AttributesRule.swift b/Source/SwiftLintBuiltInRules/Rules/Style/AttributesRule.swift index 19e3195688..38d4cee778 100644 --- a/Source/SwiftLintBuiltInRules/Rules/Style/AttributesRule.swift +++ b/Source/SwiftLintBuiltInRules/Rules/Style/AttributesRule.swift @@ -19,7 +19,14 @@ struct AttributesRule: OptInRule { their own lines before a member declaration has become a conventional Swift style." "This approach limits declaration length. It allows a member to float below its attribute and supports \ - flush-left access modifiers, so `internal`, `public`, etc appear in the leftmost column." + flush-left access modifiers, so `internal`, `public`, etc appear in the leftmost column. Many developers \ + mix-and-match styles for short Swift attributes like `@objc`" + + SwiftLint's rule requires attributes to be on their own lines for functions and types, but on the same line \ + for variables and imports. + + The `attributes_with_arguments_always_on_line_above`, `always_on_same_line`, and `always_on_line_above` \ + configuration parameters can be used to fine-tune the rules behaviour for particular attributes. """, kind: .style, nonTriggeringExamples: AttributesRuleExamples.nonTriggeringExamples,