Skip to content

Commit 18df4b6

Browse files
committed
Merge branch 'develop' into v5
2 parents 471944e + 6cf0a57 commit 18df4b6

File tree

71 files changed

+1256
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1256
-399
lines changed

.swiftformat

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,66 @@
22
--header "\nCopyright © {year} Stream.io Inc. All rights reserved.\n"
33
--swiftversion 6.0
44

5-
--ifdef no-indent
6-
--disable redundantType
7-
--disable extensionAccessControl
8-
--disable andOperator
9-
--disable hoistPatternLet
10-
--disable typeSugar
11-
12-
--disable redundantGet # it removes get async throws from getters
5+
# Use allow-list
6+
--rules blankLinesAroundMark
7+
--rules blankLinesAtEndOfScope
8+
--rules blankLinesAtStartOfScope
9+
--rules blankLinesBetweenScopes
10+
--rules braces
11+
--rules consecutiveBlankLines
12+
--rules consecutiveSpaces
13+
--rules duplicateImports
14+
--rules elseOnSameLine
15+
--rules emptyBraces
16+
--rules enumNamespaces
17+
--rules fileHeader
18+
--rules indent
19+
--rules initCoderUnavailable
20+
--rules isEmpty
21+
--rules leadingDelimiters
22+
--rules linebreakAtEndOfFile
23+
--rules linebreaks
24+
--rules modifierOrder
25+
--rules numberFormatting
26+
--rules redundantBackticks
27+
--rules redundantBreak
28+
--rules redundantExtensionACL
29+
--rules redundantFileprivate
30+
--rules redundantLet
31+
--rules redundantLetError
32+
--rules redundantNilInit
33+
--rules redundantObjc
34+
--rules redundantPattern
35+
--rules redundantRawValues
36+
--rules redundantVoidReturnType
37+
--rules semicolons
38+
--rules sortedImports
39+
--rules spaceAroundBraces
40+
--rules spaceAroundBrackets
41+
--rules spaceAroundComments
42+
--rules spaceAroundGenerics
43+
--rules spaceAroundOperators
44+
--rules spaceAroundParens
45+
--rules spaceInsideBraces
46+
--rules spaceInsideBrackets
47+
--rules spaceInsideComments
48+
--rules spaceInsideGenerics
49+
--rules spaceInsideParens
50+
--rules strongOutlets
51+
--rules strongifiedSelf
52+
--rules todos
53+
--rules trailingCommas
54+
--rules trailingSpace
55+
--rules unusedArguments
56+
--rules void
57+
--rules wrap
58+
--rules wrapArguments
59+
--rules wrapAttributes
60+
--rules yodaConditions
1361

14-
# Rules inferred from Swift Standard Library:
15-
--disable anyObjectProtocol, wrapMultilineStatementBraces
62+
# Configuration for enabled rules
63+
--ifdef no-indent
1664
--indent 4
17-
--enable isEmpty
18-
--disable redundantParens # it generates mistakes for e.g. "if (a || b), let x = ... {}"
1965
--semicolons inline
2066
--nospaceoperators ..., ..< # what about ==, +=?
2167
--commas inline

.swiftlint.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ excluded:
77
- Sources/StreamChatSwiftUI/StreamNuke
88

