From d9028abe48352786af3fc38bbd540a680b9c434c Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 23 Aug 2017 23:26:48 +0300 Subject: [PATCH 1/5] Add some useful rules --- .swiftlint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index cdc4692..5bc070e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -2,6 +2,11 @@ disabled_rules: - identifier_name opt_in_rules: - private_outlet + - closure_spacing + - closure_end_indentation + - empty_count + - explicit_init + - extension_access_modifier excluded: - Carthage - Pods From 80da3eddc9cdac450887af645efbba2088e06a09 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 23 Aug 2017 23:39:00 +0300 Subject: [PATCH 2/5] Add more rules --- .swiftlint.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.swiftlint.yml b/.swiftlint.yml index 5bc070e..8835b19 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -7,6 +7,11 @@ opt_in_rules: - empty_count - explicit_init - extension_access_modifier + - fatal_error_message + - file_header +# - first_where + - force_unwrapping + - implicit_return excluded: - Carthage - Pods From 5cfd54c4a1b0c14a46e31ad44f49f3a40a52ed12 Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 23 Aug 2017 23:58:04 +0300 Subject: [PATCH 3/5] Update rules --- .swiftlint.yml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 8835b19..62c8c92 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -12,6 +12,17 @@ opt_in_rules: # - first_where - force_unwrapping - implicit_return + - let_var_whitespace + - multiline_parameters + - nimble_operator + - number_separator + - object_literal + - overridden_super_call + - prohibited_super_call + - redundant_nil_coalescing +# - sorted_imports + - unneeded_parentheses_in_closure_argument + - vertical_parameter_alignment_on_call excluded: - Carthage - Pods @@ -89,31 +100,6 @@ custom_rules: message: "Please use `weak` instead. " severity: error - empty_count_zero: - name: "Empty Count Violation" - regex: '\.count\s*(==|!=|<|<=|>|>=)\s*0' - message: "Prefer checking `isEmpty` over comparing `count` to zero." - severity: warning - - # Should be { braces_body } instead of {braces_body} - spaces_around_braces: - included: ".*.swift" - name: "Spaces around the braces" - regex: '(([A-Za-z0-9])[\{\}])|([\{\}]([A-Za-z0-9]))' - message: "No spaces around the braces" - severity: error - match_kinds: - - attribute.builtin - - attribute.id - - buildconfig.id - - buildconfig.keyword - - identifier - - keyword - - objectliteral - - parameter - - placeholder - - typeidentifier - inout_keyword: name: "Inout" regex: 'inout' From cbc5daee9d0e71ee0d40d088a238427cf15c8efa Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 24 Aug 2017 13:13:17 +0300 Subject: [PATCH 4/5] Update rules for discussion --- .swiftlint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 62c8c92..f563b7e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,18 +9,18 @@ opt_in_rules: - extension_access_modifier - fatal_error_message - file_header -# - first_where +# - first_where - discuss - force_unwrapping - implicit_return - let_var_whitespace - multiline_parameters - - nimble_operator +# - nimble_operator - discuss - number_separator - object_literal - overridden_super_call - prohibited_super_call - redundant_nil_coalescing -# - sorted_imports +# - sorted_imports - discuss - unneeded_parentheses_in_closure_argument - vertical_parameter_alignment_on_call excluded: From fa1cdee4f082ad5b4b007b45a161f309d7242ece Mon Sep 17 00:00:00 2001 From: Igor Date: Thu, 24 Aug 2017 14:37:22 +0300 Subject: [PATCH 5/5] Update rules --- .swiftlint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index f563b7e..730c175 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,18 +9,18 @@ opt_in_rules: - extension_access_modifier - fatal_error_message - file_header -# - first_where - discuss + - first_where - force_unwrapping - implicit_return - let_var_whitespace - multiline_parameters -# - nimble_operator - discuss + - nimble_operator - discuss + - conditional_returns_on_newline - number_separator - object_literal - overridden_super_call - prohibited_super_call - redundant_nil_coalescing -# - sorted_imports - discuss - unneeded_parentheses_in_closure_argument - vertical_parameter_alignment_on_call excluded: