Skip to content

Commit

Permalink
Add SwiftLint phase and fix violations
Browse files Browse the repository at this point in the history
  • Loading branch information
kean committed Jul 12, 2024
1 parent 561ae06 commit fa10ccd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Sources/WordPressShared/WordPressComLanguageDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ class WordPressComLanguageDatabase: NSObject {
return (Locale.current as NSLocale).displayName(forKey: NSLocale.Key.identifier, value: slug) ?? name
}



/// Designated initializer. Will fail if any of the required properties is missing
///
init?(dict: [String: Any]) {
Expand All @@ -147,7 +145,6 @@ class WordPressComLanguageDatabase: NSObject {
slug = unwrappedSlug
}


/// Given an array of raw languages, will return a parsed array.
///
static func fromArray(_ array: [[String: Any]] ) -> [Language] {
Expand All @@ -169,7 +166,6 @@ class WordPressComLanguageDatabase: NSObject {
return NSLocale.preferredLanguages.first?.lowercased() ?? "en"
}()


// MARK: - Private Constants
fileprivate let filename = "Languages"

Expand All @@ -180,7 +176,6 @@ class WordPressComLanguageDatabase: NSObject {
"zh-hant": "zh-tw"
]


// MARK: - Private Nested Structures

/// Keys used to parse the raw languages.
Expand Down
23 changes: 23 additions & 0 deletions WordPressKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2835,6 +2835,7 @@
9368C7761EC5EF1B0092CE8E /* Sources */,
9368C7771EC5EF1B0092CE8E /* Frameworks */,
9368C7791EC5EF1B0092CE8E /* Resources */,
0C2F2A2C2C41F82B000A153E /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -3256,6 +3257,28 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
0C2F2A2C2C41F82B000A153E /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = SwiftLint;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "./Pods/SwiftLint/swiftlint lint\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
9368C7761EC5EF1B0092CE8E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down

0 comments on commit fa10ccd

Please sign in to comment.