-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from xzeror/master
Swift 5, SwiftLint, Refactoring
- Loading branch information
Showing
5 changed files
with
183 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,6 @@ fastlane/report.xml | |
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
|
||
# macos | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
excluded: # paths to ignore during linting. Takes precedence over `included`. | ||
- Carthage | ||
- Pods | ||
|
||
disabled_rules: # rule identifiers to exclude from running | ||
- block_based_kvo # Swift implementatoin has bugs which lead to a crash - https://bugs.swift.org/browse/SR-5116, https://bugs.swift.org/browse/SR-5117 | ||
- trailing_comma # There should be a com after the last item in the list | ||
|
||
opt_in_rules: # some rules are only opt-in | ||
- attributes | ||
- anyobject_protocol | ||
- discouraged_optional_boolean | ||
- closure_body_length | ||
- closure_end_indentation | ||
- closure_spacing | ||
- collection_alignment | ||
- contains_over_first_not_nil | ||
- convenience_type | ||
- discouraged_object_literal | ||
- discouraged_optional_collection | ||
- empty_count | ||
- empty_string | ||
- empty_xctest_method | ||
- explicit_init | ||
- extension_access_modifier | ||
- fallthrough | ||
- fatal_error_message | ||
- first_where | ||
# - file_header | ||
- file_name | ||
- force_unwrapping | ||
- function_default_parameter_at_end | ||
- identical_operands | ||
- implicit_return | ||
- implicitly_unwrapped_optional | ||
- joined_default_parameter | ||
- last_where | ||
- legacy_random | ||
- let_var_whitespace | ||
- literal_expression_end_indentation | ||
- lower_acl_than_parent | ||
- missing_docs | ||
- modifier_order | ||
- multiline_arguments | ||
- multiline_arguments_brackets | ||
- multiline_literal_brackets | ||
- multiline_parameters | ||
- multiline_parameters_brackets | ||
- nimble_operator | ||
- number_separator | ||
- operator_usage_whitespace | ||
- override_in_extension | ||
- overridden_super_call | ||
- pattern_matching_keywords | ||
- prefixed_toplevel_constant | ||
- private_action | ||
- private_outlet | ||
- prohibited_interface_builder | ||
- prohibited_super_call | ||
- quick_discouraged_call | ||
- redundant_nil_coalescing | ||
- redundant_type_annotation | ||
- required_enum_case | ||
- single_test_class | ||
- sorted_first_last | ||
- sorted_imports | ||
- static_operator | ||
- strict_fileprivate | ||
- switch_case_on_newline | ||
- toggle_bool | ||
- trailing_closure | ||
- unavailable_function | ||
- unneeded_parentheses_in_closure_argument | ||
- untyped_error_in_catch | ||
- unused_import | ||
- unused_private_declaration | ||
- vertical_parameter_alignment_on_call | ||
- vertical_whitespace_closing_braces | ||
- vertical_whitespace_opening_braces | ||
- xct_specific_matcher | ||
- yoda_condition | ||
|
||
line_length: 200 | ||
|
||
identifier_name: | ||
severity: warning | ||
min_length: 3 | ||
max_length: 40 | ||
excluded: | ||
- id | ||
- ID | ||
- rx | ||
validates_start_with_lowercase: true | ||
|
||
function_body_length: 50 | ||
|
||
cyclomatic_complexity: | ||
warning: 8 | ||
error: 10 | ||
|
||
force_unwrapping: | ||
severity: error | ||
|
||
redundant_type_annotation: | ||
severity: error | ||
|
||
custom_rules: | ||
empty_lines_after_type_declarations: | ||
included: ".*.swift" | ||
name: "Empty lines after type declarations" | ||
regex: '(struct|class|enum|protocol|extension) ([\w]+(:\s*[\w\s,]+)* )\{\n\n' | ||
message: "There should be no empty lines after type declarations" | ||
severity: error | ||
|
||
warning_threshold: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters