Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 910a70b

Browse files
authored
Merge pull request #1139 from ccrama/core_data_rewrite
v7: Slide Backend Overhaul
2 parents 48684c8 + a23f1e4 commit 910a70b

235 files changed

Lines changed: 12188 additions & 8483 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.pbxproj merge=union
22
*.pbxproj filter=filter-credentials
33
"Slide for Reddit/Info.plist" filter=filter-credentials
4+
*.ipa filter=lfs diff=lfs merge=lfs -text

.github/workflows/core_data_tests.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,51 @@
11
name: CI
22
on:
33
pull_request:
4-
branches:
5-
- develop
4+
branches-ignore: #All branches
5+
- ignore
66
jobs:
77
validate-and-test:
88
runs-on: macOS-latest
9+
timeout-minutes: 30
910
steps:
1011
- name: Checkout
11-
uses: actions/checkout@v1
12+
uses: actions/checkout@v2
1213
- name: Cache RubyGems
13-
uses: actions/cache@v1
14+
uses: actions/cache@v2.1.3
1415
with:
1516
path: vendor/bundle
1617
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
17-
restore-keys: ${{ runner.os }}-gem-
18+
restore-keys: |
19+
${{ runner.os }}-gem-
20+
- name: Cache Pods
21+
uses: actions/cache@v2.1.3
22+
with:
23+
path: Pods
24+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-pods-
1827
- name: Cache Mint packages
19-
uses: actions/cache@v1
28+
uses: actions/cache@v2.1.3
2029
with:
2130
path: ${{ env.MINT_PATH }}
2231
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
23-
restore-keys: ${{ runner.os }}-mint-
32+
restore-keys: |
33+
${{ runner.os }}-mint-
34+
- name: Cache Swift Package Manager
35+
uses: actions/cache@v2.1.3
36+
with:
37+
path: .build
38+
key: ${{ runner.os }}-spm-${{ github.workspace }}-${{ hashFiles('Package.resolved') }}
39+
restore-keys: |
40+
${{ runner.os }}-spm-${{ github.workspace }}
2441
- name: Install dependencies
25-
run: sh ./bootstrap.sh
42+
run: |
43+
sh ./bootstrap.sh
44+
pod install
2645
- name: Run code validation
27-
run: bundle exec danger
46+
uses: actions/checkout@v1
47+
with:
48+
args: --failOnErrors --no-publish-check
2849
env:
2950
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_TOKEN }}
3051
- name: Run tests

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,13 @@ DerivedData/
7070
!default.mode2v3
7171
*.perspectivev3
7272
!default.perspectivev3
73-
*.ipa
7473
*.dSYM.zip
7574