99
only_rules:
10-
# Currently enabled autocorrectable rules
1110
- attribute_name_spacing
1211
- closing_brace
1312
- colon
@@ -19,14 +18,15 @@ only_rules:
1918
- empty_enum_arguments
2019
- empty_parameters
2120
- empty_parentheses_with_trailing_closure
22-
- explicit_init
21+
- file_name_no_space
2322
- joined_default_parameter
2423
- leading_whitespace
2524
- legacy_cggeometry_functions
2625
- legacy_constant
2726
- legacy_constructor
2827
- legacy_nsgeometry_functions
2928
- mark
29+
- multiline_arguments
3030
- no_space_in_method_call
3131
- prefer_type_checking
3232
- private_over_fileprivate
@@ -50,3 +50,12 @@ only_rules:
5050
- unused_import
5151
- vertical_whitespace
5252
- void_return
53+
54+
multiline_arguments:
55+
only_enforce_after_first_closure_on_first_line: true
56+
57+
trailing_whitespace:
58+
ignores_empty_lines: true
59+
60+
file_name_no_space:
61+
severity: error

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
### ✅ Added
77
- Opens the `commandsHandler` and makes the mention methods public [#979](https://github.com/GetStream/stream-chat-swiftui/pull/979)
88
- Opens `MarkdownFormatter` so that it can be customised [#978](https://github.com/GetStream/stream-chat-swiftui/pull/978)
9+
- Add participant actions in channel info view [#982](https://github.com/GetStream/stream-chat-swiftui/pull/982)
10+
- Add support for overriding `onImageTap` in `LinkAttachmentView` [#986](https://github.com/GetStream/stream-chat-swiftui/pull/986)
911

1012
### 🐞 Fixed
1113
- Fix openChannel not working when searching or another chat shown [#975](https://github.com/GetStream/stream-chat-swiftui/pull/975)

DemoAppSwiftUI/ChannelHeader/CustomChannelHeader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct CustomChannelModifier: ChannelListHeaderViewModifier {
7575
actionsPopupShown: $actionsPopupShown
7676
)
7777
#if compiler(>=6.2)
78-
.sharedBackgroundVisibility(.hidden)
78+
.sharedBackgroundVisibility(.hidden)
7979
#endif
8080
}
8181
} else {

DemoAppSwiftUI/CustomComposerAttachmentView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CustomAttachmentsFactory: ViewFactory {
5252

5353
func makeAttachmentSourcePickerView(
5454
selected: AttachmentPickerState,
55-
onPickerStateChange: @escaping @MainActor(AttachmentPickerState) -> Void
55+
onPickerStateChange: @escaping @MainActor (AttachmentPickerState) -> Void
5656
) -> some View {
5757
CustomAttachmentSourcePickerView(
5858
selected: selected,
@@ -62,7 +62,7 @@ class CustomAttachmentsFactory: ViewFactory {
6262

6363
func makeCustomAttachmentView(
6464
addedCustomAttachments: [CustomAttachment],
65-
onCustomAttachmentTap: @escaping @MainActor(CustomAttachment) -> Void
65+
onCustomAttachmentTap: @escaping @MainActor (CustomAttachment) -> Void
6666
) -> some View {
6767
CustomContactAttachmentView(
6868
contacts: mockContacts,
@@ -98,7 +98,7 @@ class CustomAttachmentsFactory: ViewFactory {
9898

9999
func makeCustomAttachmentPreviewView(
100100
addedCustomAttachments: [CustomAttachment],
101-
onCustomAttachmentTap: @escaping @MainActor(CustomAttachment) -> Void
101+
onCustomAttachmentTap: @escaping @MainActor (CustomAttachment) -> Void
102102
) -> some View {
103103
CustomContactAttachmentComposerPreview(
104104
addedCustomAttachments: addedCustomAttachments,

DemoAppSwiftUI/ViewFactoryExamples.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class DemoAppFactory: ViewFactory {
2121

2222
func supportedMoreChannelActions(
2323
for channel: ChatChannel,
24-
onDismiss: @escaping @MainActor() -> Void,
25-
onError: @escaping @MainActor(Error) -> Void
24+
onDismiss: @escaping @MainActor () -> Void,
25+
onError: @escaping @MainActor (Error) -> Void
2626
) -> [ChannelAction] {
2727
var actions = ChannelAction.defaultActions(
2828
for: channel,
@@ -49,11 +49,11 @@ class DemoAppFactory: ViewFactory {
4949
disabled: Bool,
5050
selectedChannel: Binding<ChannelSelectionInfo?>,
5151
swipedChannelId: Binding<String?>,
52-
channelDestination: @escaping @MainActor(ChannelSelectionInfo) -> ChatChannelView<DemoAppFactory>,
53-
onItemTap: @escaping @MainActor(ChatChannel) -> Void,
54-
trailingSwipeRightButtonTapped: @escaping @MainActor(ChatChannel) -> Void,
55-
trailingSwipeLeftButtonTapped: @escaping @MainActor(ChatChannel) -> Void,
56-
leadingSwipeButtonTapped: @escaping @MainActor(ChatChannel) -> Void
52+
channelDestination: @escaping @MainActor (ChannelSelectionInfo) -> ChatChannelView<DemoAppFactory>,
53+
onItemTap: @escaping @MainActor (ChatChannel) -> Void,
54+
trailingSwipeRightButtonTapped: @escaping @MainActor (ChatChannel) -> Void,
55+
trailingSwipeLeftButtonTapped: @escaping @MainActor (ChatChannel) -> Void,
56+
leadingSwipeButtonTapped: @escaping @MainActor (ChatChannel) -> Void
5757
) -> some View {
5858
let listItem = DemoAppChatChannelNavigatableListItem(
5959
channel: channel,
@@ -83,8 +83,8 @@ class DemoAppFactory: ViewFactory {
8383

8484
private func archiveChannelAction(
8585
for channel: ChatChannel,
86-
onDismiss: @escaping @MainActor() -> Void,
87-
onError: @escaping @MainActor(Error) -> Void
86+
onDismiss: @escaping @MainActor () -> Void,
87+
onError: @escaping @MainActor (Error) -> Void
8888
) -> ChannelAction {
8989
ChannelAction(
9090
title: channel.isArchived ? "Unarchive Channel" : "Archive Channel",
@@ -117,8 +117,8 @@ class DemoAppFactory: ViewFactory {
117117

118118
private func pinChannelAction(
119119
for channel: ChatChannel,
120-
onDismiss: @escaping @MainActor() -> Void,
121-
onError: @escaping @MainActor(Error) -> Void
120+
onDismiss: @escaping @MainActor () -> Void,
121+
onError: @escaping @MainActor (Error) -> Void
122122
) -> ChannelAction {
123123
let pinChannel = ChannelAction(
124124
title: channel.isPinned ? "Unpin Channel" : "Pin Channel",
@@ -257,16 +257,16 @@ class CustomFactory: ViewFactory {
257257
// Example for an injected action. Uncomment to see it in action.
258258
func supportedMoreChannelActions(
259259
for channel: ChatChannel,
260-
onDismiss: @escaping @MainActor() -> Void,
261-
onError: @escaping @MainActor(Error) -> Void
260+
onDismiss: @escaping @MainActor () -> Void,
261+
onError: @escaping @MainActor (Error) -> Void
262262
) -> [ChannelAction] {
263263
var defaultActions = ChannelAction.defaultActions(
264264
for: channel,
265265
chatClient: chatClient,
266266
onDismiss: onDismiss,
267267
onError: onError
268268
)
269-
let freeze: @MainActor() -> Void = {
269+
let freeze: @MainActor () -> Void = {
270270
let controller = self.chatClient.channelController(for: channel.cid)
271271
controller.freezeChannel { error in
272272
if let error {
@@ -297,8 +297,8 @@ class CustomFactory: ViewFactory {
297297

298298
func makeMoreChannelActionsView(
299299
for channel: ChatChannel,
300-
onDismiss: @escaping @MainActor() -> Void,
301-
onError: @escaping @MainActor(Error) -> Void
300+
onDismiss: @escaping @MainActor () -> Void,
301+
onError: @escaping @MainActor (Error) -> Void
302302
) -> some View {
303303
VStack {
304304
Text("This is our custom view")

DemoAppSwiftUI/iMessagePocView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class iMessageViewFactory: ViewFactory {
126126
channel: ChatChannel,
127127
offsetX: CGFloat,
128128
buttonWidth: CGFloat,
129-
buttonTapped: @escaping @MainActor(ChatChannel) -> Void
129+
buttonTapped: @escaping @MainActor (ChatChannel) -> Void
130130
) -> some View {
131131
HStack {
132132
ActionItemButton(imageName: "pin.fill") {

Githubfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ export YEETD_VERSION='1.0'
66
export SONAR_VERSION='6.2.1.4610'
77
export IPSW_VERSION='3.1.592'
88
export INTERFACE_ANALYZER_VERSION='1.0.7'
9-
export SWIFT_LINT_VERSION='0.55.1'
10-
export SWIFT_FORMAT_VERSION='0.47.12'
9+
export SWIFT_LINT_VERSION='0.59.1'
10+
export SWIFT_FORMAT_VERSION='0.58.2'
1111
export SWIFT_GEN_VERSION='6.5.1'

Sources/StreamChatSwiftUI/Appearance.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public class Appearance {
2121
}
2222

2323
/// Provider for custom localization which is dependent on App Bundle.
24-
nonisolated(unsafe)
25-
public static var localizationProvider: @Sendable(_ key: String, _ table: String) -> String = { key, table in
24+
public nonisolated(unsafe)
25+
static var localizationProvider: @Sendable (_ key: String, _ table: String) -> String = { key, table in
2626
Bundle.streamChatUI.localizedString(forKey: key, value: nil, table: table)
2727
}
2828
}

Sources/StreamChatSwiftUI/ChatChannel/ChannelHeader/ChatChannelHeaderViewModifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public struct DefaultChannelHeaderModifier<Factory: ViewFactory>: ChatChannelHea
118118
isActive: $isActive
119119
)
120120
#if compiler(>=6.2)
121-
.sharedBackgroundVisibility(.hidden)
121+
.sharedBackgroundVisibility(.hidden)
122122
#endif
123123
}
124124
} else {

0 commit comments

Comments
 (0)