Skip to content

Commit e972ff3

Browse files
Add SwiftLint, fix swiftlint issues
1 parent ede1182 commit e972ff3

File tree

16 files changed

+68
-22
lines changed

16 files changed

+68
-22
lines changed

OktaLogger.playground/Pages/FileLogger.xcplaygroundpage/Contents.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
/*
2+
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
3+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4+
*
5+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6+
* Unless required by applicable law or agreed to in writing, software
7+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
*
10+
* See the License for the specific language governing permissions and limitations under the License.
11+
*/
12+
113
import UIKit
214
import OktaLogger
315

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1+
/*
2+
* Copyright (c) 2021-Present, Okta, Inc. and/or its affiliates. All rights reserved.
3+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4+
*
5+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6+
* Unless required by applicable law or agreed to in writing, software
7+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
*
10+
* See the License for the specific language governing permissions and limitations under the License.
11+
*/
12+
13+
114
//: # OktaLogger Documentation
215
//: - [How to Use a File Logger?](FileLogger)

OktaLogger.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@
367367
D5C824D12469DBF1005CF747 /* Frameworks */,
368368
D5C824D22469DBF1005CF747 /* Resources */,
369369
80DDE78E24B962C900D0E2F3 /* Embed Frameworks */,
370+
7B0C4EE7276D1DAC0033BDC6 /* SwiftLint */,
370371
);
371372
buildRules = (
372373
);
@@ -574,6 +575,24 @@
574575
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
575576
showEnvVarsInLog = 0;
576577
};
578+
7B0C4EE7276D1DAC0033BDC6 /* SwiftLint */ = {
579+
isa = PBXShellScriptBuildPhase;
580+
buildActionMask = 2147483647;
581+
files = (
582+
);
583+
inputFileListPaths = (
584+
);
585+
inputPaths = (
586+
);
587+
name = SwiftLint;
588+
outputFileListPaths = (
589+
);
590+
outputPaths = (
591+
);
592+
runOnlyForDeploymentPostprocessing = 0;
593+
shellPath = /bin/sh;
594+
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\" --config \"${PROJECT_DIR}/.swiftlint.yml\"\n";
595+
};
577596
9ECAD1E0171C5273C443BE35 /* [CP] Embed Pods Frameworks */ = {
578597
isa = PBXShellScriptBuildPhase;
579598
buildActionMask = 2147483647;

OktaLogger/AppCenterLogger/AppCenterLogger.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import AppCenterAnalytics
1314

1415
/**

OktaLogger/FileLoggers/DDLogFileManagerCustomName.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import Foundation
1314
import CocoaLumberjack
1415

OktaLogger/FileLoggers/LumberjackLoggerDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import CocoaLumberjack
1314

1415
class LumberjackLoggerDelegate: FileLoggerDelegate {

OktaLogger/FileLoggers/OktaLoggerFileLogFormatter.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12-
//
13-
// OktaLoggerFileLogFormatter.swift
14-
// OktaLogger
15-
//
16-
// Created by Borys Kasianenko on 1/25/21.
17-
//
1812

1913
import Foundation
2014
import CocoaLumberjack

OktaLogger/FileLoggers/OktaLoggerFileLogger.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-Present, Okta, Inc. and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021-Present, Okta, Inc. and/or its affiliates. All rights reserved.
33
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
44
*
55
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
@@ -9,6 +9,7 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import Foundation
1314

1415
@objc

OktaLogger/FileLoggers/OktaLoggerFileLoggerConfig.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import Foundation
14+
1315
@objc
1416
public class OktaLoggerFileLoggerConfig: NSObject {
1517

OktaLogger/FirebaseCrashlyticsLogger/OktaLoggerFirebaseCrashlyticsLogger.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*
1010
* See the License for the specific language governing permissions and limitations under the License.
1111
*/
12+
1213
import FirebaseCrashlytics
1314

1415
/**
@@ -91,7 +92,7 @@ open class OktaLoggerFirebaseCrashlyticsLogger: OktaLoggerDestinationBase {
9192
let normalizedEventName = eventName.lowercased().replacingOccurrences(of: " ", with: "-")
9293
return "\(identifier).\(normalizedEventName)"
9394
}
94-
95+
9596
class func createUserInfoDict(level: OktaLoggerLogLevel,
9697
eventName: String,
9798
message: String?,
@@ -108,19 +109,19 @@ open class OktaLoggerFirebaseCrashlyticsLogger: OktaLoggerDestinationBase {
108109
"line": line,
109110
"function": funcName
110111
]
111-
112+
112113
// merge destination-level properties into userInfo (high priority)
113114
if let defaultProperties = defaultProperties as? [String: Any],
114115
!defaultProperties.isEmpty {
115116
userInfo.merge(defaultProperties) { (_, last) in last }
116117
}
117-
118+
118119
// merge log-level properties into userInfo (highest priority)
119120
if let properties = properties as? [String: Any],
120121
!properties.isEmpty {
121122
userInfo.merge(properties) { (_, last) in last }
122123
}
123-
124+
124125
return userInfo
125126
}
126127
}

0 commit comments

Comments
 (0)