Skip to content

Commit

Permalink
chore: Apply swift format (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
fummicc1 authored Sep 21, 2024
1 parent 04e38a0 commit e64e8f2
Show file tree
Hide file tree
Showing 53 changed files with 1,277 additions and 1,269 deletions.
70 changes: 70 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentation" : {
"spaces" : 4
},
"indentConditionalCompilationBlocks" : true,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : false,
"lineBreakBeforeEachGenericRequirement" : false,
"lineLength" : 100,
"maximumBlankLines" : 1,
"multiElementCollectionTrailingCommas" : true,
"noAssignmentInExpressions" : {
"allowedFunctions" : [
"XCTAssertNoThrow"
]
},
"prioritizeKeepingFunctionOutputTogether" : false,
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoPlaygroundLiterals" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : false,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"TypeNamesShouldBeCapitalized" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : true,
"UseLetInEveryBoundCaseVariable" : true,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
},
"spacesAroundRangeFormationOperators" : false,
"tabWidth" : 8,
"version" : 1
}
8 changes: 4 additions & 4 deletions Csv2ImageApp/Csv2ImageApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,12 @@
INFOPLIST_KEY_UIRequiresFullScreen = NO;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_PREPROCESS = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.5;
PRODUCT_BUNDLE_IDENTIFIER = dev.fummicc1.Csv2ImageApp_debug;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -680,12 +680,12 @@
INFOPLIST_KEY_UIRequiresFullScreen = NO;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
INFOPLIST_PREPROCESS = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 13.0;
MACOSX_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 1.5;
PRODUCT_BUNDLE_IDENTIFIER = dev.fummicc1.Csv2ImageApp;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
21 changes: 11 additions & 10 deletions Csv2ImageApp/Csv2ImageApp/Csv2ImageAppApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
// Created by Fumiya Tanaka on 2022/06/07.
//

import SwiftUI
import CoreData

import SwiftUI

enum CsvImageAppError: Swift.Error {
case invalidNetworkURL(url: String)
Expand All @@ -26,7 +25,6 @@ enum CsvImageAppError: Swift.Error {
}
}


@main
struct Csv2ImageAppApp: App {

Expand Down Expand Up @@ -62,13 +60,16 @@ struct Csv2ImageAppApp: App {
.environment(
\.managedObjectContext, persistentController.viewContext
)
#if os(macOS)
.onReceive(NotificationCenter.default.publisher(for: Application.willUpdateNotification), perform: { _ in
for window in Application.shared.windows {
window.standardWindowButton(.zoomButton)?.isEnabled = false
}
})
#endif
#if os(macOS)
.onReceive(
NotificationCenter.default.publisher(
for: Application.willUpdateNotification),
perform: { _ in
for window in Application.shared.windows {
window.standardWindowButton(.zoomButton)?.isEnabled = false
}
})
#endif
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Csv2ImageApp/Csv2ImageApp/Ex/Binding+Ex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation
import SwiftUI

extension Binding {
func isNotNil<V>() -> Binding<Bool> where Value == Optional<V> {
func isNotNil<V>() -> Binding<Bool> where Value == V? {
Binding<Bool> {
self.wrappedValue != nil
} set: { v, _ in
Expand All @@ -19,7 +19,7 @@ extension Binding {
}
}

func isNil<V>() -> Binding<Bool> where Value == Optional<V> {
func isNil<V>() -> Binding<Bool> where Value == V? {
Binding<Bool> {
self.wrappedValue == nil
} set: { v, _ in
Expand Down
18 changes: 9 additions & 9 deletions Csv2ImageApp/Csv2ImageApp/Ex/UIApplication+Ex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import Foundation

#if os(iOS)
import UIKit
extension Application {
var activeRootViewController: UIViewController? {
self.connectedScenes
.filter { $0.activationState == .foregroundActive }
.compactMap { $0 as? UIWindowScene }
.compactMap { $0.keyWindow }.first?
.rootViewController
import UIKit
extension Application {
var activeRootViewController: UIViewController? {
self.connectedScenes
.filter { $0.activationState == .foregroundActive }
.compactMap { $0 as? UIWindowScene }
.compactMap { $0.keyWindow }.first?
.rootViewController
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//

import Foundation
import CoreData
import Foundation

@objc(CsvConfig)
public class CsvConfig: NSManagedObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
//
//

import Foundation
import CoreData

import Foundation

extension CsvConfig {

Expand All @@ -21,6 +20,6 @@ extension CsvConfig {

}

extension CsvConfig : Identifiable {
extension CsvConfig: Identifiable {

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//

import Foundation
import CoreData
import Foundation

@objc(CsvOutput)
public class CsvOutput: NSManagedObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
//
//

import Foundation
import CoreData

import Foundation

extension CsvOutput {

Expand All @@ -23,6 +22,6 @@ extension CsvOutput {

}

extension CsvOutput : Identifiable {
extension CsvOutput: Identifiable {

}
Loading

0 comments on commit e64e8f2

Please sign in to comment.