From cc4647e3b4c19d044e425cbd49ccf465401b3fc6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 21:51:42 +0300 Subject: [PATCH 1/7] Add check on type annotation for Bool --- xcode/.swiftlint.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index 4bbc84c..6c66505 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -239,6 +239,12 @@ custom_rules: message: "Use сontentView instead of self for addSubview or addSubviews methods in cell." severity: error + redundant_type_annotation_bool: + name: "Redundant type annotation for Bool" + regex: '((: *Bool *= *)|(BehaviourRelay *= *\S*\s*))((true)|(false))' + message: "Using a type annotation for Bool is redundant" + severity: error + # Rx unused_map_parameter: From 05fd54ed8db80ded84fcd56f2a91ed2d79318064 Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 21:58:35 +0300 Subject: [PATCH 2/7] Update rule --- xcode/.swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index 6c66505..b535f1e 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -241,7 +241,7 @@ custom_rules: redundant_type_annotation_bool: name: "Redundant type annotation for Bool" - regex: '((: *Bool *= *)|(BehaviourRelay *= *\S*\s*))((true)|(false))' + regex: '((var|let)) *\w+ *: *((Bool *= *)|(BehaviourRelay *= *\S*\s*))((true)|(false))' message: "Using a type annotation for Bool is redundant" severity: error From 7979e8088bfed6ef1ccffb6548a80d678567df5f Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 22:42:37 +0300 Subject: [PATCH 3/7] Update rule --- xcode/.swiftlint.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index b535f1e..bfd2f73 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -245,6 +245,12 @@ custom_rules: message: "Using a type annotation for Bool is redundant" severity: error + redundant_type_annotation_string: + name: "Redundant type annotation for Bool" + regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\(\s*value\s*:)) *((true)|(false))' + message: "Using a type annotation for Bool is redundant" + severity: error + # Rx unused_map_parameter: From 74b5c1da9115c6dd760e8c210e49c61112aacd31 Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 22:43:26 +0300 Subject: [PATCH 4/7] Update rule --- xcode/.swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index bfd2f73..bab5181 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -247,7 +247,7 @@ custom_rules: redundant_type_annotation_string: name: "Redundant type annotation for Bool" - regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\(\s*value\s*:)) *((true)|(false))' + regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\(\ *value\ *:)) *((true)|(false))' message: "Using a type annotation for Bool is redundant" severity: error From d6589c53a3f39eb90471fd25323d0eacfec17504 Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 22:46:05 +0300 Subject: [PATCH 5/7] Update rule --- xcode/.swiftlint.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index bab5181..a22ae70 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -240,12 +240,6 @@ custom_rules: severity: error redundant_type_annotation_bool: - name: "Redundant type annotation for Bool" - regex: '((var|let)) *\w+ *: *((Bool *= *)|(BehaviourRelay *= *\S*\s*))((true)|(false))' - message: "Using a type annotation for Bool is redundant" - severity: error - - redundant_type_annotation_string: name: "Redundant type annotation for Bool" regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\(\ *value\ *:)) *((true)|(false))' message: "Using a type annotation for Bool is redundant" From 1eedb7120912f1960bad93214fd7d8d6636d47eb Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 22:48:24 +0300 Subject: [PATCH 6/7] Small corrections --- xcode/.swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index a22ae70..6be9284 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -241,7 +241,7 @@ custom_rules: redundant_type_annotation_bool: name: "Redundant type annotation for Bool" - regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\(\ *value\ *:)) *((true)|(false))' + regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\( *value *:)) *((true)|(false))' message: "Using a type annotation for Bool is redundant" severity: error From 0e5f9b67f65ce402768438bc573b1df8f548390c Mon Sep 17 00:00:00 2001 From: Vlad Date: Mon, 1 Jun 2020 23:00:46 +0300 Subject: [PATCH 7/7] Update rule --- xcode/.swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index 6be9284..3fc2c03 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -241,7 +241,7 @@ custom_rules: redundant_type_annotation_bool: name: "Redundant type annotation for Bool" - regex: '((var|let)) *\w+ *((: *Bool *=)|([^=]*= *BehaviourRelay\( *value *:)) *((true)|(false))' + regex: '((var|let)) *\w+ *((: *Bool *=)|((\w| |<|>|:)*= *BehaviorRelay\( *value *:)) *((true)|(false))' message: "Using a type annotation for Bool is redundant" severity: error