Skip to content

Commit

Permalink
Merge branch 'master' into infomaniak-editor
Browse files Browse the repository at this point in the history
# Conflicts:
#	Mail/Helpers/RichTextEditor.swift
#	Package.swift
#	Project.swift
  • Loading branch information
valentinperignon committed Apr 30, 2024
2 parents e66116e + 314f143 commit cb198ab
Show file tree
Hide file tree
Showing 266 changed files with 1,807 additions and 1,004 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
with:
access_token: ${{ github.token }}
- uses: jdx/mise-action@v2
with:
cache: false
- name: Checkout
uses: actions/checkout@v2
- name: Create test env
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/periphery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI workflow

on:
pull_request:
branches: [ master ]

jobs:
build:
name: Scan unused code
runs-on: [ self-hosted, iOS ]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: jdx/mise-action@v2
with:
cache: false
- name: Checkout
uses: actions/checkout@v2
- name: Periphery
id: periphery
run: ./scripts/periphery.sh
- uses: mshick/add-pr-comment@v2
with:
message: |
Found ${{ steps.periphery.outputs.unused_count }} unused code occurences
<details>
<summary>Expand</summary>
```
${{ steps.periphery.outputs.detailed_output }}
```
</details>
2 changes: 2 additions & 0 deletions .github/workflows/uitests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
with:
access_token: ${{ github.token }}
- uses: jdx/mise-action@v2
with:
cache: false
- name: Checkout
uses: actions/checkout@v2
- name: Create test env
Expand Down
3 changes: 2 additions & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[tools]
tuist = '4.9.0'
periphery = '2.18.0'
swiftformat = '0.53.7'
swiftlint = '0.54.0'
swiftlint = '0.54.0'
19 changes: 19 additions & 0 deletions .periphery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
clean_build: true
retain_objc_accessible: true
retain_public: true
schemes:
- Infomaniak Mail
- MailAppIntentsExtension
- MailCore
- MailCoreUI
- MailNotificationServiceExtension
- MailResources
- MailShareExtension
targets:
- Infomaniak Mail
- MailAppIntentsExtension
- MailCore
- MailNotificationServiceExtension
- MailResources
- MailShareExtension
workspace: Mail.xcworkspace
2 changes: 2 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ disabled_rules:
- force_cast
- cyclomatic_complexity
- inclusive_language
- for_where
opt_in_rules:
- closure_end_indentation
- closure_spacing
Expand All @@ -29,6 +30,7 @@ opt_in_rules:
- toggle_bool
- trailing_closure
- unneeded_parentheses_in_closure_argument
analyzer_rules:
- unused_import
excluded:
- .tuist-bin/*
Expand Down
1 change: 1 addition & 0 deletions Mail/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import InfomaniakCore
import InfomaniakDI
import InfomaniakNotifications
import MailCore
import MailCoreUI
import UIKit

@available(iOSApplicationExtension, unavailable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import InfomaniakCore
import MailCore
import MailCoreUI
import MailResources
import SwiftModalPresentation
import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import MailCoreUI
import MailResources
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import InfomaniakCoreUI
import InfomaniakDI
import MailCore
import MailCoreUI
import MailResources
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import MailCore
import MailCoreUI
import MailResources
import SwiftUI

Expand Down
1 change: 1 addition & 0 deletions Mail/Components/MailboxListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import MailCore
import MailCoreUI
import MailResources
import RealmSwift
import SwiftUI
Expand Down
8 changes: 7 additions & 1 deletion Mail/Components/ThreadCell/ThreadCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import MailCore
import MailCoreUI
import MailResources
import SwiftUI

Expand All @@ -33,6 +34,10 @@ extension ThreadDensity {
}

struct ThreadCellDataHolder {
static let lastMessageNotFromSentPredicate = NSPredicate(
format: "SUBQUERY(folders, $folder, $folder.role != %@).@count > 0",
FolderRole.sent.rawValue
)
/// Sender of the last message that is not in the Sent folder, otherwise the last message of the thread
let recipientToDisplay: Recipient?

Expand All @@ -48,7 +53,8 @@ struct ThreadCellDataHolder {
let isInWrittenByMeFolder: Bool

init(thread: Thread) {
let lastMessageNotFromSent = thread.messages.last { $0.folder?.role != .sent } ?? thread.messages.last
let lastMessageNotFromSent = thread.messages.filter(Self.lastMessageNotFromSentPredicate).last ?? thread.messages.last

date = thread.date.formatted(.thread(.list))

subject = thread.formattedSubject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import MailCore
import MailCoreUI
import SwiftUI

struct ThreadCellAvatarCheckboxView: View {
Expand Down
1 change: 1 addition & 0 deletions Mail/Components/ThreadCell/ThreadCellDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import MailCore
import MailCoreUI
import MailResources
import SwiftUI

Expand Down
1 change: 1 addition & 0 deletions Mail/Helpers/MailTargetAssembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import InfomaniakDI
import InfomaniakLogin
import InfomaniakNotifications
import MailCore
import MailCoreUI

open class CommonAppAndShareTargetAssembly: TargetAssembly {
override open class func getTargetServices() -> [Factory] {
Expand Down
Loading

0 comments on commit cb198ab

Please sign in to comment.