75+
## Build Stuff
76+
DistributionSummary.plist
77+
ExportOptions.plist
78+
Packaging.log
79+
7680
## Xcode Patch
7781
*.xcodeproj/*
7882
!*.xcodeproj/project.pbxproj

.swiftlint.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ disabled_rules:
1717
- force_cast
1818
- type_name
1919
- force_try
20-
- weak_delegate
2120

2221
opt_in_rules:
2322
- array_init
@@ -27,9 +26,15 @@ opt_in_rules:
2726
- operator_usage_whitespace
2827
- sorted_first_last
2928
- sorted_imports
29+
30+
excluded:
31+
- CoreData_Models
32+
- "*+CoreDataClass.swift"
33+
- "*+CoreDataProperties.swift"
34+
- Pods
3035

3136
control_statement:
32-
severity: error
37+
severity: warning
3338

3439
shorthand_operator:
3540
severity: warning
@@ -54,7 +59,12 @@ custom_rules:
5459
regex: "(?:edge|horizontal|vertical|leading|trailing|top|bottom|left|right|height|width|centerX|centerY)Anchors?\\s*(==|<=|>=)"
5560
message: "Wrap Anchorage operators with //. For example, use /==/ instead of ==."
5661
severity: warning
62+
swift_migrator_functions:
63+
name: "Swift Migrator Functions"
64+
regex: "\\/\\/ Helper function inserted by Swift \\d(.\\d)* migrator."
65+
message: "Function left over from automatic Swift version migrator. Refactor or eliminate."
66+
severity: warning
5767

5868

5969
excluded:
60-
- Pods
70+
- Pods
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// CommentModel+CoreDataClass.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
@objc(CommentModel)
14+
public class CommentModel: NSManagedObject {
15+
16+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
//
2+
// CommentModel+CoreDataProperties.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
extension CommentModel {
14+
15+
@nonobjc public class func fetchRequest() -> NSFetchRequest<CommentModel> {
16+
return NSFetchRequest<CommentModel>(entityName: "CommentModel")
17+
}
18+
19+
@NSManaged public var approvedBy: String?
20+
@NSManaged public var author: String
21+
@NSManaged public var awardsJSON: String?
22+
@NSManaged public var controversality: Int64
23+
@NSManaged public var created: Date
24+
@NSManaged public var edited: Date
25+
@NSManaged public var depth: Int64
26+
@NSManaged public var distinguished: String?
27+
@NSManaged public var flairJSON: String?
28+
@NSManaged public var hasVoted: Bool
29+
@NSManaged public var hidden: Bool
30+
@NSManaged public var htmlBody: String
31+
@NSManaged public var id: String
32+
@NSManaged public var isApproved: Bool
33+
@NSManaged public var isArchived: Bool
34+
@NSManaged public var isCakeday: Bool
35+
@NSManaged public var isEdited: Bool
36+
@NSManaged public var isMod: Bool
37+
@NSManaged public var isRemoved: Bool
38+
@NSManaged public var isSaved: Bool
39+
@NSManaged public var isStickied: Bool
40+
@NSManaged public var locked: Bool
41+
@NSManaged public var markdownBody: String
42+
@NSManaged public var linkID: String
43+
@NSManaged public var name: String
44+
@NSManaged public var parentID: String
45+
@NSManaged public var permalink: String
46+
@NSManaged public var removalNote: String?
47+
@NSManaged public var removalReason: String?
48+
@NSManaged public var removedBy: String?
49+
@NSManaged public var reportsJSON: String?
50+
@NSManaged public var score: Int64
51+
@NSManaged public var scoreHidden: Bool
52+
@NSManaged public var submissionTitle: String
53+
@NSManaged public var subreddit: String
54+
@NSManaged public var voteDirection: Bool
55+
@NSManaged public var saveDate: Date
56+
57+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// FriendModel+CoreDataClass.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
@objc(FriendModel)
14+
public class FriendModel: NSManagedObject {
15+
16+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// FriendModel+CoreDataProperties.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
extension FriendModel {
14+
15+
@nonobjc public class func fetchRequest() -> NSFetchRequest<FriendModel> {
16+
return NSFetchRequest<FriendModel>(entityName: "FriendModel")
17+
}
18+
19+
@NSManaged public var name: String
20+
@NSManaged public var friendSince: Date
21+
22+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// ModlogModel+CoreDataClass.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
@objc(ModlogModel)
14+
public class ModlogModel: NSManagedObject {
15+
16+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// ModlogModel+CoreDataProperties.swift
3+
// Slide for Reddit
4+
//
5+
// Created by Carlos Crane on 12/6/20.
6+
// Copyright © 2020 Haptic Apps. All rights reserved.
7+
//
8+
//
9+
10+
import CoreData
11+
import Foundation
12+
13+
extension ModlogModel {
14+
15+
@nonobjc public class func fetchRequest() -> NSFetchRequest<ModlogModel> {
16+
return NSFetchRequest<ModlogModel>(entityName: "ModlogModel")
17+
}
18+
19+
@NSManaged public var id: String
20+
@NSManaged public var mod: String
21+
@NSManaged public var targetBody: String
22+
@NSManaged public var created: Date
23+
@NSManaged public var subreddit: String
24+
@NSManaged public var targetTitle: String
25+
@NSManaged public var permalink: String
26+
@NSManaged public var details: String
27+
@NSManaged public var action: String
28+
@NSManaged public var targetAuthor: String
29+
@NSManaged public var subject: String
30+
}

0 commit comments

Comments
 (0)