Skip to content

Commit

Permalink
Update SwiftFormat to version 0.53.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny committed Feb 21, 2024
1 parent 0c40d1a commit da3ba1d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: |
brew update
brew install carthage swiftformat
brew install go || brew link --overwrite go
brew install go@1.20 || brew link --overwrite go
brew install swiftlint || brew link --overwrite swiftlint
gem install bundler
- uses: actions/cache@v3
Expand Down
13 changes: 11 additions & 2 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
blankLinesAroundMark, \
blankLinesAtEndOfScope, \
blankLinesAtStartOfScope, \
blankLinesBetweenChainedFunctions, \
# blankLinesBetweenImports, \
blankLinesBetweenScopes, \
blockComments, \
Expand All @@ -32,6 +33,7 @@
extensionAccessControl, \
fileHeader, \
# genericExtensions, \
headerFileName, \
hoistPatternLet, \
indent, \
initCoderUnavailable, \
Expand All @@ -41,9 +43,11 @@
linebreaks, \
modifierOrder, \
# markTypes, \
noExplicitOwnership, \
numberFormatting, \
# opaqueGenericParameters, \
# organizeDeclarations, \
# preferForLoop, \
preferKeyPath, \
redundantBackticks, \
redundantBreak, \
Expand All @@ -52,6 +56,7 @@
redundantFileprivate, \
redundantGet, \
redundantInit, \
redundantInternal, \
redundantLet, \
redundantLetError, \
redundantNilInit, \
Expand All @@ -62,11 +67,13 @@
redundantRawValues, \
redundantReturn, \
redundantSelf, \
redundantStaticSelf, \
redundantType, \
redundantVoidReturnType, \
semicolons, \
sortedImports, \
sortedSwitchCases, \
sortImports, \
sortSwitchCases, \
sortTypealiases, \
spaceAroundBraces, \
spaceAroundBrackets, \
spaceAroundComments, \
Expand All @@ -93,6 +100,8 @@
wrapAttributes, \
wrapConditionalBodies, \
# wrapEnumCases, \
wrapLoopBodies, \
wrapMultilineConditionalAssignment, \
# wrapMultilineStatementBraces, \
wrapSingleLineComments, \
# wrapSwitchCases, \
Expand Down
8 changes: 4 additions & 4 deletions pass.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
DC4914961E434301007FF592 /* LabelTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4914941E434301007FF592 /* LabelTableViewCell.swift */; };
DC4914991E434600007FF592 /* PasswordDetailTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4914981E434600007FF592 /* PasswordDetailTableViewController.swift */; };
DC5F385B1E56AADB00C69ACA /* PGPKeyArmorImportTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5F385A1E56AADB00C69ACA /* PGPKeyArmorImportTableViewController.swift */; };
DC8963C01E38EEB900828B09 /* SSHKeyURLImportTableViewController..swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController..swift */; };
DC8963C01E38EEB900828B09 /* SSHKeyURLImportTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController.swift */; };
DC917BD71E2E8231000FDF54 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC917BD61E2E8231000FDF54 /* AppDelegate.swift */; };
DC917BDC1E2E8231000FDF54 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC917BDA1E2E8231000FDF54 /* Main.storyboard */; };
DC917BDE1E2E8231000FDF54 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC917BDD1E2E8231000FDF54 /* Assets.xcassets */; };
Expand Down Expand Up @@ -496,7 +496,7 @@
DC4914941E434301007FF592 /* LabelTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LabelTableViewCell.swift; sourceTree = "<group>"; };
DC4914981E434600007FF592 /* PasswordDetailTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordDetailTableViewController.swift; sourceTree = "<group>"; };
DC5F385A1E56AADB00C69ACA /* PGPKeyArmorImportTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PGPKeyArmorImportTableViewController.swift; sourceTree = "<group>"; };
DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController..swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSHKeyURLImportTableViewController..swift; sourceTree = "<group>"; };
DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSHKeyURLImportTableViewController.swift; sourceTree = "<group>"; };
DC917BD31E2E8231000FDF54 /* Pass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pass.app; sourceTree = BUILT_PRODUCTS_DIR; };
DC917BD61E2E8231000FDF54 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
DC917BDB1E2E8231000FDF54 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -982,7 +982,7 @@
DC037CA91E4B8EAE00609409 /* SpecialThanksTableViewController.swift */,
DCC441531E916382008A90C4 /* SSHKeyArmorImportTableViewController.swift */,
30650E7023F82AF8005CCD5E /* SSHKeyFileImportTableViewController.swift */,
DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController..swift */,
DC8963BF1E38EEB900828B09 /* SSHKeyURLImportTableViewController.swift */,
);
path = Controllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1661,7 +1661,7 @@
DCC441541E916382008A90C4 /* SSHKeyArmorImportTableViewController.swift in Sources */,
306D970E24091CDD006C0E2E /* SwitchTableViewCell.swift in Sources */,
A2A61C201EEFABAD00CFE063 /* UtilsExtension.swift in Sources */,
DC8963C01E38EEB900828B09 /* SSHKeyURLImportTableViewController..swift in Sources */,
DC8963C01E38EEB900828B09 /* SSHKeyURLImportTableViewController.swift in Sources */,
DC30F83829BED4E2001EB12B /* PasswordGeneratorUISwitch.swift in Sources */,
9AFC87F025B514AD008D6060 /* PasswordDecryptor.swift in Sources */,
3066AD6823EE0D6500F65535 /* PGPKeyImporter.swift in Sources */,
Expand Down
6 changes: 3 additions & 3 deletions pass/Controllers/KeyImporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ protocol KeyImporter {

extension KeyImporter {
static var isCurrentKeySource: Bool {
Defaults.gitSSHKeySource == Self.keySource
Defaults.gitSSHKeySource == keySource
}

static var menuLabel: String {
if isCurrentKeySource {
return "\(Self.label)"
return "\(label)"
}
return Self.label
return label
}
}
2 changes: 1 addition & 1 deletion pass/Controllers/PGPKeyImporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol PGPKeyImporter: KeyImporter {

extension PGPKeyImporter {
static var isCurrentKeySource: Bool {
Defaults.pgpKeySource == Self.keySource
Defaults.pgpKeySource == keySource
}

func doAfterImport() {}
Expand Down
3 changes: 2 additions & 1 deletion passKitTests/Crypto/CryptoFrameworkTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

import XCTest

@testable import Gopenpgp

// swiftformat:disable:next sortedImports
@testable import passKit
@testable import Gopenpgp

class CryptoFrameworkTest: XCTestCase {
private typealias MessageConverter = (CryptoPGPMessage, NSErrorPointer) -> CryptoPGPMessage?
Expand Down
2 changes: 1 addition & 1 deletion scripts/swiftformat.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
SWIFTFORMAT_VERSION="0.51.*"
SWIFTFORMAT_VERSION="0.53.*"

if [[ "${CI}" == "true" ]]; then
echo "Running in a Continuous Integration environment. Formatting is skipped."
Expand Down

0 comments on commit da3ba1d

Please sign in to comment.