diff --git a/xcode/.swiftlint.yml b/xcode/.swiftlint.yml index b731824..4cf4b27 100644 --- a/xcode/.swiftlint.yml +++ b/xcode/.swiftlint.yml @@ -6,10 +6,17 @@ opt_in_rules: - last_where - empty_string - empty_count + - contains_over_filter_count + - contains_over_filter_is_empty + - empty_collection_literal + - contains_over_range_nil_comparison + - contains_over_first_not_nil + - flatmap_over_map_reduce # idiomatic - legacy_random + - legacy_multiple - pattern_matching_keywords - redundant_nil_coalescing - redundant_type_annotation @@ -45,6 +52,7 @@ opt_in_rules: - conditional_returns_on_newline - closure_spacing - closure_end_indentation + - prefer_self_type_over_type_of_self # lint @@ -52,9 +60,14 @@ opt_in_rules: - private_outlet - prohibited_super_call - unused_import - - unused_private_declaration + - unused_declaration - identical_operands - overridden_super_call + - unowned_variable_capture + + # metrics + + - enum_case_associated_values_count excluded: - Carthage @@ -78,6 +91,13 @@ file_length: function_parameter_count: error: 5 +colon: + flexible_right_spacing: true + +enum_case_associated_values_count: + warning: 4 + error: 5 + identifier_name: excluded: - id diff --git a/xcode/build_phases/swiftlint.sh b/xcode/build_phases/swiftlint.sh index 9491bf4..f1f8fb8 100644 --- a/xcode/build_phases/swiftlint.sh +++ b/xcode/build_phases/swiftlint.sh @@ -1,2 +1,2 @@ -SOURCES_DIR=${1:-${PROJECT_NAME}} # first argument or PROJECT_NAME +SOURCES_DIR=${1:-${TARGET_NAME}} # first argument or TARGET_NAME ${PODS_ROOT}/SwiftLint/swiftlint autocorrect --path ${SOURCES_DIR} --config ${PROJECT_DIR}/build-scripts/xcode/.swiftlint.yml && ${PODS_ROOT}/SwiftLint/swiftlint --path ${SOURCES_DIR} --config ${PROJECT_DIR}/build-scripts/xcode/.swiftlint.yml