From 1206fd4dd42fcfd1c331eb8d76c902e41e134192 Mon Sep 17 00:00:00 2001 From: Marcelo Fabri Date: Sun, 20 Oct 2019 19:17:15 -0700 Subject: [PATCH] Fixes after rebase --- CHANGELOG.md | 9 ++++----- Rules.md | 12 +++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a576d1ab..f67b531ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,12 +34,11 @@ * Support building with Swift 5.1 on Linux. [Marcelo Fabri](https://github.com/marcelofabri) [#2874](https://github.com/realm/SwiftLint/issues/2874) -* Add `snake_case_raw_value_codable_string_enum` opt-in rule to enforce snake - cased raw values for camel cased Codable String enum cases. + * Add `raw_value_for_camel_cased_codable_enum` opt-in rule to enforce raw values - for camel cased Codable String enum cases. - [Marko Pejovic](https://github.com/00FA9A) - [#2888](https://github.com/realm/SwiftLint/issues/2888) + for camel cased Codable String enum cases. + [Marko Pejovic](https://github.com/00FA9A) + [#2888](https://github.com/realm/SwiftLint/issues/2888) * Speedup `LetVarWhiteSpacesRule`. [PaulTaykalo](https://github.com/PaulTaykalo) diff --git a/Rules.md b/Rules.md index 3a4655fea..b84195978 100644 --- a/Rules.md +++ b/Rules.md @@ -16874,21 +16874,19 @@ class TotoTests: QuickSpec { - ## Raw Value For Camel Cased Codable Enum Identifier | Enabled by default | Supports autocorrection | Kind | Analyzer | Minimum Swift Compiler Version --- | --- | --- | --- | --- | --- `raw_value_for_camel_cased_codable_enum` | Disabled | No | lint | No | 3.0.0 -Camel cased Codable String enum cases should have explicitly assigned raw value. +Camel cased cases of Codable String enums should have raw value. ### Examples
Non Triggering Examples - ```swift enum Numbers: Codable { case int(Int) @@ -16940,7 +16938,7 @@ enum Status: Int, Codable { ```swift enum Status: String, Codable { case ok - case notAcceptable + case ↓notAcceptable case maybeAcceptable = "maybe_acceptable" } ``` @@ -16948,7 +16946,7 @@ enum Status: String, Codable { ```swift enum Status: String, Decodable { case ok - case notAcceptable + case ↓notAcceptable case maybeAcceptable = "maybe_acceptable" } ``` @@ -16956,7 +16954,7 @@ enum Status: String, Decodable { ```swift enum Status: String, Encodable { case ok - case notAcceptable + case ↓notAcceptable case maybeAcceptable = "maybe_acceptable" } ``` @@ -16964,7 +16962,7 @@ enum Status: String, Encodable { ```swift enum Status: String, Codable { case ok - case notAcceptable + case ↓notAcceptable case maybeAcceptable = "maybe_acceptable" } ```