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 Dec 2, 2023
1 parent fafa6ec commit bc4650c
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 @@ -746,7 +746,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 @@ -4741,7 +4741,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 @@ -4781,7 +4781,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 bc4650c

Please sign in to comment.