Skip to content

Commit

Permalink
Include @Environment as non-complex attribute by default
Browse files Browse the repository at this point in the history
  • Loading branch information
calda authored and nicklockwood committed Jun 9, 2024
1 parent 193aabc commit 1df1735
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ public struct FormatOptions: CustomStringConvertible {
storedVarAttributes: AttributeMode = .preserve,
computedVarAttributes: AttributeMode = .preserve,
complexAttributes: AttributeMode = .preserve,
complexAttributesExceptions: Set<String> = [],
complexAttributesExceptions: Set<String> = ["@Environment"],
markTypes: MarkMode = .always,
typeMarkComment: String = "MARK: - %t",
markExtensions: MarkMode = .always,
Expand Down
4 changes: 2 additions & 2 deletions Tests/RulesTests+Wrapping.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4736,7 +4736,7 @@ class WrappingTests: RulesTests {
}
}
"""
let options = FormatOptions(varAttributes: .sameLine, storedVarAttributes: .sameLine, computedVarAttributes: .prevLine, complexAttributes: .prevLine, complexAttributesExceptions: ["@Environment"])
let options = FormatOptions(varAttributes: .sameLine, storedVarAttributes: .sameLine, computedVarAttributes: .prevLine, complexAttributes: .prevLine)
testFormatting(for: input, output, rule: FormatRules.wrapAttributes, options: options)
}

Expand Down Expand Up @@ -4776,7 +4776,7 @@ class WrappingTests: RulesTests {
}
"""

let options = FormatOptions(varAttributes: .sameLine, complexAttributes: .prevLine, complexAttributesExceptions: ["@Environment"])
let options = FormatOptions(varAttributes: .sameLine, complexAttributes: .prevLine)
testFormatting(for: input, rule: FormatRules.wrapAttributes, options: options)
}

Expand Down

0 comments on commit 1df1735

Please sign in to comment.