From 2c97109908435d62f5ccffaa995e5e6e6f0242f6 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 11 Feb 2021 17:45:45 +0300 Subject: [PATCH 1/3] Add pattern_matching and fallthrough rules --- xcode/.swiftlint.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index 35c417c..2c5dcc6 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -284,6 +284,18 @@ custom_rules: message: "Use a local function instead of capture strong self" severity: error + pattern_matching: + name: "Pattern matching" + regex: 'case[^\(]+\([^\)]*(let|var)\s' + message: "Use a let|var keyword behind parentheses" + severity: error + + fallthrough: + name: "Fallthrough" + regex: '\sfallthrough\s' + message: "Fallthrough usage is restricted!" + severity: error + # Rx unused_map_parameter: From 69ec87dc47e19436a9d03732eee657e13bf3f932 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 11 Feb 2021 18:19:50 +0300 Subject: [PATCH 2/3] Update pattern_matching --- xcode/.swiftlint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index 2c5dcc6..d29d115 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -286,7 +286,7 @@ custom_rules: pattern_matching: name: "Pattern matching" - regex: 'case[^\(]+\([^\)]*(let|var)\s' + regex: 'case[^\n\(]+\([^\)]*(let|var)\s' message: "Use a let|var keyword behind parentheses" severity: error From f62bc00b9c3e3bd57ca9101f6661ba11d1635364 Mon Sep 17 00:00:00 2001 From: Vlad Date: Thu, 11 Feb 2021 18:33:05 +0300 Subject: [PATCH 3/3] Remove fallthrough --- xcode/.swiftlint.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index d29d115..2db54e1 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -288,13 +288,7 @@ custom_rules: name: "Pattern matching" regex: 'case[^\n\(]+\([^\)]*(let|var)\s' message: "Use a let|var keyword behind parentheses" - severity: error - - fallthrough: - name: "Fallthrough" - regex: '\sfallthrough\s' - message: "Fallthrough usage is restricted!" - severity: error + severity: warning # Rx