-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add swift lint and fix some warnings
- Loading branch information
1 parent
3db70f7
commit e4b1c29
Showing
17 changed files
with
231 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,112 @@ | ||
excluded: | ||
- ${PWD}/DerivedData | ||
- ${PWD}/.build | ||
- Tests | ||
- Example.swiftpm | ||
|
||
disabled_rules: | ||
- discarded_notification_center_observer | ||
- notification_center_detachment | ||
- orphaned_doc_comment | ||
- todo | ||
- unused_capture_list | ||
- opening_brace | ||
- trailing_comma | ||
|
||
analyzer_rules: | ||
- unused_import | ||
|
||
opt_in_rules: | ||
- array_init | ||
- attributes | ||
- closure_end_indentation | ||
- closure_spacing | ||
- collection_alignment | ||
- colon # promote to error | ||
- convenience_type | ||
- discouraged_object_literal | ||
- empty_collection_literal | ||
- empty_count | ||
- empty_string | ||
- enum_case_associated_values_count | ||
- fatal_error_message | ||
- first_where | ||
- force_unwrapping | ||
- implicitly_unwrapped_optional | ||
- indentation_width | ||
- last_where | ||
- legacy_random | ||
- literal_expression_end_indentation | ||
- multiline_arguments | ||
- multiline_function_chains | ||
- multiline_literal_brackets | ||
- multiline_parameters | ||
- multiline_parameters_brackets | ||
- operator_usage_whitespace | ||
- overridden_super_call | ||
- pattern_matching_keywords | ||
- prefer_self_type_over_type_of_self | ||
- redundant_nil_coalescing | ||
- redundant_type_annotation | ||
- strict_fileprivate | ||
- toggle_bool | ||
- trailing_closure | ||
- unneeded_parentheses_in_closure_argument | ||
- vertical_whitespace_closing_braces | ||
- vertical_whitespace_opening_braces | ||
- yoda_condition | ||
|
||
|
||
custom_rules: | ||
array_constructor: | ||
name: "Array/Dictionary initializer" | ||
regex: '[let,var] .+ = (\[.+\]\(\))' | ||
capture_group: 1 | ||
message: "Use explicit type annotation when initializing empty arrays and dictionaries" | ||
severity: warning | ||
|
||
|
||
attributes: | ||
always_on_same_line: | ||
- "@IBSegueAction" | ||
- "@IBAction" | ||
- "@NSManaged" | ||
- "@objc" | ||
|
||
force_cast: warning | ||
force_try: warning | ||
function_body_length: | ||
warning: 100 | ||
|
||
legacy_hashing: error | ||
|
||
identifier_name: | ||
excluded: | ||
- i | ||
- id | ||
- x | ||
- y | ||
- z | ||
|
||
indentation_width: | ||
indentation_width: 4 | ||
|
||
line_length: | ||
warning: 150 | ||
ignores_urls: true | ||
ignores_function_declarations: true | ||
ignores_comments: true | ||
|
||
multiline_arguments: | ||
first_argument_location: next_line | ||
only_enforce_after_first_closure_on_first_line: true | ||
|
||
private_over_fileprivate: | ||
validate_extensions: true | ||
|
||
trailing_whitespace: | ||
ignores_empty_lines: false | ||
ignores_comments: true | ||
|
||
vertical_whitespace: | ||
max_empty_lines: 2 |
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,86 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "collectionconcurrencykit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", | ||
"state" : { | ||
"revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", | ||
"version" : "0.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "cryptoswift", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/krzyzanowskim/CryptoSwift.git", | ||
"state" : { | ||
"revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c", | ||
"version" : "1.8.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "sourcekitten", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/jpsim/SourceKitten.git", | ||
"state" : { | ||
"revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", | ||
"version" : "0.34.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-argument-parser", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-argument-parser.git", | ||
"state" : { | ||
"revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", | ||
"version" : "1.2.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-syntax", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-syntax.git", | ||
"state" : { | ||
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", | ||
"version" : "509.0.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftlint", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/realm/SwiftLint", | ||
"state" : { | ||
"revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee", | ||
"version" : "0.54.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftytexttable", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", | ||
"state" : { | ||
"revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", | ||
"version" : "0.9.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swxmlhash", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/drmohundro/SWXMLHash.git", | ||
"state" : { | ||
"revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", | ||
"version" : "7.0.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "yams", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/jpsim/Yams.git", | ||
"state" : { | ||
"revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", | ||
"version" : "5.0.6" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
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
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
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
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
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
Oops, something went wrong.