Skip to content

Commit a4376ef

Browse files
committed
Merge branch 'master' into feature/283-refactor-string-literals
2 parents 3314dac + 8d96956 commit a4376ef

File tree

57 files changed

+2369
-471
lines changed

Some content is hidden

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

57 files changed

+2369
-471
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ fastlane/screenshots
6161
.swift-version
6262
test_push.rb
6363
SwiftLibExampleCertificate.pem
64+
65+
# macOS
66+
67+
.DS_Store

.swiftlint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
excluded:
2+
- Carthage
3+
- Package.swift
4+
5+
identifier_name:
6+
excluded:
7+
- id
8+
- ex
9+
- to
10+
- ws
11+
12+
# This generates a compiler error if more than this many SwiftLint warnings are present
13+
# (This threshold can become more restrictive as remaining warnings are resolved via refactoring)
14+
warning_threshold: 22

Consumption-Tests/.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled_rules:
2+
- line_length

Consumption-Tests/Shared/Swift/ViewController+Extensions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct DebugConsoleMessage: Codable {
2121
}
2222

2323
extension ViewController {
24-
24+
2525
func makeAndLaunchPusher() -> Pusher {
2626

2727
// Only use your secret here for testing or if you're sure that there's security risk
@@ -38,7 +38,7 @@ extension ViewController {
3838
pusher.connect()
3939

4040
// bind to all events globally
41-
let _ = pusher.bind(eventCallback: { (event: PusherEvent) in
41+
_ = pusher.bind(eventCallback: { (event: PusherEvent) in
4242
var message = "Received event: '\(event.eventName)'"
4343

4444
if let channel = event.channelName {
@@ -58,7 +58,7 @@ extension ViewController {
5858
let myChannel = pusher.subscribe("my-channel")
5959

6060
// bind a callback to event "my-event" on that channel
61-
let _ = myChannel.bind(eventName: "my-event", eventCallback: { (event: PusherEvent) in
61+
_ = myChannel.bind(eventName: "my-event", eventCallback: { (event: PusherEvent) in
6262

6363
// convert the data string to type data for decoding
6464
guard let json: String = event.data,
@@ -88,13 +88,13 @@ extension ViewController {
8888

8989
// triggers a client event on that channel
9090
chan.trigger(eventName: "client-test", data: ["test": "some value"])
91-
91+
9292
return pusher
9393
}
9494
}
9595

9696
extension ViewController: PusherDelegate {
97-
97+
9898
// PusherDelegate methods
9999

100100
func changedConnectionState(from old: ConnectionState, to new: ConnectionState) {

Consumption-Tests/Shared/Swift/iOS/AppDelegate.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
66
var window: UIWindow?
77

88
#if swift(>=4.2)
9-
10-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9+
10+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
1111

1212
return true
1313
}
14-
14+
1515
#else
16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
1818

1919
return true
2020
}
21-
21+
2222
#endif
23-
23+
2424
}

Consumption-Tests/Shared/Swift/iOS/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class ViewController: UIViewController {
2121
super.viewDidLoad()
2222
self.pusher = makeAndLaunchPusher()
2323
}
24-
24+
2525
}

Consumption-Tests/Shared/Swift/macOS/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import Cocoa
33
@NSApplicationMain
44
class AppDelegate: NSObject, NSApplicationDelegate {
55

6-
7-
86
func applicationDidFinishLaunching(_ aNotification: Notification) {
97
// Insert code here to initialize your application
108
}
@@ -13,6 +11,4 @@ class AppDelegate: NSObject, NSApplicationDelegate {
1311
// Insert code here to tear down your application
1412
}
1513

16-
1714
}
18-

Consumption-Tests/Shared/Swift/tvOS/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
21
import UIKit
32

43
@UIApplicationMain
54
class AppDelegate: UIResponder, UIApplicationDelegate {
65

76
var window: UIWindow?
87

9-
108
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
119
// Override point for customization after application launch.
1210
return true
@@ -29,6 +27,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2927
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3028
}
3129

32-
3330
}
34-

Consumption-Tests/Shared/Swift/tvOS/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class ViewController: UIViewController {
2121
super.viewDidLoad()
2222
self.pusher = makeAndLaunchPusher()
2323
}
24-
24+
2525
}

PusherSwift.xcodeproj/project.pbxproj

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@
366366
33831C861A9CF61600B124F1 /* Headers */,
367367
33831C871A9CF61600B124F1 /* Resources */,
368368
50355EA8A07B4B8038A4DDF1 /* Frameworks */,
369+
5333AD0A24FE4A8C006E8DF0 /* Run SwiftLint autocorrect */,
370+
5333AD0824F928F1006E8DF0 /* Run SwiftLint */,
369371
);
370372
buildRules = (
371373
);
@@ -404,6 +406,8 @@
404406
73D8A1F72435E5F3001FDE05 /* Headers */,
405407
73D8A1F92435E5F3001FDE05 /* Resources */,
406408
73D8A1FA2435E5F3001FDE05 /* Frameworks */,
409+
5333AD0B24FE4AAC006E8DF0 /* Run SwiftLint autocorrect */,
410+
5333AD0924F92916006E8DF0 /* Run SwiftLint */,
407411
);
408412
buildRules = (
409413
);
@@ -528,6 +532,78 @@
528532
shellPath = /bin/sh;
529533
shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\ntv*) plat=tvOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone\n";
530534
};
535+
5333AD0824F928F1006E8DF0 /* Run SwiftLint */ = {
536+
isa = PBXShellScriptBuildPhase;
537+
buildActionMask = 2147483647;
538+
files = (
539+
);
540+
inputFileListPaths = (
541+
);
542+
inputPaths = (
543+
);
544+
name = "Run SwiftLint";
545+
outputFileListPaths = (
546+
);
547+
outputPaths = (
548+
);
549+
runOnlyForDeploymentPostprocessing = 0;
550+
shellPath = /bin/sh;
551+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
552+
};
553+
5333AD0924F92916006E8DF0 /* Run SwiftLint */ = {
554+
isa = PBXShellScriptBuildPhase;
555+
buildActionMask = 2147483647;
556+
files = (
557+
);
558+
inputFileListPaths = (
559+
);
560+
inputPaths = (
561+
);
562+
name = "Run SwiftLint";
563+
outputFileListPaths = (
564+
);
565+
outputPaths = (
566+
);
567+
runOnlyForDeploymentPostprocessing = 0;
568+
shellPath = /bin/sh;
569+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
570+
};
571+
5333AD0A24FE4A8C006E8DF0 /* Run SwiftLint autocorrect */ = {
572+
isa = PBXShellScriptBuildPhase;
573+
buildActionMask = 2147483647;
574+
files = (
575+
);
576+
inputFileListPaths = (
577+
);
578+
inputPaths = (
579+
);
580+
name = "Run SwiftLint autocorrect";
581+
outputFileListPaths = (
582+
);
583+
outputPaths = (
584+
);
585+
runOnlyForDeploymentPostprocessing = 0;
586+
shellPath = /bin/sh;
587+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
588+
};
589+
5333AD0B24FE4AAC006E8DF0 /* Run SwiftLint autocorrect */ = {
590+
isa = PBXShellScriptBuildPhase;
591+
buildActionMask = 2147483647;
592+
files = (
593+
);
594+
inputFileListPaths = (
595+
);
596+
inputPaths = (
597+
);
598+
name = "Run SwiftLint autocorrect";
599+
outputFileListPaths = (
600+
);
601+
outputPaths = (
602+
);
603+
runOnlyForDeploymentPostprocessing = 0;
604+
shellPath = /bin/sh;
605+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
606+
};
531607
73D8A2222435F24E001FDE05 /* Copy Carthage Frameworks */ = {
532608
isa = PBXShellScriptBuildPhase;
533609
buildActionMask = 2147483647;

0 commit comments

Comments
 (0)