diff --git a/.swiftlint.yml b/.swiftlint.yml index 55fb820..3841c04 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,7 +1,7 @@ # Source: https://github.com/sindresorhus/swiftlint-sindre (with modifications) # Rules covered by SwiftFormat are commented out -whitelist_rules: +only_rules: - anyobject_protocol - array_init - attributes @@ -165,3 +165,5 @@ identifier_name: - "x2" - "y1" - "y2" +opening_brace: + allow_multiline_func: true diff --git a/Glance/Extensions/NSMenuItem.swift b/Glance/Extensions/NSMenuItem.swift index 7b0ac74..b73b2d5 100644 --- a/Glance/Extensions/NSMenuItem.swift +++ b/Glance/Extensions/NSMenuItem.swift @@ -41,9 +41,9 @@ final class ObjectAssociation { } extension NSMenuItem { - typealias ActionClosure = ((NSMenuItem) -> Void) + typealias ActionClosure = (NSMenuItem) -> Void - private struct AssociatedKeys { + private enum AssociatedKeys { static let onActionClosure = ObjectAssociation() } diff --git a/Glance/ViewController.swift b/Glance/ViewController.swift index b30d4fc..af63e2c 100644 --- a/Glance/ViewController.swift +++ b/Glance/ViewController.swift @@ -9,7 +9,7 @@ class ViewController: NSViewController { let supportedFilesWC = SupportedFilesWC(windowNibName: NSNib.Name("SupportedFilesWC")) supportedFilesWC.showWindow(nil) } - + @IBAction private func openGitHubRepository(_: NSButton) { websiteURL.open() } diff --git a/Mintfile b/Mintfile index a17f35a..44dea23 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ -nicklockwood/SwiftFormat@0.44.7 -realm/SwiftLint@0.39.2 +nicklockwood/SwiftFormat@0.49.9 +realm/SwiftLint@0.47.1 diff --git a/QLPlugin/Utils/HTMLRenderer.swift b/QLPlugin/Utils/HTMLRenderer.swift index 86a97fc..ee69461 100644 --- a/QLPlugin/Utils/HTMLRenderer.swift +++ b/QLPlugin/Utils/HTMLRenderer.swift @@ -24,7 +24,7 @@ extension HTMLRendererError: LocalizedError { } } -class HTMLRenderer { +enum HTMLRenderer { /// Throws an error if the return value indicates one. Because all `HTMLConverter` return values /// are C strings, errors are implemented as return values starting with "error: ". static func throwIfErrored(fileType: String, returnValue: String) throws { diff --git a/QLPlugin/Views/Previews/TARPreview.swift b/QLPlugin/Views/Previews/TARPreview.swift index 71a349a..59e197a 100644 --- a/QLPlugin/Views/Previews/TARPreview.swift +++ b/QLPlugin/Views/Previews/TARPreview.swift @@ -132,7 +132,8 @@ class TARPreview: Preview { } private func parseGZIPSize(lines: String) - -> (sizeUncompressed: Int?, compressionRatio: Double?) { + -> (sizeUncompressed: Int?, compressionRatio: Double?) + { let sizeMatches = lines.matchRegex(regex: sizeRegex) let sizeUncompressed = Int(sizeMatches[0][1]) let compressionRatio = Double(sizeMatches[0][2])