From 137390111a01acf6467786c967d9b3eb6ae35eb9 Mon Sep 17 00:00:00 2001 From: "Glenn R. Fisher" Date: Tue, 10 Apr 2018 13:47:14 -0500 Subject: [PATCH 1/2] Exclude SwiftLint rule for cyclomatic_complexity --- .swiftlint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index 3f048fbae..af1b0664b 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -6,6 +6,7 @@ disabled_rules: # rule identifiers to exclude from running - closure_parameter_position - opening_brace - redundant_string_enum_value + - cyclomatic_complexity opt_in_rules: - force_unwrapping From 79e8789a4b865b93939ad9387eb32a7c1320cb7d Mon Sep 17 00:00:00 2001 From: "Glenn R. Fisher" Date: Tue, 10 Apr 2018 13:47:28 -0500 Subject: [PATCH 2/2] Remove exceptions for cyclomatic_complexity --- Source/DiscoveryV1/Discovery.swift | 4 ---- Source/DiscoveryV1/Models/QueryAggregation.swift | 1 - Source/SpeechToTextV1/Models/RecognitionSettings.swift | 1 - Source/TextToSpeechV1/TextToSpeechDecoder.swift | 1 - 4 files changed, 7 deletions(-) diff --git a/Source/DiscoveryV1/Discovery.swift b/Source/DiscoveryV1/Discovery.swift index 697551efb..f0e44b8f3 100644 --- a/Source/DiscoveryV1/Discovery.swift +++ b/Source/DiscoveryV1/Discovery.swift @@ -1470,8 +1470,6 @@ public class Discovery { } } - // swiftlint:disable cyclomatic_complexity - /** Query documents. @@ -1629,8 +1627,6 @@ public class Discovery { } } - // swiftlint:enable cyclomatic_complexity - /** Query system notices. diff --git a/Source/DiscoveryV1/Models/QueryAggregation.swift b/Source/DiscoveryV1/Models/QueryAggregation.swift index ae5d13d7f..2133c6f26 100644 --- a/Source/DiscoveryV1/Models/QueryAggregation.swift +++ b/Source/DiscoveryV1/Models/QueryAggregation.swift @@ -38,7 +38,6 @@ public enum QueryAggregation: Decodable { case type = "type" } - // swiftlint:disable:next cyclomatic_complexity public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) guard let type = try container.decodeIfPresent(String.self, forKey: .type) else { diff --git a/Source/SpeechToTextV1/Models/RecognitionSettings.swift b/Source/SpeechToTextV1/Models/RecognitionSettings.swift index 6a62de288..ed07d60cb 100644 --- a/Source/SpeechToTextV1/Models/RecognitionSettings.swift +++ b/Source/SpeechToTextV1/Models/RecognitionSettings.swift @@ -99,7 +99,6 @@ public struct RecognitionSettings: JSONEncodable { } /** Used internally to serialize a `RecognitionSettings` model to JSON. */ - // swiftlint:disable:next cyclomatic_complexity public func toJSONObject() -> Any { var json = [String: Any]() json["action"] = action diff --git a/Source/TextToSpeechV1/TextToSpeechDecoder.swift b/Source/TextToSpeechV1/TextToSpeechDecoder.swift index 9570ae075..70f91fa77 100644 --- a/Source/TextToSpeechV1/TextToSpeechDecoder.swift +++ b/Source/TextToSpeechV1/TextToSpeechDecoder.swift @@ -125,7 +125,6 @@ internal class TextToSpeechDecoder { } // Extract a packet from the ogg stream and store the extracted data within the packet object. - // swiftlint:disable:next cyclomatic_complexity private func extractPacket(_ streamState: inout ogg_stream_state, _ packet: inout ogg_packet) throws { // attempt to extract a packet from the ogg stream while ogg_stream_packetout(&streamState, &packet) == 1 {