Skip to content

Commit

Permalink
wip: updated swiftlint and swiftformat to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorErrorError committed Oct 13, 2023
1 parent c09489a commit ad01510
Show file tree
Hide file tree
Showing 49 changed files with 127 additions and 158 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/cd.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Lint code using SwiftFormat
run: |
swiftformat --version
swiftformat --config .swiftformat.yml --lint --quiet .
swiftformat --config .swiftformat.yml --lint --quiet --reporter github-actions-log .
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.8
5.9
4 changes: 4 additions & 0 deletions .swiftformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@
# op-ins (disable)

--disable wrapMultilineStatementBraces

# exclude
--exclude "**/Package/*"
--exclude "**/Package.swift"
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ included:

excluded:
- "**/.build"
- "**/Package"

disabled_rules:
- nesting
Expand Down
20 changes: 20 additions & 0 deletions App/Mochi.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
13C18B8E29CE6CC200C14F26 /* Frameworks */,
13C18B8F29CE6CC200C14F26 /* Resources */,
1345C12F29E079120009AB4E /* Run Swiftlint Script */,
13BC25D22AD895AE001DAE2A /* Run SwiftFormat Script */,
);
buildRules = (
);
Expand Down Expand Up @@ -202,6 +203,25 @@
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint --config ../.swiftlint.yml ../\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
13BC25D22AD895AE001DAE2A /* Run SwiftFormat Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Run SwiftFormat Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# export PATH=\"$PATH:/opt/homebrew/bin\"\n# if which swiftformat >/dev/null; then\n# swiftformat --config ../.swiftformat.yml --lint ../\n# else\n# echo \"warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat\"\n# fi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
2 changes: 1 addition & 1 deletion App/Shared/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let store = Store(
reducer: { AppFeature() }
)

@UIApplicationMain
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_: UIApplication,
Expand Down
4 changes: 2 additions & 2 deletions Package/Sources/Clients/AnalyticsClient.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// File.swift
//
// AnalyticsClient.swift
//
//
// Created by ErrorErrorError on 10/4/23.
//
Expand Down
6 changes: 3 additions & 3 deletions Sources/Clients/BuildClient/BuildClient.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// File.swift
//
// BuildClient.swift
//
//
// Created by ErrorErrorError on 7/28/23.
//
//
//

import Dependencies
Expand Down
2 changes: 0 additions & 2 deletions Sources/Clients/DatabaseClient/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public extension DatabaseClient {
}
}

// MARK: DependencyKey

extension DatabaseClient: DependencyKey {}

public extension DependencyValues {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clients/DatabaseClient/Supporting Files/Cast.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// File.swift
// Case.swift
//
//
// Created by ErrorErrorError on 5/16/23.
Expand Down
9 changes: 3 additions & 6 deletions Sources/Clients/DatabaseClient/Supporting Files/Entity.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// File.swift
//
// Entity.swift
//
//
// Created by ErrorErrorError on 9/12/23.
//
//
//

import CoreData
Expand All @@ -21,14 +21,11 @@ public extension Entity {
static var entityName: String { .init(describing: Self.self) }
}

// MARK: - EntityError

public enum EntityError: Error {
case managedObjectIdIsNotPermanent
}

extension Entity {

/// Decodes an NSManagedObject data to Entity type
///
init(id: NSManagedObjectID, context: NSManagedObjectContext) throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ extension TransformableValue {
return
} else if Self.Primitive.self == Int16.self {
return
} else if Self.Primitive.self == Int16.self {
return
} else if Self.Primitive.self == Int32.self {
return
} else if Self.Primitive.self == Int64.self {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Clients/FileClient/Client.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// Client.swift

Check warning on line 2 in Sources/Clients/FileClient/Client.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Add a MARK comment before top-level types and extensions. (markTypes)
//
//
//
// Created by ErrorErrorError on 10/6/23.
//
//

Check warning on line 6 in Sources/Clients/FileClient/Client.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Remove trailing space at end of a line. (trailingSpace)
//

import ComposableArchitecture
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clients/ModuleClient/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension SwiftSoup.Exception: Equatable {
public static func == (lhs: Exception, rhs: Exception) -> Bool {
switch (lhs, rhs) {
case let (.Error(typeOne, messageOne), .Error(typeTwo, messageTwo)):
return typeOne == typeTwo && messageOne == messageTwo
typeOne == typeTwo && messageOne == messageTwo
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Bindings+Env.swift
// Binding+Env.swift
//
//
// Created by ErrorErrorError on 7/25/23.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostModuleInterop+Crypto.swift
// Bindings+Crypto.swift
//
//
// Created by ErrorErrorError on 6/7/23.
Expand Down Expand Up @@ -136,3 +136,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostBindings+HTML.swift
// Bindings+HTML.swift
//
//
// Created by ErrorErrorError on 5/9/23.
Expand Down Expand Up @@ -224,3 +224,4 @@ extension ModuleClient.Instance {
}
}
}
// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostModuleInterop+Json.swift
// Bindings+JSON.swift
//
//
// Created by ErrorErrorError on 5/9/23.
Expand All @@ -24,3 +24,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostModuleInterop+Structs.swift
// Bindings+Meta.swift
//
//
// Created by ErrorErrorError on 5/9/23.
Expand All @@ -12,7 +12,7 @@ import WasmInterpreter

// MARK: Meta Structs Imports

// swiftlint:disable closure_parameter_position closure_parameter_position
// swiftlint:disable closure_parameter_position
extension ModuleClient.Instance {
func metaImports() -> WasmInstance.Import {
WasmInstance.Import(namespace: "structs_meta") {
Expand Down Expand Up @@ -236,3 +236,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostModuleInterop+Http.swift
// Bindings+Request.swift
//
//
// Created by ErrorErrorError on 5/9/23.
Expand Down Expand Up @@ -116,3 +116,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// HostModuleInterop+Video.swift
// Bindings+Video.swift
//
//
// Created by ErrorErrorError on 6/1/23.
Expand Down Expand Up @@ -116,3 +116,5 @@ extension ModuleClient.Instance {
}
}
}

// swiftlint:enable closure_parameter_position
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AVClasses+Struct.swift
// AVMediaSelectionGroup+Struct.swift
//
//
// Created by ErrorErrorError on 7/16/23.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// AVPlayer+AsyncStream.swift
// AVPlayer+Extension.swift
//
//
// Created by ErrorErrorError on 6/10/23.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// File.swift
// CMTime+Extension.swift
//
//
// Created by ErrorErrorError on 6/11/23.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Clients/UserSettingsClient/AppIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
//
// Created by ErrorErrorError on 10/11/23.
//
//
//

import Foundation
Expand Down
4 changes: 2 additions & 2 deletions Sources/Features/App/AppDelegateFeature.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// File.swift
// AppDelegateFeature.swift
//
//
// Created by ErrorErrorError on 5/19/23.
Expand Down Expand Up @@ -33,7 +33,7 @@ public struct AppDelegateFeature: Reducer {
Reduce { _, action in
switch action {
case .didFinishLaunching:
return .run { _ in
.run { _ in
try? await databaseClient.initialize()
try? await moduleClient.initialize()
}
Expand Down
17 changes: 7 additions & 10 deletions Sources/Features/App/AppFeature+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,12 @@ extension AppFeature.View {
}
}

// MARK: - AppFeatureView_Previews

struct AppFeatureView_Previews: PreviewProvider {
static var previews: some View {
AppFeature.View(
store: .init(
initialState: .init(),
reducer: { AppFeature() }
)
#Preview {
AppFeature.View(
store: .init(
initialState: .init(),
reducer: { AppFeature() }
)
}
)

}
Loading

0 comments on commit ad01510

Please sign in to comment.