From 105bc55b2eed09e2ad71b002b9905ef2c5a446c1 Mon Sep 17 00:00:00 2001 From: "swiftlintbot@jpsim.com" Date: Fri, 9 Dec 2022 19:44:21 +0000 Subject: [PATCH] Automated deployment to GitHub Pages: a876e860ee0e166a05428f430888de5d798c0f8d --- Classes.html | 464 ++ Classes/LinterCache.html | 446 ++ Classes/RuleStorage.html | 408 ++ Classes/SwiftLintFile.html | 769 +++ Classes/ViolationsSyntaxVisitor.html | 581 ++ Enums.html | 593 ++ Enums/AccessControlLevel.html | 563 ++ Enums/ConfigurationError.html | 469 ++ Enums/ExecutableInfo.html | 379 ++ Enums/RuleIdentifier.html | 567 ++ Enums/RuleKind.html | 499 ++ Enums/RuleListError.html | 379 ++ Enums/SwiftExpressionKind.html | 559 ++ Enums/ViolationSeverity.html | 451 ++ Extensions.html | 393 ++ Extensions/FileManager.html | 403 ++ Extensions/String.html | 462 ++ Functions.html | 522 ++ Global Variables.html | 369 ++ Guides.html | 2328 +++++++ Protocols.html | 772 +++ Protocols/ASTRule.html | 613 ++ Protocols/AnalyzerRule.html | 382 ++ Protocols/CollectingRule.html | 784 +++ Protocols/ConfigurationProviderRule.html | 505 ++ Protocols/LintableFileManager.html | 470 ++ Protocols/Reporter.html | 463 ++ Protocols/Rule.html | 853 +++ Protocols/RuleConfiguration.html | 486 ++ Protocols/SeverityBasedRuleConfiguration.html | 412 ++ Protocols/SwiftSyntaxRule.html | 624 ++ Protocols/ViolationsSyntaxRewriter.html | 379 ++ Reporters.html | 618 ++ Rules.html | 347 ++ Structs.html | 1043 ++++ Structs/CSVReporter.html | 474 ++ Structs/CheckstyleReporter.html | 475 ++ Structs/CodeClimateReporter.html | 474 ++ Structs/CollectedLinter.html | 549 ++ Structs/Command.html | 596 ++ Structs/Command/Action.html | 409 ++ Structs/Command/Modifier.html | 439 ++ Structs/Configuration.html | 1559 +++++ Structs/Configuration/IndentationStyle.html | 409 ++ Structs/Configuration/RulesMode.html | 441 ++ Structs/EmojiReporter.html | 474 ++ Structs/Example.html | 862 +++ Structs/GitHubActionsLoggingReporter.html | 474 ++ Structs/GitLabJUnitReporter.html | 474 ++ Structs/HTMLReporter.html | 474 ++ Structs/JSONReporter.html | 474 ++ Structs/JUnitReporter.html | 474 ++ Structs/Linter.html | 548 ++ Structs/Location.html | 800 +++ Structs/MarkdownReporter.html | 474 ++ Structs/ReasonedRuleViolation.html | 541 ++ Structs/Region.html | 727 +++ Structs/RuleDescription.html | 934 +++ Structs/RuleList.html | 520 ++ Structs/RuleListDocumentation.html | 452 ++ Structs/RuleParameter.html | 470 ++ Structs/SonarQubeReporter.html | 474 ++ Structs/SourceKittenDictionary.html | 530 ++ Structs/StyleViolation.html | 745 +++ Structs/SwiftLintSyntaxMap.html | 458 ++ Structs/SwiftLintSyntaxToken.html | 548 ++ Structs/SwiftVersion.html | 740 +++ Structs/Version.html | 409 ++ Structs/XcodeReporter.html | 474 ++ Structs/YamlParser.html | 420 ++ accessibility_label_for_image.html | 580 ++ accessibility_trait_for_button.html | 583 ++ anonymous_argument_in_multiline_closure.html | 360 ++ anyobject_protocol.html | 365 ++ array_init.html | 405 ++ attributes.html | 570 ++ badge.svg | 28 + balanced_xctest_lifecycle.html | 420 ++ block_based_kvo.html | 360 ++ capture_variable.html | 465 ++ class_delegate_protocol.html | 390 ++ closing_brace.html | 354 ++ closure_body_length.html | 1034 ++++ closure_end_indentation.html | 414 ++ closure_parameter_position.html | 438 ++ closure_spacing.html | 362 ++ collection_alignment.html | 420 ++ colon.html | 632 ++ comma.html | 397 ++ comma_inheritance.html | 378 ++ comment_spacing.html | 400 ++ compiler_protocol_init.html | 362 ++ computed_accessors_order.html | 541 ++ conditional_returns_on_newline.html | 381 ++ contains_over_filter_count.html | 407 ++ contains_over_filter_is_empty.html | 383 ++ contains_over_first_not_nil.html | 428 ++ contains_over_range_nil_comparison.html | 356 ++ control_statement.html | 459 ++ convenience_type.html | 421 ++ css/highlight.css | 202 + css/jazzy.css | 404 ++ custom_rules.html | 342 ++ cyclomatic_complexity.html | 395 ++ deployment_target.html | 422 ++ discarded_notification_center_observer.html | 389 ++ discouraged_assert.html | 362 ++ discouraged_direct_init.html | 386 ++ discouraged_none_name.html | 472 ++ discouraged_object_literal.html | 360 ++ discouraged_optional_boolean.html | 728 +++ discouraged_optional_collection.html | 908 +++ .../Contents/Info.plist | 22 + .../Contents/Resources/Documents/Classes.html | 464 ++ .../Documents/Classes/LinterCache.html | 446 ++ .../Documents/Classes/RuleStorage.html | 408 ++ .../Documents/Classes/SwiftLintFile.html | 769 +++ .../Classes/ViolationsSyntaxVisitor.html | 581 ++ .../Contents/Resources/Documents/Enums.html | 593 ++ .../Documents/Enums/AccessControlLevel.html | 563 ++ .../Documents/Enums/ConfigurationError.html | 469 ++ .../Documents/Enums/ExecutableInfo.html | 379 ++ .../Documents/Enums/RuleIdentifier.html | 567 ++ .../Resources/Documents/Enums/RuleKind.html | 499 ++ .../Documents/Enums/RuleListError.html | 379 ++ .../Documents/Enums/SwiftExpressionKind.html | 559 ++ .../Documents/Enums/ViolationSeverity.html | 451 ++ .../Resources/Documents/Extensions.html | 393 ++ .../Documents/Extensions/FileManager.html | 403 ++ .../Documents/Extensions/String.html | 462 ++ .../Resources/Documents/Functions.html | 522 ++ .../Resources/Documents/Global Variables.html | 369 ++ .../Contents/Resources/Documents/Guides.html | 2328 +++++++ .../Resources/Documents/Protocols.html | 772 +++ .../Documents/Protocols/ASTRule.html | 613 ++ .../Documents/Protocols/AnalyzerRule.html | 382 ++ .../Documents/Protocols/CollectingRule.html | 784 +++ .../Protocols/ConfigurationProviderRule.html | 505 ++ .../Protocols/LintableFileManager.html | 470 ++ .../Documents/Protocols/Reporter.html | 463 ++ .../Resources/Documents/Protocols/Rule.html | 853 +++ .../Protocols/RuleConfiguration.html | 486 ++ .../SeverityBasedRuleConfiguration.html | 412 ++ .../Documents/Protocols/SwiftSyntaxRule.html | 624 ++ .../Protocols/ViolationsSyntaxRewriter.html | 379 ++ .../Resources/Documents/Reporters.html | 618 ++ .../Contents/Resources/Documents/Rules.html | 347 ++ .../Contents/Resources/Documents/Structs.html | 1043 ++++ .../Documents/Structs/CSVReporter.html | 474 ++ .../Documents/Structs/CheckstyleReporter.html | 475 ++ .../Structs/CodeClimateReporter.html | 474 ++ .../Documents/Structs/CollectedLinter.html | 549 ++ .../Resources/Documents/Structs/Command.html | 596 ++ .../Documents/Structs/Command/Action.html | 409 ++ .../Documents/Structs/Command/Modifier.html | 439 ++ .../Documents/Structs/Configuration.html | 1559 +++++ .../Configuration/IndentationStyle.html | 409 ++ .../Structs/Configuration/RulesMode.html | 441 ++ .../Documents/Structs/EmojiReporter.html | 474 ++ .../Resources/Documents/Structs/Example.html | 862 +++ .../Structs/GitHubActionsLoggingReporter.html | 474 ++ .../Structs/GitLabJUnitReporter.html | 474 ++ .../Documents/Structs/HTMLReporter.html | 474 ++ .../Documents/Structs/JSONReporter.html | 474 ++ .../Documents/Structs/JUnitReporter.html | 474 ++ .../Resources/Documents/Structs/Linter.html | 548 ++ .../Resources/Documents/Structs/Location.html | 800 +++ .../Documents/Structs/MarkdownReporter.html | 474 ++ .../Structs/ReasonedRuleViolation.html | 541 ++ .../Resources/Documents/Structs/Region.html | 727 +++ .../Documents/Structs/RuleDescription.html | 934 +++ .../Resources/Documents/Structs/RuleList.html | 520 ++ .../Structs/RuleListDocumentation.html | 452 ++ .../Documents/Structs/RuleParameter.html | 470 ++ .../Documents/Structs/SonarQubeReporter.html | 474 ++ .../Structs/SourceKittenDictionary.html | 530 ++ .../Documents/Structs/StyleViolation.html | 745 +++ .../Documents/Structs/SwiftLintSyntaxMap.html | 458 ++ .../Structs/SwiftLintSyntaxToken.html | 548 ++ .../Documents/Structs/SwiftVersion.html | 740 +++ .../Resources/Documents/Structs/Version.html | 409 ++ .../Documents/Structs/XcodeReporter.html | 474 ++ .../Documents/Structs/YamlParser.html | 420 ++ .../accessibility_label_for_image.html | 580 ++ .../accessibility_trait_for_button.html | 583 ++ ...onymous_argument_in_multiline_closure.html | 360 ++ .../Documents/anyobject_protocol.html | 365 ++ .../Resources/Documents/array_init.html | 405 ++ .../Resources/Documents/attributes.html | 570 ++ .../Documents/balanced_xctest_lifecycle.html | 420 ++ .../Resources/Documents/block_based_kvo.html | 360 ++ .../Resources/Documents/capture_variable.html | 465 ++ .../Documents/class_delegate_protocol.html | 390 ++ .../Resources/Documents/closing_brace.html | 354 ++ .../Documents/closure_body_length.html | 1034 ++++ .../Documents/closure_end_indentation.html | 414 ++ .../Documents/closure_parameter_position.html | 438 ++ .../Resources/Documents/closure_spacing.html | 362 ++ .../Documents/collection_alignment.html | 420 ++ .../Contents/Resources/Documents/colon.html | 632 ++ .../Contents/Resources/Documents/comma.html | 397 ++ .../Documents/comma_inheritance.html | 378 ++ .../Resources/Documents/comment_spacing.html | 400 ++ .../Documents/compiler_protocol_init.html | 362 ++ .../Documents/computed_accessors_order.html | 541 ++ .../conditional_returns_on_newline.html | 381 ++ .../Documents/contains_over_filter_count.html | 407 ++ .../contains_over_filter_is_empty.html | 383 ++ .../contains_over_first_not_nil.html | 428 ++ .../contains_over_range_nil_comparison.html | 356 ++ .../Documents/control_statement.html | 459 ++ .../Resources/Documents/convenience_type.html | 421 ++ .../Resources/Documents/css/highlight.css | 202 + .../Resources/Documents/css/jazzy.css | 404 ++ .../Resources/Documents/custom_rules.html | 342 ++ .../Documents/cyclomatic_complexity.html | 395 ++ .../Documents/deployment_target.html | 422 ++ ...iscarded_notification_center_observer.html | 389 ++ .../Documents/discouraged_assert.html | 362 ++ .../Documents/discouraged_direct_init.html | 386 ++ .../Documents/discouraged_none_name.html | 472 ++ .../Documents/discouraged_object_literal.html | 360 ++ .../discouraged_optional_boolean.html | 728 +++ .../discouraged_optional_collection.html | 908 +++ .../Documents/duplicate_enum_cases.html | 380 ++ .../Documents/duplicate_imports.html | 445 ++ .../duplicated_key_in_dictionary_literal.html | 398 ++ .../Resources/Documents/dynamic_inline.html | 376 ++ .../Documents/empty_collection_literal.html | 368 ++ .../Resources/Documents/empty_count.html | 401 ++ .../Documents/empty_enum_arguments.html | 459 ++ .../Resources/Documents/empty_parameters.html | 374 ++ ...pty_parentheses_with_trailing_closure.html | 387 ++ .../Resources/Documents/empty_string.html | 362 ++ .../Documents/empty_xctest_method.html | 483 ++ .../enum_case_associated_values_count.html | 362 ++ .../Resources/Documents/expiring_todo.html | 386 ++ .../Resources/Documents/explicit_acl.html | 436 ++ .../Documents/explicit_enum_raw_value.html | 396 ++ .../Resources/Documents/explicit_init.html | 394 ++ .../Resources/Documents/explicit_self.html | 415 ++ .../Documents/explicit_top_level_acl.html | 385 ++ .../Documents/explicit_type_interface.html | 384 ++ .../Documents/extension_access_modifier.html | 407 ++ .../Resources/Documents/fallthrough.html | 356 ++ .../Documents/fatal_error_message.html | 360 ++ .../Resources/Documents/file_header.html | 365 ++ .../Resources/Documents/file_length.html | 1955 ++++++ .../Resources/Documents/file_name.html | 342 ++ .../Documents/file_name_no_space.html | 342 ++ .../Resources/Documents/file_types_order.html | 549 ++ .../Resources/Documents/first_where.html | 388 ++ .../Documents/flatmap_over_map_reduce.html | 350 ++ .../Resources/Documents/for_where.html | 421 ++ .../Resources/Documents/force_cast.html | 350 ++ .../Resources/Documents/force_try.html | 352 ++ .../Resources/Documents/force_unwrapping.html | 422 ++ .../Documents/function_body_length.html | 342 ++ .../function_default_parameter_at_end.html | 382 ++ .../Documents/function_parameter_count.html | 375 ++ .../Documents/generic_type_name.html | 452 ++ .../Documents/ibinspectable_in_extension.html | 352 ++ .../Documents/identical_operands.html | 830 +++ .../Resources/Documents/identifier_name.html | 394 ++ .../Resources/Documents/img/carat.png | Bin 0 -> 274 bytes .../Contents/Resources/Documents/img/dash.png | Bin 0 -> 1338 bytes .../Contents/Resources/Documents/img/gh.png | Bin 0 -> 1571 bytes .../Resources/Documents/img/spinner.gif | Bin 0 -> 1849 bytes .../Resources/Documents/implicit_getter.html | 555 ++ .../Resources/Documents/implicit_return.html | 428 ++ .../implicitly_unwrapped_optional.html | 376 ++ .../Documents/inclusive_language.html | 378 ++ .../Documents/indentation_width.html | 382 ++ .../Contents/Resources/Documents/index.html | 1020 +++ .../Resources/Documents/inert_defer.html | 373 ++ .../Resources/Documents/is_disjoint.html | 356 ++ .../Documents/joined_default_parameter.html | 359 ++ .../Contents/Resources/Documents/js/jazzy.js | 74 + .../Resources/Documents/js/jazzy.search.js | 74 + .../Resources/Documents/js/jquery.min.js | 2 + .../Resources/Documents/js/lunr.min.js | 6 + .../Documents/js/typeahead.jquery.js | 1694 +++++ .../Resources/Documents/large_tuple.html | 491 ++ .../Resources/Documents/last_where.html | 380 ++ .../Documents/leading_whitespace.html | 354 ++ .../legacy_cggeometry_functions.html | 424 ++ .../Resources/Documents/legacy_constant.html | 384 ++ .../Documents/legacy_constructor.html | 438 ++ .../Resources/Documents/legacy_hashing.html | 397 ++ .../Resources/Documents/legacy_multiple.html | 375 ++ .../legacy_nsgeometry_functions.html | 420 ++ .../Resources/Documents/legacy_objc_type.html | 377 ++ .../Resources/Documents/legacy_random.html | 362 ++ .../Documents/let_var_whitespace.html | 472 ++ .../Resources/Documents/line_length.html | 362 ++ .../literal_expression_end_indentation.html | 389 ++ .../Documents/local_doc_comment.html | 364 ++ .../Documents/lower_acl_than_parent.html | 416 ++ .../Contents/Resources/Documents/mark.html | 419 ++ .../Resources/Documents/missing_docs.html | 396 ++ .../Resources/Documents/modifier_order.html | 531 ++ .../Documents/multiline_arguments.html | 405 ++ .../multiline_arguments_brackets.html | 452 ++ .../Documents/multiline_function_chains.html | 411 ++ .../Documents/multiline_literal_brackets.html | 418 ++ .../Documents/multiline_parameters.html | 702 +++ .../multiline_parameters_brackets.html | 406 ++ ...ltiple_closures_with_trailing_closure.html | 378 ++ .../Contents/Resources/Documents/nesting.html | 1033 ++++ .../Resources/Documents/nimble_operator.html | 426 ++ .../no_extension_access_modifier.html | 361 ++ .../Documents/no_fallthrough_only.html | 480 ++ .../Documents/no_grouping_extension.html | 372 ++ .../Resources/Documents/no_magic_numbers.html | 388 ++ .../Documents/no_space_in_method_call.html | 378 ++ .../notification_center_detachment.html | 362 ++ .../ns_number_init_as_function_reference.html | 356 ++ .../Documents/nslocalizedstring_key.html | 365 ++ .../nslocalizedstring_require_bundle.html | 363 ++ .../Documents/nsobject_prefer_isequal.html | 416 ++ .../Resources/Documents/number_separator.html | 506 ++ .../Resources/Documents/object_literal.html | 392 ++ .../Resources/Documents/opening_brace.html | 484 ++ .../Documents/operator_usage_whitespace.html | 528 ++ .../Documents/operator_whitespace.html | 371 ++ .../optional_enum_case_matching.html | 396 ++ .../Documents/orphaned_doc_comment.html | 368 ++ .../Documents/overridden_super_call.html | 396 ++ .../Documents/override_in_extension.html | 381 ++ .../Documents/pattern_matching_keywords.html | 420 ++ .../Resources/Documents/prefer_nimble.html | 360 ++ .../prefer_self_in_static_references.html | 401 ++ .../prefer_self_type_over_type_of_self.html | 386 ++ .../prefer_zero_over_explicit_init.html | 368 ++ .../Documents/prefixed_toplevel_constant.html | 416 ++ .../Resources/Documents/private_action.html | 429 ++ .../Resources/Documents/private_outlet.html | 419 ++ .../Documents/private_over_fileprivate.html | 380 ++ .../Resources/Documents/private_subject.html | 494 ++ .../Documents/private_unit_test.html | 415 ++ .../prohibited_interface_builder.html | 360 ++ .../Documents/prohibited_super_call.html | 393 ++ .../protocol_property_accessors_order.html | 360 ++ .../Documents/quick_discouraged_call.html | 605 ++ .../quick_discouraged_focused_test.html | 413 ++ .../quick_discouraged_pending_test.html | 419 ++ ...aw_value_for_camel_cased_codable_enum.html | 409 ++ .../Resources/Documents/reduce_boolean.html | 364 ++ .../Resources/Documents/reduce_into.html | 419 ++ .../Documents/redundant_discardable_let.html | 366 ++ .../Documents/redundant_nil_coalescing.html | 350 ++ .../Documents/redundant_objc_attribute.html | 485 ++ .../redundant_optional_initialization.html | 405 ++ .../redundant_set_access_control.html | 384 ++ .../redundant_string_enum_value.html | 381 ++ .../Documents/redundant_type_annotation.html | 391 ++ .../Documents/redundant_void_return.html | 399 ++ .../Resources/Documents/required_deinit.html | 389 ++ .../Documents/required_enum_case.html | 387 ++ .../Documents/return_arrow_whitespace.html | 416 ++ .../return_value_from_void_function.html | 540 ++ .../Resources/Documents/rule-directory.html | 558 ++ .../Contents/Resources/Documents/search.json | 1 + .../Resources/Documents/self_binding.html | 372 ++ .../self_in_property_initialization.html | 392 ++ .../Documents/shorthand_operator.html | 495 ++ .../Documents/shorthand_optional_binding.html | 366 ++ .../Documents/single_test_class.html | 378 ++ .../Documents/sorted_first_last.html | 414 ++ .../Resources/Documents/sorted_imports.html | 406 ++ .../Documents/statement_position.html | 372 ++ .../Resources/Documents/static_operator.html | 398 ++ .../Documents/strict_fileprivate.html | 382 ++ .../Resources/Documents/strong_iboutlet.html | 364 ++ .../superfluous_disable_command.html | 342 ++ .../Documents/swift-syntax-dashboard.html | 571 ++ .../Documents/switch_case_alignment.html | 420 ++ .../Documents/switch_case_on_newline.html | 458 ++ .../Resources/Documents/syntactic_sugar.html | 424 ++ .../Documents/test_case_accessibility.html | 438 ++ .../Contents/Resources/Documents/todo.html | 374 ++ .../Resources/Documents/toggle_bool.html | 368 ++ .../Resources/Documents/trailing_closure.html | 380 ++ .../Resources/Documents/trailing_comma.html | 409 ++ .../Resources/Documents/trailing_newline.html | 353 ++ .../Documents/trailing_semicolon.html | 356 ++ .../Documents/trailing_whitespace.html | 365 ++ .../Resources/Documents/type_body_length.html | 5444 +++++++++++++++++ .../Documents/type_contents_order.html | 565 ++ .../Resources/Documents/type_name.html | 411 ++ .../Documents/typesafe_array_init.html | 372 ++ .../Documents/unavailable_condition.html | 382 ++ .../Documents/unavailable_function.html | 393 ++ .../Documents/unneeded_break_in_switch.html | 405 ++ ...eeded_parentheses_in_closure_argument.html | 395 ++ .../Documents/unowned_variable_capture.html | 362 ++ .../Documents/untyped_error_in_catch.html | 399 ++ .../Documents/unused_capture_list.html | 434 ++ .../Documents/unused_closure_parameter.html | 482 ++ .../Documents/unused_control_flow_label.html | 387 ++ .../Documents/unused_declaration.html | 604 ++ .../Documents/unused_enumerated.html | 383 ++ .../Resources/Documents/unused_import.html | 391 ++ .../Documents/unused_optional_binding.html | 399 ++ .../Documents/unused_setter_value.html | 433 ++ .../Documents/valid_ibinspectable.html | 420 ++ .../vertical_parameter_alignment.html | 409 ++ .../vertical_parameter_alignment_on_call.html | 413 ++ .../Documents/vertical_whitespace.html | 377 ++ .../vertical_whitespace_between_cases.html | 431 ++ .../vertical_whitespace_closing_braces.html | 468 ++ .../vertical_whitespace_opening_braces.html | 458 ++ .../Documents/void_function_in_ternary.html | 423 ++ .../Resources/Documents/void_return.html | 386 ++ .../Resources/Documents/weak_delegate.html | 435 ++ .../Documents/xct_specific_matcher.html | 488 ++ .../Resources/Documents/xctfail_message.html | 360 ++ .../Resources/Documents/yoda_condition.html | 390 ++ .../Contents/Resources/docSet.dsidx | Bin 0 -> 135168 bytes docsets/SwiftLintFramework.tgz | Bin 0 -> 478782 bytes docsets/SwiftLintFramework.xml | 1 + duplicate_enum_cases.html | 380 ++ duplicate_imports.html | 445 ++ duplicated_key_in_dictionary_literal.html | 398 ++ dynamic_inline.html | 376 ++ empty_collection_literal.html | 368 ++ empty_count.html | 401 ++ empty_enum_arguments.html | 459 ++ empty_parameters.html | 374 ++ empty_parentheses_with_trailing_closure.html | 387 ++ empty_string.html | 362 ++ empty_xctest_method.html | 483 ++ enum_case_associated_values_count.html | 362 ++ expiring_todo.html | 386 ++ explicit_acl.html | 436 ++ explicit_enum_raw_value.html | 396 ++ explicit_init.html | 394 ++ explicit_self.html | 415 ++ explicit_top_level_acl.html | 385 ++ explicit_type_interface.html | 384 ++ extension_access_modifier.html | 407 ++ fallthrough.html | 356 ++ fatal_error_message.html | 360 ++ file_header.html | 365 ++ file_length.html | 1955 ++++++ file_name.html | 342 ++ file_name_no_space.html | 342 ++ file_types_order.html | 549 ++ first_where.html | 388 ++ flatmap_over_map_reduce.html | 350 ++ for_where.html | 421 ++ force_cast.html | 350 ++ force_try.html | 352 ++ force_unwrapping.html | 422 ++ function_body_length.html | 342 ++ function_default_parameter_at_end.html | 382 ++ function_parameter_count.html | 375 ++ generic_type_name.html | 452 ++ ibinspectable_in_extension.html | 352 ++ identical_operands.html | 830 +++ identifier_name.html | 394 ++ img/carat.png | Bin 0 -> 274 bytes img/dash.png | Bin 0 -> 1338 bytes img/gh.png | Bin 0 -> 1571 bytes img/spinner.gif | Bin 0 -> 1849 bytes implicit_getter.html | 555 ++ implicit_return.html | 428 ++ implicitly_unwrapped_optional.html | 376 ++ inclusive_language.html | 378 ++ indentation_width.html | 382 ++ index.html | 1020 +++ inert_defer.html | 373 ++ is_disjoint.html | 356 ++ joined_default_parameter.html | 359 ++ js/jazzy.js | 74 + js/jazzy.search.js | 74 + js/jquery.min.js | 2 + js/lunr.min.js | 6 + js/typeahead.jquery.js | 1694 +++++ large_tuple.html | 491 ++ last_where.html | 380 ++ leading_whitespace.html | 354 ++ legacy_cggeometry_functions.html | 424 ++ legacy_constant.html | 384 ++ legacy_constructor.html | 438 ++ legacy_hashing.html | 397 ++ legacy_multiple.html | 375 ++ legacy_nsgeometry_functions.html | 420 ++ legacy_objc_type.html | 377 ++ legacy_random.html | 362 ++ let_var_whitespace.html | 472 ++ line_length.html | 362 ++ literal_expression_end_indentation.html | 389 ++ local_doc_comment.html | 364 ++ lower_acl_than_parent.html | 416 ++ mark.html | 419 ++ missing_docs.html | 396 ++ modifier_order.html | 531 ++ multiline_arguments.html | 405 ++ multiline_arguments_brackets.html | 452 ++ multiline_function_chains.html | 411 ++ multiline_literal_brackets.html | 418 ++ multiline_parameters.html | 702 +++ multiline_parameters_brackets.html | 406 ++ multiple_closures_with_trailing_closure.html | 378 ++ nesting.html | 1033 ++++ nimble_operator.html | 426 ++ no_extension_access_modifier.html | 361 ++ no_fallthrough_only.html | 480 ++ no_grouping_extension.html | 372 ++ no_magic_numbers.html | 388 ++ no_space_in_method_call.html | 378 ++ notification_center_detachment.html | 362 ++ ns_number_init_as_function_reference.html | 356 ++ nslocalizedstring_key.html | 365 ++ nslocalizedstring_require_bundle.html | 363 ++ nsobject_prefer_isequal.html | 416 ++ number_separator.html | 506 ++ object_literal.html | 392 ++ opening_brace.html | 484 ++ operator_usage_whitespace.html | 528 ++ operator_whitespace.html | 371 ++ optional_enum_case_matching.html | 396 ++ orphaned_doc_comment.html | 368 ++ overridden_super_call.html | 396 ++ override_in_extension.html | 381 ++ pattern_matching_keywords.html | 420 ++ prefer_nimble.html | 360 ++ prefer_self_in_static_references.html | 401 ++ prefer_self_type_over_type_of_self.html | 386 ++ prefer_zero_over_explicit_init.html | 368 ++ prefixed_toplevel_constant.html | 416 ++ private_action.html | 429 ++ private_outlet.html | 419 ++ private_over_fileprivate.html | 380 ++ private_subject.html | 494 ++ private_unit_test.html | 415 ++ prohibited_interface_builder.html | 360 ++ prohibited_super_call.html | 393 ++ protocol_property_accessors_order.html | 360 ++ quick_discouraged_call.html | 605 ++ quick_discouraged_focused_test.html | 413 ++ quick_discouraged_pending_test.html | 419 ++ raw_value_for_camel_cased_codable_enum.html | 409 ++ reduce_boolean.html | 364 ++ reduce_into.html | 419 ++ redundant_discardable_let.html | 366 ++ redundant_nil_coalescing.html | 350 ++ redundant_objc_attribute.html | 485 ++ redundant_optional_initialization.html | 405 ++ redundant_set_access_control.html | 384 ++ redundant_string_enum_value.html | 381 ++ redundant_type_annotation.html | 391 ++ redundant_void_return.html | 399 ++ required_deinit.html | 389 ++ required_enum_case.html | 387 ++ return_arrow_whitespace.html | 416 ++ return_value_from_void_function.html | 540 ++ rule-directory.html | 558 ++ search.json | 1 + self_binding.html | 372 ++ self_in_property_initialization.html | 392 ++ shorthand_operator.html | 495 ++ shorthand_optional_binding.html | 366 ++ single_test_class.html | 378 ++ sorted_first_last.html | 414 ++ sorted_imports.html | 406 ++ statement_position.html | 372 ++ static_operator.html | 398 ++ strict_fileprivate.html | 382 ++ strong_iboutlet.html | 364 ++ superfluous_disable_command.html | 342 ++ swift-syntax-dashboard.html | 571 ++ switch_case_alignment.html | 420 ++ switch_case_on_newline.html | 458 ++ syntactic_sugar.html | 424 ++ test_case_accessibility.html | 438 ++ todo.html | 374 ++ toggle_bool.html | 368 ++ trailing_closure.html | 380 ++ trailing_comma.html | 409 ++ trailing_newline.html | 353 ++ trailing_semicolon.html | 356 ++ trailing_whitespace.html | 365 ++ type_body_length.html | 5444 +++++++++++++++++ type_contents_order.html | 565 ++ type_name.html | 411 ++ typesafe_array_init.html | 372 ++ unavailable_condition.html | 382 ++ unavailable_function.html | 393 ++ undocumented.json | 6 + unneeded_break_in_switch.html | 405 ++ unneeded_parentheses_in_closure_argument.html | 395 ++ unowned_variable_capture.html | 362 ++ untyped_error_in_catch.html | 399 ++ unused_capture_list.html | 434 ++ unused_closure_parameter.html | 482 ++ unused_control_flow_label.html | 387 ++ unused_declaration.html | 604 ++ unused_enumerated.html | 383 ++ unused_import.html | 391 ++ unused_optional_binding.html | 399 ++ unused_setter_value.html | 433 ++ valid_ibinspectable.html | 420 ++ vertical_parameter_alignment.html | 409 ++ vertical_parameter_alignment_on_call.html | 413 ++ vertical_whitespace.html | 377 ++ vertical_whitespace_between_cases.html | 431 ++ vertical_whitespace_closing_braces.html | 468 ++ vertical_whitespace_opening_braces.html | 458 ++ void_function_in_ternary.html | 423 ++ void_return.html | 386 ++ weak_delegate.html | 435 ++ xct_specific_matcher.html | 488 ++ xctfail_message.html | 360 ++ yoda_condition.html | 390 ++ 616 files changed, 287581 insertions(+) create mode 100644 Classes.html create mode 100644 Classes/LinterCache.html create mode 100644 Classes/RuleStorage.html create mode 100644 Classes/SwiftLintFile.html create mode 100644 Classes/ViolationsSyntaxVisitor.html create mode 100644 Enums.html create mode 100644 Enums/AccessControlLevel.html create mode 100644 Enums/ConfigurationError.html create mode 100644 Enums/ExecutableInfo.html create mode 100644 Enums/RuleIdentifier.html create mode 100644 Enums/RuleKind.html create mode 100644 Enums/RuleListError.html create mode 100644 Enums/SwiftExpressionKind.html create mode 100644 Enums/ViolationSeverity.html create mode 100644 Extensions.html create mode 100644 Extensions/FileManager.html create mode 100644 Extensions/String.html create mode 100644 Functions.html create mode 100644 Global Variables.html create mode 100644 Guides.html create mode 100644 Protocols.html create mode 100644 Protocols/ASTRule.html create mode 100644 Protocols/AnalyzerRule.html create mode 100644 Protocols/CollectingRule.html create mode 100644 Protocols/ConfigurationProviderRule.html create mode 100644 Protocols/LintableFileManager.html create mode 100644 Protocols/Reporter.html create mode 100644 Protocols/Rule.html create mode 100644 Protocols/RuleConfiguration.html create mode 100644 Protocols/SeverityBasedRuleConfiguration.html create mode 100644 Protocols/SwiftSyntaxRule.html create mode 100644 Protocols/ViolationsSyntaxRewriter.html create mode 100644 Reporters.html create mode 100644 Rules.html create mode 100644 Structs.html create mode 100644 Structs/CSVReporter.html create mode 100644 Structs/CheckstyleReporter.html create mode 100644 Structs/CodeClimateReporter.html create mode 100644 Structs/CollectedLinter.html create mode 100644 Structs/Command.html create mode 100644 Structs/Command/Action.html create mode 100644 Structs/Command/Modifier.html create mode 100644 Structs/Configuration.html create mode 100644 Structs/Configuration/IndentationStyle.html create mode 100644 Structs/Configuration/RulesMode.html create mode 100644 Structs/EmojiReporter.html create mode 100644 Structs/Example.html create mode 100644 Structs/GitHubActionsLoggingReporter.html create mode 100644 Structs/GitLabJUnitReporter.html create mode 100644 Structs/HTMLReporter.html create mode 100644 Structs/JSONReporter.html create mode 100644 Structs/JUnitReporter.html create mode 100644 Structs/Linter.html create mode 100644 Structs/Location.html create mode 100644 Structs/MarkdownReporter.html create mode 100644 Structs/ReasonedRuleViolation.html create mode 100644 Structs/Region.html create mode 100644 Structs/RuleDescription.html create mode 100644 Structs/RuleList.html create mode 100644 Structs/RuleListDocumentation.html create mode 100644 Structs/RuleParameter.html create mode 100644 Structs/SonarQubeReporter.html create mode 100644 Structs/SourceKittenDictionary.html create mode 100644 Structs/StyleViolation.html create mode 100644 Structs/SwiftLintSyntaxMap.html create mode 100644 Structs/SwiftLintSyntaxToken.html create mode 100644 Structs/SwiftVersion.html create mode 100644 Structs/Version.html create mode 100644 Structs/XcodeReporter.html create mode 100644 Structs/YamlParser.html create mode 100644 accessibility_label_for_image.html create mode 100644 accessibility_trait_for_button.html create mode 100644 anonymous_argument_in_multiline_closure.html create mode 100644 anyobject_protocol.html create mode 100644 array_init.html create mode 100644 attributes.html create mode 100644 badge.svg create mode 100644 balanced_xctest_lifecycle.html create mode 100644 block_based_kvo.html create mode 100644 capture_variable.html create mode 100644 class_delegate_protocol.html create mode 100644 closing_brace.html create mode 100644 closure_body_length.html create mode 100644 closure_end_indentation.html create mode 100644 closure_parameter_position.html create mode 100644 closure_spacing.html create mode 100644 collection_alignment.html create mode 100644 colon.html create mode 100644 comma.html create mode 100644 comma_inheritance.html create mode 100644 comment_spacing.html create mode 100644 compiler_protocol_init.html create mode 100644 computed_accessors_order.html create mode 100644 conditional_returns_on_newline.html create mode 100644 contains_over_filter_count.html create mode 100644 contains_over_filter_is_empty.html create mode 100644 contains_over_first_not_nil.html create mode 100644 contains_over_range_nil_comparison.html create mode 100644 control_statement.html create mode 100644 convenience_type.html create mode 100644 css/highlight.css create mode 100644 css/jazzy.css create mode 100644 custom_rules.html create mode 100644 cyclomatic_complexity.html create mode 100644 deployment_target.html create mode 100644 discarded_notification_center_observer.html create mode 100644 discouraged_assert.html create mode 100644 discouraged_direct_init.html create mode 100644 discouraged_none_name.html create mode 100644 discouraged_object_literal.html create mode 100644 discouraged_optional_boolean.html create mode 100644 discouraged_optional_collection.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Info.plist create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/LinterCache.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/RuleStorage.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ConfigurationError.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleKind.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleListError.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/FileManager.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/String.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Functions.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Global Variables.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Guides.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ASTRule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/CollectingRule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ConfigurationProviderRule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/LintableFileManager.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Reporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Rule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ViolationsSyntaxRewriter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Reporters.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Rules.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CSVReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CheckstyleReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CodeClimateReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CollectedLinter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Action.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Modifier.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/IndentationStyle.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/RulesMode.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/EmojiReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Example.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitHubActionsLoggingReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitLabJUnitReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/HTMLReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JSONReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JUnitReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Linter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Location.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/MarkdownReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Region.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleDescription.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleList.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleParameter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SonarQubeReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SourceKittenDictionary.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/StyleViolation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftVersion.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Version.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/XcodeReporter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/YamlParser.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_label_for_image.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_trait_for_button.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anyobject_protocol.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/array_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/attributes.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/block_based_kvo.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/capture_variable.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/class_delegate_protocol.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closing_brace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_body_length.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_end_indentation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_parameter_position.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_spacing.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/collection_alignment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/colon.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma_inheritance.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comment_spacing.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/compiler_protocol_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/computed_accessors_order.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/conditional_returns_on_newline.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_count.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_first_not_nil.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/control_statement.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/convenience_type.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/highlight.css create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/jazzy.css create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/custom_rules.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/cyclomatic_complexity.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/deployment_target.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discarded_notification_center_observer.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_assert.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_direct_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_none_name.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_object_literal.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_boolean.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_collection.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_enum_cases.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_imports.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/dynamic_inline.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_collection_literal.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_count.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_enum_arguments.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parameters.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_string.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_xctest_method.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/enum_case_associated_values_count.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/expiring_todo.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_acl.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_enum_raw_value.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_self.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_top_level_acl.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_type_interface.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/extension_access_modifier.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fallthrough.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fatal_error_message.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_header.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_length.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name_no_space.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_types_order.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/first_where.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/for_where.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_cast.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_try.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_unwrapping.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_body_length.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_default_parameter_at_end.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_parameter_count.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/generic_type_name.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ibinspectable_in_extension.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identical_operands.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identifier_name.html create mode 100755 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/carat.png create mode 100755 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/dash.png create mode 100755 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/gh.png create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/spinner.gif create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_getter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_return.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inclusive_language.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/indentation_width.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/index.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inert_defer.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/is_disjoint.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/joined_default_parameter.html create mode 100755 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.js create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.search.js create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jquery.min.js create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/lunr.min.js create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/typeahead.jquery.js create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/large_tuple.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/last_where.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/leading_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constant.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constructor.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_hashing.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_multiple.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_objc_type.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_random.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/let_var_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/line_length.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/literal_expression_end_indentation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/local_doc_comment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/lower_acl_than_parent.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/mark.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/missing_docs.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/modifier_order.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments_brackets.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_function_chains.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_literal_brackets.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters_brackets.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nesting.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nimble_operator.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_extension_access_modifier.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_fallthrough_only.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_grouping_extension.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_magic_numbers.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_space_in_method_call.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/notification_center_detachment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_key.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/number_separator.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/object_literal.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/opening_brace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_usage_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/optional_enum_case_matching.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/orphaned_doc_comment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/overridden_super_call.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/override_in_extension.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/pattern_matching_keywords.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_nimble.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_in_static_references.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_action.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_outlet.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_over_fileprivate.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_subject.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_unit_test.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_interface_builder.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_super_call.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/protocol_property_accessors_order.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_call.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_boolean.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_into.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_discardable_let.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_nil_coalescing.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_objc_attribute.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_optional_initialization.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_set_access_control.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_string_enum_value.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_type_annotation.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_void_return.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_deinit.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_enum_case.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_arrow_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_value_from_void_function.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/rule-directory.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/search.json create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_binding.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_in_property_initialization.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_operator.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_optional_binding.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/single_test_class.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_first_last.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_imports.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/statement_position.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/static_operator.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strict_fileprivate.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strong_iboutlet.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/superfluous_disable_command.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/swift-syntax-dashboard.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_alignment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_on_newline.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/syntactic_sugar.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/test_case_accessibility.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/todo.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/toggle_bool.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_closure.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_comma.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_newline.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_semicolon.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_body_length.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_contents_order.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_name.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/typesafe_array_init.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_condition.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_function.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_break_in_switch.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unowned_variable_capture.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/untyped_error_in_catch.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_capture_list.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_closure_parameter.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_control_flow_label.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_declaration.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_enumerated.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_import.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_optional_binding.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_setter_value.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/valid_ibinspectable.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_function_in_ternary.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_return.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/weak_delegate.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xct_specific_matcher.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xctfail_message.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/Documents/yoda_condition.html create mode 100644 docsets/SwiftLintFramework.docset/Contents/Resources/docSet.dsidx create mode 100644 docsets/SwiftLintFramework.tgz create mode 100644 docsets/SwiftLintFramework.xml create mode 100644 duplicate_enum_cases.html create mode 100644 duplicate_imports.html create mode 100644 duplicated_key_in_dictionary_literal.html create mode 100644 dynamic_inline.html create mode 100644 empty_collection_literal.html create mode 100644 empty_count.html create mode 100644 empty_enum_arguments.html create mode 100644 empty_parameters.html create mode 100644 empty_parentheses_with_trailing_closure.html create mode 100644 empty_string.html create mode 100644 empty_xctest_method.html create mode 100644 enum_case_associated_values_count.html create mode 100644 expiring_todo.html create mode 100644 explicit_acl.html create mode 100644 explicit_enum_raw_value.html create mode 100644 explicit_init.html create mode 100644 explicit_self.html create mode 100644 explicit_top_level_acl.html create mode 100644 explicit_type_interface.html create mode 100644 extension_access_modifier.html create mode 100644 fallthrough.html create mode 100644 fatal_error_message.html create mode 100644 file_header.html create mode 100644 file_length.html create mode 100644 file_name.html create mode 100644 file_name_no_space.html create mode 100644 file_types_order.html create mode 100644 first_where.html create mode 100644 flatmap_over_map_reduce.html create mode 100644 for_where.html create mode 100644 force_cast.html create mode 100644 force_try.html create mode 100644 force_unwrapping.html create mode 100644 function_body_length.html create mode 100644 function_default_parameter_at_end.html create mode 100644 function_parameter_count.html create mode 100644 generic_type_name.html create mode 100644 ibinspectable_in_extension.html create mode 100644 identical_operands.html create mode 100644 identifier_name.html create mode 100755 img/carat.png create mode 100755 img/dash.png create mode 100755 img/gh.png create mode 100644 img/spinner.gif create mode 100644 implicit_getter.html create mode 100644 implicit_return.html create mode 100644 implicitly_unwrapped_optional.html create mode 100644 inclusive_language.html create mode 100644 indentation_width.html create mode 100644 index.html create mode 100644 inert_defer.html create mode 100644 is_disjoint.html create mode 100644 joined_default_parameter.html create mode 100755 js/jazzy.js create mode 100644 js/jazzy.search.js create mode 100644 js/jquery.min.js create mode 100644 js/lunr.min.js create mode 100644 js/typeahead.jquery.js create mode 100644 large_tuple.html create mode 100644 last_where.html create mode 100644 leading_whitespace.html create mode 100644 legacy_cggeometry_functions.html create mode 100644 legacy_constant.html create mode 100644 legacy_constructor.html create mode 100644 legacy_hashing.html create mode 100644 legacy_multiple.html create mode 100644 legacy_nsgeometry_functions.html create mode 100644 legacy_objc_type.html create mode 100644 legacy_random.html create mode 100644 let_var_whitespace.html create mode 100644 line_length.html create mode 100644 literal_expression_end_indentation.html create mode 100644 local_doc_comment.html create mode 100644 lower_acl_than_parent.html create mode 100644 mark.html create mode 100644 missing_docs.html create mode 100644 modifier_order.html create mode 100644 multiline_arguments.html create mode 100644 multiline_arguments_brackets.html create mode 100644 multiline_function_chains.html create mode 100644 multiline_literal_brackets.html create mode 100644 multiline_parameters.html create mode 100644 multiline_parameters_brackets.html create mode 100644 multiple_closures_with_trailing_closure.html create mode 100644 nesting.html create mode 100644 nimble_operator.html create mode 100644 no_extension_access_modifier.html create mode 100644 no_fallthrough_only.html create mode 100644 no_grouping_extension.html create mode 100644 no_magic_numbers.html create mode 100644 no_space_in_method_call.html create mode 100644 notification_center_detachment.html create mode 100644 ns_number_init_as_function_reference.html create mode 100644 nslocalizedstring_key.html create mode 100644 nslocalizedstring_require_bundle.html create mode 100644 nsobject_prefer_isequal.html create mode 100644 number_separator.html create mode 100644 object_literal.html create mode 100644 opening_brace.html create mode 100644 operator_usage_whitespace.html create mode 100644 operator_whitespace.html create mode 100644 optional_enum_case_matching.html create mode 100644 orphaned_doc_comment.html create mode 100644 overridden_super_call.html create mode 100644 override_in_extension.html create mode 100644 pattern_matching_keywords.html create mode 100644 prefer_nimble.html create mode 100644 prefer_self_in_static_references.html create mode 100644 prefer_self_type_over_type_of_self.html create mode 100644 prefer_zero_over_explicit_init.html create mode 100644 prefixed_toplevel_constant.html create mode 100644 private_action.html create mode 100644 private_outlet.html create mode 100644 private_over_fileprivate.html create mode 100644 private_subject.html create mode 100644 private_unit_test.html create mode 100644 prohibited_interface_builder.html create mode 100644 prohibited_super_call.html create mode 100644 protocol_property_accessors_order.html create mode 100644 quick_discouraged_call.html create mode 100644 quick_discouraged_focused_test.html create mode 100644 quick_discouraged_pending_test.html create mode 100644 raw_value_for_camel_cased_codable_enum.html create mode 100644 reduce_boolean.html create mode 100644 reduce_into.html create mode 100644 redundant_discardable_let.html create mode 100644 redundant_nil_coalescing.html create mode 100644 redundant_objc_attribute.html create mode 100644 redundant_optional_initialization.html create mode 100644 redundant_set_access_control.html create mode 100644 redundant_string_enum_value.html create mode 100644 redundant_type_annotation.html create mode 100644 redundant_void_return.html create mode 100644 required_deinit.html create mode 100644 required_enum_case.html create mode 100644 return_arrow_whitespace.html create mode 100644 return_value_from_void_function.html create mode 100644 rule-directory.html create mode 100644 search.json create mode 100644 self_binding.html create mode 100644 self_in_property_initialization.html create mode 100644 shorthand_operator.html create mode 100644 shorthand_optional_binding.html create mode 100644 single_test_class.html create mode 100644 sorted_first_last.html create mode 100644 sorted_imports.html create mode 100644 statement_position.html create mode 100644 static_operator.html create mode 100644 strict_fileprivate.html create mode 100644 strong_iboutlet.html create mode 100644 superfluous_disable_command.html create mode 100644 swift-syntax-dashboard.html create mode 100644 switch_case_alignment.html create mode 100644 switch_case_on_newline.html create mode 100644 syntactic_sugar.html create mode 100644 test_case_accessibility.html create mode 100644 todo.html create mode 100644 toggle_bool.html create mode 100644 trailing_closure.html create mode 100644 trailing_comma.html create mode 100644 trailing_newline.html create mode 100644 trailing_semicolon.html create mode 100644 trailing_whitespace.html create mode 100644 type_body_length.html create mode 100644 type_contents_order.html create mode 100644 type_name.html create mode 100644 typesafe_array_init.html create mode 100644 unavailable_condition.html create mode 100644 unavailable_function.html create mode 100644 undocumented.json create mode 100644 unneeded_break_in_switch.html create mode 100644 unneeded_parentheses_in_closure_argument.html create mode 100644 unowned_variable_capture.html create mode 100644 untyped_error_in_catch.html create mode 100644 unused_capture_list.html create mode 100644 unused_closure_parameter.html create mode 100644 unused_control_flow_label.html create mode 100644 unused_declaration.html create mode 100644 unused_enumerated.html create mode 100644 unused_import.html create mode 100644 unused_optional_binding.html create mode 100644 unused_setter_value.html create mode 100644 valid_ibinspectable.html create mode 100644 vertical_parameter_alignment.html create mode 100644 vertical_parameter_alignment_on_call.html create mode 100644 vertical_whitespace.html create mode 100644 vertical_whitespace_between_cases.html create mode 100644 vertical_whitespace_closing_braces.html create mode 100644 vertical_whitespace_opening_braces.html create mode 100644 void_function_in_ternary.html create mode 100644 void_return.html create mode 100644 weak_delegate.html create mode 100644 xct_specific_matcher.html create mode 100644 xctfail_message.html create mode 100644 yoda_condition.html diff --git a/Classes.html b/Classes.html new file mode 100644 index 000000000..478f9a404 --- /dev/null +++ b/Classes.html @@ -0,0 +1,464 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Classes

+

The following classes are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + SwiftLintFile + +
    +
    +
    +
    +
    +
    +

    A unit of Swift source code, either on disk or in memory.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SwiftLintFile
    +
    extension SwiftLintFile: Equatable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LinterCache + +
    +
    +
    +
    +
    +
    +

    A persisted cache for storing and retrieving linter results.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class LinterCache
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleStorage + +
    +
    +
    +
    +
    +
    +

    A storage mechanism for aggregating the results of CollectingRules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class RuleStorage : CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ViolationsSyntaxVisitor : SyntaxVisitor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/LinterCache.html b/Classes/LinterCache.html new file mode 100644 index 000000000..26be504d8 --- /dev/null +++ b/Classes/LinterCache.html @@ -0,0 +1,446 @@ + + + + LinterCache Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

LinterCache

+
+
+ +
public final class LinterCache
+ +
+
+

A persisted cache for storing and retrieving linter results.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: Configuration, fileManager: LintableFileManager = FileManager.default)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + configuration + + +
    +

    The SwiftLint configuration for which this cache will be used.

    +
    +
    + + fileManager + + +
    +

    The file manager to use to read lintable file information.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save() + +
    +
    +
    +
    +
    +
    +

    Persists the cache to disk.

    +
    +

    Throws

    + Throws if the linter cache doesn’t have a location value, if the cache couldn’t be serialized, or if + the contents couldn’t be written to disk. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func save() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/RuleStorage.html b/Classes/RuleStorage.html new file mode 100644 index 000000000..d09fec165 --- /dev/null +++ b/Classes/RuleStorage.html @@ -0,0 +1,408 @@ + + + + RuleStorage Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleStorage

+
+
+ +
public class RuleStorage : CustomStringConvertible
+ +
+
+

A storage mechanism for aggregating the results of CollectingRules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a RuleStorage with no initial stored data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/SwiftLintFile.html b/Classes/SwiftLintFile.html new file mode 100644 index 000000000..446587bc2 --- /dev/null +++ b/Classes/SwiftLintFile.html @@ -0,0 +1,769 @@ + + + + SwiftLintFile Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintFile

+
+
+ +
public final class SwiftLintFile
+
extension SwiftLintFile: Equatable, Hashable
+ +
+
+

A unit of Swift source code, either on disk or in memory.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(file:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile with a SourceKitten File.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: File)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    A file from SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(path:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile by specifying its path on disk. +Fails if the file does not exist.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init?(path: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The path to a file on disk. Relative and absolute paths supported.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this +one does not read its contents immediately, but rather traps at runtime when attempting to access its contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(pathDeferringReading path: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The path to a file on disk. Relative and absolute paths supported.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(contents:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(contents: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + contents + + +
    +

    The contents of the file.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path on disk for this file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contents + +
    +
    +
    +
    +
    +
    +

    The file’s contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var contents: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + stringView + +
    +
    +
    +
    +
    +
    +

    A string view into the contents of this file optimized for string manipulation operations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var stringView: StringView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lines + +
    +
    +
    +
    +
    +
    +

    The parsed lines for this file’s contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lines: [Line] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + invalidateCache() + +
    +
    +
    +
    +
    +
    +

    Invalidates all cached data for this file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func invalidateCache()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable Conformance +

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: SwiftLintFile, rhs: SwiftLintFile) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Classes/ViolationsSyntaxVisitor.html b/Classes/ViolationsSyntaxVisitor.html new file mode 100644 index 000000000..ff16e9b2e --- /dev/null +++ b/Classes/ViolationsSyntaxVisitor.html @@ -0,0 +1,581 @@ + + + + ViolationsSyntaxVisitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationsSyntaxVisitor

+
+
+ +
open class ViolationsSyntaxVisitor : SyntaxVisitor
+ +
+
+

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ActorDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ExtensionDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums.html b/Enums.html new file mode 100644 index 000000000..f7c5fa9de --- /dev/null +++ b/Enums.html @@ -0,0 +1,593 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Enums/AccessControlLevel.html b/Enums/AccessControlLevel.html new file mode 100644 index 000000000..d6a81f251 --- /dev/null +++ b/Enums/AccessControlLevel.html @@ -0,0 +1,563 @@ + + + + AccessControlLevel Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

AccessControlLevel

+
+
+ +
public enum AccessControlLevel : String, CustomStringConvertible
+
extension AccessControlLevel: Comparable
+ +
+
+

The accessibility of a Swift source declaration.

+ + + +
+
+ +
+
+
+
    +
  • +
    + + + + private + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s immediate lexical scope.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `private` = "source.lang.swift.accessibility.private"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileprivate + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `fileprivate` = "source.lang.swift.accessibility.fileprivate"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + internal + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `internal` = "source.lang.swift.accessibility.internal"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + public + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same program.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `public` = "source.lang.swift.accessibility.public"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open + +
    +
    +
    +
    +
    +
    +

    Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case open = "source.lang.swift.accessibility.open"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: AccessControlLevel, rhs: AccessControlLevel) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ConfigurationError.html b/Enums/ConfigurationError.html new file mode 100644 index 000000000..d54467836 --- /dev/null +++ b/Enums/ConfigurationError.html @@ -0,0 +1,469 @@ + + + + ConfigurationError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ConfigurationError

+
+
+ +
public enum ConfigurationError : Error, Equatable
+ +
+
+

All possible configuration errors.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unknownConfiguration + +
    +
    +
    +
    +
    +
    +

    The configuration didn’t match internal expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The configuration had both match_kind and excluded_match_kind parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ambiguousMatchKindParameters
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generic(_:) + +
    +
    +
    +
    +
    +
    +

    A generic configuration error specified by a string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case generic(String)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The initial configuration file was not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case initialFileNotFound(path: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/ExecutableInfo.html b/Enums/ExecutableInfo.html new file mode 100644 index 000000000..eabf073f8 --- /dev/null +++ b/Enums/ExecutableInfo.html @@ -0,0 +1,379 @@ + + + + ExecutableInfo Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ExecutableInfo

+
+
+ +
public enum ExecutableInfo
+ +
+
+

Information about this executable.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + buildID + +
    +
    +
    +
    +
    +
    +

    A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let buildID: String?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/RuleIdentifier.html b/Enums/RuleIdentifier.html new file mode 100644 index 000000000..ef7757c37 --- /dev/null +++ b/Enums/RuleIdentifier.html @@ -0,0 +1,567 @@ + + + + RuleIdentifier Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleIdentifier

+
+
+ +
public enum RuleIdentifier : Hashable, ExpressibleByStringLiteral
+ +
+
+

An identifier representing a SwiftLint rule, or all rules.

+ + +
+
+ +
+
+
+
+ + +
+ +

Values +

+
+
+
    +
  • +
    + + + + all + +
    +
    +
    +
    +
    +
    +

    Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in +disabling all SwiftLint rules in a given file by adding a // swiftlint:disable all comment at the top of the +file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case all
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + single(identifier:) + +
    +
    +
    +
    +
    +
    +

    Represents a single SwiftLint rule with the specified identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case single(identifier: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Properties +

+
+
+
    +
  • +
    + + + + stringRepresentation + +
    +
    +
    +
    +
    +
    +

    The spelling of the string for this idenfitier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var stringRepresentation: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleIdentifier by its string representation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The string representation.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ExpressibleByStringLiteral Conformance +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/Enums/RuleKind.html b/Enums/RuleKind.html new file mode 100644 index 000000000..8855b8e7d --- /dev/null +++ b/Enums/RuleKind.html @@ -0,0 +1,499 @@ + + + + RuleKind Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleKind

+
+
+ +
public enum RuleKind : String, Codable
+ +
+
+

All the possible rule kinds (categories).

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + lint + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate Swift source conventions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lint
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + idiomatic + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate common practices in the Swift community.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case idiomatic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + style + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate stylistic choices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case style
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + metrics + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate magnitudes or measurements of Swift source.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case metrics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performance + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate that code patterns with poor performance are avoided.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case performance
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/RuleListError.html b/Enums/RuleListError.html new file mode 100644 index 000000000..02b2755cb --- /dev/null +++ b/Enums/RuleListError.html @@ -0,0 +1,379 @@ + + + + RuleListError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleListError

+
+
+ +
public enum RuleListError : Error
+ +
+
+

All possible rule list configuration errors.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The rule list contains more than one configuration for the specified rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case duplicatedConfigurations(rule: Rule.Type)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Enums/SwiftExpressionKind.html b/Enums/SwiftExpressionKind.html new file mode 100644 index 000000000..3e411d7b5 --- /dev/null +++ b/Enums/SwiftExpressionKind.html @@ -0,0 +1,559 @@ + + + + SwiftExpressionKind Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftExpressionKind

+
+
+ +
public enum SwiftExpressionKind : String
+ +
+
+

The kind of expression for a contiguous set of Swift source tokens.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Enums/ViolationSeverity.html b/Enums/ViolationSeverity.html new file mode 100644 index 000000000..057a31178 --- /dev/null +++ b/Enums/ViolationSeverity.html @@ -0,0 +1,451 @@ + + + + ViolationSeverity Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationSeverity

+
+
+ +
public enum ViolationSeverity : String, Comparable, Codable
+ +
+
+

The magnitude of a StyleViolation.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + warning + +
    +
    +
    +
    +
    +
    +

    Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case warning
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case error
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparable +

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: ViolationSeverity, rhs: ViolationSeverity) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Extensions.html b/Extensions.html new file mode 100644 index 000000000..85cd1eafe --- /dev/null +++ b/Extensions.html @@ -0,0 +1,393 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Extensions/FileManager.html b/Extensions/FileManager.html new file mode 100644 index 000000000..93a714784 --- /dev/null +++ b/Extensions/FileManager.html @@ -0,0 +1,403 @@ + + + + FileManager Extension Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

FileManager

+
+
+ +
extension FileManager: LintableFileManager
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Extensions/String.html b/Extensions/String.html new file mode 100644 index 000000000..4666b0cd2 --- /dev/null +++ b/Extensions/String.html @@ -0,0 +1,462 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

String

+
+
+ +
extension String
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a new string, converting the path to a canonical absolute path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func absolutePathStandardized() -> String
    + +
    +
    +
    +

    Return Value

    +

    A new String.

    +
    + +
    +
    +
  • +
  • +
    + + + + countOccurrences(of:) + +
    +
    +
    +
    +
    +
    +

    Count the number of occurrences of the given character in self

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func countOccurrences(of character: Character) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + character + + +
    +

    Character to count

    +
    +
    +
    +
    +

    Return Value

    +

    Number of times character occurs in self

    +
    + +
    +
    +
  • +
  • +
    + + + + path(relativeTo:) + +
    +
    +
    +
    +
    +
    +

    If self is a path, this method can be used to get a path expression relative to a root directory

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func path(relativeTo rootDirectory: String) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Functions.html b/Functions.html new file mode 100644 index 000000000..8c66fb720 --- /dev/null +++ b/Functions.html @@ -0,0 +1,522 @@ + + + + Functions Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Functions

+

The following functions are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + queuedPrint(_:) + +
    +
    +
    +
    +
    +
    +

    A thread-safe version of Swift’s standard print().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedPrint<T>(_ object: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    Object to print.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + queuedPrintError(_:) + +
    +
    +
    +
    +
    +
    +

    A thread-safe, newline-terminated version of fputs(..., stderr).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedPrintError(_ string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    String to print.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A thread-safe, newline-terminated version of fatalError(...) that doesn’t leak +the source path from the compiled binary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedFatalError(_ string: String, file: StaticString = #file, line: UInt = #line) -> Never
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any +known reporters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reporterFrom(identifier: String) -> Reporter.Type
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier corresponding to the reporter.

    +
    +
    +
    +
    +

    Return Value

    +

    The reporter type.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Global Variables.html b/Global Variables.html new file mode 100644 index 000000000..b59ce3120 --- /dev/null +++ b/Global Variables.html @@ -0,0 +1,369 @@ + + + + Global Variables Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Global Variables

+

The following global variables are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + primaryRuleList + +
    +
    +
    +
    +
    +
    +

    The rule list containing all available rules built into SwiftLint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let primaryRuleList: RuleList
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Guides.html b/Guides.html new file mode 100644 index 000000000..57cad68c2 --- /dev/null +++ b/Guides.html @@ -0,0 +1,2328 @@ + + + + Guides Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Guides

+

The following guides are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Protocols.html b/Protocols.html new file mode 100644 index 000000000..38e0c0b8a --- /dev/null +++ b/Protocols.html @@ -0,0 +1,772 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + LintableFileManager + +
    +
    +
    +
    +
    +
    +

    An interface for enumerating files that can be linted by SwiftLint.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol LintableFileManager
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ASTRule + +
    +
    +
    +
    +
    +
    +

    A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s +structure, validating the rule recursively in nested source bodies.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ASTRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyCollectingRule + +
    +
    +
    +
    +
    +
    +

    Type-erased protocol used to check whether a rule is collectable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AnyCollectingRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollectingRule + +
    +
    +
    +
    +
    +
    +

    A rule that requires knowledge of all other files being linted.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CollectingRule : AnyCollectingRule
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A rule that is user-configurable.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ConfigurationProviderRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Reporter + +
    +
    +
    +
    +
    +
    +

    An interface for reporting violations as strings.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Reporter : CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Rule + +
    +
    +
    +
    +
    +
    +

    An executable value that can identify issues (violations) in Swift source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + OptInRule + +
    +
    +
    +
    +
    +
    +

    A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol OptInRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SourceKitFreeRule + +
    +
    +
    +
    +
    +
    +

    A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SourceKitFreeRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnalyzerRule + +
    +
    +
    +
    +
    +
    +

    A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like +static analysis than syntactic checks.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AnalyzerRule : OptInRule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleConfiguration + +
    +
    +
    +
    +
    +
    +

    A configuration value for a rule to allow users to modify its behavior.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol RuleConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A configuration for a rule that allows to configure at least the severity.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SeverityBasedRuleConfiguration : RuleConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ViolationsSyntaxRewriter : SyntaxRewriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftSyntaxRule + +
    +
    +
    +
    +
    +
    +

    A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SwiftSyntaxRule : SourceKitFreeRule
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ASTRule.html b/Protocols/ASTRule.html new file mode 100644 index 000000000..2ef9c071d --- /dev/null +++ b/Protocols/ASTRule.html @@ -0,0 +1,613 @@ + + + + ASTRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ASTRule

+
+
+ +
public protocol ASTRule : Rule
+ +
+
+

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s +structure, validating the rule recursively in nested source bodies.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + KindType + +
    +
    +
    +
    +
    +
    +

    The kind of token being recursed over.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype KindType : RawRepresentable
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, kind: KindType, dictionary: SourceKittenDictionary) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + kind + + +
    +

    The kind of token being recursed over.

    +
    +
    + + dictionary + + +
    +

    The dictionary for an AST subset to validate.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + kind(from:) + +
    +
    +
    +
    +
    +
    +

    Get the kind from the specified dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func kind(from dictionary: SourceKittenDictionary) -> KindType?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dictionary + + +
    +

    The SourceKittenDictionary representing the source structure from which to extract the + kind.

    +
    +
    +
    +
    +

    Return Value

    +

    The kind from the specified dictionary, if one was found.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:dictionary:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, dictionary: SourceKittenDictionary) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + dictionary + + +
    +

    The dictionary for an AST subset to validate.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/AnalyzerRule.html b/Protocols/AnalyzerRule.html new file mode 100644 index 000000000..295440ea9 --- /dev/null +++ b/Protocols/AnalyzerRule.html @@ -0,0 +1,382 @@ + + + + AnalyzerRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

AnalyzerRule

+
+
+ +
public protocol AnalyzerRule : OptInRule
+ +
+
+

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like +static analysis than syntactic checks.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Protocols/CollectingRule.html b/Protocols/CollectingRule.html new file mode 100644 index 000000000..c3dcdda2f --- /dev/null +++ b/Protocols/CollectingRule.html @@ -0,0 +1,784 @@ + + + + CollectingRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CollectingRule

+
+
+ +
public protocol CollectingRule : AnyCollectingRule
+ +
+
+

A rule that requires knowledge of all other files being linted.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + FileInfo + +
    +
    +
    +
    +
    +
    +

    The kind of information to collect for each file being linted for this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype FileInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, compilerArguments: [String]) -> FileInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    The collected file information.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:) + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile) -> FileInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    +
    +
    +

    Return Value

    +

    The collected file information.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:collectedInfo:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile: FileInfo],
    +              compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + collectedInfo + + +
    +

    All collected info for all files.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile : FileInfo]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + collectedInfo + + +
    +

    All collected info for all files.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:into:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:using:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ConfigurationProviderRule.html b/Protocols/ConfigurationProviderRule.html new file mode 100644 index 000000000..ddd2924d3 --- /dev/null +++ b/Protocols/ConfigurationProviderRule.html @@ -0,0 +1,505 @@ + + + + ConfigurationProviderRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ConfigurationProviderRule

+
+
+ +
public protocol ConfigurationProviderRule : Rule
+ +
+
+

A rule that is user-configurable.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Protocols/LintableFileManager.html b/Protocols/LintableFileManager.html new file mode 100644 index 000000000..e276bafb8 --- /dev/null +++ b/Protocols/LintableFileManager.html @@ -0,0 +1,470 @@ + + + + LintableFileManager Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

LintableFileManager

+
+
+ +
public protocol LintableFileManager
+ +
+
+

An interface for enumerating files that can be linted by SwiftLint.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns all files that can be linted in the specified path. If the path is relative, it will be appended to the +specified root path, or currentt working directory if no root directory is specified.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func filesToLint(inPath path: String, rootDirectory: String?) -> [String]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path in which lintable files should be found.

    +
    +
    + + rootDirectory + + +
    +

    The parent directory for the specified path. If none is provided, the current working + directory will be used.

    +
    +
    +
    +
    +

    Return Value

    +

    Files to lint.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the date when the file at the specified path was last modified. Returns nil if the file cannot be +found or its last modification date cannot be determined.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func modificationDate(forFileAtPath path: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The file whose modification date should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    A date, if one was determined.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/Reporter.html b/Protocols/Reporter.html new file mode 100644 index 000000000..deb88e528 --- /dev/null +++ b/Protocols/Reporter.html @@ -0,0 +1,463 @@ + + + + Reporter Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Reporter

+
+
+ +
public protocol Reporter : CustomStringConvertible
+ +
+
+

An interface for reporting violations as strings.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    +

    The unique identifier for this reporter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var identifier: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    +

    Whether or not this reporter can output incrementally as violations are found or if all violations must be +collected before generating the report.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var isRealtime: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    +

    Return a string with the report for the specified violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + violations + + +
    +

    The violations to report.

    +
    +
    +
    +
    +

    Return Value

    +

    The report.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/Rule.html b/Protocols/Rule.html new file mode 100644 index 000000000..7298ed7d0 --- /dev/null +++ b/Protocols/Rule.html @@ -0,0 +1,853 @@ + + + + Rule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Rule

+
+
+ +
public protocol Rule
+ +
+
+

An executable value that can identify issues (violations) in Swift source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A verbose description of many of this rule’s properties.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var description: RuleDescription { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A description of how this rule has been configured to run.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configurationDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    A default initializer for rules. All rules need to be trivially initializable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Creates a rule by applying its configuration.

    +
    +

    Throws

    +

    Throws if the configuration didn’t match the expected format.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(configuration: Any) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    The untyped configuration value to apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and returns any violations to the rule’s expectations.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and returns any violations to the rule’s expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + isEqualTo(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Whether or not the specified rule is equivalent to the current rule.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func isEqualTo(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule value to compare against.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether or not the specified rule is equivalent to the current rule.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:into:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

    +
    +

    Note

    +

    This function is called by the linter and is always implemented in extensions.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    + + storage + + +
    +

    The storage object where collected info should be saved.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:using:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    +
    +

    Note

    +

    This function is called by the linter and is always implemented in extensions.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/RuleConfiguration.html b/Protocols/RuleConfiguration.html new file mode 100644 index 000000000..e6f1036c3 --- /dev/null +++ b/Protocols/RuleConfiguration.html @@ -0,0 +1,486 @@ + + + + RuleConfiguration Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleConfiguration

+
+
+ +
public protocol RuleConfiguration
+ +
+
+

A configuration value for a rule to allow users to modify its behavior.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + consoleDescription + +
    +
    +
    +
    +
    +
    +

    A human-readable description for this configuration and its applied values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var consoleDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + apply(configuration:) + +
    +
    +
    +
    +
    +
    +

    Apply an untyped configuration to the current value.

    +
    +

    Throws

    +

    Throws if the configuration is not in the expected format.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func apply(configuration: Any) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    The untyped configuration value to apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEqualTo(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified configuration is equivalent to the current value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func isEqualTo(_ ruleConfiguration: RuleConfiguration) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + ruleConfiguration + + +
    +

    The rule configuration to compare against.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the specified configuration is equivalent to the current value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/SeverityBasedRuleConfiguration.html b/Protocols/SeverityBasedRuleConfiguration.html new file mode 100644 index 000000000..b41e1f884 --- /dev/null +++ b/Protocols/SeverityBasedRuleConfiguration.html @@ -0,0 +1,412 @@ + + + + SeverityBasedRuleConfiguration Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SeverityBasedRuleConfiguration

+
+
+ +
public protocol SeverityBasedRuleConfiguration : RuleConfiguration
+ +
+
+

A configuration for a rule that allows to configure at least the severity.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + severityConfiguration + +
    +
    +
    +
    +
    +
    +

    The configuration of a rule’s severity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var severityConfiguration: SeverityConfiguration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The severity of a rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var severity: ViolationSeverity { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/SwiftSyntaxRule.html b/Protocols/SwiftSyntaxRule.html new file mode 100644 index 000000000..938749efc --- /dev/null +++ b/Protocols/SwiftSyntaxRule.html @@ -0,0 +1,624 @@ + + + + SwiftSyntaxRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftSyntaxRule

+
+
+ +
public protocol SwiftSyntaxRule : SourceKitFreeRule
+ +
+
+

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + makeVisitor(file:) + +
    +
    +
    +
    +
    +
    +

    Produce a ViolationsSyntaxVisitor for the given file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to produce the visitor.

    +
    +
    +
    +
    +

    Return Value

    +

    A ViolationsSyntaxVisitor for the given file.

    +
    + +
    +
    +
  • +
  • +
    + + + + makeViolation(file:violation:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Produce a violation for the given file and absolute position.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeViolation(file: SwiftLintFile, violation: ReasonedRuleViolation) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to produce the violation.

    +
    +
    + + violation + + +
    +

    A violation in the file.

    +
    +
    +
    +
    +

    Return Value

    +

    A violation for the given file and absolute position.

    +
    + +
    +
    +
  • +
  • +
    + + + + preprocess(syntaxTree:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Gives a chance for the rule to do some pre-processing on the syntax tree. +One typical example is using SwiftOperators to “fold” the tree, resolving operators precedence. +By default, it just returns the same syntaxTree.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func preprocess(syntaxTree: SourceFileSyntax) -> SourceFileSyntax?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + syntaxTree + + +
    +

    The syntax tree to run pre-processing on

    +
    +
    +
    +
    +

    Return Value

    +

    The tree that will be used to check for violations. If nil, this rule will return no violations.

    +
    + +
    +
    +
  • +
  • +
    + + + + disabledRegions(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the source ranges in the specified file where this rule is disabled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func disabledRegions(file: SwiftLintFile) -> [SourceRange]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file to get regions.

    +
    +
    +
    +
    +

    Return Value

    +

    The source ranges in the specified file where this rule is disabled.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Protocols/ViolationsSyntaxRewriter.html b/Protocols/ViolationsSyntaxRewriter.html new file mode 100644 index 000000000..526befe0b --- /dev/null +++ b/Protocols/ViolationsSyntaxRewriter.html @@ -0,0 +1,379 @@ + + + + ViolationsSyntaxRewriter Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationsSyntaxRewriter

+
+
+ +
public protocol ViolationsSyntaxRewriter : SyntaxRewriter
+ +
+
+

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + correctionPositions + +
    +
    +
    +
    +
    +
    +

    Positions in a source file where corrections were applied.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var correctionPositions: [AbsolutePosition] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Reporters.html b/Reporters.html new file mode 100644 index 000000000..ba1e33d98 --- /dev/null +++ b/Reporters.html @@ -0,0 +1,618 @@ + + + + Reporters Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Reporters

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Rules.html b/Rules.html new file mode 100644 index 000000000..e97805017 --- /dev/null +++ b/Rules.html @@ -0,0 +1,347 @@ + + + + Rules Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Rules

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Structs.html b/Structs.html new file mode 100644 index 000000000..01766a0cf --- /dev/null +++ b/Structs.html @@ -0,0 +1,1043 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + RuleListDocumentation + +
    +
    +
    +
    +
    +
    +

    User-facing documentation for a SwiftLint RuleList.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleListDocumentation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Configuration + +
    +
    +
    +
    +
    +
    +

    The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Configuration
    +
    extension Configuration: Hashable
    +
    extension Configuration: CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collection of keys and values as parsed out of SourceKit, with many conveniences for accessing SwiftLint-specific +values.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SourceKittenDictionary
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Command + +
    +
    +
    +
    +
    +
    +

    A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Command : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Example + +
    +
    +
    +
    +
    +
    +

    Captures code and context information for an example of a triggering or +non-triggering style

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Example
    +
    extension Example: Hashable
    +
    extension Example: Comparable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Linter + +
    +
    +
    +
    +
    +
    +

    Represents a file that can be linted for style violations and corrections after being collected.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Linter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollectedLinter + +
    +
    +
    +
    +
    +
    +

    Represents a file that can compute style violations and corrections for a list of rules.

    + +

    A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CollectedLinter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Location + +
    +
    +
    +
    +
    +
    +

    The placement of a segment of Swift in a collection of source files.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Location : CustomStringConvertible, Comparable, Codable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Region + +
    +
    +
    +
    +
    +
    +

    A contiguous region of Swift source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Region : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleDescription + +
    +
    +
    +
    +
    +
    +

    A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleDescription : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleList + +
    +
    +
    +
    +
    +
    +

    A list of available SwiftLint rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleList
    +
    extension RuleList: Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleParameter + +
    +
    +
    +
    +
    +
    +

    A configuration parameter for rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleParameter<T> : Equatable where T : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + StyleViolation + +
    +
    +
    +
    +
    +
    +

    A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct StyleViolation : CustomStringConvertible, Equatable, Codable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftLintSyntaxMap + +
    +
    +
    +
    +
    +
    +

    Represents a Swift file’s syntax information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftLintSyntaxMap
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftLintSyntaxToken + +
    +
    +
    +
    +
    +
    +

    A SwiftLint-aware Swift syntax token.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftLintSyntaxToken
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftVersion + +
    +
    +
    +
    +
    +
    +

    A value describing the version of the Swift compiler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftVersion : RawRepresentable, Codable, Comparable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Version + +
    +
    +
    +
    +
    +
    +

    A type describing the SwiftLint version.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Version
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

YamlParser +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/Structs/CSVReporter.html b/Structs/CSVReporter.html new file mode 100644 index 000000000..444d40d74 --- /dev/null +++ b/Structs/CSVReporter.html @@ -0,0 +1,474 @@ + + + + CSVReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CSVReporter

+
+
+ +
public struct CSVReporter : Reporter
+ +
+
+

Reports violations as a newline-separated string of comma-separated values (CSV).

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/CheckstyleReporter.html b/Structs/CheckstyleReporter.html new file mode 100644 index 000000000..cb6c95a9e --- /dev/null +++ b/Structs/CheckstyleReporter.html @@ -0,0 +1,475 @@ + + + + CheckstyleReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CheckstyleReporter

+
+
+ +
public struct CheckstyleReporter : Reporter
+ +
+
+

Reports violations as XML conforming to the Checkstyle specification, as defined here: +https://www.jetbrains.com/help/teamcity/xml-report-processing.html

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/CodeClimateReporter.html b/Structs/CodeClimateReporter.html new file mode 100644 index 000000000..c0c15d564 --- /dev/null +++ b/Structs/CodeClimateReporter.html @@ -0,0 +1,474 @@ + + + + CodeClimateReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CodeClimateReporter

+
+
+ +
public struct CodeClimateReporter : Reporter
+ +
+
+

Reports violations as a JSON array in Code Climate format.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/CollectedLinter.html b/Structs/CollectedLinter.html new file mode 100644 index 000000000..e846f01cb --- /dev/null +++ b/Structs/CollectedLinter.html @@ -0,0 +1,549 @@ + + + + CollectedLinter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CollectedLinter

+
+
+ +
public struct CollectedLinter
+ +
+
+

Represents a file that can compute style violations and corrections for a list of rules.

+ +

A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file to lint with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: SwiftLintFile
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Computes or retrieves style violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func styleViolations(using storage: RuleStorage) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations found by this linter.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Computes or retrieves style violations and the time spent executing each rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func styleViolationsAndRuleTimes(using storage: RuleStorage)
    +    -> ([StyleViolation], [(id: String, time: Double)])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations found by this linter, and the time spent executing each rule.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Formats the file associated with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func format(useTabs: Bool, indentWidth: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + useTabs + + +
    +

    Should the file be formatted using tabs?

    +
    +
    + + indentWidth + + +
    +

    How many spaces should be used per indentation level.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Command.html b/Structs/Command.html new file mode 100644 index 000000000..b9eb45bf0 --- /dev/null +++ b/Structs/Command.html @@ -0,0 +1,596 @@ + + + + Command Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Command

+
+
+ +
public struct Command : Equatable
+ +
+
+

A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Action + +
    +
    +
    +
    +
    +
    +

    The action (verb) that SwiftLint should perform when interpreting this command.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Action : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Modifier + +
    +
    +
    +
    +
    +
    +

    The modifier for a command, used to modify its scope.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Modifier : String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a command based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(action: Action, ruleIdentifiers: Set<RuleIdentifier>, line: Int = 0,
    +            character: Int? = nil, modifier: Modifier? = nil, trailingComment: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + action + + +
    +

    This command’s action.

    +
    +
    + + ruleIdentifiers + + +
    +

    The identifiers for the rules associated with this command.

    +
    +
    + + line + + +
    +

    The line in the source file where this command is defined.

    +
    +
    + + character + + +
    +

    The character offset within the line in the source file where this command is + defined.

    +
    +
    + + modifier + + +
    +

    This command’s modifier, if any.

    +
    +
    + + trailingComment + + +
    +

    The comment following this command’s - delimiter, if any.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a command based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(actionString: String, line: Int, character: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + actionString + + +
    +

    The string in the command’s definition describing its action.

    +
    +
    + + line + + +
    +

    The line in the source file where this command is defined.

    +
    +
    + + character + + +
    +

    The character offset within the line in the source file where this command is + defined.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Command/Action.html b/Structs/Command/Action.html new file mode 100644 index 000000000..681c59326 --- /dev/null +++ b/Structs/Command/Action.html @@ -0,0 +1,409 @@ + + + + Action Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Action

+
+
+ +
public enum Action : String
+ +
+
+

The action (verb) that SwiftLint should perform when interpreting this command.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + enable + +
    +
    +
    +
    +
    +
    +

    The rule(s) associated with this command should be enabled by the SwiftLint engine.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case enable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + disable + +
    +
    +
    +
    +
    +
    +

    The rule(s) associated with this command should be disabled by the SwiftLint engine.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case disable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Command/Modifier.html b/Structs/Command/Modifier.html new file mode 100644 index 000000000..a64f662c7 --- /dev/null +++ b/Structs/Command/Modifier.html @@ -0,0 +1,439 @@ + + + + Modifier Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Modifier

+
+
+ +
public enum Modifier : String
+ +
+
+

The modifier for a command, used to modify its scope.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + previous + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the line preceding its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case previous
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + this + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the same line as its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case this
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + next + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the line following its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case next
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Configuration.html b/Structs/Configuration.html new file mode 100644 index 000000000..2dc14010d --- /dev/null +++ b/Structs/Configuration.html @@ -0,0 +1,1559 @@ + + + + Configuration Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Configuration

+
+
+ +
public struct Configuration
+
extension Configuration: Hashable
+
extension Configuration: CustomStringConvertible
+ +
+
+

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

+ + +
+
+ +
+
+
+
+ + +
+ +

Properties: Static +

+
+
+
    +
  • +
    + + + + default + +
    +
    +
    +
    +
    +
    +

    The default Configuration resulting from an empty configuration file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var `default`: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultFileName + +
    +
    +
    +
    +
    +
    +

    The default file name to look for user-defined configurations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let defaultFileName: String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public Instance +

+
+
+
    +
  • +
    + + + + includedPaths + +
    +
    +
    +
    +
    +
    +

    The paths that should be included when linting

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var includedPaths: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + excludedPaths + +
    +
    +
    +
    +
    +
    +

    The paths that should be excluded when linting

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var excludedPaths: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + indentation + +
    +
    +
    +
    +
    +
    +

    The style to use when indenting Swift source code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indentation: IndentationStyle
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + warningThreshold + +
    +
    +
    +
    +
    +
    +

    The threshold for the number of warnings to tolerate before treating the lint as having failed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let warningThreshold: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reporter + +
    +
    +
    +
    +
    +
    +

    The identifier for the Reporter to use to report style violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reporter: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + cachePath + +
    +
    +
    +
    +
    +
    +

    The location of the persisted cache to use with this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let cachePath: String?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let allowZeroLintableFiles: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This value is true iff the --config parameter was used to specify (a) configuration file(s) +In particular, this means that the value is also true if the --config parameter +was used to explicitly specify the default .swiftlint.yml as the configuration file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var basedOnCustomConfigurationFiles: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public Computed +

+
+
+
    +
  • +
    + + + + rules + +
    +
    +
    +
    +
    +
    +

    All rules enabled in this configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rules: [Rule] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rootDirectory + +
    +
    +
    +
    +
    +
    +

    The root directory is the directory that included & excluded paths relate to. +By default, the root directory is the current working directory, +but during some merging algorithms it may be used differently. +The rootDirectory also serves as the stopping point when searching for nested configs along the file hierarchy.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rootDirectory: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rulesMode + +
    +
    +
    +
    +
    +
    +

    The rules mode used for this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rulesMode: RulesMode { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a Configuration with convenience parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    configurationFiles: [String], // No default value here to avoid ambiguous Configuration() initializer
    +    enableAllRules: Bool = false,
    +    cachePath: String? = nil,
    +    ignoreParentAndChildConfigs: Bool = false,
    +    mockedNetworkResults: [String: String] = [:],
    +    useDefaultConfigOnFailure: Bool? = nil
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + configurationFiles + + +
    +

    The path on disk to one or multiple configuration files. If this array + is empty, the default .swiftlint.yml file will be used.

    +
    +
    + + enableAllRules + + +
    +

    Enable all available rules.

    +
    +
    + + cachePath + + +
    +

    The location of the persisted cache to use whith this configuration.

    +
    +
    + + ignoreParentAndChildConfigs + + +
    +

    If true, child and parent config references will be ignored.

    +
    +
    + + mockedNetworkResults + + +
    +

    For testing purposes only. Instead of loading the specified urls, + the mocked value will be used. Example: [“http://mock.com”: “content”]

    +
    +
    + + useDefaultConfigOnFailure + + +
    +

    If this value is specified, it will override the normal behavior. + This is only intended for tests checking whether invalid configs fail.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Caching Configurations By Identifier (In-Memory) +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a copy of the current Configuration with its computedCacheDescription property set to the value of +cacheDescription, which is expensive to compute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func withPrecomputedCacheDescription() -> Configuration
    + +
    +
    +
    +

    Return Value

    +

    A new Configuration value.

    +
    + +
    +
    +
  • +
  • +
    + + + + IndentationStyle + +
    +
    +
    +
    +
    +
    +

    The style of indentation used in a Swift project.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    enum IndentationStyle : Hashable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Lintable Paths +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns the files that can be linted by SwiftLint in the specified parent path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func lintableFiles(inPath path: String, forceExclude: Bool,
    +                          excludeByPrefix: Bool = false) -> [SwiftLintFile]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + path + + +
    +

    The parent path in which to search for lintable files. Can be a directory or a + file.

    +
    +
    + + forceExclude + + +
    +

    Whether or not excludes defined in this configuration should be applied even if + path is an exact match.

    +
    +
    + + excludeByPrefix + + +
    +

    Whether or not uses excluding by prefix algorithm.

    +
    +
    +
    +
    +

    Return Value

    +

    Files to lint.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of file paths after removing the excluded paths as defined by this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filterExcludedPaths(
    +    fileManager: LintableFileManager = FileManager.default,
    +    in paths: [String]...
    +) -> [String]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + fileManager + + +
    +

    The lintable file manager to use to expand the excluded paths into all matching paths.

    +
    +
    + + paths + + +
    +

    The input paths to filter.

    +
    +
    +
    +
    +

    Return Value

    +

    The input paths after removing the excluded paths.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the file paths that are excluded by this configuration using filtering by absolute path prefix.

    + +

    For cases when excluded directories contain many lintable files (e. g. Pods) it works faster than default +algorithm filterExcludedPaths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filterExcludedPathsByPrefix(in paths: [String]...) -> [String]
    + +
    +
    +
    +

    Return Value

    +

    The input paths after removing the excluded paths.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing File Configurations +

+
+
+
    +
  • +
    + + + + configuration(for:) + +
    +
    +
    +
    +
    +
    +

    Returns a new configuration that applies to the specified file by merging the current configuration with any +nested configurations in the directory inheritance graph present until the level of the specified file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func configuration(for file: SwiftLintFile) -> Configuration
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to obtain a configuration value.

    +
    +
    +
    +
    +

    Return Value

    +

    A new configuration.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a Configuration value based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    dict: [String: Any],
    +    ruleList: RuleList = primaryRuleList,
    +    enableAllRules: Bool = false,
    +    cachePath: String? = nil
    +) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + dict + + +
    +

    The untyped dictionary to serve as the input for this typed configuration. + Typically generated from a YAML-formatted file.

    +
    +
    + + ruleList + + +
    +

    The list of rules to be available to this configuration.

    +
    +
    + + enableAllRules + + +
    +

    Whether all rules from ruleList should be enabled, regardless of the + settings in dict.

    +
    +
    + + cachePath + + +
    +

    The location of the persisted cache on disk.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the rule for the specified ID, if configured in this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func configuredRule(forID ruleID: String) -> Rule?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + ruleID + + +
    +

    The identifier for the rule to look up.

    +
    +
    +
    +
    +

    Return Value

    +

    The rule for the specified ID, if configured in this configuration.

    +
    + +
    +
    +
  • +
  • +
    + + + + RulesMode + +
    +
    +
    +
    +
    +
    +

    Represents how a Configuration object can be configured with regards to rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    enum RulesMode
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable +

+
+
+
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Configuration, rhs: Configuration) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CustomStringConvertible +

+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Configuration/IndentationStyle.html b/Structs/Configuration/IndentationStyle.html new file mode 100644 index 000000000..e58ae3afa --- /dev/null +++ b/Structs/Configuration/IndentationStyle.html @@ -0,0 +1,409 @@ + + + + IndentationStyle Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

IndentationStyle

+
+
+ +
enum IndentationStyle : Hashable
+ +
+
+

The style of indentation used in a Swift project.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + tabs + +
    +
    +
    +
    +
    +
    +

    Swift source code should be indented using tabs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tabs
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + spaces(count:) + +
    +
    +
    +
    +
    +
    +

    Swift source code should be indented using spaces with count spaces per indentation level.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case spaces(count: Int)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Configuration/RulesMode.html b/Structs/Configuration/RulesMode.html new file mode 100644 index 000000000..82eb4ec95 --- /dev/null +++ b/Structs/Configuration/RulesMode.html @@ -0,0 +1,441 @@ + + + + RulesMode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RulesMode

+
+
+ +
enum RulesMode
+ +
+
+

Represents how a Configuration object can be configured with regards to rules.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The default rules mode, which will enable all rules that aren’t defined as being opt-in +(conforming to the OptInRule protocol), minus the rules listed in disabled, plus the rules listed in +optIn.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `default`(disabled: Set<String>, optIn: Set<String>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + only(_:) + +
    +
    +
    +
    +
    +
    +

    Only enable the rules explicitly listed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case only(Set<String>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + allEnabled + +
    +
    +
    +
    +
    +
    +

    Enable all available rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case allEnabled
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/EmojiReporter.html b/Structs/EmojiReporter.html new file mode 100644 index 000000000..667b3a978 --- /dev/null +++ b/Structs/EmojiReporter.html @@ -0,0 +1,474 @@ + + + + EmojiReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

EmojiReporter

+
+
+ +
public struct EmojiReporter : Reporter
+ +
+
+

Reports violations in the format that’s both fun and easy to read.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Example.html b/Structs/Example.html new file mode 100644 index 000000000..de4da2bec --- /dev/null +++ b/Structs/Example.html @@ -0,0 +1,862 @@ + + + + Example Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Example

+
+
+ +
public struct Example
+
extension Example: Hashable
+
extension Example: Comparable
+ +
+
+

Captures code and context information for an example of a triggering or +non-triggering style

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    The contents of the example

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var code: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The untyped configuration to apply to the rule, if deviating from the default configuration. +The structure should match what is expected as a configuration value for the rule being tested.

    + +

    For example, if the following YAML would be used to configure the rule:

    +
    severity: warning
    +
    + +

    Then the equivalent configuration value would be ["severity": "warning"].

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var configuration: Any? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + testMultiByteOffsets + +
    +
    +
    +
    +
    +
    +

    Whether the example should be tested by prepending multibyte grapheme clusters

    +
    +

    See also

    + addEmoji(_:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var testMultiByteOffsets: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + testOnLinux + +
    +
    +
    +
    +
    +
    +

    Whether the example should be tested on Linux

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var testOnLinux: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The path to the file where the example was created

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var file: StaticString { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + line + +
    +
    +
    +
    +
    +
    +

    The line in the file where the example was created

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var line: UInt
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Create a new Example with the specified code, file, and line.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ code: String, configuration: Any? = nil, testMultiByteOffsets: Bool = true,
    +     testWrappingInComment: Bool = true, testWrappingInString: Bool = true, testDisableCommand: Bool = true,
    +     testOnLinux: Bool = true, file: StaticString = #file, line: UInt = #line,
    +     excludeFromDocumentation: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + code + + +
    +

    The contents of the example.

    +
    +
    + + configuration + + +
    +

    The untyped configuration to apply to the rule, if deviating from the default + configuration.

    +
    +
    + + testMultibyteOffsets + + +
    +

    Whether the example should be tested by prepending multibyte grapheme clusters.

    +
    +
    + + testWrappingInComment + + +
    +

    Whether test shall verify that the example wrapped in a comment doesn’t trigger.

    +
    +
    + + testWrappingInString + + +
    +

    Whether tests shall verify that the example wrapped into a string doesn’t trigger.

    +
    +
    + + testDisableCommand + + +
    +

    Whether tests shall verify that the disabled rule (comment in the example) doesn’t + trigger.

    +
    +
    + + testOnLinux + + +
    +

    Whether the example should be tested on Linux.

    +
    +
    + + file + + +
    +

    The path to the file where the example is located. + Defaults to the file where this initializer is called.

    +
    +
    + + line + + +
    +

    The line in the file where the example is located. + Defaults to the line where this initializer is called.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(code:) + +
    +
    +
    +
    +
    +
    +

    Returns the same example, but with the code that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func with(code: String) -> Example
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + code + + +
    +

    the new code to use in the modified example

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a copy of the Example with all instances of the “↓” character removed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func removingViolationMarkers() -> Example
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Example, rhs: Example) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: Example, rhs: Example) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/GitHubActionsLoggingReporter.html b/Structs/GitHubActionsLoggingReporter.html new file mode 100644 index 000000000..7ebf742c7 --- /dev/null +++ b/Structs/GitHubActionsLoggingReporter.html @@ -0,0 +1,474 @@ + + + + GitHubActionsLoggingReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

GitHubActionsLoggingReporter

+
+
+ +
public struct GitHubActionsLoggingReporter : Reporter
+ +
+
+

Reports violations in the format GitHub-hosted virtual machine for Actions can recognize as messages.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/GitLabJUnitReporter.html b/Structs/GitLabJUnitReporter.html new file mode 100644 index 000000000..5ed833db7 --- /dev/null +++ b/Structs/GitLabJUnitReporter.html @@ -0,0 +1,474 @@ + + + + GitLabJUnitReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

GitLabJUnitReporter

+
+
+ +
public struct GitLabJUnitReporter : Reporter
+ +
+
+

Reports violations as JUnit XML supported by GitLab.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/HTMLReporter.html b/Structs/HTMLReporter.html new file mode 100644 index 000000000..ba568bc58 --- /dev/null +++ b/Structs/HTMLReporter.html @@ -0,0 +1,474 @@ + + + + HTMLReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

HTMLReporter

+
+
+ +
public struct HTMLReporter : Reporter
+ +
+
+

Reports violations as HTML.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/JSONReporter.html b/Structs/JSONReporter.html new file mode 100644 index 000000000..275241d9e --- /dev/null +++ b/Structs/JSONReporter.html @@ -0,0 +1,474 @@ + + + + JSONReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

JSONReporter

+
+
+ +
public struct JSONReporter : Reporter
+ +
+
+

Reports violations as a JSON array.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/JUnitReporter.html b/Structs/JUnitReporter.html new file mode 100644 index 000000000..24796c9f6 --- /dev/null +++ b/Structs/JUnitReporter.html @@ -0,0 +1,474 @@ + + + + JUnitReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

JUnitReporter

+
+
+ +
public struct JUnitReporter : Reporter
+ +
+
+

Reports violations as JUnit XML.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Linter.html b/Structs/Linter.html new file mode 100644 index 000000000..fc2d541a7 --- /dev/null +++ b/Structs/Linter.html @@ -0,0 +1,548 @@ + + + + Linter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Linter

+
+
+ +
public struct Linter
+ +
+
+

Represents a file that can be linted for style violations and corrections after being collected.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file to lint with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: SwiftLintFile
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isCollecting + +
    +
    +
    +
    +
    +
    +

    Whether or not this linter will be used to collect information from several files.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isCollecting: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Linter by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, configuration: Configuration = Configuration.default, cache: LinterCache? = nil,
    +            compilerArguments: [String] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file to lint with this linter.

    +
    +
    + + configuration + + +
    +

    The SwiftLint configuration to apply to this linter.

    +
    +
    + + cache + + +
    +

    The persisted cache to use for this linter.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments to use for this linter if it is to execute analyzer rules.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + collect(into:) + +
    +
    +
    +
    +
    +
    +

    Returns a linter capable of checking for violations after running each rule’s collection step.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func collect(into storage: RuleStorage) -> CollectedLinter
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object where collected info should be saved.

    +
    +
    +
    +
    +

    Return Value

    +

    A linter capable of checking for violations after running each rule’s collection step.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Location.html b/Structs/Location.html new file mode 100644 index 000000000..ceabd2038 --- /dev/null +++ b/Structs/Location.html @@ -0,0 +1,800 @@ + + + + Location Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Location

+
+
+ +
public struct Location : CustomStringConvertible, Comparable, Codable
+ +
+
+

The placement of a segment of Swift in a collection of source files.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file path on disk for this location.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + line + +
    +
    +
    +
    +
    +
    +

    The line offset in the file for this location. 1-indexed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let line: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + character + +
    +
    +
    +
    +
    +
    +

    The character offset in the file for this location. 1-indexed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let character: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A lossless printable description of this location.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + relativeFile + +
    +
    +
    +
    +
    +
    +

    The file path for this location relative to the current working directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var relativeFile: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: String?, line: Int? = nil, character: Int? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file path on disk for this location.

    +
    +
    + + line + + +
    +

    The line offset in the file for this location. 1-indexed.

    +
    +
    + + character + + +
    +

    The character offset in the file for this location. 1-indexed.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a byte-offset into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, byteOffset offset: ByteCount)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + offset + + +
    +

    The offset in bytes into the file for this location.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(file:position:) + +
    +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, position: AbsolutePosition)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + position + + +
    +

    The absolute position returned from SwiftSyntax.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, characterOffset offset: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + offset + + +
    +

    The offset in UTF8 fragments into the file for this location.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparable +

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: Location, rhs: Location) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/MarkdownReporter.html b/Structs/MarkdownReporter.html new file mode 100644 index 000000000..8ca49aa59 --- /dev/null +++ b/Structs/MarkdownReporter.html @@ -0,0 +1,474 @@ + + + + MarkdownReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

MarkdownReporter

+
+
+ +
public struct MarkdownReporter : Reporter
+ +
+
+

Reports violations as markdown formated (with tables).

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/ReasonedRuleViolation.html b/Structs/ReasonedRuleViolation.html new file mode 100644 index 000000000..4d9d9e4b5 --- /dev/null +++ b/Structs/ReasonedRuleViolation.html @@ -0,0 +1,541 @@ + + + + ReasonedRuleViolation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ReasonedRuleViolation

+
+
+ +
public struct ReasonedRuleViolation : Comparable
+ +
+
+

A violation produced by ViolationsSyntaxVisitors.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + position + +
    +
    +
    +
    +
    +
    +

    The violation’s position.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let position: AbsolutePosition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reason + +
    +
    +
    +
    +
    +
    +

    A specific reason for the violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reason: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The violation’s severity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let severity: ViolationSeverity?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ReasonedRuleViolation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(position: AbsolutePosition, reason: String? = nil, severity: ViolationSeverity? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + position + + +
    +

    The violations position in the analyzed source file.

    +
    +
    + + reason + + +
    +

    The reason for the violation if different from the rule’s description.

    +
    +
    + + severity + + +
    +

    The severity of the violation if different from the rule’s default configured severity.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: `Self`, rhs: `Self`) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/Region.html b/Structs/Region.html new file mode 100644 index 000000000..963b3a80d --- /dev/null +++ b/Structs/Region.html @@ -0,0 +1,727 @@ + + + + Region Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Region

+
+
+ +
public struct Region : Equatable
+ +
+
+

A contiguous region of Swift source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + start + +
    +
    +
    +
    +
    +
    +

    The location describing the start of the region. All locations that are less than this value +(earlier in the source file) are not contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let start: Location
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + end + +
    +
    +
    +
    +
    +
    +

    The location describing the end of the region. All locations that are greater than this value +(later in the source file) are not contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let end: Location
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All SwiftLint rule identifiers that are disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let disabledRuleIdentifiers: Set<RuleIdentifier>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Region by setting explicit values for all its properties.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(start: Location, end: Location, disabledRuleIdentifiers: Set<RuleIdentifier>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + start + + +
    +

    The region’s starting location.

    +
    +
    + + end + + +
    +

    The region’s ending location.

    +
    +
    + + disabledRuleIdentifiers + + +
    +

    All SwiftLint rule identifiers that are disabled in this region.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specific location is contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ location: Location) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + location + + +
    +

    The location to check for containment.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specific location is contained in this region.

    +
    + +
    +
    +
  • +
  • +
    + + + + isRuleEnabled(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified rule is enabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isRuleEnabled(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule whose status should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specified rule is enabled in this region.

    +
    + +
    +
    +
  • +
  • +
    + + + + isRuleDisabled(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified rule is disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isRuleDisabled(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule whose status should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specified rule is disabled in this region.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the deprecated rule aliases that are disabling the specified rule in this region. +Returns the empty set if the rule isn’t disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deprecatedAliasesDisabling(rule: Rule) -> Set<String>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule to check.

    +
    +
    +
    +
    +

    Return Value

    +

    Deprecated rule aliases.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/RuleDescription.html b/Structs/RuleDescription.html new file mode 100644 index 000000000..2b5f8e425 --- /dev/null +++ b/Structs/RuleDescription.html @@ -0,0 +1,934 @@ + + + + RuleDescription Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleDescription

+
+
+ +
public struct RuleDescription : Equatable
+ +
+
+

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    +

    The rule’s unique identifier, to be used in configuration files and SwiftLint commands. +Should be short and only comprised of lowercase latin alphabet letters and underscores formatted in snake case.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an +explanation of the rule’s purpose and rationale.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let description: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The RuleKind that best categorizes this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: RuleKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nonTriggeringExamples + +
    +
    +
    +
    +
    +
    +

    Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform +users of various samples of code that are considered valid by this rule. Should be valid Swift syntax but is not +required to compile.

    + +

    These examples are also used for automatic testing purposes. Tests will validate that the rule does not trigger +any violations for these examples.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let nonTriggeringExamples: [Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + triggeringExamples + +
    +
    +
    +
    +
    +
    +

    Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to +inform users of various samples of code that are considered invalid by this rule. Should be valid Swift syntax +but is not required to compile.

    + +

    Violations should occur where ↓ markers are located.

    + +

    These examples are also used for automatic testing purposes. Tests will validate that the rule triggers +violations for these examples wherever ↓ markers are located.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let triggeringExamples: [Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + corrections + +
    +
    +
    +
    +
    +
    +

    Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values +are the expected value after applying corrections with the rule.

    + +

    Rules that aren’t correctable (conforming to the CorrectableRule protocol) should leave property empty.

    + +

    These examples are used for testing purposes if the rule conforms to AutomaticTestableRule. Tests will +validate that the rule corrects all keys to their corresponding values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let corrections: [Example : Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deprecatedAliases + +
    +
    +
    +
    +
    +
    +

    Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let deprecatedAliases: Set<String>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + minSwiftVersion + +
    +
    +
    +
    +
    +
    +

    The oldest version of the Swift compiler supported by this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let minSwiftVersion: SwiftVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + requiresFileOnDisk + +
    +
    +
    +
    +
    +
    +

    Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules +conforming to AnalyzerRule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let requiresFileOnDisk: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + consoleDescription + +
    +
    +
    +
    +
    +
    +

    The console-printable string for this description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var consoleDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + allIdentifiers + +
    +
    +
    +
    +
    +
    +

    All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var allIdentifiers: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a RuleDescription by specifying all its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(identifier: String, name: String, description: String, kind: RuleKind,
    +            minSwiftVersion: SwiftVersion = .five,
    +            nonTriggeringExamples: [Example] = [], triggeringExamples: [Example] = [],
    +            corrections: [Example: Example] = [:],
    +            deprecatedAliases: Set<String> = [],
    +            requiresFileOnDisk: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + identifier + + +
    +

    Sets the description’s identifier property.

    +
    +
    + + name + + +
    +

    Sets the description’s name property.

    +
    +
    + + description + + +
    +

    Sets the description’s description property.

    +
    +
    + + kind + + +
    +

    Sets the description’s kind property.

    +
    +
    + + minSwiftVersion + + +
    +

    Sets the description’s minSwiftVersion property.

    +
    +
    + + nonTriggeringExamples + + +
    +

    Sets the description’s nonTriggeringExamples property.

    +
    +
    + + triggeringExamples + + +
    +

    Sets the description’s triggeringExamples property.

    +
    +
    + + corrections + + +
    +

    Sets the description’s corrections property.

    +
    +
    + + deprecatedAliases + + +
    +

    Sets the description’s deprecatedAliases property.

    +
    +
    + + requiresFileOnDisk + + +
    +

    Sets the description’s requiresFileOnDisk property.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Equatable +

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/RuleList.html b/Structs/RuleList.html new file mode 100644 index 000000000..1298e2427 --- /dev/null +++ b/Structs/RuleList.html @@ -0,0 +1,520 @@ + + + + RuleList Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleList

+
+
+ +
public struct RuleList
+
extension RuleList: Equatable
+ +
+
+

A list of available SwiftLint rules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + list + +
    +
    +
    +
    +
    +
    +

    The rules contained in this list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let list: [String : Rule.Type]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • +
    + + + + init(rules:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleList by specifying all its rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rules: Rule.Type...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rules + + +
    +

    The rules to be contained in this list.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rules:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleList by specifying all its rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rules: [Rule.Type])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rules + + +
    +

    The rules to be contained in this list.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: RuleList, rhs: RuleList) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/RuleListDocumentation.html b/Structs/RuleListDocumentation.html new file mode 100644 index 000000000..849156d8d --- /dev/null +++ b/Structs/RuleListDocumentation.html @@ -0,0 +1,452 @@ + + + + RuleListDocumentation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleListDocumentation

+
+
+ +
public struct RuleListDocumentation
+ +
+
+

User-facing documentation for a SwiftLint RuleList.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleListDocumentation instance from a RuleList.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ list: RuleList)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + list + + +
    +

    A RuleList to document.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + write(to:) + +
    +
    +
    +
    +
    +
    +

    Write the rule list documentation as markdown files to the specified directory.

    +
    +

    Throws

    +

    Throws if the files could not be written to.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func write(to url: URL) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + url + + +
    +

    Local URL for directory where the markdown files for this documentation should be saved.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/RuleParameter.html b/Structs/RuleParameter.html new file mode 100644 index 000000000..3b73ffe49 --- /dev/null +++ b/Structs/RuleParameter.html @@ -0,0 +1,470 @@ + + + + RuleParameter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleParameter

+
+
+ +
public struct RuleParameter<T> : Equatable where T : Equatable
+ +
+
+

A configuration parameter for rules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The severity that should be assigned to the violation of this parameter’s value is met.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let severity: ViolationSeverity
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The value to configure the rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(severity:value:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleParameter by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(severity: ViolationSeverity, value: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + severity + + +
    +

    The severity that should be assigned to the violation of this parameter’s value is met.

    +
    +
    + + value + + +
    +

    The value to configure the rule.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SonarQubeReporter.html b/Structs/SonarQubeReporter.html new file mode 100644 index 000000000..cf4200662 --- /dev/null +++ b/Structs/SonarQubeReporter.html @@ -0,0 +1,474 @@ + + + + SonarQubeReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SonarQubeReporter

+
+
+ +
public struct SonarQubeReporter : Reporter
+ +
+
+

Reports violations in SonarQube import format.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SourceKittenDictionary.html b/Structs/SourceKittenDictionary.html new file mode 100644 index 000000000..069b7fcc3 --- /dev/null +++ b/Structs/SourceKittenDictionary.html @@ -0,0 +1,530 @@ + + + + SourceKittenDictionary Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SourceKittenDictionary

+
+
+ +
public struct SourceKittenDictionary
+ +
+
+

A collection of keys and values as parsed out of SourceKit, with many conveniences for accessing SwiftLint-specific +values.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The underlying SourceKitten dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: [String : SourceKitRepresentable]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + substructure + +
    +
    +
    +
    +
    +
    +

    The cached substructure for this dictionary. Empty if there is no substructure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let substructure: [SourceKittenDictionary]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + expressionKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift expression represented by this dictionary, if it is an expression.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let expressionKind: SwiftExpressionKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + declarationKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift declaration represented by this dictionary, if it is a declaration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let declarationKind: SwiftDeclarationKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + statementKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift statement represented by this dictionary, if it is a statement.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let statementKind: StatementKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessibility + +
    +
    +
    +
    +
    +
    +

    The accessibility level for this dictionary, if it is a declaration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let accessibility: AccessControlLevel?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/StyleViolation.html b/Structs/StyleViolation.html new file mode 100644 index 000000000..6375649bb --- /dev/null +++ b/Structs/StyleViolation.html @@ -0,0 +1,745 @@ + + + + StyleViolation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

StyleViolation

+
+
+ +
public struct StyleViolation : CustomStringConvertible, Equatable, Codable
+ +
+
+

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + ruleIdentifier + +
    +
    +
    +
    +
    +
    +

    The identifier of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleIdentifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ruleDescription + +
    +
    +
    +
    +
    +
    +

    The description of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleDescription: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ruleName + +
    +
    +
    +
    +
    +
    +

    The name of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The severity of this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var severity: ViolationSeverity { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + location + +
    +
    +
    +
    +
    +
    +

    The location of this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var location: Location { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reason + +
    +
    +
    +
    +
    +
    +

    The justification for this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reason: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A printable description for this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a StyleViolation by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(ruleDescription: RuleDescription,
    +            severity: ViolationSeverity = .warning,
    +            location: Location,
    +            reason: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + ruleDescription + + +
    +

    The description of the rule that generated this violation.

    +
    +
    + + severity + + +
    +

    The severity of this violation.

    +
    +
    + + location + + +
    +

    The location of this violation.

    +
    +
    + + reason + + +
    +

    The justification for this violation.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(severity:) + +
    +
    +
    +
    +
    +
    +

    Returns the same violation, but with the severity that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func with(severity: ViolationSeverity) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + severity + + +
    +

    the new severity to use in the modified violation

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(location:) + +
    +
    +
    +
    +
    +
    +

    Returns the same violation, but with the location that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func with(location: Location) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + location + + +
    +

    the new location to use in the modified violation

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SwiftLintSyntaxMap.html b/Structs/SwiftLintSyntaxMap.html new file mode 100644 index 000000000..134fed765 --- /dev/null +++ b/Structs/SwiftLintSyntaxMap.html @@ -0,0 +1,458 @@ + + + + SwiftLintSyntaxMap Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintSyntaxMap

+
+
+ +
public struct SwiftLintSyntaxMap
+ +
+
+

Represents a Swift file’s syntax information.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The raw SyntaxMap obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: SyntaxMap
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tokens + +
    +
    +
    +
    +
    +
    +

    The SwiftLint-specific syntax tokens for this syntax map.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let tokens: [SwiftLintSyntaxToken]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(value: SyntaxMap)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The raw SyntaxMap obtained by SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SwiftLintSyntaxToken.html b/Structs/SwiftLintSyntaxToken.html new file mode 100644 index 000000000..1ee1c9cca --- /dev/null +++ b/Structs/SwiftLintSyntaxToken.html @@ -0,0 +1,548 @@ + + + + SwiftLintSyntaxToken Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintSyntaxToken

+
+
+ +
public struct SwiftLintSyntaxToken
+ +
+
+

A SwiftLint-aware Swift syntax token.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The raw SyntaxToken obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: SyntaxToken
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The syntax kind associated with is token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: SyntaxKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(value: SyntaxToken)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The raw SyntaxToken obtained by SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + range + +
    +
    +
    +
    +
    +
    +

    The byte range in a source file for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var range: ByteRange { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + offset + +
    +
    +
    +
    +
    +
    +

    The starting byte offset in a source file for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var offset: ByteCount { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + length + +
    +
    +
    +
    +
    +
    +

    The length in bytes for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var length: ByteCount { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/SwiftVersion.html b/Structs/SwiftVersion.html new file mode 100644 index 000000000..ed263e4cc --- /dev/null +++ b/Structs/SwiftVersion.html @@ -0,0 +1,740 @@ + + + + SwiftVersion Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftVersion

+
+
+ +
public struct SwiftVersion : RawRepresentable, Codable, Comparable
+ +
+
+

A value describing the version of the Swift compiler.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/Structs/Version.html b/Structs/Version.html new file mode 100644 index 000000000..ca8a87720 --- /dev/null +++ b/Structs/Version.html @@ -0,0 +1,409 @@ + + + + Version Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Version

+
+
+ +
public struct Version
+ +
+
+

A type describing the SwiftLint version.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The string value for this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + current + +
    +
    +
    +
    +
    +
    +

    The current SwiftLint version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let current: Version
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/XcodeReporter.html b/Structs/XcodeReporter.html new file mode 100644 index 000000000..2795c2cad --- /dev/null +++ b/Structs/XcodeReporter.html @@ -0,0 +1,474 @@ + + + + XcodeReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

XcodeReporter

+
+
+ +
public struct XcodeReporter : Reporter
+ +
+
+

Reports violations in the format Xcode uses to display in the IDE. (default)

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/Structs/YamlParser.html b/Structs/YamlParser.html new file mode 100644 index 000000000..a6957ca2c --- /dev/null +++ b/Structs/YamlParser.html @@ -0,0 +1,420 @@ + + + + YamlParser Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

YamlParser

+
+
+ +
public struct YamlParser
+ +
+
+

An interface for parsing YAML.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + parse(_:env:) + +
    +
    +
    +
    +
    +
    +

    Parses the input YAML string as an untyped dictionary.

    +
    +

    Throws

    +

    Throws if the yaml string provided could not be parsed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func parse(_ yaml: String,
    +                         env: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + yaml + + +
    +

    YAML-formatted string.

    +
    +
    + + env + + +
    +

    The environment to use to expand variables in the YAML.

    +
    +
    +
    +
    +

    Return Value

    +

    The parsed YAML as an untyped dictionary.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/accessibility_label_for_image.html b/accessibility_label_for_image.html new file mode 100644 index 000000000..b4062ce3d --- /dev/null +++ b/accessibility_label_for_image.html @@ -0,0 +1,580 @@ + + + + accessibility_label_for_image Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Accessibility Label for Image

+ +

All Images that provide context should have an accessibility label. Purely decorative images can be hidden from accessibility.

+ +
    +
  • Identifier: accessibility_label_for_image
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        Image(decorative: "my-image")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(systemName: "circle.plus")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image", label: Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibility(hidden: true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibility(label: Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibilityLabel(Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .renderingMode(.template)
+            .foregroundColor(.blue)
+            .accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .accessibilityLabel(Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityElement()
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .combine)
+        .padding(16)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .ignore)
+        .padding(16)
+        .accessibilityLabel(Text("Label for my image and text"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Button(action: { doAction() }) {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+        }
+        .accessibilityLabel(Text("Label for my image"))
+    }
+}
+
+

Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        ↓Image("my-image")
+            .resizable(true)
+            .frame(width: 48, height: 48)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Image(uiImage: myUiImage)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(false)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .resizable()
+            .frame(width: 48, height: 48)
+            .accessibilityLabel(Text("Alt text for my image"))
+        ↓Image("other image")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(decorative: "image1")
+        ↓Image("image2")
+        Image(uiImage: "image3")
+            .accessibility(label: Text("a pretty picture"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            ↓Image("my-image")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityElement(children: .contain)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityHidden(false)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .combine)
+        .padding(16)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Button(action: { doAction() }) {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/accessibility_trait_for_button.html b/accessibility_trait_for_button.html new file mode 100644 index 000000000..a523324bb --- /dev/null +++ b/accessibility_trait_for_button.html @@ -0,0 +1,583 @@ + + + + accessibility_trait_for_button Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Accessibility Trait for Button

+ +

All views with tap gestures added should include the .isButton accessibility trait. If a tap opens an external link the .isLink trait should be used instead.

+ +
    +
  • Identifier: accessibility_trait_for_button
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        Button {
+            print("tapped")
+        } label: {
+            Text("Learn more")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Link("Open link", destination: myUrl)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture {
+                print("tapped - open URL")
+            }
+            .accessibility(addTraits: .isLink)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .accessibilityAddTraits(.isButton)
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .accessibility(addTraits: [.isButton, .isHeader])
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture {
+                print("tapped - open URL")
+            }
+            .accessibilityAddTraits([.isHeader, .isLink])
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture(count: 1, perform: {
+                print("tapped")
+            })
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            // This rule does not include tap gestures with multiple taps for now.
+            // Custom gestures like this are also not very accessible, but require
+            // alternative ways to accomplish the same task with assistive tech.
+            .onTapGesture(count: 2) {
+                print("double-tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Label("Learn more", systemImage: "info.circle")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack {
+            Image(systemName: "info.circle")
+            Text("Learn more")
+        }
+        .onTapGesture {
+            print("tapped")
+        }
+        // This modifier is not strictly required — each subview will inherit the button trait.
+        // That said, grouping a tappable stack into a single element is a good way to reduce
+        // the number of swipes required for a VoiceOver user to navigate the page.
+        .accessibilityElement(children: .combine)
+        .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .gesture(TapGesture().onEnded {
+                print("tapped")
+            })
+            .accessibilityAddTraits(.isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .simultaneousGesture(TapGesture(count: 1).onEnded {
+                print("tapped - open URL")
+            })
+            .accessibilityAddTraits(.isLink)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .highPriorityGesture(TapGesture().onEnded {
+                print("tapped")
+            })
+            .accessibility(addTraits: [.isButton])
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .gesture(TapGesture(count: 2).onEnded {
+                print("tapped")
+            })
+    }
+}
+
+

Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .accessibility(addTraits: .isHeader)
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture(count: 1, perform: {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Label("Learn more", systemImage: "info.circle")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓HStack {
+            Image(systemName: "info.circle")
+            Text("Learn more")
+        }
+        .onTapGesture {
+            print("tapped")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .gesture(TapGesture().onEnded {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .simultaneousGesture(TapGesture(count: 1).onEnded {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .highPriorityGesture(TapGesture().onEnded {
+                print("tapped")
+            })
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/anonymous_argument_in_multiline_closure.html b/anonymous_argument_in_multiline_closure.html new file mode 100644 index 000000000..3780a481a --- /dev/null +++ b/anonymous_argument_in_multiline_closure.html @@ -0,0 +1,360 @@ + + + + anonymous_argument_in_multiline_closure Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Anonymous Argument in Multiline Closure

+ +

Use named arguments in multiline closures

+ +
    +
  • Identifier: anonymous_argument_in_multiline_closure
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
closure { $0 }
+
+
closure { print($0) }
+
+
closure { arg in
+    print(arg)
+}
+
+
closure { arg in
+    nestedClosure { $0 + arg }
+}
+
+

Triggering Examples

+
closure {
+    print(↓$0)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/anyobject_protocol.html b/anyobject_protocol.html new file mode 100644 index 000000000..296d06add --- /dev/null +++ b/anyobject_protocol.html @@ -0,0 +1,365 @@ + + + + anyobject_protocol Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

AnyObject Protocol

+ +

Prefer using AnyObject over class for class-only protocols.

+ +
    +
  • Identifier: anyobject_protocol
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol SomeProtocol {}
+
+
+
protocol SomeClassOnlyProtocol: AnyObject {}
+
+
+
protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
+
+
+
@objc protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
+
+
+

Triggering Examples

+
protocol SomeClassOnlyProtocol: ↓class {}
+
+
+
protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
+
+
+
@objc protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/array_init.html b/array_init.html new file mode 100644 index 000000000..bfbe91afd --- /dev/null +++ b/array_init.html @@ -0,0 +1,405 @@ + + + + array_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Array Init

+ +

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.

+ +
    +
  • Identifier: array_init
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
Array(foo)
+
+
+
foo.map { $0.0 }
+
+
+
foo.map { $1 }
+
+
+
foo.map { $0() }
+
+
+
foo.map { ((), $0) }
+
+
+
foo.map { $0! }
+
+
+
foo.map { $0! /* force unwrap */ }
+
+
+
foo.something { RouteMapper.map($0) }
+
+
+
foo.map { !$0 }
+
+
+
foo.map { /* a comment */ !$0 }
+
+
+

Triggering Examples

+
foo.↓map({ $0 })
+
+
+
foo.↓map { $0 }
+
+
+
foo.↓map { return $0 }
+
+
+
    foo.↓map { elem in
+        elem
+    }
+
+
    foo.↓map { elem in
+        return elem
+    }
+
+
    foo.↓map { (elem: String) in
+        elem
+    }
+
+
    foo.↓map { elem -> String in
+        elem
+    }
+
+
foo.↓map { $0 /* a comment */ }
+
+
+
foo.↓map { /* a comment */ $0 }
+
+
+ +
+
+ + +
+
+ + + diff --git a/attributes.html b/attributes.html new file mode 100644 index 000000000..f51b42014 --- /dev/null +++ b/attributes.html @@ -0,0 +1,570 @@ + + + + attributes Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Attributes

+ +

Attributes should be on their own lines in functions and types, but on the same line as variables and imports.

+ +
    +
  • Identifier: attributes
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, always_on_same_line: [“@IBAction”, “@NSManaged”], always_on_line_above: []
  • +
+

Non Triggering Examples

+
@objc var x: String
+
+
@objc private var x: String
+
+
@nonobjc var x: String
+
+
@IBOutlet private var label: UILabel
+
+
@IBOutlet @objc private var label: UILabel
+
+
@NSCopying var name: NSString
+
+
@NSManaged var name: String?
+
+
@IBInspectable var cornerRadius: CGFloat
+
+
@available(iOS 9.0, *)
+ let stackView: UIStackView
+
+
@NSManaged func addSomeObject(book: SomeObject)
+
+
@IBAction func buttonPressed(button: UIButton)
+
+
@objc
+ @IBAction func buttonPressed(button: UIButton)
+
+
@available(iOS 9.0, *)
+ func animate(view: UIStackView)
+
+
@available(*, deprecated, message: "A message")
+ func animate(view: UIStackView)
+
+
@nonobjc
+ final class X {}
+
+
@available(iOS 9.0, *)
+ class UIStackView {}
+
+
@NSApplicationMain
+ class AppDelegate: NSObject, NSApplicationDelegate {}
+
+
@UIApplicationMain
+ class AppDelegate: NSObject, UIApplicationDelegate {}
+
+
@IBDesignable
+ class MyCustomView: UIView {}
+
+
@testable import SourceKittenFramework
+
+
@objc(foo_x)
+ var x: String
+
+
@available(iOS 9.0, *)
+@objc(abc_stackView)
+ let stackView: UIStackView
+
+
@objc(abc_addSomeObject:)
+ @NSManaged func addSomeObject(book: SomeObject)
+
+
@objc(ABCThing)
+ @available(iOS 9.0, *)
+ class Thing {}
+
+
class Foo: NSObject {
+ override var description: String { return "" }
+}
+
+
class Foo: NSObject {
+
+ override func setUp() {}
+}
+
+
@objc
+class ⽺ {}
+
+
+
extension Property {
+
+ @available(*, unavailable, renamed: "isOptional")
+public var optional: Bool { fatalError() }
+}
+
+
@GKInspectable var maxSpeed: Float
+
+
@discardableResult
+ func a() -> Int
+
+
@objc
+ @discardableResult
+ func a() -> Int
+
+
func increase(f: @autoclosure () -> Int) -> Int
+
+
func foo(completionHandler: @escaping () -> Void)
+
+
private struct DefaultError: Error {}
+
+
@testable import foo
+
+private let bar = 1
+
+
import XCTest
+@testable import DeleteMe
+
+@available (iOS 11.0, *)
+class DeleteMeTests: XCTestCase {
+}
+
+
@objc
+internal func foo(identifier: String, completion: @escaping (() -> Void)) {}
+
+
@objc
+internal func foo(identifier: String, completion: @autoclosure (() -> Bool)) {}
+
+
func printBoolOrTrue(_ expression: @autoclosure () throws -> Bool?) rethrows {
+  try print(expression() ?? true)
+}
+
+
import Foundation
+
+class MyClass: NSObject {
+  @objc(
+    first:
+  )
+  static func foo(first: String) {}
+}
+
+
func refreshable(action: @escaping @Sendable () async -> Void) -> some View {
+    modifier(RefreshableModifier(action: action))
+}
+
+

Triggering Examples

+
@objc
+ ↓var x: String
+
+
@objc
+
+ ↓var x: String
+
+
@objc
+ private ↓var x: String
+
+
@nonobjc
+ ↓var x: String
+
+
@IBOutlet
+ private ↓var label: UILabel
+
+
@IBOutlet
+
+ private ↓var label: UILabel
+
+
@NSCopying
+ ↓var name: NSString
+
+
@NSManaged
+ ↓var name: String?
+
+
@IBInspectable
+ ↓var cornerRadius: CGFloat
+
+
@available(iOS 9.0, *) ↓let stackView: UIStackView
+
+
@NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@IBAction
+ ↓func buttonPressed(button: UIButton)
+
+
@IBAction
+ @objc
+ ↓func buttonPressed(button: UIButton)
+
+
@available(iOS 9.0, *) ↓func animate(view: UIStackView)
+
+
@nonobjc final ↓class X {}
+
+
@available(iOS 9.0, *) ↓class UIStackView {}
+
+
@available(iOS 9.0, *)
+ @objc ↓class UIStackView {}
+
+
@available(iOS 9.0, *) @objc
+ ↓class UIStackView {}
+
+
@available(iOS 9.0, *)
+
+ ↓class UIStackView {}
+
+
@UIApplicationMain ↓class AppDelegate: NSObject, UIApplicationDelegate {}
+
+
@IBDesignable ↓class MyCustomView: UIView {}
+
+
@testable
+↓import SourceKittenFramework
+
+
@testable
+
+
+↓import SourceKittenFramework
+
+
@available(iOS 9.0, *) @objc(abc_stackView)
+ ↓let stackView: UIStackView
+
+
@objc(abc_addSomeObject:) @NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@objc(abc_addSomeObject:)
+ @NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@available(iOS 9.0, *)
+ @objc(ABCThing) ↓class Thing {}
+
+
@GKInspectable
+ ↓var maxSpeed: Float
+
+
@discardableResult ↓func a() -> Int
+
+
@objc
+ @discardableResult ↓func a() -> Int
+
+
@objc
+
+ @discardableResult
+ ↓func a() -> Int
+
+ +
+
+ + +
+
+ + + diff --git a/badge.svg b/badge.svg new file mode 100644 index 000000000..a096feca8 --- /dev/null +++ b/badge.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + documentation + + + documentation + + + 100% + + + 100% + + + diff --git a/balanced_xctest_lifecycle.html b/balanced_xctest_lifecycle.html new file mode 100644 index 000000000..9d1352e2c --- /dev/null +++ b/balanced_xctest_lifecycle.html @@ -0,0 +1,420 @@ + + + + balanced_xctest_lifecycle Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Balanced XCTest life-cycle

+ +

Test classes must implement balanced setUp and tearDown methods.

+ +
    +
  • Identifier: balanced_xctest_lifecycle
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, test_parent_classes: [“QuickSpec”, “XCTestCase”]
  • +
+

Non Triggering Examples

+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDown() {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDown() {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDownWithError() throws {}
+}
+final class BarTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDownWithError() throws {}
+}
+
+
struct FooTests {
+    override func setUp() {}
+}
+class BarTests {
+    override func setUpWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpAlLExamples() {}
+}
+
+
final class FooTests: XCTestCase {
+    class func setUp() {}
+    class func tearDown() {}
+}
+
+

Triggering Examples

+
final class ↓FooTests: XCTestCase {
+    override func setUp() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+final class ↓BarTests: XCTestCase {
+    override func setUpWithError() throws {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    class func tearDown() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func tearDown() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func tearDownWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+final class ↓BarTests: XCTestCase {
+    override func tearDownWithError() throws {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/block_based_kvo.html b/block_based_kvo.html new file mode 100644 index 000000000..55e22cd62 --- /dev/null +++ b/block_based_kvo.html @@ -0,0 +1,360 @@ + + + + block_based_kvo Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Block Based KVO

+ +

Prefer the new block based KVO API with keypaths when using Swift 3.2 or later.

+ +
    +
  • Identifier: block_based_kvo
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let observer = foo.observe(\.value, options: [.new]) { (foo, change) in
+   print(change.newValue)
+}
+
+

Triggering Examples

+
class Foo: NSObject {
+  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
+                              change: [NSKeyValueChangeKey : Any]?,
+                              context: UnsafeMutableRawPointer?) {}
+}
+
+
class Foo: NSObject {
+  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
+                              change: Dictionary<NSKeyValueChangeKey, Any>?,
+                              context: UnsafeMutableRawPointer?) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/capture_variable.html b/capture_variable.html new file mode 100644 index 000000000..07ee44a63 --- /dev/null +++ b/capture_variable.html @@ -0,0 +1,465 @@ + + + + capture_variable Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Capture Variable

+ +

Non-constant variables should not be listed in a closure’s capture list to avoid confusion about closures capturing variables at creation time.

+ +
    +
  • Identifier: capture_variable
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class C {
+    let i: Int
+    init(_ i: Int) { self.i = i }
+}
+
+let j: Int = 0
+let c = C(1)
+
+let closure: () -> Void = { [j, c] in
+    print(c.i, j)
+}
+
+closure()
+
+
let iGlobal: Int = 0
+
+class C {
+    class var iClass: Int { 0 }
+    static let iStatic: Int = 0
+    let iInstance: Int = 0
+
+    func callTest() {
+        var iLocal: Int = 0
+        test { [unowned self, iGlobal, iInstance, iLocal, iClass=C.iClass, iStatic=C.iStatic] j in
+            print(iGlobal, iClass, iStatic, iInstance, iLocal, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+
var j: Int!
+j = 0
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+
lazy var j: Int = { 0 }()
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+

Triggering Examples

+
var j: Int = 0
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+
class C {
+    let i: Int
+    init(_ i: Int) { self.i = i }
+}
+
+var c = C(0)
+let closure: () -> Void = { [c] in
+    print(c.i)
+}
+
+closure()
+c = C(1)
+closure()
+
+
var iGlobal: Int = 0
+
+class C {
+    func callTest() {
+        test { [iGlobal] j in
+            print(iGlobal, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+
class C {
+    static var iStatic: Int = 0
+
+    static func callTest() {
+        test { [↓iStatic] j in
+            print(iStatic, j)
+        }
+    }
+
+    static func test(_ completionHandler: @escaping (Int) -> Void) {
+        completionHandler(2)
+        C.iStatic = 1
+        completionHandler(3)
+    }
+}
+
+C.callTest()
+
+
class C {
+    var iInstance: Int = 0
+
+    func callTest() {
+        test { [iInstance] j in
+            print(iInstance, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/class_delegate_protocol.html b/class_delegate_protocol.html new file mode 100644 index 000000000..c5fd1a783 --- /dev/null +++ b/class_delegate_protocol.html @@ -0,0 +1,390 @@ + + + + class_delegate_protocol Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Class Delegate Protocol

+ +

Delegate protocols should be class-only so they can be weakly referenced.

+ +
    +
  • Identifier: class_delegate_protocol
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol FooDelegate: class {}
+
+
+
protocol FooDelegate: class, BarDelegate {}
+
+
+
protocol Foo {}
+
+
+
class FooDelegate {}
+
+
+
@objc protocol FooDelegate {}
+
+
+
@objc(MyFooDelegate)
+ protocol FooDelegate {}
+
+
+
protocol FooDelegate: BarDelegate {}
+
+
+
protocol FooDelegate: AnyObject {}
+
+
+
protocol FooDelegate: NSObjectProtocol {}
+
+
+
protocol FooDelegate where Self: BarDelegate {}
+
+
+
protocol FooDelegate where Self: AnyObject {}
+
+
+
protocol FooDelegate where Self: NSObjectProtocol {}
+
+
+

Triggering Examples

+
↓protocol FooDelegate {}
+
+
+
↓protocol FooDelegate: Bar {}
+
+
+
↓protocol FooDelegate where Self: StringProtocol {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/closing_brace.html b/closing_brace.html new file mode 100644 index 000000000..53f70b5ae --- /dev/null +++ b/closing_brace.html @@ -0,0 +1,354 @@ + + + + closing_brace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closing Brace Spacing

+ +

Closing brace with closing parenthesis should not have any whitespaces in the middle.

+ +
    +
  • Identifier: closing_brace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[].map({ })
+
+
[].map(
+  { }
+)
+
+

Triggering Examples

+
[].map({ ↓} )
+
+
[].map({ ↓}   )
+
+ +
+
+ + +
+
+ + + diff --git a/closure_body_length.html b/closure_body_length.html new file mode 100644 index 000000000..0eb1555b9 --- /dev/null +++ b/closure_body_length.html @@ -0,0 +1,1034 @@ + + + + closure_body_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Body Length

+ +

Closure bodies should not span too many lines.

+ +
    +
  • Identifier: closure_body_length
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 30, error: 100
  • +
+

Non Triggering Examples

+
foo.bar { $0 }
+
+
foo.bar { toto in
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar({ toto in
+})
+
+
foo.bar({ toto in
+    let a0 = 0
+})
+
+
foo.bar({ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}, anotherLabel: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}) { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}
+
+
let foo: Bar = { toto in
+    let bar = Bar()
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    return bar
+}()
+
+

Triggering Examples

+
foo.bar ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}
+
+
foo.bar ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar(↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}, anotherLabel: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}) ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}
+
+
let foo: Bar = ↓{ toto in
+    let bar = Bar()
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    return bar
+}()
+
+ +
+
+ + +
+
+ + + diff --git a/closure_end_indentation.html b/closure_end_indentation.html new file mode 100644 index 000000000..fb5adb857 --- /dev/null +++ b/closure_end_indentation.html @@ -0,0 +1,414 @@ + + + + closure_end_indentation Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure End Indentation

+ +

Closure end should have the same indentation as the line that started it.

+ +
    +
  • Identifier: closure_end_indentation
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
SignalProducer(values: [1, 2, 3])
+   .startWithNext { number in
+       print(number)
+   }
+
+
+
[1, 2].map { $0 + 1 }
+
+
+
return match(pattern: pattern, with: [.comment]).flatMap { range in
+   return Command(string: contents, range: range)
+}.flatMap { command in
+   return command.expand()
+}
+
+
+
foo(foo: bar,
+    options: baz) { _ in }
+
+
+
someReallyLongProperty.chainingWithAnotherProperty
+   .foo { _ in }
+
+
foo(abc, 123)
+{ _ in }
+
+
+
function(
+    closure: { x in
+        print(x)
+    },
+    anotherClosure: { y in
+        print(y)
+    })
+
+
function(parameter: param,
+         closure: { x in
+    print(x)
+})
+
+
function(parameter: param, closure: { x in
+        print(x)
+    },
+    anotherClosure: { y in
+        print(y)
+    })
+
+
(-variable).foo()
+
+

Triggering Examples

+
SignalProducer(values: [1, 2, 3])
+   .startWithNext { number in
+       print(number)
+↓}
+
+
+
return match(pattern: pattern, with: [.comment]).flatMap { range in
+   return Command(string: contents, range: range)
+   ↓}.flatMap { command in
+   return command.expand()
+↓}
+
+
+
function(
+    closure: { x in
+        print(x)
+↓},
+    anotherClosure: { y in
+        print(y)
+↓})
+
+ +
+
+ + +
+
+ + + diff --git a/closure_parameter_position.html b/closure_parameter_position.html new file mode 100644 index 000000000..653e6536f --- /dev/null +++ b/closure_parameter_position.html @@ -0,0 +1,438 @@ + + + + closure_parameter_position Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Parameter Position

+ +

Closure parameters should be on the same line as opening brace.

+ +
    +
  • Identifier: closure_parameter_position
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2].map { $0 + 1 }
+
+
+
[1, 2].map({ $0 + 1 })
+
+
+
[1, 2].map { number in
+ number + 1 
+}
+
+
+
[1, 2].map { number -> Int in
+ number + 1 
+}
+
+
+
[1, 2].map { (number: Int) -> Int in
+ number + 1 
+}
+
+
+
[1, 2].map { [weak self] number in
+ number + 1 
+}
+
+
+
[1, 2].something(closure: { number in
+ number + 1 
+})
+
+
+
let isEmpty = [1, 2].isEmpty()
+
+
+
rlmConfiguration.migrationBlock.map { rlmMigration in
+    return { migration, schemaVersion in
+        rlmMigration(migration.rlmMigration, schemaVersion)
+    }
+}
+
+
let mediaView: UIView = { [weak self] index in
+   return UIView()
+}(index)
+
+

Triggering Examples

+
[1, 2].map {
+    ↓number in
+    number + 1
+}
+
+
[1, 2].map {
+    ↓number -> Int in
+    number + 1
+}
+
+
[1, 2].map {
+    (↓number: Int) -> Int in
+    number + 1
+}
+
+
[1, 2].map {
+    [weak ↓self] ↓number in
+    number + 1
+}
+
+
[1, 2].map { [weak self]
+    ↓number in
+    number + 1
+}
+
+
[1, 2].map({
+    ↓number in
+    number + 1
+})
+
+
[1, 2].something(closure: {
+    ↓number in
+    number + 1
+})
+
+
[1, 2].reduce(0) {
+    ↓sum, ↓number in
+    number + sum
+})
+
+
f.completionHandler = {
+    ↓thing in
+    doStuff()
+}
+
+
foo {
+    [weak ↓self] in
+    self?.bar()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/closure_spacing.html b/closure_spacing.html new file mode 100644 index 000000000..2f2f03176 --- /dev/null +++ b/closure_spacing.html @@ -0,0 +1,362 @@ + + + + closure_spacing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Spacing

+ +

Closure expressions should have a single space inside each brace.

+ +
    +
  • Identifier: closure_spacing
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[].map ({ $0.description })
+
+
[].filter { $0.contains(location) }
+
+
extension UITableViewCell: ReusableView { }
+
+
extension UITableViewCell: ReusableView {}
+
+

Triggering Examples

+
[].filter↓{ $0.contains(location) }
+
+
[].filter(↓{$0.contains(location)})
+
+
[].map(↓{$0})
+
+
(↓{each in return result.contains(where: ↓{e in return e}) }).count
+
+
filter ↓{ sorted ↓{ $0 < $1}}
+
+ +
+
+ + +
+
+ + + diff --git a/collection_alignment.html b/collection_alignment.html new file mode 100644 index 000000000..79bb9f335 --- /dev/null +++ b/collection_alignment.html @@ -0,0 +1,420 @@ + + + + collection_alignment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Collection Element Alignment

+ +

All elements in a collection literal should be vertically aligned

+ +
    +
  • Identifier: collection_alignment
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, align_colons: false
  • +
+

Non Triggering Examples

+
doThings(arg: [
+    "foo": 1,
+    "bar": 2,
+    "fizz": 2,
+    "buzz": 2
+])
+
+
let abc = [
+    "alpha": "a",
+    "beta": "b",
+    "gamma": "g",
+    "delta": "d",
+    "epsilon": "e"
+]
+
+
let meals = [
+                "breakfast": "oatmeal",
+                "lunch": "sandwich",
+                "dinner": "burger"
+]
+
+
let coordinates = [
+    CLLocationCoordinate2D(latitude: 0, longitude: 33),
+    CLLocationCoordinate2D(latitude: 0, longitude: 66),
+    CLLocationCoordinate2D(latitude: 0, longitude: 99)
+]
+
+
var evenNumbers: Set<Int> = [
+    2,
+    4,
+    6
+]
+
+
let abc = [1, 2, 3, 4]
+
+
let abc = [
+    1, 2, 3, 4
+]
+
+
let abc = [
+    "foo": "bar", "fizz": "buzz"
+]
+
+

Triggering Examples

+
doThings(arg: [
+    "foo": 1,
+    "bar": 2,
+   ↓"fizz": 2,
+   ↓"buzz": 2
+])
+
+
let abc = [
+    "alpha": "a",
+     ↓"beta": "b",
+    "gamma": "g",
+    "delta": "d",
+  ↓"epsilon": "e"
+]
+
+
let meals = [
+                "breakfast": "oatmeal",
+                "lunch": "sandwich",
+    ↓"dinner": "burger"
+]
+
+
let coordinates = [
+    CLLocationCoordinate2D(latitude: 0, longitude: 33),
+        ↓CLLocationCoordinate2D(latitude: 0, longitude: 66),
+    CLLocationCoordinate2D(latitude: 0, longitude: 99)
+]
+
+
var evenNumbers: Set<Int> = [
+    2,
+  ↓4,
+    6
+]
+
+ +
+
+ + +
+
+ + + diff --git a/colon.html b/colon.html new file mode 100644 index 000000000..77d7091a0 --- /dev/null +++ b/colon.html @@ -0,0 +1,632 @@ + + + + colon Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Colon Spacing

+ +

Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.

+ +
    +
  • Identifier: colon
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, flexible_right_spacing: false, apply_to_dictionaries: true
  • +
+

Non Triggering Examples

+
let abc: Void
+
+
+
let abc: [Void: Void]
+
+
+
let abc: (Void, Void)
+
+
+
let abc: ([Void], String, Int)
+
+
+
let abc: [([Void], String, Int)]
+
+
+
let abc: String="def"
+
+
+
let abc: Int=0
+
+
+
let abc: Enum=Enum.Value
+
+
+
func abc(def: Void) {}
+
+
+
func abc(def: Void, ghi: Void) {}
+
+
+
let abc: String = "abc:"
+
+
let abc = [Void: Void]()
+
+
+
let abc = [1: [3: 2], 3: 4]
+
+
+
let abc = ["string": "string"]
+
+
+
let abc = ["string:string": "string"]
+
+
+
let abc: [String: Int]
+
+
+
func foo(bar: [String: Int]) {}
+
+
+
func foo() -> [String: Int] { return [:] }
+
+
+
let abc: Any
+
+
+
let abc: [Any: Int]
+
+
+
let abc: [String: Any]
+
+
+
class Foo: Bar {}
+
+
+
class Foo<T>: Bar {}
+
+
+
class Foo<T: Equatable>: Bar {}
+
+
+
class Foo<T, U>: Bar {}
+
+
+
class Foo<T: Equatable> {}
+
+
+
object.method(x: /* comment */ 5)
+
+
+
switch foo {
+case .bar:
+    _ = something()
+}
+
+
object.method(x: 5, y: "string")
+
+
+
object.method(x: 5, y:
+              "string")
+
+
object.method(5, y: "string")
+
+
+
func abc() { def(ghi: jkl) }
+
+
func abc(def: Void) { ghi(jkl: mno) }
+
+
class ABC { let def = ghi(jkl: mno) } }
+
+
func foo() { let dict = [1: 1] }
+
+
let aaa = Self.bbb ? Self.ccc : Self.ddd else {
+return nil
+Example("}
+
+
range.flatMap(file.syntaxMap.kinds(inByteRange:)) ?? []
+
+
@objc(receiveReply:)
+public class func receiveReply(_ reply: bad_instruction_exception_reply_t) -> CInt { 0 }
+
+
switch str {
+case "adlm", "adlam":             return .adlam
+case "aghb", "caucasianalbanian": return .caucasianAlbanian
+default:                          return nil
+}
+
+
precedencegroup PipelinePrecedence {
+  associativity: left
+}
+infix operator |> : PipelinePrecedence
+
+
switch scalar {
+  case 0x000A...0x000D /* LF ... CR */: return true
+  case 0x0085 /* NEXT LINE (NEL) */: return true
+  case 0x2028 /* LINE SEPARATOR */: return true
+  case 0x2029 /* PARAGRAPH SEPARATOR */: return true
+  default: return false
+}
+
+

Triggering Examples

+
let abc↓:Void
+
+
+
let abc↓:  Void
+
+
+
let abc↓ :Void
+
+
+
let abc↓ : Void
+
+
+
let abc↓ : [Void: Void]
+
+
+
let abc↓ : (Void, String, Int)
+
+
+
let abc↓ : ([Void], String, Int)
+
+
+
let abc↓ : [([Void], String, Int)]
+
+
+
let abc↓:  (Void, String, Int)
+
+
+
let abc↓:  ([Void], String, Int)
+
+
+
let abc↓:  [([Void], String, Int)]
+
+
+
let abc↓ :String="def"
+
+
+
let abc↓ :Int=0
+
+
+
let abc↓ :Int = 0
+
+
+
let abc↓:Int=0
+
+
+
let abc↓:Int = 0
+
+
+
let abc↓:Enum=Enum.Value
+
+
+
func abc(def↓:Void) {}
+
+
+
func abc(def↓:  Void) {}
+
+
+
func abc(def↓ :Void) {}
+
+
+
func abc(def↓ : Void) {}
+
+
+
func abc(def: Void, ghi↓ :Void) {}
+
+
+
let abc = [Void↓:Void]()
+
+
+
let abc = [Void↓ : Void]()
+
+
+
let abc = [Void↓:  Void]()
+
+
+
let abc = [Void↓ :  Void]()
+
+
+
let abc = [1: [3↓ : 2], 3: 4]
+
+
+
let abc = [1: [3↓ : 2], 3↓:  4]
+
+
+
let abc: [String↓ : Int]
+
+
+
let abc: [String↓:Int]
+
+
+
func foo(bar: [String↓ : Int]) {}
+
+
+
func foo(bar: [String↓:Int]) {}
+
+
+
func foo() -> [String↓ : Int] { return [:] }
+
+
+
func foo() -> [String↓:Int] { return [:] }
+
+
+
let abc↓ : Any
+
+
+
let abc: [Any↓ : Int]
+
+
+
let abc: [String↓ : Any]
+
+
+
class Foo↓ : Bar {}
+
+
+
class Foo↓:Bar {}
+
+
+
class Foo<T>↓ : Bar {}
+
+
+
class Foo<T>↓:Bar {}
+
+
+
class Foo<T, U>↓:Bar {}
+
+
+
class Foo<T: Equatable>↓:Bar {}
+
+
+
class Foo<T↓:Equatable> {}
+
+
+
class Foo<T↓ : Equatable> {}
+
+
+
object.method(x: 5, y↓ : "string")
+
+
+
object.method(x↓:5, y: "string")
+
+
+
object.method(x↓:  5, y: "string")
+
+
+
func abc() { def(ghi↓:jkl) }
+
+
func abc(def: Void) { ghi(jkl↓:mno) }
+
+
class ABC { let def = ghi(jkl↓:mno) } }
+
+
func foo() { let dict = [1↓ : 1] }
+
+
switch foo {
+case .bar↓ : return baz
+}
+
+
private var action↓:(() -> Void)?
+
+ +
+
+ + +
+
+ + + diff --git a/comma.html b/comma.html new file mode 100644 index 000000000..468fc5060 --- /dev/null +++ b/comma.html @@ -0,0 +1,397 @@ + + + + comma Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comma Spacing

+ +

There should be no space before and one after any comma.

+ +
    +
  • Identifier: comma
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func abc(a: String, b: String) { }
+
+
abc(a: "string", b: "string"
+
+
enum a { case a, b, c }
+
+
func abc(
+  a: String,  // comment
+  bcd: String // comment
+) {
+}
+
+
+
func abc(
+  a: String,
+  bcd: String
+) {
+}
+
+
+
#imageLiteral(resourceName: "foo,bar,baz")
+
+
kvcStringBuffer.advanced(by: rootKVCLength)
+  .storeBytes(of: 0x2E /* '.' */, as: CChar.self)
+
+

Triggering Examples

+
func abc(a: String↓ ,b: String) { }
+
+
func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }
+
+
abc(a: "string"↓,b: "string"
+
+
enum a { case a↓ ,b }
+
+
let result = plus(
+    first: 3↓ , // #683
+    second: 4
+)
+
+
+
Foo(
+  parameter: a.b.c,
+  tag: a.d,
+  value: a.identifier.flatMap { Int64($0) }↓ ,
+  reason: Self.abcd()
+)
+
+
return Foo(bar: .baz, title: fuzz,
+          message: My.Custom.message↓ ,
+          another: parameter, doIt: true,
+          alignment: .center)
+
+
Logger.logError("Hat is too large"↓,  info: [])
+
+ +
+
+ + +
+
+ + + diff --git a/comma_inheritance.html b/comma_inheritance.html new file mode 100644 index 000000000..92c451fcd --- /dev/null +++ b/comma_inheritance.html @@ -0,0 +1,378 @@ + + + + comma_inheritance Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comma Inheritance Rule

+ +

Use commas to separate types in inheritance lists

+ +
    +
  • Identifier: comma_inheritance
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct A: Codable, Equatable {}
+
+
enum B: Codable, Equatable {}
+
+
class C: Codable, Equatable {}
+
+
protocol D: Codable, Equatable {}
+
+
typealias E = Equatable & Codable
+
+
func foo<T: Equatable & Codable>(_ param: T) {}
+
+
protocol G {
+    associatedtype Model: Codable, Equatable
+}
+
+

Triggering Examples

+
struct A: Codable↓ & Equatable {}
+
+
struct A: Codable↓  & Equatable {}
+
+
struct A: Codable↓&Equatable {}
+
+
struct A: Codable↓& Equatable {}
+
+
enum B: Codable↓ & Equatable {}
+
+
class C: Codable↓ & Equatable {}
+
+
protocol D: Codable↓ & Equatable {}
+
+
protocol G {
+    associatedtype Model: Codable↓ & Equatable
+}
+
+ +
+
+ + +
+
+ + + diff --git a/comment_spacing.html b/comment_spacing.html new file mode 100644 index 000000000..0fc3dedab --- /dev/null +++ b/comment_spacing.html @@ -0,0 +1,400 @@ + + + + comment_spacing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comment Spacing

+ +

Prefer at least one space after slashes for comments.

+ +
    +
  • Identifier: comment_spacing
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
// This is a comment
+
+
/// Triple slash comment
+
+
// Multiline double-slash
+// comment
+
+
/// Multiline triple-slash
+/// comment
+
+
/// Multiline triple-slash
+///   - This is indented
+
+
// - MARK: Mark comment
+
+
//: Swift Playground prose section
+
+
///////////////////////////////////////////////
+// Comment with some lines of slashes boxing it
+///////////////////////////////////////////////
+
+
//:#localized(key: "SwiftPlaygroundLocalizedProse")
+
+
/* Asterisk comment */
+
+
/*
+    Multiline asterisk comment
+*/
+
+
/*:
+    Multiline Swift Playground prose section
+*/
+
+
/*#-editable-code Swift Platground editable area*/default/*#-end-editable-code*/
+
+

Triggering Examples

+
//↓Something
+
+
//↓MARK
+
+
//↓👨‍👨‍👦‍👦Something
+
+
func a() {
+    //↓This needs refactoring
+    print("Something")
+}
+//↓We should improve above function
+
+
///↓This is a comment
+
+
/// Multiline triple-slash
+///↓This line is incorrect, though
+
+
//↓- MARK: Mark comment
+
+
//:↓Swift Playground prose section
+
+ +
+
+ + +
+
+ + + diff --git a/compiler_protocol_init.html b/compiler_protocol_init.html new file mode 100644 index 000000000..15ad4c612 --- /dev/null +++ b/compiler_protocol_init.html @@ -0,0 +1,362 @@ + + + + compiler_protocol_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Compiler Protocol Init

+ +

The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn’t be called directly.

+ +
    +
  • Identifier: compiler_protocol_init
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let set: Set<Int> = [1, 2]
+
+
+
let set = Set(array)
+
+
+

Triggering Examples

+
let set = ↓Set(arrayLiteral: 1, 2)
+
+
+
let set = ↓Set (arrayLiteral: 1, 2)
+
+
+
let set = ↓Set.init(arrayLiteral: 1, 2)
+
+
+
let set = ↓Set.init(arrayLiteral : 1, 2)
+
+
+ +
+
+ + +
+
+ + + diff --git a/computed_accessors_order.html b/computed_accessors_order.html new file mode 100644 index 000000000..19228ee59 --- /dev/null +++ b/computed_accessors_order.html @@ -0,0 +1,541 @@ + + + + computed_accessors_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Computed Accessors Order

+ +

Getter and setters in computed properties and subscripts should be in a consistent order.

+ +
    +
  • Identifier: computed_accessors_order
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, order: get_set
  • +
+

Non Triggering Examples

+
class Foo {
+    var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int
+}
+
+
class Foo {
+    var foo: Int {
+        return getValueFromDisk()
+    }
+}
+
+
class Foo {
+    var foo: String {
+        return "get"
+    }
+}
+
+
protocol Foo {
+    var foo: Int { get }
+
+
protocol Foo {
+    var foo: Int { get set }
+}
+
+
protocol Foo {
+    var foo: Int { set get }
+
+
class Foo {
+    var foo: Int {
+        struct Bar {
+            var bar: Int {
+                get { return 1 }
+                set { _ = newValue }
+            }
+        }
+
+        return Bar().bar
+    }
+}
+
+
var _objCTaggedPointerBits: UInt {
+    @inline(__always) get { return 0 }
+    set { print(newValue) }
+}
+
+
var next: Int? {
+    mutating get {
+        defer { self.count += 1 }
+        return self.count
+    }
+    set {
+        self.count = newValue
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set { self._bar = newValue }
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set(newValue) { self._bar = newValue }
+    }
+}
+
+
extension Reactive where Base: UITapGestureRecognizer {
+    var tapped: CocoaAction<Base>? {
+        get {
+            return associatedAction.withValue { $0.flatMap { $0.action } }
+        }
+        nonmutating set {
+            setAction(newValue)
+        }
+    }
+}
+
+
extension Test {
+    var foo: Bool {
+        get {
+            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
+        }
+        set {
+            bar = NSNumber(value: newValue as Bool)
+        }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        return 20
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get set }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { set get }
+}
+
+

Triggering Examples

+
class Foo {
+    var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+
var foo: Int {
+    ↓set { print(newValue) }
+    get { return 20 }
+}
+
+
extension Foo {
+    var bar: Bool {
+        ↓set { print(bar) }
+        get { _bar }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        mutating get {
+            return 20
+        }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        ↓set {
+            print(i)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/conditional_returns_on_newline.html b/conditional_returns_on_newline.html new file mode 100644 index 000000000..7bd610813 --- /dev/null +++ b/conditional_returns_on_newline.html @@ -0,0 +1,381 @@ + + + + conditional_returns_on_newline Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Conditional Returns on Newline

+ +

Conditional statements should always return on the next line

+ +
    +
  • Identifier: conditional_returns_on_newline
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, if_only: false
  • +
+

Non Triggering Examples

+
guard true else {
+ return true
+}
+
+
guard true,
+ let x = true else {
+ return true
+}
+
+
if true else {
+ return true
+}
+
+
if true,
+ let x = true else {
+ return true
+}
+
+
if textField.returnKeyType == .Next {
+
+
if true { // return }
+
+
guard something
+else { return }
+
+

Triggering Examples

+
↓guard true else { return }
+
+
↓if true { return }
+
+
↓if true { break } else { return }
+
+
↓if true { break } else {       return }
+
+
↓if true { return "YES" } else { return "NO" }
+
+
↓guard condition else { XCTFail(); return }
+
+ +
+
+ + +
+
+ + + diff --git a/contains_over_filter_count.html b/contains_over_filter_count.html new file mode 100644 index 000000000..a5a017798 --- /dev/null +++ b/contains_over_filter_count.html @@ -0,0 +1,407 @@ + + + + contains_over_filter_count Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains Over Filter Count

+ +

Prefer contains over comparing filter(where:).count to 0.

+ +
    +
  • Identifier: contains_over_filter_count
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count > 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 01
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count == 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 01
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count != 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 01
+
+
+
let result = myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = !myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = myList.contains(10)
+
+
+

Triggering Examples

+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count > 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count > 0
+
+
+
let result = ↓myList.filter(where: someFunction).count > 0
+
+
+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count == 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count == 0
+
+
+
let result = ↓myList.filter(where: someFunction).count == 0
+
+
+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count != 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count != 0
+
+
+
let result = ↓myList.filter(where: someFunction).count != 0
+
+
+ +
+
+ + +
+
+ + + diff --git a/contains_over_filter_is_empty.html b/contains_over_filter_is_empty.html new file mode 100644 index 000000000..ab2c84b96 --- /dev/null +++ b/contains_over_filter_is_empty.html @@ -0,0 +1,383 @@ + + + + contains_over_filter_is_empty Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains Over Filter Is Empty

+ +

Prefer contains over using filter(where:).isEmpty

+ +
    +
  • Identifier: contains_over_filter_is_empty
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count > 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count == 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count != 1
+
+
+
let result = myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = !myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = myList.contains(10)
+
+
+

Triggering Examples

+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
+
+
+
let result = !↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.isEmpty
+
+
+
let result = ↓myList.filter(where: someFunction).isEmpty
+
+
+ +
+
+ + +
+
+ + + diff --git a/contains_over_first_not_nil.html b/contains_over_first_not_nil.html new file mode 100644 index 000000000..104dfd3bd --- /dev/null +++ b/contains_over_first_not_nil.html @@ -0,0 +1,428 @@ + + + + contains_over_first_not_nil Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains over first not nil

+ +

Prefer contains over first(where:) != nil and firstIndex(where:) != nil.

+ +
    +
  • Identifier: contains_over_first_not_nil
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let first = myList.first(where: { $0 % 2 == 0 })
+
+
+
let first = myList.first { $0 % 2 == 0 }
+
+
+
let firstIndex = myList.firstIndex(where: { $0 % 2 == 0 })
+
+
+
let firstIndex = myList.firstIndex { $0 % 2 == 0 }
+
+
+

Triggering Examples

+
↓myList.first { $0 % 2 == 0 } != nil
+
+
+
↓myList.first(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.first(where: someFunction) != nil
+
+
+
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } != nil
+
+
+
(↓myList.first { $0 % 2 == 0 }) != nil
+
+
+
↓myList.first { $0 % 2 == 0 } == nil
+
+
+
↓myList.first(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.first(where: someFunction) == nil
+
+
+
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } == nil
+
+
+
(↓myList.first { $0 % 2 == 0 }) == nil
+
+
+
↓myList.firstIndex { $0 % 2 == 0 } != nil
+
+
+
↓myList.firstIndex(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.firstIndex(where: someFunction) != nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } != nil
+
+
+
(↓myList.firstIndex { $0 % 2 == 0 }) != nil
+
+
+
↓myList.firstIndex { $0 % 2 == 0 } == nil
+
+
+
↓myList.firstIndex(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.firstIndex(where: someFunction) == nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } == nil
+
+
+
(↓myList.firstIndex { $0 % 2 == 0 }) == nil
+
+
+ +
+
+ + +
+
+ + + diff --git a/contains_over_range_nil_comparison.html b/contains_over_range_nil_comparison.html new file mode 100644 index 000000000..4fd7596dd --- /dev/null +++ b/contains_over_range_nil_comparison.html @@ -0,0 +1,356 @@ + + + + contains_over_range_nil_comparison Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains over range(of:) comparison to nil

+ +

Prefer contains over range(of:) != nil and range(of:) == nil.

+ +
    +
  • Identifier: contains_over_range_nil_comparison
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let range = myString.range(of: "Test")
+
+
myString.contains("Test")
+
+
!myString.contains("Test")
+
+
resourceString.range(of: rule.regex, options: .regularExpression) != nil
+
+

Triggering Examples

+
↓myString.range(of: "Test") != nil
+
+
↓myString.range(of: "Test") == nil
+
+ +
+
+ + +
+
+ + + diff --git a/control_statement.html b/control_statement.html new file mode 100644 index 000000000..f131e58cc --- /dev/null +++ b/control_statement.html @@ -0,0 +1,459 @@ + + + + control_statement Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Control Statement

+ +

if, for, guard, switch, while, and catch statements shouldn’t unnecessarily wrap their conditionals or arguments in parentheses.

+ +
    +
  • Identifier: control_statement
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
if condition {
+
+
+
if (a, b) == (0, 1) {
+
+
+
if (a || b) && (c || d) {
+
+
+
if (min...max).contains(value) {
+
+
+
if renderGif(data) {
+
+
+
renderGif(data)
+
+
+
for item in collection {
+
+
+
for (key, value) in dictionary {
+
+
+
for (index, value) in enumerate(array) {
+
+
+
for var index = 0; index < 42; index++ {
+
+
+
guard condition else {
+
+
+
while condition {
+
+
+
} while condition {
+
+
+
do { ; } while condition {
+
+
+
switch foo {
+
+
+
do {
+} catch let error as NSError {
+}
+
+
foo().catch(all: true) {}
+
+
if max(a, b) < c {
+
+
+
switch (lhs, rhs) {
+
+
+

Triggering Examples

+
↓if (condition) {
+
+
+
↓if(condition) {
+
+
+
↓if (condition == endIndex) {
+
+
+
↓if ((a || b) && (c || d)) {
+
+
+
↓if ((min...max).contains(value)) {
+
+
+
↓for (item in collection) {
+
+
+
↓for (var index = 0; index < 42; index++) {
+
+
+
↓for(item in collection) {
+
+
+
↓for(var index = 0; index < 42; index++) {
+
+
+
↓guard (condition) else {
+
+
+
↓while (condition) {
+
+
+
↓while(condition) {
+
+
+
} ↓while (condition) {
+
+
+
} ↓while(condition) {
+
+
+
do { ; } ↓while(condition) {
+
+
+
do { ; } ↓while (condition) {
+
+
+
↓switch (foo) {
+
+
+
do {
+} ↓catch(let error as NSError) {
+}
+
+
↓if (max(a, b) < c) {
+
+
+ +
+
+ + +
+
+ + + diff --git a/convenience_type.html b/convenience_type.html new file mode 100644 index 000000000..41b6d99b2 --- /dev/null +++ b/convenience_type.html @@ -0,0 +1,421 @@ + + + + convenience_type Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Convenience Type

+ +

Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation.

+ +
    +
  • Identifier: convenience_type
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum Math { // enum
+  public static let pi = 3.14
+}
+
+
// class with inheritance
+class MathViewController: UIViewController {
+  public static let pi = 3.14
+}
+
+
@objc class Math: NSObject { // class visible to Obj-C
+  public static let pi = 3.14
+}
+
+
struct Math { // type with non-static declarations
+  public static let pi = 3.14
+  public let randomNumber = 2
+}
+
+
class DummyClass {}
+
+
class Foo: NSObject { // class with Obj-C class property
+    class @objc let foo = 1
+}
+
+
class Foo: NSObject { // class with Obj-C static property
+    static @objc let foo = 1
+}
+
+
class Foo { // @objc class func can't exist on an enum
+   @objc class func foo() {}
+}
+
+
class Foo { // @objc static func can't exist on an enum
+   @objc static func foo() {}
+}
+
+
@objcMembers class Foo { // @objc static func can't exist on an enum
+   static func foo() {}
+}
+
+
final class Foo { // final class, but @objc class func can't exist on an enum
+   @objc class func foo() {}
+}
+
+
final class Foo { // final class, but @objc static func can't exist on an enum
+   @objc static func foo() {}
+}
+
+
@globalActor actor MyActor {
+  static let shared = MyActor()
+}
+
+

Triggering Examples

+
↓struct Math {
+  public static let pi = 3.14
+}
+
+
↓struct Math {
+  public static let pi = 3.14
+  @available(*, unavailable) init() {}
+}
+
+
final ↓class Foo { // final class can't be inherited
+    class let foo = 1
+}
+
+
↓class Foo {
+    class let foo = 1
+}
+
+
↓class Foo {
+    final class let foo = 1
+}
+
+
↓class SomeClass {
+    static func foo() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/css/highlight.css b/css/highlight.css new file mode 100644 index 000000000..c170357ce --- /dev/null +++ b/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/css/jazzy.css b/css/jazzy.css new file mode 100644 index 000000000..c7bb9fe22 --- /dev/null +++ b/css/jazzy.css @@ -0,0 +1,404 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + .item .declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/custom_rules.html b/custom_rules.html new file mode 100644 index 000000000..8c315afb7 --- /dev/null +++ b/custom_rules.html @@ -0,0 +1,342 @@ + + + + custom_rules Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Custom Rules

+ +

Create custom rules by providing a regex string. Optionally specify what syntax kinds to match against, the severity level, and what message to display.

+ +
    +
  • Identifier: custom_rules
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: user-defined
  • +
+ +
+
+ + +
+
+ + + diff --git a/cyclomatic_complexity.html b/cyclomatic_complexity.html new file mode 100644 index 000000000..7f905d43e --- /dev/null +++ b/cyclomatic_complexity.html @@ -0,0 +1,395 @@ + + + + cyclomatic_complexity Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Cyclomatic Complexity

+ +

Complexity of function bodies should be limited.

+ +
    +
  • Identifier: cyclomatic_complexity
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 10, error: 20, ignores_case_statements: false
  • +
+

Non Triggering Examples

+
func f1() {
+    if true {
+        for _ in 1..5 { }
+    }
+    if false { }
+}
+
+
func f(code: Int) -> Int {
+    switch code {
+    case 0: fallthrough
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    default: return 1
+    }
+}
+
+
func f1() {
+    if true {}; if true {}; if true {}; if true {}; if true {}; if true {}
+    func f2() {
+        if true {}; if true {}; if true {}; if true {}; if true {}
+    }
+}
+
+

Triggering Examples

+
↓func f1() {
+    if true {
+        if true {
+            if false {}
+        }
+    }
+    if false {}
+    let i = 0
+    switch i {
+        case 1: break
+        case 2: break
+        case 3: break
+        case 4: break
+        default: break
+    }
+    for _ in 1...5 {
+        guard true else {
+            return
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/deployment_target.html b/deployment_target.html new file mode 100644 index 000000000..ef581d8e1 --- /dev/null +++ b/deployment_target.html @@ -0,0 +1,422 @@ + + + + deployment_target Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Deployment Target

+ +

Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.

+ +
    +
  • Identifier: deployment_target
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, iOSApplicationExtension_deployment_target: 7.0, iOS_deployment_target: 7.0, macOSApplicationExtension_deployment_target: 10.9, macOS_deployment_target: 10.9, tvOSApplicationExtension_deployment_target: 9.0, tvOS_deployment_target: 9.0, watchOSApplicationExtension_deployment_target: 1.0, watchOS_deployment_target: 1.0
  • +
+

Non Triggering Examples

+
@available(iOS 12.0, *)
+class A {}
+
+
@available(iOSApplicationExtension 13.0, *)
+class A {}
+
+
@available(watchOS 4.0, *)
+class A {}
+
+
@available(watchOSApplicationExtension 4.0, *)
+class A {}
+
+
@available(swift 3.0.2)
+class A {}
+
+
class A {}
+
+
if #available(iOS 10.0, *) {}
+
+
if #available(iOS 10, *) {}
+
+
guard #available(iOS 12.0, *) else { return }
+
+
#if #unavailable(iOS 15.0) {}
+
+
#guard #unavailable(iOS 15.0) {} else { return }
+
+

Triggering Examples

+
↓@available(iOS 6.0, *)
+class A {}
+
+
↓@available(iOSApplicationExtension 6.0, *)
+class A {}
+
+
↓@available(iOS 7.0, *)
+class A {}
+
+
↓@available(iOS 6, *)
+class A {}
+
+
↓@available(iOS 6.0, macOS 10.12, *)
+ class A {}
+
+
↓@available(macOS 10.12, iOS 6.0, *)
+ class A {}
+
+
↓@available(macOS 10.7, *)
+class A {}
+
+
↓@available(macOSApplicationExtension 10.7, *)
+class A {}
+
+
↓@available(OSX 10.7, *)
+class A {}
+
+
↓@available(watchOS 0.9, *)
+class A {}
+
+
↓@available(watchOSApplicationExtension 0.9, *)
+class A {}
+
+
↓@available(tvOS 8, *)
+class A {}
+
+
↓@available(tvOSApplicationExtension 8, *)
+class A {}
+
+
if ↓#available(iOS 6.0, *) {}
+
+
if ↓#available(iOS 6, *) {}
+
+
guard ↓#available(iOS 6.0, *) else { return }
+
+
if ↓#unavailable(iOS 7.0) {}
+
+
if ↓#unavailable(iOS 6.9) {}
+
+
guard ↓#unavailable(iOS 7.0) {} else { return }
+
+ +
+
+ + +
+
+ + + diff --git a/discarded_notification_center_observer.html b/discarded_notification_center_observer.html new file mode 100644 index 000000000..03c270cc8 --- /dev/null +++ b/discarded_notification_center_observer.html @@ -0,0 +1,389 @@ + + + + discarded_notification_center_observer Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discarded Notification Center Observer

+ +

When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later.

+ +
    +
  • Identifier: discarded_notification_center_observer
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
func foo() -> Any {
+   return nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+}
+
+
+
var obs: [Any?] = []
+obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
var obs: [String: Any?] = []
+obs["foo"] = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
var obs: [Any?] = []
+obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
func foo(_ notif: Any) {
+   obs.append(notif)
+}
+foo(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
var obs: [NSObjectProtocol] = [
+   nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }),
+   nc.addObserver(forName: .CKAccountChanged, object: nil, queue: nil, using: { })
+]
+
+

Triggering Examples

+
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
_ = ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
+
@discardableResult func foo() -> Any {
+   return ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+}
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_assert.html b/discouraged_assert.html new file mode 100644 index 000000000..5bb0c7764 --- /dev/null +++ b/discouraged_assert.html @@ -0,0 +1,362 @@ + + + + discouraged_assert Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Assert

+ +

Prefer assertionFailure() and/or preconditionFailure() over assert(false)

+ +
    +
  • Identifier: discouraged_assert
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
assert(true)
+
+
assert(true, "foobar")
+
+
assert(true, "foobar", file: "toto", line: 42)
+
+
assert(false || true)
+
+
XCTAssert(false)
+
+

Triggering Examples

+
↓assert(false)
+
+
↓assert(false, "foobar")
+
+
↓assert(false, "foobar", file: "toto", line: 42)
+
+
↓assert(   false    , "foobar")
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_direct_init.html b/discouraged_direct_init.html new file mode 100644 index 000000000..2d882aca9 --- /dev/null +++ b/discouraged_direct_init.html @@ -0,0 +1,386 @@ + + + + discouraged_direct_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Direct Initialization

+ +

Discouraged direct initialization of types that can be harmful.

+ +
    +
  • Identifier: discouraged_direct_init
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, types: [“Bundle”, “Bundle.init”, “NSError”, “NSError.init”, “UIDevice”, “UIDevice.init”]
  • +
+

Non Triggering Examples

+
let foo = UIDevice.current
+
+
let foo = Bundle.main
+
+
let foo = Bundle(path: "bar")
+
+
let foo = Bundle(identifier: "bar")
+
+
let foo = Bundle.init(path: "bar")
+
+
let foo = Bundle.init(identifier: "bar")
+
+
let foo = NSError(domain: "bar", code: 0)
+
+
let foo = NSError.init(domain: "bar", code: 0)
+
+
func testNSError()
+
+

Triggering Examples

+
↓UIDevice()
+
+
↓Bundle()
+
+
let foo = ↓UIDevice()
+
+
let foo = ↓Bundle()
+
+
let foo = ↓NSError()
+
+
let foo = bar(bundle: ↓Bundle(), device: ↓UIDevice(), error: ↓NSError())
+
+
↓UIDevice.init()
+
+
↓Bundle.init()
+
+
↓NSError.init()
+
+
let foo = ↓UIDevice.init()
+
+
let foo = ↓Bundle.init()
+
+
let foo = bar(bundle: ↓Bundle.init(), device: ↓UIDevice.init(), error: ↓NSError.init())
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_none_name.html b/discouraged_none_name.html new file mode 100644 index 000000000..8c5813cbc --- /dev/null +++ b/discouraged_none_name.html @@ -0,0 +1,472 @@ + + + + discouraged_none_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged None Name

+ +

Discourages name cases/static members none, which can conflict with Optional<T>.none.

+ +
    +
  • Identifier: discouraged_none_name
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum MyEnum {
+    case nOne
+}
+
+
enum MyEnum {
+    case _none
+}
+
+
enum MyEnum {
+    case none_
+}
+
+
enum MyEnum {
+    case none(Any)
+}
+
+
enum MyEnum {
+    case nonenone
+}
+
+
class MyClass {
+    class var nonenone: MyClass { MyClass() }
+}
+
+
class MyClass {
+    static var nonenone = MyClass()
+}
+
+
class MyClass {
+    static let nonenone = MyClass()
+}
+
+
struct MyStruct {
+    static var nonenone = MyStruct()
+}
+
+
struct MyStruct {
+    static let nonenone = MyStruct()
+}
+
+
struct MyStruct {
+    let none = MyStruct()
+}
+
+
struct MyStruct {
+    var none = MyStruct()
+}
+
+
class MyClass {
+    let none = MyClass()
+}
+
+
class MyClass {
+    var none = MyClass()
+}
+
+

Triggering Examples

+
enum MyEnum {
+    case ↓none
+}
+
+
enum MyEnum {
+    case a, ↓none
+}
+
+
enum MyEnum {
+    case ↓none, b
+}
+
+
enum MyEnum {
+    case a, ↓none, b
+}
+
+
enum MyEnum {
+    case a
+    case ↓none
+}
+
+
enum MyEnum {
+    case ↓none
+    case b
+}
+
+
enum MyEnum {
+    case a
+    case ↓none
+    case b
+}
+
+
class MyClass {
+    ↓static let none = MyClass()
+}
+
+
class MyClass {
+    ↓static let none: MyClass = MyClass()
+}
+
+
class MyClass {
+    ↓static var none: MyClass = MyClass()
+}
+
+
class MyClass {
+    ↓class var none: MyClass { MyClass() }
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none: MyStruct = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none: MyStruct = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var a = MyStruct(), none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct(), a = MyStruct()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_object_literal.html b/discouraged_object_literal.html new file mode 100644 index 000000000..07a17cb42 --- /dev/null +++ b/discouraged_object_literal.html @@ -0,0 +1,360 @@ + + + + discouraged_object_literal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Object Literal

+ +

Prefer initializers over object literals.

+ +
    +
  • Identifier: discouraged_object_literal
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, image_literal: true, color_literal: true
  • +
+

Non Triggering Examples

+
let image = UIImage(named: aVariable)
+
+
let image = UIImage(named: "interpolated \(variable)")
+
+
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
+
+
let image = NSImage(named: aVariable)
+
+
let image = NSImage(named: "interpolated \(variable)")
+
+
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
+
+

Triggering Examples

+
let image = ↓#imageLiteral(resourceName: "image.jpg")
+
+
let color = ↓#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_optional_boolean.html b/discouraged_optional_boolean.html new file mode 100644 index 000000000..0b3e04c10 --- /dev/null +++ b/discouraged_optional_boolean.html @@ -0,0 +1,728 @@ + + + + discouraged_optional_boolean Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Optional Boolean

+ +

Prefer non-optional booleans over optional booleans.

+ +
    +
  • Identifier: discouraged_optional_boolean
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var foo: Bool
+
+
var foo: [String: Bool]
+
+
var foo: [Bool]
+
+
let foo: Bool = true
+
+
let foo: Bool = false
+
+
let foo: [String: Bool] = [:]
+
+
let foo: [Bool] = []
+
+
var foo: Bool { return true }
+
+
let foo: Bool { return false }()
+
+
func foo() -> Bool {}
+
+
func foo() -> [String: Bool] {}
+
+
func foo() -> ([Bool]) -> String {}
+
+
func foo(input: Bool = true) {}
+
+
func foo(input: [String: Bool] = [:]) {}
+
+
func foo(input: [Bool] = []) {}
+
+
class Foo {
+    func foo() -> Bool {}
+}
+
+
class Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
class Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
struct Foo {
+    func foo() -> Bool {}
+}
+
+
struct Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
struct Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
enum Foo {
+    func foo() -> Bool {}
+}
+
+
enum Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
enum Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
class Foo {
+    func foo(input: Bool = true) {}
+}
+
+
class Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
class Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+
struct Foo {
+    func foo(input: Bool = true) {}
+}
+
+
struct Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
struct Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+
enum Foo {
+    func foo(input: Bool = true) {}
+}
+
+
enum Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
enum Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+

Triggering Examples

+
var foo: ↓Bool?
+
+
var foo: [String: ↓Bool?]
+
+
var foo: [↓Bool?]
+
+
let foo: ↓Bool? = nil
+
+
let foo: [String: ↓Bool?] = [:]
+
+
let foo: [↓Bool?] = []
+
+
let foo = ↓Optional.some(false)
+
+
let foo = ↓Optional.some(true)
+
+
var foo: ↓Bool? { return nil }
+
+
let foo: ↓Bool? { return nil }()
+
+
func foo() -> ↓Bool? {}
+
+
func foo() -> [String: ↓Bool?] {}
+
+
func foo() -> [↓Bool?] {}
+
+
static func foo() -> ↓Bool? {}
+
+
static func foo() -> [String: ↓Bool?] {}
+
+
static func foo() -> [↓Bool?] {}
+
+
func foo() -> (↓Bool?) -> String {}
+
+
func foo() -> ([Int]) -> ↓Bool? {}
+
+
func foo(input: ↓Bool?) {}
+
+
func foo(input: [String: ↓Bool?]) {}
+
+
func foo(input: [↓Bool?]) {}
+
+
static func foo(input: ↓Bool?) {}
+
+
static func foo(input: [String: ↓Bool?]) {}
+
+
static func foo(input: [↓Bool?]) {}
+
+
class Foo {
+    var foo: ↓Bool?
+}
+
+
class Foo {
+    var foo: [String: ↓Bool?]
+}
+
+
class Foo {
+    let foo: ↓Bool? = nil
+}
+
+
class Foo {
+    let foo: [String: ↓Bool?] = [:]
+}
+
+
class Foo {
+    let foo: [↓Bool?] = []
+}
+
+
struct Foo {
+    var foo: ↓Bool?
+}
+
+
struct Foo {
+    var foo: [String: ↓Bool?]
+}
+
+
struct Foo {
+    let foo: ↓Bool? = nil
+}
+
+
struct Foo {
+    let foo: [String: ↓Bool?] = [:]
+}
+
+
struct Foo {
+    let foo: [↓Bool?] = []
+}
+
+
class Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
class Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
struct Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
struct Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
enum Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
enum Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
class Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
class Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
class Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
class Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
class Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
class Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
class Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
class Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
struct Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
struct Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
struct Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
struct Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
struct Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
struct Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
struct Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
struct Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
enum Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
enum Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
enum Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
enum Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
enum Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
enum Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
enum Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
enum Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
class Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
class Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
class Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
class Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
class Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
class Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
struct Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
struct Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
struct Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
struct Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
struct Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
struct Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
enum Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
enum Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
enum Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
enum Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
enum Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
enum Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
_ = ↓Bool?.values()
+
+ +
+
+ + +
+
+ + + diff --git a/discouraged_optional_collection.html b/discouraged_optional_collection.html new file mode 100644 index 000000000..36dea304a --- /dev/null +++ b/discouraged_optional_collection.html @@ -0,0 +1,908 @@ + + + + discouraged_optional_collection Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Optional Collection

+ +

Prefer empty collection over optional collection.

+ +
    +
  • Identifier: discouraged_optional_collection
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var foo: [Int]
+
+
var foo: [String: Int]
+
+
var foo: Set<String>
+
+
var foo: [String: [String: Int]]
+
+
let foo: [Int] = []
+
+
let foo: [String: Int] = [:]
+
+
let foo: Set<String> = []
+
+
let foo: [String: [String: Int]] = [:]
+
+
var foo: [Int] { return [] }
+
+
func foo() -> [Int] {}
+
+
func foo() -> [String: String] {}
+
+
func foo() -> Set<Int> {}
+
+
func foo() -> ([Int]) -> String {}
+
+
func foo(input: [String] = []) {}
+
+
func foo(input: [String: String] = [:]) {}
+
+
func foo(input: Set<String> = []) {}
+
+
class Foo {
+    func foo() -> [Int] {}
+}
+
+
class Foo {
+    func foo() -> [String: String] {}
+}
+
+
class Foo {
+    func foo() -> Set<Int> {}
+}
+
+
class Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
struct Foo {
+    func foo() -> [Int] {}
+}
+
+
struct Foo {
+    func foo() -> [String: String] {}
+}
+
+
struct Foo {
+    func foo() -> Set<Int> {}
+}
+
+
struct Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
enum Foo {
+    func foo() -> [Int] {}
+}
+
+
enum Foo {
+    func foo() -> [String: String] {}
+}
+
+
enum Foo {
+    func foo() -> Set<Int> {}
+}
+
+
enum Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
class Foo {
+    func foo(input: [String] = []) {}
+}
+
+
class Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
class Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+
struct Foo {
+    func foo(input: [String] = []) {}
+}
+
+
struct Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
struct Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+
enum Foo {
+    func foo(input: [String] = []) {}
+}
+
+
enum Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
enum Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+

Triggering Examples

+
↓var foo: [Int]?
+
+
↓var foo: [String: Int]?
+
+
↓var foo: Set<String>?
+
+
↓let foo: [Int]? = nil
+
+
↓let foo: [String: Int]? = nil
+
+
↓let foo: Set<String>? = nil
+
+
↓var foo: [Int]? { return nil }
+
+
↓let foo: [Int]? { return nil }()
+
+
func ↓foo() -> [T]? {}
+
+
func ↓foo() -> [String: String]? {}
+
+
func ↓foo() -> [String: [String: String]]? {}
+
+
func ↓foo() -> [String: [String: String]?] {}
+
+
func ↓foo() -> Set<Int>? {}
+
+
static func ↓foo() -> [T]? {}
+
+
static func ↓foo() -> [String: String]? {}
+
+
static func ↓foo() -> [String: [String: String]]? {}
+
+
static func ↓foo() -> [String: [String: String]?] {}
+
+
static func ↓foo() -> Set<Int>? {}
+
+
func ↓foo() -> ([Int]?) -> String {}
+
+
func ↓foo() -> ([Int]) -> [String]? {}
+
+
func foo(↓input: [String: String]?) {}
+
+
func foo(↓input: [String: [String: String]]?) {}
+
+
func foo(↓input: [String: [String: String]?]) {}
+
+
func foo(↓↓input: [String: [String: String]?]?) {}
+
+
func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+
+
func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+
+
static func foo(↓input: [String: String]?) {}
+
+
static func foo(↓input: [String: [String: String]]?) {}
+
+
static func foo(↓input: [String: [String: String]?]) {}
+
+
static func foo(↓↓input: [String: [String: String]?]?) {}
+
+
static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+
+
static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+
+
class Foo {
+    ↓var foo: [Int]?
+}
+
+
class Foo {
+    ↓var foo: [String: Int]?
+}
+
+
class Foo {
+    ↓var foo: Set<String>?
+}
+
+
class Foo {
+    ↓let foo: [Int]? = nil
+}
+
+
class Foo {
+    ↓let foo: [String: Int]? = nil
+}
+
+
class Foo {
+    ↓let foo: Set<String>? = nil
+}
+
+
struct Foo {
+    ↓var foo: [Int]?
+}
+
+
struct Foo {
+    ↓var foo: [String: Int]?
+}
+
+
struct Foo {
+    ↓var foo: Set<String>?
+}
+
+
struct Foo {
+    ↓let foo: [Int]? = nil
+}
+
+
struct Foo {
+    ↓let foo: [String: Int]? = nil
+}
+
+
struct Foo {
+    ↓let foo: Set<String>? = nil
+}
+
+
class Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
class Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
class Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
class Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
struct Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
struct Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
struct Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
struct Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
enum Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
enum Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
enum Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
enum Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
class Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
class Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
class Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
class Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
class Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
struct Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
struct Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
struct Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
struct Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
enum Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
enum Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
enum Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
enum Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
class Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
class Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
class Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
class Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
class Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
class Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
class Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
class Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
class Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
struct Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
struct Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
struct Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
struct Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
struct Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
struct Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
struct Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
struct Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
enum Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
enum Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
enum Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
enum Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
enum Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
enum Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
enum Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
enum Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Info.plist b/docsets/SwiftLintFramework.docset/Contents/Info.plist new file mode 100644 index 000000000..6209ef44f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleIdentifier + com.jazzy.swiftlintframework + CFBundleName + SwiftLintFramework + DocSetPlatformFamily + swiftlintframework + isDashDocset + + dashIndexFilePath + index.html + isJavaScriptEnabled + + DashDocSetFamily + dashtoc + DashDocSetFallbackURL + https://realm.github.io/SwiftLint/ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes.html new file mode 100644 index 000000000..478f9a404 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes.html @@ -0,0 +1,464 @@ + + + + Classes Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Classes

+

The following classes are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + SwiftLintFile + +
    +
    +
    +
    +
    +
    +

    A unit of Swift source code, either on disk or in memory.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SwiftLintFile
    +
    extension SwiftLintFile: Equatable, Hashable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + LinterCache + +
    +
    +
    +
    +
    +
    +

    A persisted cache for storing and retrieving linter results.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class LinterCache
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleStorage + +
    +
    +
    +
    +
    +
    +

    A storage mechanism for aggregating the results of CollectingRules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public class RuleStorage : CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    open class ViolationsSyntaxVisitor : SyntaxVisitor
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/LinterCache.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/LinterCache.html new file mode 100644 index 000000000..26be504d8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/LinterCache.html @@ -0,0 +1,446 @@ + + + + LinterCache Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

LinterCache

+
+
+ +
public final class LinterCache
+ +
+
+

A persisted cache for storing and retrieving linter results.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(configuration: Configuration, fileManager: LintableFileManager = FileManager.default)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + configuration + + +
    +

    The SwiftLint configuration for which this cache will be used.

    +
    +
    + + fileManager + + +
    +

    The file manager to use to read lintable file information.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + save() + +
    +
    +
    +
    +
    +
    +

    Persists the cache to disk.

    +
    +

    Throws

    + Throws if the linter cache doesn’t have a location value, if the cache couldn’t be serialized, or if + the contents couldn’t be written to disk. + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func save() throws
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/RuleStorage.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/RuleStorage.html new file mode 100644 index 000000000..d09fec165 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/RuleStorage.html @@ -0,0 +1,408 @@ + + + + RuleStorage Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleStorage

+
+
+ +
public class RuleStorage : CustomStringConvertible
+ +
+
+

A storage mechanism for aggregating the results of CollectingRules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    Creates a RuleStorage with no initial stored data.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html new file mode 100644 index 000000000..446587bc2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/SwiftLintFile.html @@ -0,0 +1,769 @@ + + + + SwiftLintFile Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintFile

+
+
+ +
public final class SwiftLintFile
+
extension SwiftLintFile: Equatable, Hashable
+ +
+
+

A unit of Swift source code, either on disk or in memory.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(file:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile with a SourceKitten File.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: File)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    A file from SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(path:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile by specifying its path on disk. +Fails if the file does not exist.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init?(path: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The path to a file on disk. Relative and absolute paths supported.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this +one does not read its contents immediately, but rather traps at runtime when attempting to access its contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(pathDeferringReading path: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The path to a file on disk. Relative and absolute paths supported.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(contents:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public convenience init(contents: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + contents + + +
    +

    The contents of the file.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + path + +
    +
    +
    +
    +
    +
    +

    The path on disk for this file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var path: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + contents + +
    +
    +
    +
    +
    +
    +

    The file’s contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var contents: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + stringView + +
    +
    +
    +
    +
    +
    +

    A string view into the contents of this file optimized for string manipulation operations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var stringView: StringView { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + lines + +
    +
    +
    +
    +
    +
    +

    The parsed lines for this file’s contents.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var lines: [Line] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + invalidateCache() + +
    +
    +
    +
    +
    +
    +

    Invalidates all cached data for this file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func invalidateCache()
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable Conformance +

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: SwiftLintFile, rhs: SwiftLintFile) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html new file mode 100644 index 000000000..ff16e9b2e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Classes/ViolationsSyntaxVisitor.html @@ -0,0 +1,581 @@ + + + + ViolationsSyntaxVisitor Class Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationsSyntaxVisitor

+
+
+ +
open class ViolationsSyntaxVisitor : SyntaxVisitor
+ +
+
+

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ActorDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ExtensionDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + visit(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    override open func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums.html new file mode 100644 index 000000000..f7c5fa9de --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums.html @@ -0,0 +1,593 @@ + + + + Enumerations Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Enumerations

+

The following enumerations are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html new file mode 100644 index 000000000..d6a81f251 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/AccessControlLevel.html @@ -0,0 +1,563 @@ + + + + AccessControlLevel Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

AccessControlLevel

+
+
+ +
public enum AccessControlLevel : String, CustomStringConvertible
+
extension AccessControlLevel: Comparable
+ +
+
+

The accessibility of a Swift source declaration.

+ + + +
+
+ +
+
+
+
    +
  • +
    + + + + private + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s immediate lexical scope.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `private` = "source.lang.swift.accessibility.private"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + fileprivate + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `fileprivate` = "source.lang.swift.accessibility.fileprivate"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + internal + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `internal` = "source.lang.swift.accessibility.internal"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + public + +
    +
    +
    +
    +
    +
    +

    Accessible by the declaration’s same program.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `public` = "source.lang.swift.accessibility.public"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + open + +
    +
    +
    +
    +
    +
    +

    Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case open = "source.lang.swift.accessibility.open"
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: AccessControlLevel, rhs: AccessControlLevel) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ConfigurationError.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ConfigurationError.html new file mode 100644 index 000000000..d54467836 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ConfigurationError.html @@ -0,0 +1,469 @@ + + + + ConfigurationError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ConfigurationError

+
+
+ +
public enum ConfigurationError : Error, Equatable
+ +
+
+

All possible configuration errors.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + unknownConfiguration + +
    +
    +
    +
    +
    +
    +

    The configuration didn’t match internal expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case unknownConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The configuration had both match_kind and excluded_match_kind parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case ambiguousMatchKindParameters
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generic(_:) + +
    +
    +
    +
    +
    +
    +

    A generic configuration error specified by a string.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case generic(String)
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    The initial configuration file was not found.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case initialFileNotFound(path: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html new file mode 100644 index 000000000..eabf073f8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ExecutableInfo.html @@ -0,0 +1,379 @@ + + + + ExecutableInfo Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ExecutableInfo

+
+
+ +
public enum ExecutableInfo
+ +
+
+

Information about this executable.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + buildID + +
    +
    +
    +
    +
    +
    +

    A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let buildID: String?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html new file mode 100644 index 000000000..ef7757c37 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleIdentifier.html @@ -0,0 +1,567 @@ + + + + RuleIdentifier Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleIdentifier

+
+
+ +
public enum RuleIdentifier : Hashable, ExpressibleByStringLiteral
+ +
+
+

An identifier representing a SwiftLint rule, or all rules.

+ + +
+
+ +
+
+
+
+ + +
+ +

Values +

+
+
+
    +
  • +
    + + + + all + +
    +
    +
    +
    +
    +
    +

    Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in +disabling all SwiftLint rules in a given file by adding a // swiftlint:disable all comment at the top of the +file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case all
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + single(identifier:) + +
    +
    +
    +
    +
    +
    +

    Represents a single SwiftLint rule with the specified identifier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case single(identifier: String)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Properties +

+
+
+
    +
  • +
    + + + + stringRepresentation + +
    +
    +
    +
    +
    +
    +

    The spelling of the string for this idenfitier.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var stringRepresentation: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleIdentifier by its string representation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ value: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The string representation.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

ExpressibleByStringLiteral Conformance +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleKind.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleKind.html new file mode 100644 index 000000000..8855b8e7d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleKind.html @@ -0,0 +1,499 @@ + + + + RuleKind Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleKind

+
+
+ +
public enum RuleKind : String, Codable
+ +
+
+

All the possible rule kinds (categories).

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + lint + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate Swift source conventions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case lint
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + idiomatic + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate common practices in the Swift community.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case idiomatic
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + style + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate stylistic choices.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case style
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + metrics + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate magnitudes or measurements of Swift source.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case metrics
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + performance + +
    +
    +
    +
    +
    +
    +

    Describes rules that validate that code patterns with poor performance are avoided.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case performance
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleListError.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleListError.html new file mode 100644 index 000000000..02b2755cb --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/RuleListError.html @@ -0,0 +1,379 @@ + + + + RuleListError Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleListError

+
+
+ +
public enum RuleListError : Error
+ +
+
+

All possible rule list configuration errors.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The rule list contains more than one configuration for the specified rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case duplicatedConfigurations(rule: Rule.Type)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html new file mode 100644 index 000000000..3e411d7b5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/SwiftExpressionKind.html @@ -0,0 +1,559 @@ + + + + SwiftExpressionKind Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftExpressionKind

+
+
+ +
public enum SwiftExpressionKind : String
+ +
+
+

The kind of expression for a contiguous set of Swift source tokens.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html new file mode 100644 index 000000000..057a31178 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Enums/ViolationSeverity.html @@ -0,0 +1,451 @@ + + + + ViolationSeverity Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationSeverity

+
+
+ +
public enum ViolationSeverity : String, Comparable, Codable
+ +
+
+

The magnitude of a StyleViolation.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + warning + +
    +
    +
    +
    +
    +
    +

    Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case warning
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + error + +
    +
    +
    +
    +
    +
    +

    Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case error
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparable +

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: ViolationSeverity, rhs: ViolationSeverity) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions.html new file mode 100644 index 000000000..85cd1eafe --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions.html @@ -0,0 +1,393 @@ + + + + Extensions Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Extensions

+

The following extensions are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/FileManager.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/FileManager.html new file mode 100644 index 000000000..93a714784 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/FileManager.html @@ -0,0 +1,403 @@ + + + + FileManager Extension Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

FileManager

+
+
+ +
extension FileManager: LintableFileManager
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/String.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/String.html new file mode 100644 index 000000000..4666b0cd2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Extensions/String.html @@ -0,0 +1,462 @@ + + + + String Extension Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

String

+
+
+ +
extension String
+ +
+
+ +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a new string, converting the path to a canonical absolute path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func absolutePathStandardized() -> String
    + +
    +
    +
    +

    Return Value

    +

    A new String.

    +
    + +
    +
    +
  • +
  • +
    + + + + countOccurrences(of:) + +
    +
    +
    +
    +
    +
    +

    Count the number of occurrences of the given character in self

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func countOccurrences(of character: Character) -> Int
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + character + + +
    +

    Character to count

    +
    +
    +
    +
    +

    Return Value

    +

    Number of times character occurs in self

    +
    + +
    +
    +
  • +
  • +
    + + + + path(relativeTo:) + +
    +
    +
    +
    +
    +
    +

    If self is a path, this method can be used to get a path expression relative to a root directory

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func path(relativeTo rootDirectory: String) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Functions.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Functions.html new file mode 100644 index 000000000..8c66fb720 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Functions.html @@ -0,0 +1,522 @@ + + + + Functions Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Functions

+

The following functions are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + queuedPrint(_:) + +
    +
    +
    +
    +
    +
    +

    A thread-safe version of Swift’s standard print().

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedPrint<T>(_ object: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + object + + +
    +

    Object to print.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + queuedPrintError(_:) + +
    +
    +
    +
    +
    +
    +

    A thread-safe, newline-terminated version of fputs(..., stderr).

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedPrintError(_ string: String)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + string + + +
    +

    String to print.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A thread-safe, newline-terminated version of fatalError(...) that doesn’t leak +the source path from the compiled binary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func queuedFatalError(_ string: String, file: StaticString = #file, line: UInt = #line) -> Never
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any +known reporters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func reporterFrom(identifier: String) -> Reporter.Type
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + identifier + + +
    +

    The identifier corresponding to the reporter.

    +
    +
    +
    +
    +

    Return Value

    +

    The reporter type.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Global Variables.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Global Variables.html new file mode 100644 index 000000000..b59ce3120 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Global Variables.html @@ -0,0 +1,369 @@ + + + + Global Variables Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Global Variables

+

The following global variables are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + primaryRuleList + +
    +
    +
    +
    +
    +
    +

    The rule list containing all available rules built into SwiftLint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let primaryRuleList: RuleList
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Guides.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Guides.html new file mode 100644 index 000000000..57cad68c2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Guides.html @@ -0,0 +1,2328 @@ + + + + Guides Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Guides

+

The following guides are available globally.

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols.html new file mode 100644 index 000000000..38e0c0b8a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols.html @@ -0,0 +1,772 @@ + + + + Protocols Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Protocols

+

The following protocols are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + LintableFileManager + +
    +
    +
    +
    +
    +
    +

    An interface for enumerating files that can be linted by SwiftLint.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol LintableFileManager
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ASTRule + +
    +
    +
    +
    +
    +
    +

    A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s +structure, validating the rule recursively in nested source bodies.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ASTRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnyCollectingRule + +
    +
    +
    +
    +
    +
    +

    Type-erased protocol used to check whether a rule is collectable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AnyCollectingRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollectingRule + +
    +
    +
    +
    +
    +
    +

    A rule that requires knowledge of all other files being linted.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol CollectingRule : AnyCollectingRule
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A rule that is user-configurable.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ConfigurationProviderRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Reporter + +
    +
    +
    +
    +
    +
    +

    An interface for reporting violations as strings.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Reporter : CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Rule + +
    +
    +
    +
    +
    +
    +

    An executable value that can identify issues (violations) in Swift source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + OptInRule + +
    +
    +
    +
    +
    +
    +

    A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol OptInRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SourceKitFreeRule + +
    +
    +
    +
    +
    +
    +

    A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SourceKitFreeRule : Rule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + AnalyzerRule + +
    +
    +
    +
    +
    +
    +

    A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like +static analysis than syntactic checks.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol AnalyzerRule : OptInRule
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleConfiguration + +
    +
    +
    +
    +
    +
    +

    A configuration value for a rule to allow users to modify its behavior.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol RuleConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A configuration for a rule that allows to configure at least the severity.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SeverityBasedRuleConfiguration : RuleConfiguration
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol ViolationsSyntaxRewriter : SyntaxRewriter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftSyntaxRule + +
    +
    +
    +
    +
    +
    +

    A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public protocol SwiftSyntaxRule : SourceKitFreeRule
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ASTRule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ASTRule.html new file mode 100644 index 000000000..2ef9c071d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ASTRule.html @@ -0,0 +1,613 @@ + + + + ASTRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ASTRule

+
+
+ +
public protocol ASTRule : Rule
+ +
+
+

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s +structure, validating the rule recursively in nested source bodies.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + KindType + +
    +
    +
    +
    +
    +
    +

    The kind of token being recursed over.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype KindType : RawRepresentable
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, kind: KindType, dictionary: SourceKittenDictionary) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + kind + + +
    +

    The kind of token being recursed over.

    +
    +
    + + dictionary + + +
    +

    The dictionary for an AST subset to validate.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + kind(from:) + +
    +
    +
    +
    +
    +
    +

    Get the kind from the specified dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func kind(from dictionary: SourceKittenDictionary) -> KindType?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + dictionary + + +
    +

    The SourceKittenDictionary representing the source structure from which to extract the + kind.

    +
    +
    +
    +
    +

    Return Value

    +

    The kind from the specified dictionary, if one was found.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:dictionary:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, dictionary: SourceKittenDictionary) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + dictionary + + +
    +

    The dictionary for an AST subset to validate.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html new file mode 100644 index 000000000..295440ea9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/AnalyzerRule.html @@ -0,0 +1,382 @@ + + + + AnalyzerRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

AnalyzerRule

+
+
+ +
public protocol AnalyzerRule : OptInRule
+ +
+
+

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like +static analysis than syntactic checks.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/CollectingRule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/CollectingRule.html new file mode 100644 index 000000000..c3dcdda2f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/CollectingRule.html @@ -0,0 +1,784 @@ + + + + CollectingRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CollectingRule

+
+
+ +
public protocol CollectingRule : AnyCollectingRule
+ +
+
+

A rule that requires knowledge of all other files being linted.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + FileInfo + +
    +
    +
    +
    +
    +
    +

    The kind of information to collect for each file being linted for this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    associatedtype FileInfo
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, compilerArguments: [String]) -> FileInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    The collected file information.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:) + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file, to be analyzed by a CollectedLinter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile) -> FileInfo
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    +
    +
    +

    Return Value

    +

    The collected file information.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:collectedInfo:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile: FileInfo],
    +              compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + collectedInfo + + +
    +

    All collected info for all files.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, collectedInfo: [SwiftLintFile : FileInfo]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + collectedInfo + + +
    +

    All collected info for all files.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:into:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:using:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:compilerArguments:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ConfigurationProviderRule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ConfigurationProviderRule.html new file mode 100644 index 000000000..ddd2924d3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ConfigurationProviderRule.html @@ -0,0 +1,505 @@ + + + + ConfigurationProviderRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ConfigurationProviderRule

+
+
+ +
public protocol ConfigurationProviderRule : Rule
+ +
+
+

A rule that is user-configurable.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/LintableFileManager.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/LintableFileManager.html new file mode 100644 index 000000000..e276bafb8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/LintableFileManager.html @@ -0,0 +1,470 @@ + + + + LintableFileManager Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

LintableFileManager

+
+
+ +
public protocol LintableFileManager
+ +
+
+

An interface for enumerating files that can be linted by SwiftLint.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns all files that can be linted in the specified path. If the path is relative, it will be appended to the +specified root path, or currentt working directory if no root directory is specified.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func filesToLint(inPath path: String, rootDirectory: String?) -> [String]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + path + + +
    +

    The path in which lintable files should be found.

    +
    +
    + + rootDirectory + + +
    +

    The parent directory for the specified path. If none is provided, the current working + directory will be used.

    +
    +
    +
    +
    +

    Return Value

    +

    Files to lint.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the date when the file at the specified path was last modified. Returns nil if the file cannot be +found or its last modification date cannot be determined.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func modificationDate(forFileAtPath path: String) -> Date?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + path + + +
    +

    The file whose modification date should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    A date, if one was determined.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Reporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Reporter.html new file mode 100644 index 000000000..deb88e528 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Reporter.html @@ -0,0 +1,463 @@ + + + + Reporter Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Reporter

+
+
+ +
public protocol Reporter : CustomStringConvertible
+ +
+
+

An interface for reporting violations as strings.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    +

    The unique identifier for this reporter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var identifier: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    +

    Whether or not this reporter can output incrementally as violations are found or if all violations must be +collected before generating the report.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var isRealtime: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    +

    Return a string with the report for the specified violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + violations + + +
    +

    The violations to report.

    +
    +
    +
    +
    +

    Return Value

    +

    The report.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Rule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Rule.html new file mode 100644 index 000000000..7298ed7d0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/Rule.html @@ -0,0 +1,853 @@ + + + + Rule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Rule

+
+
+ +
public protocol Rule
+ +
+
+

An executable value that can identify issues (violations) in Swift source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A verbose description of many of this rule’s properties.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    static var description: RuleDescription { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A description of how this rule has been configured to run.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var configurationDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init() + +
    +
    +
    +
    +
    +
    +

    A default initializer for rules. All rules need to be trivially initializable.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init()
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(configuration:) + +
    +
    +
    +
    +
    +
    +

    Creates a rule by applying its configuration.

    +
    +

    Throws

    +

    Throws if the configuration didn’t match the expected format.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(configuration: Any) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    The untyped configuration value to apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and returns any violations to the rule’s expectations.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file and returns any violations to the rule’s expectations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
  • +
    + + + + isEqualTo(_:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Whether or not the specified rule is equivalent to the current rule.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func isEqualTo(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule value to compare against.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether or not the specified rule is equivalent to the current rule.

    +
    + +
    +
    +
  • +
  • +
    + + + + collectInfo(for:into:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

    +
    +

    Note

    +

    This function is called by the linter and is always implemented in extensions.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func collectInfo(for file: SwiftLintFile, into storage: RuleStorage, compilerArguments: [String])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to collect info.

    +
    +
    + + storage + + +
    +

    The storage object where collected info should be saved.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:using:compilerArguments:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s +expectations.

    +
    +

    Note

    +

    This function is called by the linter and is always implemented in extensions.

    + +
    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile, using storage: RuleStorage, compilerArguments: [String]) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to execute the rule.

    +
    +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments needed to compile this file.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations to the rule’s expectations.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html new file mode 100644 index 000000000..e6f1036c3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/RuleConfiguration.html @@ -0,0 +1,486 @@ + + + + RuleConfiguration Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleConfiguration

+
+
+ +
public protocol RuleConfiguration
+ +
+
+

A configuration value for a rule to allow users to modify its behavior.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + consoleDescription + +
    +
    +
    +
    +
    +
    +

    A human-readable description for this configuration and its applied values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var consoleDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + apply(configuration:) + +
    +
    +
    +
    +
    +
    +

    Apply an untyped configuration to the current value.

    +
    +

    Throws

    +

    Throws if the configuration is not in the expected format.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    mutating func apply(configuration: Any) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + configuration + + +
    +

    The untyped configuration value to apply.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + isEqualTo(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified configuration is equivalent to the current value.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func isEqualTo(_ ruleConfiguration: RuleConfiguration) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + ruleConfiguration + + +
    +

    The rule configuration to compare against.

    +
    +
    +
    +
    +

    Return Value

    +

    Whether the specified configuration is equivalent to the current value.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html new file mode 100644 index 000000000..b41e1f884 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SeverityBasedRuleConfiguration.html @@ -0,0 +1,412 @@ + + + + SeverityBasedRuleConfiguration Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SeverityBasedRuleConfiguration

+
+
+ +
public protocol SeverityBasedRuleConfiguration : RuleConfiguration
+ +
+
+

A configuration for a rule that allows to configure at least the severity.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + severityConfiguration + +
    +
    +
    +
    +
    +
    +

    The configuration of a rule’s severity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var severityConfiguration: SeverityConfiguration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + + + Extension method + +
    +
    +
    +
    +
    +
    +

    The severity of a rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var severity: ViolationSeverity { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html new file mode 100644 index 000000000..938749efc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/SwiftSyntaxRule.html @@ -0,0 +1,624 @@ + + + + SwiftSyntaxRule Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftSyntaxRule

+
+
+ +
public protocol SwiftSyntaxRule : SourceKitFreeRule
+ +
+
+

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + makeVisitor(file:) + +
    +
    +
    +
    +
    +
    +

    Produce a ViolationsSyntaxVisitor for the given file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeVisitor(file: SwiftLintFile) -> ViolationsSyntaxVisitor
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to produce the visitor.

    +
    +
    +
    +
    +

    Return Value

    +

    A ViolationsSyntaxVisitor for the given file.

    +
    + +
    +
    +
  • +
  • +
    + + + + makeViolation(file:violation:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Produce a violation for the given file and absolute position.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func makeViolation(file: SwiftLintFile, violation: ReasonedRuleViolation) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for which to produce the violation.

    +
    +
    + + violation + + +
    +

    A violation in the file.

    +
    +
    +
    +
    +

    Return Value

    +

    A violation for the given file and absolute position.

    +
    + +
    +
    +
  • +
  • +
    + + + + preprocess(syntaxTree:) + + + Default implementation + +
    +
    +
    +
    +
    +
    +

    Gives a chance for the rule to do some pre-processing on the syntax tree. +One typical example is using SwiftOperators to “fold” the tree, resolving operators precedence. +By default, it just returns the same syntaxTree.

    + +
    +

    Default Implementation

    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func preprocess(syntaxTree: SourceFileSyntax) -> SourceFileSyntax?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + syntaxTree + + +
    +

    The syntax tree to run pre-processing on

    +
    +
    +
    +
    +

    Return Value

    +

    The tree that will be used to check for violations. If nil, this rule will return no violations.

    +
    + +
    +
    +
  • +
  • +
    + + + + disabledRegions(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    +

    Returns the source ranges in the specified file where this rule is disabled.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func disabledRegions(file: SwiftLintFile) -> [SourceRange]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file to get regions.

    +
    +
    +
    +
    +

    Return Value

    +

    The source ranges in the specified file where this rule is disabled.

    +
    + +
    +
    +
  • +
  • +
    + + + + validate(file:) + + + Extension method + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func validate(file: SwiftLintFile) -> [StyleViolation]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ViolationsSyntaxRewriter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ViolationsSyntaxRewriter.html new file mode 100644 index 000000000..526befe0b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Protocols/ViolationsSyntaxRewriter.html @@ -0,0 +1,379 @@ + + + + ViolationsSyntaxRewriter Protocol Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ViolationsSyntaxRewriter

+
+
+ +
public protocol ViolationsSyntaxRewriter : SyntaxRewriter
+ +
+
+

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + correctionPositions + +
    +
    +
    +
    +
    +
    +

    Positions in a source file where corrections were applied.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    var correctionPositions: [AbsolutePosition] { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Reporters.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Reporters.html new file mode 100644 index 000000000..ba1e33d98 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Reporters.html @@ -0,0 +1,618 @@ + + + + Reporters Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Reporters

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Rules.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Rules.html new file mode 100644 index 000000000..e97805017 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Rules.html @@ -0,0 +1,347 @@ + + + + Rules Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Rules

+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs.html new file mode 100644 index 000000000..01766a0cf --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs.html @@ -0,0 +1,1043 @@ + + + + Structures Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Structures

+

The following structures are available globally.

+ +
+
+ +
+
+
+
    +
  • +
    + + + + RuleListDocumentation + +
    +
    +
    +
    +
    +
    +

    User-facing documentation for a SwiftLint RuleList.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleListDocumentation
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Configuration + +
    +
    +
    +
    +
    +
    +

    The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Configuration
    +
    extension Configuration: Hashable
    +
    extension Configuration: CustomStringConvertible
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    A collection of keys and values as parsed out of SourceKit, with many conveniences for accessing SwiftLint-specific +values.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SourceKittenDictionary
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Command + +
    +
    +
    +
    +
    +
    +

    A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Command : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Example + +
    +
    +
    +
    +
    +
    +

    Captures code and context information for an example of a triggering or +non-triggering style

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Example
    +
    extension Example: Hashable
    +
    extension Example: Comparable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Linter + +
    +
    +
    +
    +
    +
    +

    Represents a file that can be linted for style violations and corrections after being collected.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Linter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + CollectedLinter + +
    +
    +
    +
    +
    +
    +

    Represents a file that can compute style violations and corrections for a list of rules.

    + +

    A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct CollectedLinter
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Location + +
    +
    +
    +
    +
    +
    +

    The placement of a segment of Swift in a collection of source files.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Location : CustomStringConvertible, Comparable, Codable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Region + +
    +
    +
    +
    +
    +
    +

    A contiguous region of Swift source code.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Region : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleDescription + +
    +
    +
    +
    +
    +
    +

    A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleDescription : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleList + +
    +
    +
    +
    +
    +
    +

    A list of available SwiftLint rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleList
    +
    extension RuleList: Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + RuleParameter + +
    +
    +
    +
    +
    +
    +

    A configuration parameter for rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct RuleParameter<T> : Equatable where T : Equatable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + StyleViolation + +
    +
    +
    +
    +
    +
    +

    A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct StyleViolation : CustomStringConvertible, Equatable, Codable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftLintSyntaxMap + +
    +
    +
    +
    +
    +
    +

    Represents a Swift file’s syntax information.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftLintSyntaxMap
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftLintSyntaxToken + +
    +
    +
    +
    +
    +
    +

    A SwiftLint-aware Swift syntax token.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftLintSyntaxToken
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + SwiftVersion + +
    +
    +
    +
    +
    +
    +

    A value describing the version of the Swift compiler.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct SwiftVersion : RawRepresentable, Codable, Comparable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Version + +
    +
    +
    +
    +
    +
    +

    A type describing the SwiftLint version.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public struct Version
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

YamlParser +

+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CSVReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CSVReporter.html new file mode 100644 index 000000000..444d40d74 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CSVReporter.html @@ -0,0 +1,474 @@ + + + + CSVReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CSVReporter

+
+
+ +
public struct CSVReporter : Reporter
+ +
+
+

Reports violations as a newline-separated string of comma-separated values (CSV).

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CheckstyleReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CheckstyleReporter.html new file mode 100644 index 000000000..cb6c95a9e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CheckstyleReporter.html @@ -0,0 +1,475 @@ + + + + CheckstyleReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CheckstyleReporter

+
+
+ +
public struct CheckstyleReporter : Reporter
+ +
+
+

Reports violations as XML conforming to the Checkstyle specification, as defined here: +https://www.jetbrains.com/help/teamcity/xml-report-processing.html

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CodeClimateReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CodeClimateReporter.html new file mode 100644 index 000000000..c0c15d564 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CodeClimateReporter.html @@ -0,0 +1,474 @@ + + + + CodeClimateReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CodeClimateReporter

+
+
+ +
public struct CodeClimateReporter : Reporter
+ +
+
+

Reports violations as a JSON array in Code Climate format.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CollectedLinter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CollectedLinter.html new file mode 100644 index 000000000..e846f01cb --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/CollectedLinter.html @@ -0,0 +1,549 @@ + + + + CollectedLinter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

CollectedLinter

+
+
+ +
public struct CollectedLinter
+ +
+
+

Represents a file that can compute style violations and corrections for a list of rules.

+ +

A CollectedLinter is only created after a Linter has run its collection steps in Linter.collect(into:).

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file to lint with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: SwiftLintFile
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Computes or retrieves style violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func styleViolations(using storage: RuleStorage) -> [StyleViolation]
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations found by this linter.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Computes or retrieves style violations and the time spent executing each rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func styleViolationsAndRuleTimes(using storage: RuleStorage)
    +    -> ([StyleViolation], [(id: String, time: Double)])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object containing all collected info.

    +
    +
    +
    +
    +

    Return Value

    +

    All style violations found by this linter, and the time spent executing each rule.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Formats the file associated with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func format(useTabs: Bool, indentWidth: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + useTabs + + +
    +

    Should the file be formatted using tabs?

    +
    +
    + + indentWidth + + +
    +

    How many spaces should be used per indentation level.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command.html new file mode 100644 index 000000000..b9eb45bf0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command.html @@ -0,0 +1,596 @@ + + + + Command Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Command

+
+
+ +
public struct Command : Equatable
+ +
+
+

A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + Action + +
    +
    +
    +
    +
    +
    +

    The action (verb) that SwiftLint should perform when interpreting this command.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Action : String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + Modifier + +
    +
    +
    +
    +
    +
    +

    The modifier for a command, used to modify its scope.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public enum Modifier : String
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a command based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(action: Action, ruleIdentifiers: Set<RuleIdentifier>, line: Int = 0,
    +            character: Int? = nil, modifier: Modifier? = nil, trailingComment: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + action + + +
    +

    This command’s action.

    +
    +
    + + ruleIdentifiers + + +
    +

    The identifiers for the rules associated with this command.

    +
    +
    + + line + + +
    +

    The line in the source file where this command is defined.

    +
    +
    + + character + + +
    +

    The character offset within the line in the source file where this command is + defined.

    +
    +
    + + modifier + + +
    +

    This command’s modifier, if any.

    +
    +
    + + trailingComment + + +
    +

    The comment following this command’s - delimiter, if any.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a command based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init?(actionString: String, line: Int, character: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + actionString + + +
    +

    The string in the command’s definition describing its action.

    +
    +
    + + line + + +
    +

    The line in the source file where this command is defined.

    +
    +
    + + character + + +
    +

    The character offset within the line in the source file where this command is + defined.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Action.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Action.html new file mode 100644 index 000000000..681c59326 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Action.html @@ -0,0 +1,409 @@ + + + + Action Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Action

+
+
+ +
public enum Action : String
+ +
+
+

The action (verb) that SwiftLint should perform when interpreting this command.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + enable + +
    +
    +
    +
    +
    +
    +

    The rule(s) associated with this command should be enabled by the SwiftLint engine.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case enable
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + disable + +
    +
    +
    +
    +
    +
    +

    The rule(s) associated with this command should be disabled by the SwiftLint engine.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case disable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Modifier.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Modifier.html new file mode 100644 index 000000000..a64f662c7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Command/Modifier.html @@ -0,0 +1,439 @@ + + + + Modifier Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Modifier

+
+
+ +
public enum Modifier : String
+ +
+
+

The modifier for a command, used to modify its scope.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + previous + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the line preceding its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case previous
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + this + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the same line as its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case this
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + next + +
    +
    +
    +
    +
    +
    +

    The command should only apply to the line following its definition.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case next
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration.html new file mode 100644 index 000000000..2dc14010d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration.html @@ -0,0 +1,1559 @@ + + + + Configuration Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Configuration

+
+
+ +
public struct Configuration
+
extension Configuration: Hashable
+
extension Configuration: CustomStringConvertible
+ +
+
+

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

+ + +
+
+ +
+
+
+
+ + +
+ +

Properties: Static +

+
+
+
    +
  • +
    + + + + default + +
    +
    +
    +
    +
    +
    +

    The default Configuration resulting from an empty configuration file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static var `default`: Configuration { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + defaultFileName + +
    +
    +
    +
    +
    +
    +

    The default file name to look for user-defined configurations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let defaultFileName: String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public Instance +

+
+
+
    +
  • +
    + + + + includedPaths + +
    +
    +
    +
    +
    +
    +

    The paths that should be included when linting

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var includedPaths: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + excludedPaths + +
    +
    +
    +
    +
    +
    +

    The paths that should be excluded when linting

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var excludedPaths: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + indentation + +
    +
    +
    +
    +
    +
    +

    The style to use when indenting Swift source code.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let indentation: IndentationStyle
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + warningThreshold + +
    +
    +
    +
    +
    +
    +

    The threshold for the number of warnings to tolerate before treating the lint as having failed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let warningThreshold: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reporter + +
    +
    +
    +
    +
    +
    +

    The identifier for the Reporter to use to report style violations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reporter: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + cachePath + +
    +
    +
    +
    +
    +
    +

    The location of the persisted cache to use with this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let cachePath: String?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let allowZeroLintableFiles: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    This value is true iff the --config parameter was used to specify (a) configuration file(s) +In particular, this means that the value is also true if the --config parameter +was used to explicitly specify the default .swiftlint.yml as the configuration file

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var basedOnCustomConfigurationFiles: Bool { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public Computed +

+
+
+
    +
  • +
    + + + + rules + +
    +
    +
    +
    +
    +
    +

    All rules enabled in this configuration

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rules: [Rule] { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rootDirectory + +
    +
    +
    +
    +
    +
    +

    The root directory is the directory that included & excluded paths relate to. +By default, the root directory is the current working directory, +but during some merging algorithms it may be used differently. +The rootDirectory also serves as the stopping point when searching for nested configs along the file hierarchy.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rootDirectory: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + rulesMode + +
    +
    +
    +
    +
    +
    +

    The rules mode used for this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var rulesMode: RulesMode { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Public +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a Configuration with convenience parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    configurationFiles: [String], // No default value here to avoid ambiguous Configuration() initializer
    +    enableAllRules: Bool = false,
    +    cachePath: String? = nil,
    +    ignoreParentAndChildConfigs: Bool = false,
    +    mockedNetworkResults: [String: String] = [:],
    +    useDefaultConfigOnFailure: Bool? = nil
    +)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + configurationFiles + + +
    +

    The path on disk to one or multiple configuration files. If this array + is empty, the default .swiftlint.yml file will be used.

    +
    +
    + + enableAllRules + + +
    +

    Enable all available rules.

    +
    +
    + + cachePath + + +
    +

    The location of the persisted cache to use whith this configuration.

    +
    +
    + + ignoreParentAndChildConfigs + + +
    +

    If true, child and parent config references will be ignored.

    +
    +
    + + mockedNetworkResults + + +
    +

    For testing purposes only. Instead of loading the specified urls, + the mocked value will be used. Example: [“http://mock.com”: “content”]

    +
    +
    + + useDefaultConfigOnFailure + + +
    +

    If this value is specified, it will override the normal behavior. + This is only intended for tests checking whether invalid configs fail.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Caching Configurations By Identifier (In-Memory) +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns a copy of the current Configuration with its computedCacheDescription property set to the value of +cacheDescription, which is expensive to compute.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func withPrecomputedCacheDescription() -> Configuration
    + +
    +
    +
    +

    Return Value

    +

    A new Configuration value.

    +
    + +
    +
    +
  • +
  • +
    + + + + IndentationStyle + +
    +
    +
    +
    +
    +
    +

    The style of indentation used in a Swift project.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    enum IndentationStyle : Hashable
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Lintable Paths +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Returns the files that can be linted by SwiftLint in the specified parent path.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func lintableFiles(inPath path: String, forceExclude: Bool,
    +                          excludeByPrefix: Bool = false) -> [SwiftLintFile]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + path + + +
    +

    The parent path in which to search for lintable files. Can be a directory or a + file.

    +
    +
    + + forceExclude + + +
    +

    Whether or not excludes defined in this configuration should be applied even if + path is an exact match.

    +
    +
    + + excludeByPrefix + + +
    +

    Whether or not uses excluding by prefix algorithm.

    +
    +
    +
    +
    +

    Return Value

    +

    Files to lint.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns an array of file paths after removing the excluded paths as defined by this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filterExcludedPaths(
    +    fileManager: LintableFileManager = FileManager.default,
    +    in paths: [String]...
    +) -> [String]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + fileManager + + +
    +

    The lintable file manager to use to expand the excluded paths into all matching paths.

    +
    +
    + + paths + + +
    +

    The input paths to filter.

    +
    +
    +
    +
    +

    Return Value

    +

    The input paths after removing the excluded paths.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the file paths that are excluded by this configuration using filtering by absolute path prefix.

    + +

    For cases when excluded directories contain many lintable files (e. g. Pods) it works faster than default +algorithm filterExcludedPaths.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func filterExcludedPathsByPrefix(in paths: [String]...) -> [String]
    + +
    +
    +
    +

    Return Value

    +

    The input paths after removing the excluded paths.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Accessing File Configurations +

+
+
+
    +
  • +
    + + + + configuration(for:) + +
    +
    +
    +
    +
    +
    +

    Returns a new configuration that applies to the specified file by merging the current configuration with any +nested configurations in the directory inheritance graph present until the level of the specified file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func configuration(for file: SwiftLintFile) -> Configuration
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + file + + +
    +

    The file for which to obtain a configuration value.

    +
    +
    +
    +
    +

    Return Value

    +

    A new configuration.

    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    Creates a Configuration value based on the specified parameters.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(
    +    dict: [String: Any],
    +    ruleList: RuleList = primaryRuleList,
    +    enableAllRules: Bool = false,
    +    cachePath: String? = nil
    +) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + dict + + +
    +

    The untyped dictionary to serve as the input for this typed configuration. + Typically generated from a YAML-formatted file.

    +
    +
    + + ruleList + + +
    +

    The list of rules to be available to this configuration.

    +
    +
    + + enableAllRules + + +
    +

    Whether all rules from ruleList should be enabled, regardless of the + settings in dict.

    +
    +
    + + cachePath + + +
    +

    The location of the persisted cache on disk.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the rule for the specified ID, if configured in this configuration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func configuredRule(forID ruleID: String) -> Rule?
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + ruleID + + +
    +

    The identifier for the rule to look up.

    +
    +
    +
    +
    +

    Return Value

    +

    The rule for the specified ID, if configured in this configuration.

    +
    + +
    +
    +
  • +
  • +
    + + + + RulesMode + +
    +
    +
    +
    +
    +
    +

    Represents how a Configuration object can be configured with regards to rules.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    enum RulesMode
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Hashable +

+
+
+
    +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Configuration, rhs: Configuration) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

CustomStringConvertible +

+
+
+
    +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/IndentationStyle.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/IndentationStyle.html new file mode 100644 index 000000000..e58ae3afa --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/IndentationStyle.html @@ -0,0 +1,409 @@ + + + + IndentationStyle Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

IndentationStyle

+
+
+ +
enum IndentationStyle : Hashable
+ +
+
+

The style of indentation used in a Swift project.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + tabs + +
    +
    +
    +
    +
    +
    +

    Swift source code should be indented using tabs.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case tabs
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + spaces(count:) + +
    +
    +
    +
    +
    +
    +

    Swift source code should be indented using spaces with count spaces per indentation level.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case spaces(count: Int)
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/RulesMode.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/RulesMode.html new file mode 100644 index 000000000..82eb4ec95 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Configuration/RulesMode.html @@ -0,0 +1,441 @@ + + + + RulesMode Enumeration Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RulesMode

+
+
+ +
enum RulesMode
+ +
+
+

Represents how a Configuration object can be configured with regards to rules.

+ + +
+
+ +
+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The default rules mode, which will enable all rules that aren’t defined as being opt-in +(conforming to the OptInRule protocol), minus the rules listed in disabled, plus the rules listed in +optIn.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case `default`(disabled: Set<String>, optIn: Set<String>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + only(_:) + +
    +
    +
    +
    +
    +
    +

    Only enable the rules explicitly listed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case only(Set<String>)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + allEnabled + +
    +
    +
    +
    +
    +
    +

    Enable all available rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    case allEnabled
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/EmojiReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/EmojiReporter.html new file mode 100644 index 000000000..667b3a978 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/EmojiReporter.html @@ -0,0 +1,474 @@ + + + + EmojiReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

EmojiReporter

+
+
+ +
public struct EmojiReporter : Reporter
+ +
+
+

Reports violations in the format that’s both fun and easy to read.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Example.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Example.html new file mode 100644 index 000000000..de4da2bec --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Example.html @@ -0,0 +1,862 @@ + + + + Example Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Example

+
+
+ +
public struct Example
+
extension Example: Hashable
+
extension Example: Comparable
+ +
+
+

Captures code and context information for an example of a triggering or +non-triggering style

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + code + +
    +
    +
    +
    +
    +
    +

    The contents of the example

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var code: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + configuration + +
    +
    +
    +
    +
    +
    +

    The untyped configuration to apply to the rule, if deviating from the default configuration. +The structure should match what is expected as a configuration value for the rule being tested.

    + +

    For example, if the following YAML would be used to configure the rule:

    +
    severity: warning
    +
    + +

    Then the equivalent configuration value would be ["severity": "warning"].

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var configuration: Any? { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + testMultiByteOffsets + +
    +
    +
    +
    +
    +
    +

    Whether the example should be tested by prepending multibyte grapheme clusters

    +
    +

    See also

    + addEmoji(_:) + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var testMultiByteOffsets: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + testOnLinux + +
    +
    +
    +
    +
    +
    +

    Whether the example should be tested on Linux

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var testOnLinux: Bool { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The path to the file where the example was created

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var file: StaticString { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + line + +
    +
    +
    +
    +
    +
    +

    The line in the file where the example was created

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var line: UInt
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Create a new Example with the specified code, file, and line.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    init(_ code: String, configuration: Any? = nil, testMultiByteOffsets: Bool = true,
    +     testWrappingInComment: Bool = true, testWrappingInString: Bool = true, testDisableCommand: Bool = true,
    +     testOnLinux: Bool = true, file: StaticString = #file, line: UInt = #line,
    +     excludeFromDocumentation: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + code + + +
    +

    The contents of the example.

    +
    +
    + + configuration + + +
    +

    The untyped configuration to apply to the rule, if deviating from the default + configuration.

    +
    +
    + + testMultibyteOffsets + + +
    +

    Whether the example should be tested by prepending multibyte grapheme clusters.

    +
    +
    + + testWrappingInComment + + +
    +

    Whether test shall verify that the example wrapped in a comment doesn’t trigger.

    +
    +
    + + testWrappingInString + + +
    +

    Whether tests shall verify that the example wrapped into a string doesn’t trigger.

    +
    +
    + + testDisableCommand + + +
    +

    Whether tests shall verify that the disabled rule (comment in the example) doesn’t + trigger.

    +
    +
    + + testOnLinux + + +
    +

    Whether the example should be tested on Linux.

    +
    +
    + + file + + +
    +

    The path to the file where the example is located. + Defaults to the file where this initializer is called.

    +
    +
    + + line + + +
    +

    The line in the file where the example is located. + Defaults to the line where this initializer is called.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(code:) + +
    +
    +
    +
    +
    +
    +

    Returns the same example, but with the code that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func with(code: String) -> Example
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + code + + +
    +

    the new code to use in the modified example

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns a copy of the Example with all instances of the “↓” character removed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    func removingViolationMarkers() -> Example
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: Example, rhs: Example) -> Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + hash(into:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func hash(into hasher: inout Hasher)
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: Example, rhs: Example) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitHubActionsLoggingReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitHubActionsLoggingReporter.html new file mode 100644 index 000000000..7ebf742c7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitHubActionsLoggingReporter.html @@ -0,0 +1,474 @@ + + + + GitHubActionsLoggingReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

GitHubActionsLoggingReporter

+
+
+ +
public struct GitHubActionsLoggingReporter : Reporter
+ +
+
+

Reports violations in the format GitHub-hosted virtual machine for Actions can recognize as messages.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitLabJUnitReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitLabJUnitReporter.html new file mode 100644 index 000000000..5ed833db7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/GitLabJUnitReporter.html @@ -0,0 +1,474 @@ + + + + GitLabJUnitReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

GitLabJUnitReporter

+
+
+ +
public struct GitLabJUnitReporter : Reporter
+ +
+
+

Reports violations as JUnit XML supported by GitLab.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/HTMLReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/HTMLReporter.html new file mode 100644 index 000000000..ba568bc58 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/HTMLReporter.html @@ -0,0 +1,474 @@ + + + + HTMLReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

HTMLReporter

+
+
+ +
public struct HTMLReporter : Reporter
+ +
+
+

Reports violations as HTML.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JSONReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JSONReporter.html new file mode 100644 index 000000000..275241d9e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JSONReporter.html @@ -0,0 +1,474 @@ + + + + JSONReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

JSONReporter

+
+
+ +
public struct JSONReporter : Reporter
+ +
+
+

Reports violations as a JSON array.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JUnitReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JUnitReporter.html new file mode 100644 index 000000000..24796c9f6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/JUnitReporter.html @@ -0,0 +1,474 @@ + + + + JUnitReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

JUnitReporter

+
+
+ +
public struct JUnitReporter : Reporter
+ +
+
+

Reports violations as JUnit XML.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Linter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Linter.html new file mode 100644 index 000000000..fc2d541a7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Linter.html @@ -0,0 +1,548 @@ + + + + Linter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Linter

+
+
+ +
public struct Linter
+ +
+
+

Represents a file that can be linted for style violations and corrections after being collected.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file to lint with this linter.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: SwiftLintFile
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isCollecting + +
    +
    +
    +
    +
    +
    +

    Whether or not this linter will be used to collect information from several files.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var isCollecting: Bool
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Linter by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, configuration: Configuration = Configuration.default, cache: LinterCache? = nil,
    +            compilerArguments: [String] = [])
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file to lint with this linter.

    +
    +
    + + configuration + + +
    +

    The SwiftLint configuration to apply to this linter.

    +
    +
    + + cache + + +
    +

    The persisted cache to use for this linter.

    +
    +
    + + compilerArguments + + +
    +

    The compiler arguments to use for this linter if it is to execute analyzer rules.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + collect(into:) + +
    +
    +
    +
    +
    +
    +

    Returns a linter capable of checking for violations after running each rule’s collection step.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func collect(into storage: RuleStorage) -> CollectedLinter
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + storage + + +
    +

    The storage object where collected info should be saved.

    +
    +
    +
    +
    +

    Return Value

    +

    A linter capable of checking for violations after running each rule’s collection step.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Location.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Location.html new file mode 100644 index 000000000..ceabd2038 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Location.html @@ -0,0 +1,800 @@ + + + + Location Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Location

+
+
+ +
public struct Location : CustomStringConvertible, Comparable, Codable
+ +
+
+

The placement of a segment of Swift in a collection of source files.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + file + +
    +
    +
    +
    +
    +
    +

    The file path on disk for this location.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let file: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + line + +
    +
    +
    +
    +
    +
    +

    The line offset in the file for this location. 1-indexed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let line: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + character + +
    +
    +
    +
    +
    +
    +

    The character offset in the file for this location. 1-indexed.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let character: Int?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A lossless printable description of this location.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + relativeFile + +
    +
    +
    +
    +
    +
    +

    The file path for this location relative to the current working directory.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var relativeFile: String? { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: String?, line: Int? = nil, character: Int? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + file + + +
    +

    The file path on disk for this location.

    +
    +
    + + line + + +
    +

    The line offset in the file for this location. 1-indexed.

    +
    +
    + + character + + +
    +

    The character offset in the file for this location. 1-indexed.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a byte-offset into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, byteOffset offset: ByteCount)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + offset + + +
    +

    The offset in bytes into the file for this location.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(file:position:) + +
    +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, position: AbsolutePosition)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + position + + +
    +

    The absolute position returned from SwiftSyntax.

    +
    +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file. +Fails if the specified offset was not a valid location in the file.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(file: SwiftLintFile, characterOffset offset: Int)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + file + + +
    +

    The file for this location.

    +
    +
    + + offset + + +
    +

    The offset in UTF8 fragments into the file for this location.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Comparable +

+
+
+
    +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: Location, rhs: Location) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/MarkdownReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/MarkdownReporter.html new file mode 100644 index 000000000..8ca49aa59 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/MarkdownReporter.html @@ -0,0 +1,474 @@ + + + + MarkdownReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

MarkdownReporter

+
+
+ +
public struct MarkdownReporter : Reporter
+ +
+
+

Reports violations as markdown formated (with tables).

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html new file mode 100644 index 000000000..4d9d9e4b5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/ReasonedRuleViolation.html @@ -0,0 +1,541 @@ + + + + ReasonedRuleViolation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

ReasonedRuleViolation

+
+
+ +
public struct ReasonedRuleViolation : Comparable
+ +
+
+

A violation produced by ViolationsSyntaxVisitors.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + position + +
    +
    +
    +
    +
    +
    +

    The violation’s position.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let position: AbsolutePosition
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reason + +
    +
    +
    +
    +
    +
    +

    A specific reason for the violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reason: String?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The violation’s severity.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let severity: ViolationSeverity?
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a ReasonedRuleViolation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(position: AbsolutePosition, reason: String? = nil, severity: ViolationSeverity? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + position + + +
    +

    The violations position in the analyzed source file.

    +
    +
    + + reason + + +
    +

    The reason for the violation if different from the rule’s description.

    +
    +
    + + severity + + +
    +

    The severity of the violation if different from the rule’s default configured severity.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + <(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func < (lhs: `Self`, rhs: `Self`) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Region.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Region.html new file mode 100644 index 000000000..963b3a80d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Region.html @@ -0,0 +1,727 @@ + + + + Region Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Region

+
+
+ +
public struct Region : Equatable
+ +
+
+

A contiguous region of Swift source code.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + start + +
    +
    +
    +
    +
    +
    +

    The location describing the start of the region. All locations that are less than this value +(earlier in the source file) are not contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let start: Location
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + end + +
    +
    +
    +
    +
    +
    +

    The location describing the end of the region. All locations that are greater than this value +(later in the source file) are not contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let end: Location
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    All SwiftLint rule identifiers that are disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let disabledRuleIdentifiers: Set<RuleIdentifier>
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a Region by setting explicit values for all its properties.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(start: Location, end: Location, disabledRuleIdentifiers: Set<RuleIdentifier>)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + +
    + + start + + +
    +

    The region’s starting location.

    +
    +
    + + end + + +
    +

    The region’s ending location.

    +
    +
    + + disabledRuleIdentifiers + + +
    +

    All SwiftLint rule identifiers that are disabled in this region.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + contains(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specific location is contained in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func contains(_ location: Location) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + location + + +
    +

    The location to check for containment.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specific location is contained in this region.

    +
    + +
    +
    +
  • +
  • +
    + + + + isRuleEnabled(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified rule is enabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isRuleEnabled(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule whose status should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specified rule is enabled in this region.

    +
    + +
    +
    +
  • +
  • +
    + + + + isRuleDisabled(_:) + +
    +
    +
    +
    +
    +
    +

    Whether the specified rule is disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func isRuleDisabled(_ rule: Rule) -> Bool
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule whose status should be determined.

    +
    +
    +
    +
    +

    Return Value

    +

    True if the specified rule is disabled in this region.

    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Returns the deprecated rule aliases that are disabling the specified rule in this region. +Returns the empty set if the rule isn’t disabled in this region.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func deprecatedAliasesDisabling(rule: Rule) -> Set<String>
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rule + + +
    +

    The rule to check.

    +
    +
    +
    +
    +

    Return Value

    +

    Deprecated rule aliases.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleDescription.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleDescription.html new file mode 100644 index 000000000..2b5f8e425 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleDescription.html @@ -0,0 +1,934 @@ + + + + RuleDescription Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleDescription

+
+
+ +
public struct RuleDescription : Equatable
+ +
+
+

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    +

    The rule’s unique identifier, to be used in configuration files and SwiftLint commands. +Should be short and only comprised of lowercase latin alphabet letters and underscores formatted in snake case.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + name + +
    +
    +
    +
    +
    +
    +

    The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let name: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an +explanation of the rule’s purpose and rationale.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let description: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The RuleKind that best categorizes this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: RuleKind
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + nonTriggeringExamples + +
    +
    +
    +
    +
    +
    +

    Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform +users of various samples of code that are considered valid by this rule. Should be valid Swift syntax but is not +required to compile.

    + +

    These examples are also used for automatic testing purposes. Tests will validate that the rule does not trigger +any violations for these examples.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let nonTriggeringExamples: [Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + triggeringExamples + +
    +
    +
    +
    +
    +
    +

    Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to +inform users of various samples of code that are considered invalid by this rule. Should be valid Swift syntax +but is not required to compile.

    + +

    Violations should occur where ↓ markers are located.

    + +

    These examples are also used for automatic testing purposes. Tests will validate that the rule triggers +violations for these examples wherever ↓ markers are located.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let triggeringExamples: [Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + corrections + +
    +
    +
    +
    +
    +
    +

    Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values +are the expected value after applying corrections with the rule.

    + +

    Rules that aren’t correctable (conforming to the CorrectableRule protocol) should leave property empty.

    + +

    These examples are used for testing purposes if the rule conforms to AutomaticTestableRule. Tests will +validate that the rule corrects all keys to their corresponding values.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let corrections: [Example : Example]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + deprecatedAliases + +
    +
    +
    +
    +
    +
    +

    Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let deprecatedAliases: Set<String>
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + minSwiftVersion + +
    +
    +
    +
    +
    +
    +

    The oldest version of the Swift compiler supported by this rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let minSwiftVersion: SwiftVersion
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + requiresFileOnDisk + +
    +
    +
    +
    +
    +
    +

    Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules +conforming to AnalyzerRule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let requiresFileOnDisk: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + consoleDescription + +
    +
    +
    +
    +
    +
    +

    The console-printable string for this description.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var consoleDescription: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + allIdentifiers + +
    +
    +
    +
    +
    +
    +

    All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var allIdentifiers: [String] { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a RuleDescription by specifying all its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(identifier: String, name: String, description: String, kind: RuleKind,
    +            minSwiftVersion: SwiftVersion = .five,
    +            nonTriggeringExamples: [Example] = [], triggeringExamples: [Example] = [],
    +            corrections: [Example: Example] = [:],
    +            deprecatedAliases: Set<String> = [],
    +            requiresFileOnDisk: Bool = false)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + identifier + + +
    +

    Sets the description’s identifier property.

    +
    +
    + + name + + +
    +

    Sets the description’s name property.

    +
    +
    + + description + + +
    +

    Sets the description’s description property.

    +
    +
    + + kind + + +
    +

    Sets the description’s kind property.

    +
    +
    + + minSwiftVersion + + +
    +

    Sets the description’s minSwiftVersion property.

    +
    +
    + + nonTriggeringExamples + + +
    +

    Sets the description’s nonTriggeringExamples property.

    +
    +
    + + triggeringExamples + + +
    +

    Sets the description’s triggeringExamples property.

    +
    +
    + + corrections + + +
    +

    Sets the description’s corrections property.

    +
    +
    + + deprecatedAliases + + +
    +

    Sets the description’s deprecatedAliases property.

    +
    +
    + + requiresFileOnDisk + + +
    +

    Sets the description’s requiresFileOnDisk property.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Equatable +

+
+
+
    +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleList.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleList.html new file mode 100644 index 000000000..1298e2427 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleList.html @@ -0,0 +1,520 @@ + + + + RuleList Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleList

+
+
+ +
public struct RuleList
+
extension RuleList: Equatable
+ +
+
+

A list of available SwiftLint rules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + list + +
    +
    +
    +
    +
    +
    +

    The rules contained in this list.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let list: [String : Rule.Type]
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ + +
+ +

Initializers +

+
+
+
    +
  • +
    + + + + init(rules:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleList by specifying all its rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rules: Rule.Type...)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rules + + +
    +

    The rules to be contained in this list.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(rules:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleList by specifying all its rules.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(rules: [Rule.Type])
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + rules + + +
    +

    The rules to be contained in this list.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + ==(_:_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func == (lhs: RuleList, rhs: RuleList) -> Bool
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html new file mode 100644 index 000000000..849156d8d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleListDocumentation.html @@ -0,0 +1,452 @@ + + + + RuleListDocumentation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleListDocumentation

+
+
+ +
public struct RuleListDocumentation
+ +
+
+

User-facing documentation for a SwiftLint RuleList.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + init(_:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleListDocumentation instance from a RuleList.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(_ list: RuleList)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + list + + +
    +

    A RuleList to document.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + write(to:) + +
    +
    +
    +
    +
    +
    +

    Write the rule list documentation as markdown files to the specified directory.

    +
    +

    Throws

    +

    Throws if the files could not be written to.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func write(to url: URL) throws
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + url + + +
    +

    Local URL for directory where the markdown files for this documentation should be saved.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleParameter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleParameter.html new file mode 100644 index 000000000..3b73ffe49 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/RuleParameter.html @@ -0,0 +1,470 @@ + + + + RuleParameter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

RuleParameter

+
+
+ +
public struct RuleParameter<T> : Equatable where T : Equatable
+ +
+
+

A configuration parameter for rules.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The severity that should be assigned to the violation of this parameter’s value is met.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let severity: ViolationSeverity
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The value to configure the rule.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: T
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(severity:value:) + +
    +
    +
    +
    +
    +
    +

    Creates a RuleParameter by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(severity: ViolationSeverity, value: T)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + severity + + +
    +

    The severity that should be assigned to the violation of this parameter’s value is met.

    +
    +
    + + value + + +
    +

    The value to configure the rule.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SonarQubeReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SonarQubeReporter.html new file mode 100644 index 000000000..cf4200662 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SonarQubeReporter.html @@ -0,0 +1,474 @@ + + + + SonarQubeReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SonarQubeReporter

+
+
+ +
public struct SonarQubeReporter : Reporter
+ +
+
+

Reports violations in SonarQube import format.

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SourceKittenDictionary.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SourceKittenDictionary.html new file mode 100644 index 000000000..069b7fcc3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SourceKittenDictionary.html @@ -0,0 +1,530 @@ + + + + SourceKittenDictionary Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SourceKittenDictionary

+
+
+ +
public struct SourceKittenDictionary
+ +
+
+

A collection of keys and values as parsed out of SourceKit, with many conveniences for accessing SwiftLint-specific +values.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The underlying SourceKitten dictionary.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: [String : SourceKitRepresentable]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + substructure + +
    +
    +
    +
    +
    +
    +

    The cached substructure for this dictionary. Empty if there is no substructure.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let substructure: [SourceKittenDictionary]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + expressionKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift expression represented by this dictionary, if it is an expression.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let expressionKind: SwiftExpressionKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + declarationKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift declaration represented by this dictionary, if it is a declaration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let declarationKind: SwiftDeclarationKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + statementKind + +
    +
    +
    +
    +
    +
    +

    The kind of Swift statement represented by this dictionary, if it is a statement.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let statementKind: StatementKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + accessibility + +
    +
    +
    +
    +
    +
    +

    The accessibility level for this dictionary, if it is a declaration.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let accessibility: AccessControlLevel?
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/StyleViolation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/StyleViolation.html new file mode 100644 index 000000000..6375649bb --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/StyleViolation.html @@ -0,0 +1,745 @@ + + + + StyleViolation Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

StyleViolation

+
+
+ +
public struct StyleViolation : CustomStringConvertible, Equatable, Codable
+ +
+
+

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + ruleIdentifier + +
    +
    +
    +
    +
    +
    +

    The identifier of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleIdentifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ruleDescription + +
    +
    +
    +
    +
    +
    +

    The description of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleDescription: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + ruleName + +
    +
    +
    +
    +
    +
    +

    The name of the rule that generated this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let ruleName: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + severity + +
    +
    +
    +
    +
    +
    +

    The severity of this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var severity: ViolationSeverity { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + location + +
    +
    +
    +
    +
    +
    +

    The location of this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public private(set) var location: Location { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + reason + +
    +
    +
    +
    +
    +
    +

    The justification for this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let reason: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    +

    A printable description for this violation.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • + +
    +
    +
    +
    +
    +

    Creates a StyleViolation by specifying its properties directly.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(ruleDescription: RuleDescription,
    +            severity: ViolationSeverity = .warning,
    +            location: Location,
    +            reason: String? = nil)
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + + + + + + + + + +
    + + ruleDescription + + +
    +

    The description of the rule that generated this violation.

    +
    +
    + + severity + + +
    +

    The severity of this violation.

    +
    +
    + + location + + +
    +

    The location of this violation.

    +
    +
    + + reason + + +
    +

    The justification for this violation.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(severity:) + +
    +
    +
    +
    +
    +
    +

    Returns the same violation, but with the severity that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func with(severity: ViolationSeverity) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + severity + + +
    +

    the new severity to use in the modified violation

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + with(location:) + +
    +
    +
    +
    +
    +
    +

    Returns the same violation, but with the location that is passed in

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func with(location: Location) -> StyleViolation
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + location + + +
    +

    the new location to use in the modified violation

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html new file mode 100644 index 000000000..134fed765 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxMap.html @@ -0,0 +1,458 @@ + + + + SwiftLintSyntaxMap Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintSyntaxMap

+
+
+ +
public struct SwiftLintSyntaxMap
+ +
+
+

Represents a Swift file’s syntax information.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The raw SyntaxMap obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: SyntaxMap
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + tokens + +
    +
    +
    +
    +
    +
    +

    The SwiftLint-specific syntax tokens for this syntax map.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let tokens: [SwiftLintSyntaxToken]
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(value: SyntaxMap)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The raw SyntaxMap obtained by SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html new file mode 100644 index 000000000..1ee1c9cca --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftLintSyntaxToken.html @@ -0,0 +1,548 @@ + + + + SwiftLintSyntaxToken Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftLintSyntaxToken

+
+
+ +
public struct SwiftLintSyntaxToken
+ +
+
+

A SwiftLint-aware Swift syntax token.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The raw SyntaxToken obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: SyntaxToken
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + kind + +
    +
    +
    +
    +
    +
    +

    The syntax kind associated with is token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let kind: SyntaxKind?
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + init(value:) + +
    +
    +
    +
    +
    +
    +

    Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public init(value: SyntaxToken)
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + value + + +
    +

    The raw SyntaxToken obtained by SourceKitten.

    +
    +
    +
    + +
    +
    +
  • +
  • +
    + + + + range + +
    +
    +
    +
    +
    +
    +

    The byte range in a source file for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var range: ByteRange { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + offset + +
    +
    +
    +
    +
    +
    +

    The starting byte offset in a source file for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var offset: ByteCount { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + length + +
    +
    +
    +
    +
    +
    +

    The length in bytes for this token.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var length: ByteCount { get }
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftVersion.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftVersion.html new file mode 100644 index 000000000..ed263e4cc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/SwiftVersion.html @@ -0,0 +1,740 @@ + + + + SwiftVersion Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

SwiftVersion

+
+
+ +
public struct SwiftVersion : RawRepresentable, Codable, Comparable
+ +
+
+

A value describing the version of the Swift compiler.

+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Version.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Version.html new file mode 100644 index 000000000..ca8a87720 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/Version.html @@ -0,0 +1,409 @@ + + + + Version Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

Version

+
+
+ +
public struct Version
+ +
+
+

A type describing the SwiftLint version.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + value + +
    +
    +
    +
    +
    +
    +

    The string value for this version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public let value: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + current + +
    +
    +
    +
    +
    +
    +

    The current SwiftLint version.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let current: Version
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/XcodeReporter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/XcodeReporter.html new file mode 100644 index 000000000..2795c2cad --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/XcodeReporter.html @@ -0,0 +1,474 @@ + + + + XcodeReporter Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

XcodeReporter

+
+
+ +
public struct XcodeReporter : Reporter
+ +
+
+

Reports violations in the format Xcode uses to display in the IDE. (default)

+ + +
+
+ +
+
+
+
+ + +
+ +

Reporter Conformance +

+
+
+
    +
  • +
    + + + + identifier + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let identifier: String
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + isRealtime + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static let isRealtime: Bool
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + description + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public var description: String { get }
    + +
    +
    + +
    +
    +
  • +
  • +
    + + + + generateReport(_:) + +
    +
    +
    +
    +
    +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func generateReport(_ violations: [StyleViolation]) -> String
    + +
    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/YamlParser.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/YamlParser.html new file mode 100644 index 000000000..a6957ca2c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/Structs/YamlParser.html @@ -0,0 +1,420 @@ + + + + YamlParser Structure Reference + + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+

YamlParser

+
+
+ +
public struct YamlParser
+ +
+
+

An interface for parsing YAML.

+ + +
+
+ +
+
+
+
    +
  • +
    + + + + parse(_:env:) + +
    +
    +
    +
    +
    +
    +

    Parses the input YAML string as an untyped dictionary.

    +
    +

    Throws

    +

    Throws if the yaml string provided could not be parsed.

    + +
    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public static func parse(_ yaml: String,
    +                         env: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any]
    + +
    +
    +
    +

    Parameters

    + + + + + + + + + + + +
    + + yaml + + +
    +

    YAML-formatted string.

    +
    +
    + + env + + +
    +

    The environment to use to expand variables in the YAML.

    +
    +
    +
    +
    +

    Return Value

    +

    The parsed YAML as an untyped dictionary.

    +
    + +
    +
    +
  • +
+
+
+
+ +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_label_for_image.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_label_for_image.html new file mode 100644 index 000000000..b4062ce3d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_label_for_image.html @@ -0,0 +1,580 @@ + + + + accessibility_label_for_image Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Accessibility Label for Image

+ +

All Images that provide context should have an accessibility label. Purely decorative images can be hidden from accessibility.

+ +
    +
  • Identifier: accessibility_label_for_image
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        Image(decorative: "my-image")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(systemName: "circle.plus")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image", label: Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibility(hidden: true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibility(label: Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image("my-image")
+            .accessibilityLabel(Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .renderingMode(.template)
+            .foregroundColor(.blue)
+            .accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .accessibilityLabel(Text("Alt text for my image"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityElement()
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityHidden(true)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .combine)
+        .padding(16)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .ignore)
+        .padding(16)
+        .accessibilityLabel(Text("Label for my image and text"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Button(action: { doAction() }) {
+            Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+        }
+        .accessibilityLabel(Text("Label for my image"))
+    }
+}
+
+

Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        ↓Image("my-image")
+            .resizable(true)
+            .frame(width: 48, height: 48)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Image(uiImage: myUiImage)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓SwiftUI.Image(uiImage: "my-image").resizable().accessibilityHidden(false)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(uiImage: myUiImage)
+            .resizable()
+            .frame(width: 48, height: 48)
+            .accessibilityLabel(Text("Alt text for my image"))
+        ↓Image("other image")
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Image(decorative: "image1")
+        ↓Image("image2")
+        Image(uiImage: "image3")
+            .accessibility(label: Text("a pretty picture"))
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            Image(decorative: "my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            ↓Image("my-image")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityElement(children: .contain)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        VStack {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Image("my-image")
+                .accessibility(label: Text("Alt text for my image"))
+        }.accessibilityHidden(false)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack(spacing: 8) {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+            Text("Text to accompany my image")
+        }.accessibilityElement(children: .combine)
+        .padding(16)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Button(action: { doAction() }) {
+            ↓Image("my-image")
+                .renderingMode(.template)
+                .foregroundColor(.blue)
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_trait_for_button.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_trait_for_button.html new file mode 100644 index 000000000..a523324bb --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/accessibility_trait_for_button.html @@ -0,0 +1,583 @@ + + + + accessibility_trait_for_button Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Accessibility Trait for Button

+ +

All views with tap gestures added should include the .isButton accessibility trait. If a tap opens an external link the .isLink trait should be used instead.

+ +
    +
  • Identifier: accessibility_trait_for_button
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        Button {
+            print("tapped")
+        } label: {
+            Text("Learn more")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Link("Open link", destination: myUrl)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture {
+                print("tapped - open URL")
+            }
+            .accessibility(addTraits: .isLink)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .accessibilityAddTraits(.isButton)
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .accessibility(addTraits: [.isButton, .isHeader])
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture {
+                print("tapped - open URL")
+            }
+            .accessibilityAddTraits([.isHeader, .isLink])
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .onTapGesture(count: 1, perform: {
+                print("tapped")
+            })
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            // This rule does not include tap gestures with multiple taps for now.
+            // Custom gestures like this are also not very accessible, but require
+            // alternative ways to accomplish the same task with assistive tech.
+            .onTapGesture(count: 2) {
+                print("double-tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Label("Learn more", systemImage: "info.circle")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+            .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        HStack {
+            Image(systemName: "info.circle")
+            Text("Learn more")
+        }
+        .onTapGesture {
+            print("tapped")
+        }
+        // This modifier is not strictly required — each subview will inherit the button trait.
+        // That said, grouping a tappable stack into a single element is a good way to reduce
+        // the number of swipes required for a VoiceOver user to navigate the page.
+        .accessibilityElement(children: .combine)
+        .accessibility(addTraits: .isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .gesture(TapGesture().onEnded {
+                print("tapped")
+            })
+            .accessibilityAddTraits(.isButton)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .simultaneousGesture(TapGesture(count: 1).onEnded {
+                print("tapped - open URL")
+            })
+            .accessibilityAddTraits(.isLink)
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .highPriorityGesture(TapGesture().onEnded {
+                print("tapped")
+            })
+            .accessibility(addTraits: [.isButton])
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        Text("Learn more")
+            .gesture(TapGesture(count: 2).onEnded {
+                print("tapped")
+            })
+    }
+}
+
+

Triggering Examples

+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .accessibility(addTraits: .isHeader)
+            .onTapGesture {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .onTapGesture(count: 1, perform: {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Label("Learn more", systemImage: "info.circle")
+            .onTapGesture(count: 1) {
+                print("tapped")
+            }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓HStack {
+            Image(systemName: "info.circle")
+            Text("Learn more")
+        }
+        .onTapGesture {
+            print("tapped")
+        }
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .gesture(TapGesture().onEnded {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .simultaneousGesture(TapGesture(count: 1).onEnded {
+                print("tapped")
+            })
+    }
+}
+
+
struct MyView: View {
+    var body: some View {
+        ↓Text("Learn more")
+            .highPriorityGesture(TapGesture().onEnded {
+                print("tapped")
+            })
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html new file mode 100644 index 000000000..3780a481a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anonymous_argument_in_multiline_closure.html @@ -0,0 +1,360 @@ + + + + anonymous_argument_in_multiline_closure Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Anonymous Argument in Multiline Closure

+ +

Use named arguments in multiline closures

+ +
    +
  • Identifier: anonymous_argument_in_multiline_closure
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
closure { $0 }
+
+
closure { print($0) }
+
+
closure { arg in
+    print(arg)
+}
+
+
closure { arg in
+    nestedClosure { $0 + arg }
+}
+
+

Triggering Examples

+
closure {
+    print(↓$0)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anyobject_protocol.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anyobject_protocol.html new file mode 100644 index 000000000..296d06add --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/anyobject_protocol.html @@ -0,0 +1,365 @@ + + + + anyobject_protocol Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

AnyObject Protocol

+ +

Prefer using AnyObject over class for class-only protocols.

+ +
    +
  • Identifier: anyobject_protocol
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol SomeProtocol {}
+
+
+
protocol SomeClassOnlyProtocol: AnyObject {}
+
+
+
protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
+
+
+
@objc protocol SomeClassOnlyProtocol: AnyObject, SomeInheritedProtocol {}
+
+
+

Triggering Examples

+
protocol SomeClassOnlyProtocol: ↓class {}
+
+
+
protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
+
+
+
@objc protocol SomeClassOnlyProtocol: ↓class, SomeInheritedProtocol {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/array_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/array_init.html new file mode 100644 index 000000000..bfbe91afd --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/array_init.html @@ -0,0 +1,405 @@ + + + + array_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Array Init

+ +

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.

+ +
    +
  • Identifier: array_init
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
Array(foo)
+
+
+
foo.map { $0.0 }
+
+
+
foo.map { $1 }
+
+
+
foo.map { $0() }
+
+
+
foo.map { ((), $0) }
+
+
+
foo.map { $0! }
+
+
+
foo.map { $0! /* force unwrap */ }
+
+
+
foo.something { RouteMapper.map($0) }
+
+
+
foo.map { !$0 }
+
+
+
foo.map { /* a comment */ !$0 }
+
+
+

Triggering Examples

+
foo.↓map({ $0 })
+
+
+
foo.↓map { $0 }
+
+
+
foo.↓map { return $0 }
+
+
+
    foo.↓map { elem in
+        elem
+    }
+
+
    foo.↓map { elem in
+        return elem
+    }
+
+
    foo.↓map { (elem: String) in
+        elem
+    }
+
+
    foo.↓map { elem -> String in
+        elem
+    }
+
+
foo.↓map { $0 /* a comment */ }
+
+
+
foo.↓map { /* a comment */ $0 }
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/attributes.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/attributes.html new file mode 100644 index 000000000..f51b42014 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/attributes.html @@ -0,0 +1,570 @@ + + + + attributes Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Attributes

+ +

Attributes should be on their own lines in functions and types, but on the same line as variables and imports.

+ +
    +
  • Identifier: attributes
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, always_on_same_line: [“@IBAction”, “@NSManaged”], always_on_line_above: []
  • +
+

Non Triggering Examples

+
@objc var x: String
+
+
@objc private var x: String
+
+
@nonobjc var x: String
+
+
@IBOutlet private var label: UILabel
+
+
@IBOutlet @objc private var label: UILabel
+
+
@NSCopying var name: NSString
+
+
@NSManaged var name: String?
+
+
@IBInspectable var cornerRadius: CGFloat
+
+
@available(iOS 9.0, *)
+ let stackView: UIStackView
+
+
@NSManaged func addSomeObject(book: SomeObject)
+
+
@IBAction func buttonPressed(button: UIButton)
+
+
@objc
+ @IBAction func buttonPressed(button: UIButton)
+
+
@available(iOS 9.0, *)
+ func animate(view: UIStackView)
+
+
@available(*, deprecated, message: "A message")
+ func animate(view: UIStackView)
+
+
@nonobjc
+ final class X {}
+
+
@available(iOS 9.0, *)
+ class UIStackView {}
+
+
@NSApplicationMain
+ class AppDelegate: NSObject, NSApplicationDelegate {}
+
+
@UIApplicationMain
+ class AppDelegate: NSObject, UIApplicationDelegate {}
+
+
@IBDesignable
+ class MyCustomView: UIView {}
+
+
@testable import SourceKittenFramework
+
+
@objc(foo_x)
+ var x: String
+
+
@available(iOS 9.0, *)
+@objc(abc_stackView)
+ let stackView: UIStackView
+
+
@objc(abc_addSomeObject:)
+ @NSManaged func addSomeObject(book: SomeObject)
+
+
@objc(ABCThing)
+ @available(iOS 9.0, *)
+ class Thing {}
+
+
class Foo: NSObject {
+ override var description: String { return "" }
+}
+
+
class Foo: NSObject {
+
+ override func setUp() {}
+}
+
+
@objc
+class ⽺ {}
+
+
+
extension Property {
+
+ @available(*, unavailable, renamed: "isOptional")
+public var optional: Bool { fatalError() }
+}
+
+
@GKInspectable var maxSpeed: Float
+
+
@discardableResult
+ func a() -> Int
+
+
@objc
+ @discardableResult
+ func a() -> Int
+
+
func increase(f: @autoclosure () -> Int) -> Int
+
+
func foo(completionHandler: @escaping () -> Void)
+
+
private struct DefaultError: Error {}
+
+
@testable import foo
+
+private let bar = 1
+
+
import XCTest
+@testable import DeleteMe
+
+@available (iOS 11.0, *)
+class DeleteMeTests: XCTestCase {
+}
+
+
@objc
+internal func foo(identifier: String, completion: @escaping (() -> Void)) {}
+
+
@objc
+internal func foo(identifier: String, completion: @autoclosure (() -> Bool)) {}
+
+
func printBoolOrTrue(_ expression: @autoclosure () throws -> Bool?) rethrows {
+  try print(expression() ?? true)
+}
+
+
import Foundation
+
+class MyClass: NSObject {
+  @objc(
+    first:
+  )
+  static func foo(first: String) {}
+}
+
+
func refreshable(action: @escaping @Sendable () async -> Void) -> some View {
+    modifier(RefreshableModifier(action: action))
+}
+
+

Triggering Examples

+
@objc
+ ↓var x: String
+
+
@objc
+
+ ↓var x: String
+
+
@objc
+ private ↓var x: String
+
+
@nonobjc
+ ↓var x: String
+
+
@IBOutlet
+ private ↓var label: UILabel
+
+
@IBOutlet
+
+ private ↓var label: UILabel
+
+
@NSCopying
+ ↓var name: NSString
+
+
@NSManaged
+ ↓var name: String?
+
+
@IBInspectable
+ ↓var cornerRadius: CGFloat
+
+
@available(iOS 9.0, *) ↓let stackView: UIStackView
+
+
@NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@IBAction
+ ↓func buttonPressed(button: UIButton)
+
+
@IBAction
+ @objc
+ ↓func buttonPressed(button: UIButton)
+
+
@available(iOS 9.0, *) ↓func animate(view: UIStackView)
+
+
@nonobjc final ↓class X {}
+
+
@available(iOS 9.0, *) ↓class UIStackView {}
+
+
@available(iOS 9.0, *)
+ @objc ↓class UIStackView {}
+
+
@available(iOS 9.0, *) @objc
+ ↓class UIStackView {}
+
+
@available(iOS 9.0, *)
+
+ ↓class UIStackView {}
+
+
@UIApplicationMain ↓class AppDelegate: NSObject, UIApplicationDelegate {}
+
+
@IBDesignable ↓class MyCustomView: UIView {}
+
+
@testable
+↓import SourceKittenFramework
+
+
@testable
+
+
+↓import SourceKittenFramework
+
+
@available(iOS 9.0, *) @objc(abc_stackView)
+ ↓let stackView: UIStackView
+
+
@objc(abc_addSomeObject:) @NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@objc(abc_addSomeObject:)
+ @NSManaged
+ ↓func addSomeObject(book: SomeObject)
+
+
@available(iOS 9.0, *)
+ @objc(ABCThing) ↓class Thing {}
+
+
@GKInspectable
+ ↓var maxSpeed: Float
+
+
@discardableResult ↓func a() -> Int
+
+
@objc
+ @discardableResult ↓func a() -> Int
+
+
@objc
+
+ @discardableResult
+ ↓func a() -> Int
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html new file mode 100644 index 000000000..9d1352e2c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/balanced_xctest_lifecycle.html @@ -0,0 +1,420 @@ + + + + balanced_xctest_lifecycle Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Balanced XCTest life-cycle

+ +

Test classes must implement balanced setUp and tearDown methods.

+ +
    +
  • Identifier: balanced_xctest_lifecycle
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, test_parent_classes: [“QuickSpec”, “XCTestCase”]
  • +
+

Non Triggering Examples

+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDown() {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDown() {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDownWithError() throws {}
+}
+final class BarTests: XCTestCase {
+    override func setUpWithError() throws {}
+    override func tearDownWithError() throws {}
+}
+
+
struct FooTests {
+    override func setUp() {}
+}
+class BarTests {
+    override func setUpWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUpAlLExamples() {}
+}
+
+
final class FooTests: XCTestCase {
+    class func setUp() {}
+    class func tearDown() {}
+}
+
+

Triggering Examples

+
final class ↓FooTests: XCTestCase {
+    override func setUp() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func setUpWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+final class ↓BarTests: XCTestCase {
+    override func setUpWithError() throws {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    class func tearDown() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func tearDown() {}
+}
+
+
final class ↓FooTests: XCTestCase {
+    override func tearDownWithError() throws {}
+}
+
+
final class FooTests: XCTestCase {
+    override func setUp() {}
+    override func tearDownWithError() throws {}
+}
+final class ↓BarTests: XCTestCase {
+    override func tearDownWithError() throws {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/block_based_kvo.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/block_based_kvo.html new file mode 100644 index 000000000..55e22cd62 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/block_based_kvo.html @@ -0,0 +1,360 @@ + + + + block_based_kvo Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Block Based KVO

+ +

Prefer the new block based KVO API with keypaths when using Swift 3.2 or later.

+ +
    +
  • Identifier: block_based_kvo
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let observer = foo.observe(\.value, options: [.new]) { (foo, change) in
+   print(change.newValue)
+}
+
+

Triggering Examples

+
class Foo: NSObject {
+  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
+                              change: [NSKeyValueChangeKey : Any]?,
+                              context: UnsafeMutableRawPointer?) {}
+}
+
+
class Foo: NSObject {
+  override ↓func observeValue(forKeyPath keyPath: String?, of object: Any?,
+                              change: Dictionary<NSKeyValueChangeKey, Any>?,
+                              context: UnsafeMutableRawPointer?) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/capture_variable.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/capture_variable.html new file mode 100644 index 000000000..07ee44a63 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/capture_variable.html @@ -0,0 +1,465 @@ + + + + capture_variable Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Capture Variable

+ +

Non-constant variables should not be listed in a closure’s capture list to avoid confusion about closures capturing variables at creation time.

+ +
    +
  • Identifier: capture_variable
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class C {
+    let i: Int
+    init(_ i: Int) { self.i = i }
+}
+
+let j: Int = 0
+let c = C(1)
+
+let closure: () -> Void = { [j, c] in
+    print(c.i, j)
+}
+
+closure()
+
+
let iGlobal: Int = 0
+
+class C {
+    class var iClass: Int { 0 }
+    static let iStatic: Int = 0
+    let iInstance: Int = 0
+
+    func callTest() {
+        var iLocal: Int = 0
+        test { [unowned self, iGlobal, iInstance, iLocal, iClass=C.iClass, iStatic=C.iStatic] j in
+            print(iGlobal, iClass, iStatic, iInstance, iLocal, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+
var j: Int!
+j = 0
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+
lazy var j: Int = { 0 }()
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+

Triggering Examples

+
var j: Int = 0
+
+let closure: () -> Void = { [j] in
+    print(j)
+}
+
+closure()
+j = 1
+closure()
+
+
class C {
+    let i: Int
+    init(_ i: Int) { self.i = i }
+}
+
+var c = C(0)
+let closure: () -> Void = { [c] in
+    print(c.i)
+}
+
+closure()
+c = C(1)
+closure()
+
+
var iGlobal: Int = 0
+
+class C {
+    func callTest() {
+        test { [iGlobal] j in
+            print(iGlobal, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+
class C {
+    static var iStatic: Int = 0
+
+    static func callTest() {
+        test { [↓iStatic] j in
+            print(iStatic, j)
+        }
+    }
+
+    static func test(_ completionHandler: @escaping (Int) -> Void) {
+        completionHandler(2)
+        C.iStatic = 1
+        completionHandler(3)
+    }
+}
+
+C.callTest()
+
+
class C {
+    var iInstance: Int = 0
+
+    func callTest() {
+        test { [iInstance] j in
+            print(iInstance, j)
+        }
+    }
+
+    func test(_ completionHandler: @escaping (Int) -> Void) {
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/class_delegate_protocol.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/class_delegate_protocol.html new file mode 100644 index 000000000..c5fd1a783 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/class_delegate_protocol.html @@ -0,0 +1,390 @@ + + + + class_delegate_protocol Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Class Delegate Protocol

+ +

Delegate protocols should be class-only so they can be weakly referenced.

+ +
    +
  • Identifier: class_delegate_protocol
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol FooDelegate: class {}
+
+
+
protocol FooDelegate: class, BarDelegate {}
+
+
+
protocol Foo {}
+
+
+
class FooDelegate {}
+
+
+
@objc protocol FooDelegate {}
+
+
+
@objc(MyFooDelegate)
+ protocol FooDelegate {}
+
+
+
protocol FooDelegate: BarDelegate {}
+
+
+
protocol FooDelegate: AnyObject {}
+
+
+
protocol FooDelegate: NSObjectProtocol {}
+
+
+
protocol FooDelegate where Self: BarDelegate {}
+
+
+
protocol FooDelegate where Self: AnyObject {}
+
+
+
protocol FooDelegate where Self: NSObjectProtocol {}
+
+
+

Triggering Examples

+
↓protocol FooDelegate {}
+
+
+
↓protocol FooDelegate: Bar {}
+
+
+
↓protocol FooDelegate where Self: StringProtocol {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closing_brace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closing_brace.html new file mode 100644 index 000000000..53f70b5ae --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closing_brace.html @@ -0,0 +1,354 @@ + + + + closing_brace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closing Brace Spacing

+ +

Closing brace with closing parenthesis should not have any whitespaces in the middle.

+ +
    +
  • Identifier: closing_brace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[].map({ })
+
+
[].map(
+  { }
+)
+
+

Triggering Examples

+
[].map({ ↓} )
+
+
[].map({ ↓}   )
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_body_length.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_body_length.html new file mode 100644 index 000000000..0eb1555b9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_body_length.html @@ -0,0 +1,1034 @@ + + + + closure_body_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Body Length

+ +

Closure bodies should not span too many lines.

+ +
    +
  • Identifier: closure_body_length
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 30, error: 100
  • +
+

Non Triggering Examples

+
foo.bar { $0 }
+
+
foo.bar { toto in
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}
+
+
foo.bar { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar({ toto in
+})
+
+
foo.bar({ toto in
+    let a0 = 0
+})
+
+
foo.bar({ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}, anotherLabel: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+})
+
+
foo.bar(label: { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}) { toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+}
+
+
let foo: Bar = { toto in
+    let bar = Bar()
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    return bar
+}()
+
+

Triggering Examples

+
foo.bar ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}
+
+
foo.bar ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+    // toto
+
+
+
+
+
+
+
+
+
+
+}
+
+
foo.bar(↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}, anotherLabel: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+})
+
+
foo.bar(label: ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}) ↓{ toto in
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    let a29 = 0
+    let a30 = 0
+}
+
+
let foo: Bar = ↓{ toto in
+    let bar = Bar()
+    let a0 = 0
+    let a1 = 0
+    let a2 = 0
+    let a3 = 0
+    let a4 = 0
+    let a5 = 0
+    let a6 = 0
+    let a7 = 0
+    let a8 = 0
+    let a9 = 0
+    let a10 = 0
+    let a11 = 0
+    let a12 = 0
+    let a13 = 0
+    let a14 = 0
+    let a15 = 0
+    let a16 = 0
+    let a17 = 0
+    let a18 = 0
+    let a19 = 0
+    let a20 = 0
+    let a21 = 0
+    let a22 = 0
+    let a23 = 0
+    let a24 = 0
+    let a25 = 0
+    let a26 = 0
+    let a27 = 0
+    let a28 = 0
+    return bar
+}()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_end_indentation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_end_indentation.html new file mode 100644 index 000000000..fb5adb857 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_end_indentation.html @@ -0,0 +1,414 @@ + + + + closure_end_indentation Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure End Indentation

+ +

Closure end should have the same indentation as the line that started it.

+ +
    +
  • Identifier: closure_end_indentation
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
SignalProducer(values: [1, 2, 3])
+   .startWithNext { number in
+       print(number)
+   }
+
+
+
[1, 2].map { $0 + 1 }
+
+
+
return match(pattern: pattern, with: [.comment]).flatMap { range in
+   return Command(string: contents, range: range)
+}.flatMap { command in
+   return command.expand()
+}
+
+
+
foo(foo: bar,
+    options: baz) { _ in }
+
+
+
someReallyLongProperty.chainingWithAnotherProperty
+   .foo { _ in }
+
+
foo(abc, 123)
+{ _ in }
+
+
+
function(
+    closure: { x in
+        print(x)
+    },
+    anotherClosure: { y in
+        print(y)
+    })
+
+
function(parameter: param,
+         closure: { x in
+    print(x)
+})
+
+
function(parameter: param, closure: { x in
+        print(x)
+    },
+    anotherClosure: { y in
+        print(y)
+    })
+
+
(-variable).foo()
+
+

Triggering Examples

+
SignalProducer(values: [1, 2, 3])
+   .startWithNext { number in
+       print(number)
+↓}
+
+
+
return match(pattern: pattern, with: [.comment]).flatMap { range in
+   return Command(string: contents, range: range)
+   ↓}.flatMap { command in
+   return command.expand()
+↓}
+
+
+
function(
+    closure: { x in
+        print(x)
+↓},
+    anotherClosure: { y in
+        print(y)
+↓})
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_parameter_position.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_parameter_position.html new file mode 100644 index 000000000..653e6536f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_parameter_position.html @@ -0,0 +1,438 @@ + + + + closure_parameter_position Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Parameter Position

+ +

Closure parameters should be on the same line as opening brace.

+ +
    +
  • Identifier: closure_parameter_position
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2].map { $0 + 1 }
+
+
+
[1, 2].map({ $0 + 1 })
+
+
+
[1, 2].map { number in
+ number + 1 
+}
+
+
+
[1, 2].map { number -> Int in
+ number + 1 
+}
+
+
+
[1, 2].map { (number: Int) -> Int in
+ number + 1 
+}
+
+
+
[1, 2].map { [weak self] number in
+ number + 1 
+}
+
+
+
[1, 2].something(closure: { number in
+ number + 1 
+})
+
+
+
let isEmpty = [1, 2].isEmpty()
+
+
+
rlmConfiguration.migrationBlock.map { rlmMigration in
+    return { migration, schemaVersion in
+        rlmMigration(migration.rlmMigration, schemaVersion)
+    }
+}
+
+
let mediaView: UIView = { [weak self] index in
+   return UIView()
+}(index)
+
+

Triggering Examples

+
[1, 2].map {
+    ↓number in
+    number + 1
+}
+
+
[1, 2].map {
+    ↓number -> Int in
+    number + 1
+}
+
+
[1, 2].map {
+    (↓number: Int) -> Int in
+    number + 1
+}
+
+
[1, 2].map {
+    [weak ↓self] ↓number in
+    number + 1
+}
+
+
[1, 2].map { [weak self]
+    ↓number in
+    number + 1
+}
+
+
[1, 2].map({
+    ↓number in
+    number + 1
+})
+
+
[1, 2].something(closure: {
+    ↓number in
+    number + 1
+})
+
+
[1, 2].reduce(0) {
+    ↓sum, ↓number in
+    number + sum
+})
+
+
f.completionHandler = {
+    ↓thing in
+    doStuff()
+}
+
+
foo {
+    [weak ↓self] in
+    self?.bar()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_spacing.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_spacing.html new file mode 100644 index 000000000..2f2f03176 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/closure_spacing.html @@ -0,0 +1,362 @@ + + + + closure_spacing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Closure Spacing

+ +

Closure expressions should have a single space inside each brace.

+ +
    +
  • Identifier: closure_spacing
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[].map ({ $0.description })
+
+
[].filter { $0.contains(location) }
+
+
extension UITableViewCell: ReusableView { }
+
+
extension UITableViewCell: ReusableView {}
+
+

Triggering Examples

+
[].filter↓{ $0.contains(location) }
+
+
[].filter(↓{$0.contains(location)})
+
+
[].map(↓{$0})
+
+
(↓{each in return result.contains(where: ↓{e in return e}) }).count
+
+
filter ↓{ sorted ↓{ $0 < $1}}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/collection_alignment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/collection_alignment.html new file mode 100644 index 000000000..79bb9f335 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/collection_alignment.html @@ -0,0 +1,420 @@ + + + + collection_alignment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Collection Element Alignment

+ +

All elements in a collection literal should be vertically aligned

+ +
    +
  • Identifier: collection_alignment
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, align_colons: false
  • +
+

Non Triggering Examples

+
doThings(arg: [
+    "foo": 1,
+    "bar": 2,
+    "fizz": 2,
+    "buzz": 2
+])
+
+
let abc = [
+    "alpha": "a",
+    "beta": "b",
+    "gamma": "g",
+    "delta": "d",
+    "epsilon": "e"
+]
+
+
let meals = [
+                "breakfast": "oatmeal",
+                "lunch": "sandwich",
+                "dinner": "burger"
+]
+
+
let coordinates = [
+    CLLocationCoordinate2D(latitude: 0, longitude: 33),
+    CLLocationCoordinate2D(latitude: 0, longitude: 66),
+    CLLocationCoordinate2D(latitude: 0, longitude: 99)
+]
+
+
var evenNumbers: Set<Int> = [
+    2,
+    4,
+    6
+]
+
+
let abc = [1, 2, 3, 4]
+
+
let abc = [
+    1, 2, 3, 4
+]
+
+
let abc = [
+    "foo": "bar", "fizz": "buzz"
+]
+
+

Triggering Examples

+
doThings(arg: [
+    "foo": 1,
+    "bar": 2,
+   ↓"fizz": 2,
+   ↓"buzz": 2
+])
+
+
let abc = [
+    "alpha": "a",
+     ↓"beta": "b",
+    "gamma": "g",
+    "delta": "d",
+  ↓"epsilon": "e"
+]
+
+
let meals = [
+                "breakfast": "oatmeal",
+                "lunch": "sandwich",
+    ↓"dinner": "burger"
+]
+
+
let coordinates = [
+    CLLocationCoordinate2D(latitude: 0, longitude: 33),
+        ↓CLLocationCoordinate2D(latitude: 0, longitude: 66),
+    CLLocationCoordinate2D(latitude: 0, longitude: 99)
+]
+
+
var evenNumbers: Set<Int> = [
+    2,
+  ↓4,
+    6
+]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/colon.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/colon.html new file mode 100644 index 000000000..77d7091a0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/colon.html @@ -0,0 +1,632 @@ + + + + colon Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Colon Spacing

+ +

Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.

+ +
    +
  • Identifier: colon
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, flexible_right_spacing: false, apply_to_dictionaries: true
  • +
+

Non Triggering Examples

+
let abc: Void
+
+
+
let abc: [Void: Void]
+
+
+
let abc: (Void, Void)
+
+
+
let abc: ([Void], String, Int)
+
+
+
let abc: [([Void], String, Int)]
+
+
+
let abc: String="def"
+
+
+
let abc: Int=0
+
+
+
let abc: Enum=Enum.Value
+
+
+
func abc(def: Void) {}
+
+
+
func abc(def: Void, ghi: Void) {}
+
+
+
let abc: String = "abc:"
+
+
let abc = [Void: Void]()
+
+
+
let abc = [1: [3: 2], 3: 4]
+
+
+
let abc = ["string": "string"]
+
+
+
let abc = ["string:string": "string"]
+
+
+
let abc: [String: Int]
+
+
+
func foo(bar: [String: Int]) {}
+
+
+
func foo() -> [String: Int] { return [:] }
+
+
+
let abc: Any
+
+
+
let abc: [Any: Int]
+
+
+
let abc: [String: Any]
+
+
+
class Foo: Bar {}
+
+
+
class Foo<T>: Bar {}
+
+
+
class Foo<T: Equatable>: Bar {}
+
+
+
class Foo<T, U>: Bar {}
+
+
+
class Foo<T: Equatable> {}
+
+
+
object.method(x: /* comment */ 5)
+
+
+
switch foo {
+case .bar:
+    _ = something()
+}
+
+
object.method(x: 5, y: "string")
+
+
+
object.method(x: 5, y:
+              "string")
+
+
object.method(5, y: "string")
+
+
+
func abc() { def(ghi: jkl) }
+
+
func abc(def: Void) { ghi(jkl: mno) }
+
+
class ABC { let def = ghi(jkl: mno) } }
+
+
func foo() { let dict = [1: 1] }
+
+
let aaa = Self.bbb ? Self.ccc : Self.ddd else {
+return nil
+Example("}
+
+
range.flatMap(file.syntaxMap.kinds(inByteRange:)) ?? []
+
+
@objc(receiveReply:)
+public class func receiveReply(_ reply: bad_instruction_exception_reply_t) -> CInt { 0 }
+
+
switch str {
+case "adlm", "adlam":             return .adlam
+case "aghb", "caucasianalbanian": return .caucasianAlbanian
+default:                          return nil
+}
+
+
precedencegroup PipelinePrecedence {
+  associativity: left
+}
+infix operator |> : PipelinePrecedence
+
+
switch scalar {
+  case 0x000A...0x000D /* LF ... CR */: return true
+  case 0x0085 /* NEXT LINE (NEL) */: return true
+  case 0x2028 /* LINE SEPARATOR */: return true
+  case 0x2029 /* PARAGRAPH SEPARATOR */: return true
+  default: return false
+}
+
+

Triggering Examples

+
let abc↓:Void
+
+
+
let abc↓:  Void
+
+
+
let abc↓ :Void
+
+
+
let abc↓ : Void
+
+
+
let abc↓ : [Void: Void]
+
+
+
let abc↓ : (Void, String, Int)
+
+
+
let abc↓ : ([Void], String, Int)
+
+
+
let abc↓ : [([Void], String, Int)]
+
+
+
let abc↓:  (Void, String, Int)
+
+
+
let abc↓:  ([Void], String, Int)
+
+
+
let abc↓:  [([Void], String, Int)]
+
+
+
let abc↓ :String="def"
+
+
+
let abc↓ :Int=0
+
+
+
let abc↓ :Int = 0
+
+
+
let abc↓:Int=0
+
+
+
let abc↓:Int = 0
+
+
+
let abc↓:Enum=Enum.Value
+
+
+
func abc(def↓:Void) {}
+
+
+
func abc(def↓:  Void) {}
+
+
+
func abc(def↓ :Void) {}
+
+
+
func abc(def↓ : Void) {}
+
+
+
func abc(def: Void, ghi↓ :Void) {}
+
+
+
let abc = [Void↓:Void]()
+
+
+
let abc = [Void↓ : Void]()
+
+
+
let abc = [Void↓:  Void]()
+
+
+
let abc = [Void↓ :  Void]()
+
+
+
let abc = [1: [3↓ : 2], 3: 4]
+
+
+
let abc = [1: [3↓ : 2], 3↓:  4]
+
+
+
let abc: [String↓ : Int]
+
+
+
let abc: [String↓:Int]
+
+
+
func foo(bar: [String↓ : Int]) {}
+
+
+
func foo(bar: [String↓:Int]) {}
+
+
+
func foo() -> [String↓ : Int] { return [:] }
+
+
+
func foo() -> [String↓:Int] { return [:] }
+
+
+
let abc↓ : Any
+
+
+
let abc: [Any↓ : Int]
+
+
+
let abc: [String↓ : Any]
+
+
+
class Foo↓ : Bar {}
+
+
+
class Foo↓:Bar {}
+
+
+
class Foo<T>↓ : Bar {}
+
+
+
class Foo<T>↓:Bar {}
+
+
+
class Foo<T, U>↓:Bar {}
+
+
+
class Foo<T: Equatable>↓:Bar {}
+
+
+
class Foo<T↓:Equatable> {}
+
+
+
class Foo<T↓ : Equatable> {}
+
+
+
object.method(x: 5, y↓ : "string")
+
+
+
object.method(x↓:5, y: "string")
+
+
+
object.method(x↓:  5, y: "string")
+
+
+
func abc() { def(ghi↓:jkl) }
+
+
func abc(def: Void) { ghi(jkl↓:mno) }
+
+
class ABC { let def = ghi(jkl↓:mno) } }
+
+
func foo() { let dict = [1↓ : 1] }
+
+
switch foo {
+case .bar↓ : return baz
+}
+
+
private var action↓:(() -> Void)?
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma.html new file mode 100644 index 000000000..468fc5060 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma.html @@ -0,0 +1,397 @@ + + + + comma Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comma Spacing

+ +

There should be no space before and one after any comma.

+ +
    +
  • Identifier: comma
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func abc(a: String, b: String) { }
+
+
abc(a: "string", b: "string"
+
+
enum a { case a, b, c }
+
+
func abc(
+  a: String,  // comment
+  bcd: String // comment
+) {
+}
+
+
+
func abc(
+  a: String,
+  bcd: String
+) {
+}
+
+
+
#imageLiteral(resourceName: "foo,bar,baz")
+
+
kvcStringBuffer.advanced(by: rootKVCLength)
+  .storeBytes(of: 0x2E /* '.' */, as: CChar.self)
+
+

Triggering Examples

+
func abc(a: String↓ ,b: String) { }
+
+
func abc(a: String↓ ,b: String↓ ,c: String↓ ,d: String) { }
+
+
abc(a: "string"↓,b: "string"
+
+
enum a { case a↓ ,b }
+
+
let result = plus(
+    first: 3↓ , // #683
+    second: 4
+)
+
+
+
Foo(
+  parameter: a.b.c,
+  tag: a.d,
+  value: a.identifier.flatMap { Int64($0) }↓ ,
+  reason: Self.abcd()
+)
+
+
return Foo(bar: .baz, title: fuzz,
+          message: My.Custom.message↓ ,
+          another: parameter, doIt: true,
+          alignment: .center)
+
+
Logger.logError("Hat is too large"↓,  info: [])
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma_inheritance.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma_inheritance.html new file mode 100644 index 000000000..92c451fcd --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comma_inheritance.html @@ -0,0 +1,378 @@ + + + + comma_inheritance Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comma Inheritance Rule

+ +

Use commas to separate types in inheritance lists

+ +
    +
  • Identifier: comma_inheritance
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct A: Codable, Equatable {}
+
+
enum B: Codable, Equatable {}
+
+
class C: Codable, Equatable {}
+
+
protocol D: Codable, Equatable {}
+
+
typealias E = Equatable & Codable
+
+
func foo<T: Equatable & Codable>(_ param: T) {}
+
+
protocol G {
+    associatedtype Model: Codable, Equatable
+}
+
+

Triggering Examples

+
struct A: Codable↓ & Equatable {}
+
+
struct A: Codable↓  & Equatable {}
+
+
struct A: Codable↓&Equatable {}
+
+
struct A: Codable↓& Equatable {}
+
+
enum B: Codable↓ & Equatable {}
+
+
class C: Codable↓ & Equatable {}
+
+
protocol D: Codable↓ & Equatable {}
+
+
protocol G {
+    associatedtype Model: Codable↓ & Equatable
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comment_spacing.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comment_spacing.html new file mode 100644 index 000000000..0fc3dedab --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/comment_spacing.html @@ -0,0 +1,400 @@ + + + + comment_spacing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Comment Spacing

+ +

Prefer at least one space after slashes for comments.

+ +
    +
  • Identifier: comment_spacing
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
// This is a comment
+
+
/// Triple slash comment
+
+
// Multiline double-slash
+// comment
+
+
/// Multiline triple-slash
+/// comment
+
+
/// Multiline triple-slash
+///   - This is indented
+
+
// - MARK: Mark comment
+
+
//: Swift Playground prose section
+
+
///////////////////////////////////////////////
+// Comment with some lines of slashes boxing it
+///////////////////////////////////////////////
+
+
//:#localized(key: "SwiftPlaygroundLocalizedProse")
+
+
/* Asterisk comment */
+
+
/*
+    Multiline asterisk comment
+*/
+
+
/*:
+    Multiline Swift Playground prose section
+*/
+
+
/*#-editable-code Swift Platground editable area*/default/*#-end-editable-code*/
+
+

Triggering Examples

+
//↓Something
+
+
//↓MARK
+
+
//↓👨‍👨‍👦‍👦Something
+
+
func a() {
+    //↓This needs refactoring
+    print("Something")
+}
+//↓We should improve above function
+
+
///↓This is a comment
+
+
/// Multiline triple-slash
+///↓This line is incorrect, though
+
+
//↓- MARK: Mark comment
+
+
//:↓Swift Playground prose section
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/compiler_protocol_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/compiler_protocol_init.html new file mode 100644 index 000000000..15ad4c612 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/compiler_protocol_init.html @@ -0,0 +1,362 @@ + + + + compiler_protocol_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Compiler Protocol Init

+ +

The initializers declared in compiler protocols such as ExpressibleByArrayLiteral shouldn’t be called directly.

+ +
    +
  • Identifier: compiler_protocol_init
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let set: Set<Int> = [1, 2]
+
+
+
let set = Set(array)
+
+
+

Triggering Examples

+
let set = ↓Set(arrayLiteral: 1, 2)
+
+
+
let set = ↓Set (arrayLiteral: 1, 2)
+
+
+
let set = ↓Set.init(arrayLiteral: 1, 2)
+
+
+
let set = ↓Set.init(arrayLiteral : 1, 2)
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/computed_accessors_order.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/computed_accessors_order.html new file mode 100644 index 000000000..19228ee59 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/computed_accessors_order.html @@ -0,0 +1,541 @@ + + + + computed_accessors_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Computed Accessors Order

+ +

Getter and setters in computed properties and subscripts should be in a consistent order.

+ +
    +
  • Identifier: computed_accessors_order
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, order: get_set
  • +
+

Non Triggering Examples

+
class Foo {
+    var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int
+}
+
+
class Foo {
+    var foo: Int {
+        return getValueFromDisk()
+    }
+}
+
+
class Foo {
+    var foo: String {
+        return "get"
+    }
+}
+
+
protocol Foo {
+    var foo: Int { get }
+
+
protocol Foo {
+    var foo: Int { get set }
+}
+
+
protocol Foo {
+    var foo: Int { set get }
+
+
class Foo {
+    var foo: Int {
+        struct Bar {
+            var bar: Int {
+                get { return 1 }
+                set { _ = newValue }
+            }
+        }
+
+        return Bar().bar
+    }
+}
+
+
var _objCTaggedPointerBits: UInt {
+    @inline(__always) get { return 0 }
+    set { print(newValue) }
+}
+
+
var next: Int? {
+    mutating get {
+        defer { self.count += 1 }
+        return self.count
+    }
+    set {
+        self.count = newValue
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set { self._bar = newValue }
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set(newValue) { self._bar = newValue }
+    }
+}
+
+
extension Reactive where Base: UITapGestureRecognizer {
+    var tapped: CocoaAction<Base>? {
+        get {
+            return associatedAction.withValue { $0.flatMap { $0.action } }
+        }
+        nonmutating set {
+            setAction(newValue)
+        }
+    }
+}
+
+
extension Test {
+    var foo: Bool {
+        get {
+            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
+        }
+        set {
+            bar = NSNumber(value: newValue as Bool)
+        }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        return 20
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get set }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { set get }
+}
+
+

Triggering Examples

+
class Foo {
+    var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+
var foo: Int {
+    ↓set { print(newValue) }
+    get { return 20 }
+}
+
+
extension Foo {
+    var bar: Bool {
+        ↓set { print(bar) }
+        get { _bar }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        ↓set {
+            print(newValue)
+        }
+        mutating get {
+            return 20
+        }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        ↓set {
+            print(i)
+        }
+        get {
+            return 20
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/conditional_returns_on_newline.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/conditional_returns_on_newline.html new file mode 100644 index 000000000..7bd610813 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/conditional_returns_on_newline.html @@ -0,0 +1,381 @@ + + + + conditional_returns_on_newline Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Conditional Returns on Newline

+ +

Conditional statements should always return on the next line

+ +
    +
  • Identifier: conditional_returns_on_newline
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, if_only: false
  • +
+

Non Triggering Examples

+
guard true else {
+ return true
+}
+
+
guard true,
+ let x = true else {
+ return true
+}
+
+
if true else {
+ return true
+}
+
+
if true,
+ let x = true else {
+ return true
+}
+
+
if textField.returnKeyType == .Next {
+
+
if true { // return }
+
+
guard something
+else { return }
+
+

Triggering Examples

+
↓guard true else { return }
+
+
↓if true { return }
+
+
↓if true { break } else { return }
+
+
↓if true { break } else {       return }
+
+
↓if true { return "YES" } else { return "NO" }
+
+
↓guard condition else { XCTFail(); return }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_count.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_count.html new file mode 100644 index 000000000..a5a017798 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_count.html @@ -0,0 +1,407 @@ + + + + contains_over_filter_count Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains Over Filter Count

+ +

Prefer contains over comparing filter(where:).count to 0.

+ +
    +
  • Identifier: contains_over_filter_count
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count > 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 01
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count == 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 01
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count != 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 01
+
+
+
let result = myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = !myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = myList.contains(10)
+
+
+

Triggering Examples

+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count > 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count > 0
+
+
+
let result = ↓myList.filter(where: someFunction).count > 0
+
+
+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count == 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count == 0
+
+
+
let result = ↓myList.filter(where: someFunction).count == 0
+
+
+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).count != 0
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.count != 0
+
+
+
let result = ↓myList.filter(where: someFunction).count != 0
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html new file mode 100644 index 000000000..ab2c84b96 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_filter_is_empty.html @@ -0,0 +1,383 @@ + + + + contains_over_filter_is_empty Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains Over Filter Is Empty

+ +

Prefer contains over using filter(where:).isEmpty

+ +
    +
  • Identifier: contains_over_filter_is_empty
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let result = myList.filter(where: { $0 % 2 == 0 }).count > 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count > 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count == 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count == 1
+
+
+
let result = myList.filter(where: { $0 % 2 == 0 }).count != 1
+
+
+
let result = myList.filter { $0 % 2 == 0 }.count != 1
+
+
+
let result = myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = !myList.contains(where: { $0 % 2 == 0 })
+
+
+
let result = myList.contains(10)
+
+
+

Triggering Examples

+
let result = ↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
+
+
+
let result = !↓myList.filter(where: { $0 % 2 == 0 }).isEmpty
+
+
+
let result = ↓myList.filter { $0 % 2 == 0 }.isEmpty
+
+
+
let result = ↓myList.filter(where: someFunction).isEmpty
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_first_not_nil.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_first_not_nil.html new file mode 100644 index 000000000..104dfd3bd --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_first_not_nil.html @@ -0,0 +1,428 @@ + + + + contains_over_first_not_nil Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains over first not nil

+ +

Prefer contains over first(where:) != nil and firstIndex(where:) != nil.

+ +
    +
  • Identifier: contains_over_first_not_nil
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let first = myList.first(where: { $0 % 2 == 0 })
+
+
+
let first = myList.first { $0 % 2 == 0 }
+
+
+
let firstIndex = myList.firstIndex(where: { $0 % 2 == 0 })
+
+
+
let firstIndex = myList.firstIndex { $0 % 2 == 0 }
+
+
+

Triggering Examples

+
↓myList.first { $0 % 2 == 0 } != nil
+
+
+
↓myList.first(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.first(where: someFunction) != nil
+
+
+
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } != nil
+
+
+
(↓myList.first { $0 % 2 == 0 }) != nil
+
+
+
↓myList.first { $0 % 2 == 0 } == nil
+
+
+
↓myList.first(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.map { $0 + 1 }.first(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.first(where: someFunction) == nil
+
+
+
↓myList.map { $0 + 1 }.first { $0 % 2 == 0 } == nil
+
+
+
(↓myList.first { $0 % 2 == 0 }) == nil
+
+
+
↓myList.firstIndex { $0 % 2 == 0 } != nil
+
+
+
↓myList.firstIndex(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) != nil
+
+
+
↓myList.firstIndex(where: someFunction) != nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } != nil
+
+
+
(↓myList.firstIndex { $0 % 2 == 0 }) != nil
+
+
+
↓myList.firstIndex { $0 % 2 == 0 } == nil
+
+
+
↓myList.firstIndex(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex(where: { $0 % 2 == 0 }) == nil
+
+
+
↓myList.firstIndex(where: someFunction) == nil
+
+
+
↓myList.map { $0 + 1 }.firstIndex { $0 % 2 == 0 } == nil
+
+
+
(↓myList.firstIndex { $0 % 2 == 0 }) == nil
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html new file mode 100644 index 000000000..4fd7596dd --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/contains_over_range_nil_comparison.html @@ -0,0 +1,356 @@ + + + + contains_over_range_nil_comparison Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Contains over range(of:) comparison to nil

+ +

Prefer contains over range(of:) != nil and range(of:) == nil.

+ +
    +
  • Identifier: contains_over_range_nil_comparison
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let range = myString.range(of: "Test")
+
+
myString.contains("Test")
+
+
!myString.contains("Test")
+
+
resourceString.range(of: rule.regex, options: .regularExpression) != nil
+
+

Triggering Examples

+
↓myString.range(of: "Test") != nil
+
+
↓myString.range(of: "Test") == nil
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/control_statement.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/control_statement.html new file mode 100644 index 000000000..f131e58cc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/control_statement.html @@ -0,0 +1,459 @@ + + + + control_statement Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Control Statement

+ +

if, for, guard, switch, while, and catch statements shouldn’t unnecessarily wrap their conditionals or arguments in parentheses.

+ +
    +
  • Identifier: control_statement
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
if condition {
+
+
+
if (a, b) == (0, 1) {
+
+
+
if (a || b) && (c || d) {
+
+
+
if (min...max).contains(value) {
+
+
+
if renderGif(data) {
+
+
+
renderGif(data)
+
+
+
for item in collection {
+
+
+
for (key, value) in dictionary {
+
+
+
for (index, value) in enumerate(array) {
+
+
+
for var index = 0; index < 42; index++ {
+
+
+
guard condition else {
+
+
+
while condition {
+
+
+
} while condition {
+
+
+
do { ; } while condition {
+
+
+
switch foo {
+
+
+
do {
+} catch let error as NSError {
+}
+
+
foo().catch(all: true) {}
+
+
if max(a, b) < c {
+
+
+
switch (lhs, rhs) {
+
+
+

Triggering Examples

+
↓if (condition) {
+
+
+
↓if(condition) {
+
+
+
↓if (condition == endIndex) {
+
+
+
↓if ((a || b) && (c || d)) {
+
+
+
↓if ((min...max).contains(value)) {
+
+
+
↓for (item in collection) {
+
+
+
↓for (var index = 0; index < 42; index++) {
+
+
+
↓for(item in collection) {
+
+
+
↓for(var index = 0; index < 42; index++) {
+
+
+
↓guard (condition) else {
+
+
+
↓while (condition) {
+
+
+
↓while(condition) {
+
+
+
} ↓while (condition) {
+
+
+
} ↓while(condition) {
+
+
+
do { ; } ↓while(condition) {
+
+
+
do { ; } ↓while (condition) {
+
+
+
↓switch (foo) {
+
+
+
do {
+} ↓catch(let error as NSError) {
+}
+
+
↓if (max(a, b) < c) {
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/convenience_type.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/convenience_type.html new file mode 100644 index 000000000..41b6d99b2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/convenience_type.html @@ -0,0 +1,421 @@ + + + + convenience_type Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Convenience Type

+ +

Types used for hosting only static members should be implemented as a caseless enum to avoid instantiation.

+ +
    +
  • Identifier: convenience_type
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum Math { // enum
+  public static let pi = 3.14
+}
+
+
// class with inheritance
+class MathViewController: UIViewController {
+  public static let pi = 3.14
+}
+
+
@objc class Math: NSObject { // class visible to Obj-C
+  public static let pi = 3.14
+}
+
+
struct Math { // type with non-static declarations
+  public static let pi = 3.14
+  public let randomNumber = 2
+}
+
+
class DummyClass {}
+
+
class Foo: NSObject { // class with Obj-C class property
+    class @objc let foo = 1
+}
+
+
class Foo: NSObject { // class with Obj-C static property
+    static @objc let foo = 1
+}
+
+
class Foo { // @objc class func can't exist on an enum
+   @objc class func foo() {}
+}
+
+
class Foo { // @objc static func can't exist on an enum
+   @objc static func foo() {}
+}
+
+
@objcMembers class Foo { // @objc static func can't exist on an enum
+   static func foo() {}
+}
+
+
final class Foo { // final class, but @objc class func can't exist on an enum
+   @objc class func foo() {}
+}
+
+
final class Foo { // final class, but @objc static func can't exist on an enum
+   @objc static func foo() {}
+}
+
+
@globalActor actor MyActor {
+  static let shared = MyActor()
+}
+
+

Triggering Examples

+
↓struct Math {
+  public static let pi = 3.14
+}
+
+
↓struct Math {
+  public static let pi = 3.14
+  @available(*, unavailable) init() {}
+}
+
+
final ↓class Foo { // final class can't be inherited
+    class let foo = 1
+}
+
+
↓class Foo {
+    class let foo = 1
+}
+
+
↓class Foo {
+    final class let foo = 1
+}
+
+
↓class SomeClass {
+    static func foo() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/highlight.css b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/highlight.css new file mode 100644 index 000000000..c170357ce --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/highlight.css @@ -0,0 +1,202 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +/* Credit to https://gist.github.com/wataru420/2048287 */ +.highlight .c { + color: #999988; + font-style: italic; } + +.highlight .err { + color: #a61717; + background-color: #e3d2d2; } + +.highlight .k { + color: #000000; + font-weight: bold; } + +.highlight .o { + color: #000000; + font-weight: bold; } + +.highlight .cm { + color: #999988; + font-style: italic; } + +.highlight .cp { + color: #999999; + font-weight: bold; } + +.highlight .c1 { + color: #999988; + font-style: italic; } + +.highlight .cs { + color: #999999; + font-weight: bold; + font-style: italic; } + +.highlight .gd { + color: #000000; + background-color: #ffdddd; } + +.highlight .gd .x { + color: #000000; + background-color: #ffaaaa; } + +.highlight .ge { + color: #000000; + font-style: italic; } + +.highlight .gr { + color: #aa0000; } + +.highlight .gh { + color: #999999; } + +.highlight .gi { + color: #000000; + background-color: #ddffdd; } + +.highlight .gi .x { + color: #000000; + background-color: #aaffaa; } + +.highlight .go { + color: #888888; } + +.highlight .gp { + color: #555555; } + +.highlight .gs { + font-weight: bold; } + +.highlight .gu { + color: #aaaaaa; } + +.highlight .gt { + color: #aa0000; } + +.highlight .kc { + color: #000000; + font-weight: bold; } + +.highlight .kd { + color: #000000; + font-weight: bold; } + +.highlight .kp { + color: #000000; + font-weight: bold; } + +.highlight .kr { + color: #000000; + font-weight: bold; } + +.highlight .kt { + color: #445588; } + +.highlight .m { + color: #009999; } + +.highlight .s { + color: #d14; } + +.highlight .na { + color: #008080; } + +.highlight .nb { + color: #0086B3; } + +.highlight .nc { + color: #445588; + font-weight: bold; } + +.highlight .no { + color: #008080; } + +.highlight .ni { + color: #800080; } + +.highlight .ne { + color: #990000; + font-weight: bold; } + +.highlight .nf { + color: #990000; } + +.highlight .nn { + color: #555555; } + +.highlight .nt { + color: #000080; } + +.highlight .nv { + color: #008080; } + +.highlight .ow { + color: #000000; + font-weight: bold; } + +.highlight .w { + color: #bbbbbb; } + +.highlight .mf { + color: #009999; } + +.highlight .mh { + color: #009999; } + +.highlight .mi { + color: #009999; } + +.highlight .mo { + color: #009999; } + +.highlight .sb { + color: #d14; } + +.highlight .sc { + color: #d14; } + +.highlight .sd { + color: #d14; } + +.highlight .s2 { + color: #d14; } + +.highlight .se { + color: #d14; } + +.highlight .sh { + color: #d14; } + +.highlight .si { + color: #d14; } + +.highlight .sx { + color: #d14; } + +.highlight .sr { + color: #009926; } + +.highlight .s1 { + color: #d14; } + +.highlight .ss { + color: #990073; } + +.highlight .bp { + color: #999999; } + +.highlight .vc { + color: #008080; } + +.highlight .vg { + color: #008080; } + +.highlight .vi { + color: #008080; } + +.highlight .il { + color: #009999; } diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/jazzy.css b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/jazzy.css new file mode 100644 index 000000000..c7bb9fe22 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/css/jazzy.css @@ -0,0 +1,404 @@ +/*! Jazzy - https://github.com/realm/jazzy + * Copyright Realm Inc. + * SPDX-License-Identifier: MIT + */ +*, *:before, *:after { + box-sizing: inherit; } + +body { + margin: 0; + background: #fff; + color: #333; + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: .2px; + -webkit-font-smoothing: antialiased; + box-sizing: border-box; } + +h1 { + font-size: 2rem; + font-weight: 700; + margin: 1.275em 0 0.6em; } + +h2 { + font-size: 1.75rem; + font-weight: 700; + margin: 1.275em 0 0.3em; } + +h3 { + font-size: 1.5rem; + font-weight: 700; + margin: 1em 0 0.3em; } + +h4 { + font-size: 1.25rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h5 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; } + +h6 { + font-size: 1rem; + font-weight: 700; + margin: 1.275em 0 0.85em; + color: #777; } + +p { + margin: 0 0 1em; } + +ul, ol { + padding: 0 0 0 2em; + margin: 0 0 0.85em; } + +blockquote { + margin: 0 0 0.85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5; } + +img { + max-width: 100%; } + +a { + color: #4183c4; + text-decoration: none; } + a:hover, a:focus { + outline: 0; + text-decoration: underline; } + a.discouraged { + text-decoration: line-through; } + a.discouraged:hover, a.discouraged:focus { + text-decoration: underline line-through; } + +table { + background: #fff; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto; + margin: 0 0 0.85em; } + +tr:nth-child(2n) { + background-color: #fbfbfb; } + +th, td { + padding: 6px 13px; + border: 1px solid #ddd; } + +hr { + height: 1px; + border: none; + background-color: #ddd; } + +pre { + margin: 0 0 1.275em; + padding: .85em 1em; + overflow: auto; + background: #f7f7f7; + font-size: .85em; + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; } + +.item-container p > code, .item-container li > code, .top-matter p > code, .top-matter li > code { + background: #f7f7f7; + padding: .2em; } + .item-container p > code:before, .item-container p > code:after, .item-container li > code:before, .item-container li > code:after, .top-matter p > code:before, .top-matter p > code:after, .top-matter li > code:before, .top-matter li > code:after { + letter-spacing: -.2em; + content: "\00a0"; } + +pre code { + padding: 0; + white-space: pre; } + +.content-wrapper { + display: flex; + flex-direction: column; } + @media (min-width: 768px) { + .content-wrapper { + flex-direction: row; } } +.header { + display: flex; + padding: 8px; + font-size: 0.875em; + background: #444; + color: #999; } + +.header-col { + margin: 0; + padding: 0 8px; } + +.header-col--primary { + flex: 1; } + +.header-link { + color: #fff; } + +.header-icon { + padding-right: 2px; + vertical-align: -3px; + height: 16px; } + +.breadcrumbs { + font-size: 0.875em; + padding: 8px 16px; + margin: 0; + background: #fbfbfb; + border-bottom: 1px solid #ddd; } + +.carat { + height: 10px; + margin: 0 5px; } + +.navigation { + order: 2; } + @media (min-width: 768px) { + .navigation { + order: 1; + width: 25%; + max-width: 300px; + padding-bottom: 64px; + overflow: hidden; + word-wrap: normal; + background: #fbfbfb; + border-right: 1px solid #ddd; } } +.nav-groups { + list-style-type: none; + padding-left: 0; } + +.nav-group-name { + border-bottom: 1px solid #ddd; + padding: 8px 0 8px 16px; } + +.nav-group-name-link { + color: #333; } + +.nav-group-tasks { + margin: 8px 0; + padding: 0 0 0 8px; } + +.nav-group-task { + font-size: 1em; + list-style-type: none; + white-space: nowrap; } + +.nav-group-task-link { + color: #808080; } + +.main-content { + order: 1; } + @media (min-width: 768px) { + .main-content { + order: 2; + flex: 1; + padding-bottom: 60px; } } +.section { + padding: 0 32px; + border-bottom: 1px solid #ddd; } + +.section-content { + max-width: 834px; + margin: 0 auto; + padding: 16px 0; } + +.section-name { + color: #666; + display: block; } + .section-name p { + margin-bottom: inherit; } + +.declaration .highlight { + overflow-x: initial; + padding: 8px 0; + margin: 0; + background-color: transparent; + border: none; } + +.task-group-section { + border-top: 1px solid #ddd; } + +.task-group { + padding-top: 0px; } + +.task-name-container a[name]:before { + content: ""; + display: block; } + +.section-name-container { + position: relative; } + .section-name-container .section-name-link { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + margin-bottom: 0; } + .section-name-container .section-name { + position: relative; + pointer-events: none; + z-index: 1; } + .section-name-container .section-name a { + pointer-events: auto; } + +.item-container { + padding: 0; } + +.item { + padding-top: 8px; + width: 100%; + list-style-type: none; } + .item a[name]:before { + content: ""; + display: block; } + .item .token, .item .direct-link { + display: inline-block; + text-indent: -20px; + padding-left: 3px; + margin-left: 20px; + font-size: 1rem; } + .item .declaration-note { + font-size: .85em; + color: #808080; + font-style: italic; } + +.pointer-container { + border-bottom: 1px solid #ddd; + left: -23px; + padding-bottom: 13px; + position: relative; + width: 110%; } + +.pointer { + left: 21px; + top: 7px; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 1px solid #ddd; + border-top: 1px solid #ddd; + background: #fff; + transform: rotate(45deg); } + +.height-container { + display: none; + position: relative; + width: 100%; + overflow: hidden; } + .height-container .section { + background: #fff; + border: 1px solid #ddd; + border-top-width: 0; + padding-top: 10px; + padding-bottom: 5px; + padding: 8px 16px; } + +.aside, .language { + padding: 6px 12px; + margin: 12px 0; + border-left: 5px solid #dddddd; + overflow-y: hidden; } + .aside .aside-title, .language .aside-title { + font-size: 9px; + letter-spacing: 2px; + text-transform: uppercase; + padding-bottom: 0; + margin: 0; + color: #aaa; + -webkit-user-select: none; } + .aside p:last-child, .language p:last-child { + margin-bottom: 0; } + +.language { + border-left: 5px solid #cde9f4; } + .language .aside-title { + color: #4183c4; } + +.aside-warning, .aside-deprecated, .aside-unavailable { + border-left: 5px solid #ff6666; } + .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title { + color: #ff0000; } + +.graybox { + border-collapse: collapse; + width: 100%; } + .graybox p { + margin: 0; + word-break: break-word; + min-width: 50px; } + .graybox td { + border: 1px solid #ddd; + padding: 5px 25px 5px 10px; + vertical-align: middle; } + .graybox tr td:first-of-type { + text-align: right; + padding: 7px; + vertical-align: top; + word-break: normal; + width: 40px; } + +.slightly-smaller { + font-size: 0.9em; } + +.footer { + padding: 8px 16px; + background: #444; + color: #ddd; + font-size: 0.8em; } + .footer p { + margin: 8px 0; } + .footer a { + color: #fff; } + +html.dash .header, html.dash .breadcrumbs, html.dash .navigation { + display: none; } + +html.dash .height-container { + display: block; } + +form[role=search] input { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 24px; + padding: 0 10px; + margin: 0; + border: none; + border-radius: 1em; } + .loading form[role=search] input { + background: white url(../img/spinner.gif) center right 4px no-repeat; } + +form[role=search] .tt-menu { + margin: 0; + min-width: 300px; + background: #fbfbfb; + color: #333; + border: 1px solid #ddd; } + +form[role=search] .tt-highlight { + font-weight: bold; } + +form[role=search] .tt-suggestion { + font: 16px/1.7 "Helvetica Neue", Helvetica, Arial, sans-serif; + padding: 0 8px; } + form[role=search] .tt-suggestion span { + display: table-cell; + white-space: nowrap; } + form[role=search] .tt-suggestion .doc-parent-name { + width: 100%; + text-align: right; + font-weight: normal; + font-size: 0.9em; + padding-left: 16px; } + +form[role=search] .tt-suggestion:hover, +form[role=search] .tt-suggestion.tt-cursor { + cursor: pointer; + background-color: #4183c4; + color: #fff; } + +form[role=search] .tt-suggestion:hover .doc-parent-name, +form[role=search] .tt-suggestion.tt-cursor .doc-parent-name { + color: #fff; } diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/custom_rules.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/custom_rules.html new file mode 100644 index 000000000..8c315afb7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/custom_rules.html @@ -0,0 +1,342 @@ + + + + custom_rules Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Custom Rules

+ +

Create custom rules by providing a regex string. Optionally specify what syntax kinds to match against, the severity level, and what message to display.

+ +
    +
  • Identifier: custom_rules
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: user-defined
  • +
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/cyclomatic_complexity.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/cyclomatic_complexity.html new file mode 100644 index 000000000..7f905d43e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/cyclomatic_complexity.html @@ -0,0 +1,395 @@ + + + + cyclomatic_complexity Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Cyclomatic Complexity

+ +

Complexity of function bodies should be limited.

+ +
    +
  • Identifier: cyclomatic_complexity
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 10, error: 20, ignores_case_statements: false
  • +
+

Non Triggering Examples

+
func f1() {
+    if true {
+        for _ in 1..5 { }
+    }
+    if false { }
+}
+
+
func f(code: Int) -> Int {
+    switch code {
+    case 0: fallthrough
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    case 0: return 1
+    default: return 1
+    }
+}
+
+
func f1() {
+    if true {}; if true {}; if true {}; if true {}; if true {}; if true {}
+    func f2() {
+        if true {}; if true {}; if true {}; if true {}; if true {}
+    }
+}
+
+

Triggering Examples

+
↓func f1() {
+    if true {
+        if true {
+            if false {}
+        }
+    }
+    if false {}
+    let i = 0
+    switch i {
+        case 1: break
+        case 2: break
+        case 3: break
+        case 4: break
+        default: break
+    }
+    for _ in 1...5 {
+        guard true else {
+            return
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/deployment_target.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/deployment_target.html new file mode 100644 index 000000000..ef581d8e1 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/deployment_target.html @@ -0,0 +1,422 @@ + + + + deployment_target Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Deployment Target

+ +

Availability checks or attributes shouldn’t be using older versions that are satisfied by the deployment target.

+ +
    +
  • Identifier: deployment_target
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, iOSApplicationExtension_deployment_target: 7.0, iOS_deployment_target: 7.0, macOSApplicationExtension_deployment_target: 10.9, macOS_deployment_target: 10.9, tvOSApplicationExtension_deployment_target: 9.0, tvOS_deployment_target: 9.0, watchOSApplicationExtension_deployment_target: 1.0, watchOS_deployment_target: 1.0
  • +
+

Non Triggering Examples

+
@available(iOS 12.0, *)
+class A {}
+
+
@available(iOSApplicationExtension 13.0, *)
+class A {}
+
+
@available(watchOS 4.0, *)
+class A {}
+
+
@available(watchOSApplicationExtension 4.0, *)
+class A {}
+
+
@available(swift 3.0.2)
+class A {}
+
+
class A {}
+
+
if #available(iOS 10.0, *) {}
+
+
if #available(iOS 10, *) {}
+
+
guard #available(iOS 12.0, *) else { return }
+
+
#if #unavailable(iOS 15.0) {}
+
+
#guard #unavailable(iOS 15.0) {} else { return }
+
+

Triggering Examples

+
↓@available(iOS 6.0, *)
+class A {}
+
+
↓@available(iOSApplicationExtension 6.0, *)
+class A {}
+
+
↓@available(iOS 7.0, *)
+class A {}
+
+
↓@available(iOS 6, *)
+class A {}
+
+
↓@available(iOS 6.0, macOS 10.12, *)
+ class A {}
+
+
↓@available(macOS 10.12, iOS 6.0, *)
+ class A {}
+
+
↓@available(macOS 10.7, *)
+class A {}
+
+
↓@available(macOSApplicationExtension 10.7, *)
+class A {}
+
+
↓@available(OSX 10.7, *)
+class A {}
+
+
↓@available(watchOS 0.9, *)
+class A {}
+
+
↓@available(watchOSApplicationExtension 0.9, *)
+class A {}
+
+
↓@available(tvOS 8, *)
+class A {}
+
+
↓@available(tvOSApplicationExtension 8, *)
+class A {}
+
+
if ↓#available(iOS 6.0, *) {}
+
+
if ↓#available(iOS 6, *) {}
+
+
guard ↓#available(iOS 6.0, *) else { return }
+
+
if ↓#unavailable(iOS 7.0) {}
+
+
if ↓#unavailable(iOS 6.9) {}
+
+
guard ↓#unavailable(iOS 7.0) {} else { return }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discarded_notification_center_observer.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discarded_notification_center_observer.html new file mode 100644 index 000000000..03c270cc8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discarded_notification_center_observer.html @@ -0,0 +1,389 @@ + + + + discarded_notification_center_observer Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discarded Notification Center Observer

+ +

When registering for a notification using a block, the opaque observer that is returned should be stored so it can be removed later.

+ +
    +
  • Identifier: discarded_notification_center_observer
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
let foo = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
func foo() -> Any {
+   return nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+}
+
+
+
var obs: [Any?] = []
+obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
var obs: [String: Any?] = []
+obs["foo"] = nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
var obs: [Any?] = []
+obs.append(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
func foo(_ notif: Any) {
+   obs.append(notif)
+}
+foo(nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }))
+
+
+
var obs: [NSObjectProtocol] = [
+   nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { }),
+   nc.addObserver(forName: .CKAccountChanged, object: nil, queue: nil, using: { })
+]
+
+

Triggering Examples

+
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
_ = ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil) { }
+
+
+
↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+
+
+
@discardableResult func foo() -> Any {
+   return ↓nc.addObserver(forName: .NSSystemTimeZoneDidChange, object: nil, queue: nil, using: { })
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_assert.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_assert.html new file mode 100644 index 000000000..5bb0c7764 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_assert.html @@ -0,0 +1,362 @@ + + + + discouraged_assert Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Assert

+ +

Prefer assertionFailure() and/or preconditionFailure() over assert(false)

+ +
    +
  • Identifier: discouraged_assert
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
assert(true)
+
+
assert(true, "foobar")
+
+
assert(true, "foobar", file: "toto", line: 42)
+
+
assert(false || true)
+
+
XCTAssert(false)
+
+

Triggering Examples

+
↓assert(false)
+
+
↓assert(false, "foobar")
+
+
↓assert(false, "foobar", file: "toto", line: 42)
+
+
↓assert(   false    , "foobar")
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_direct_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_direct_init.html new file mode 100644 index 000000000..2d882aca9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_direct_init.html @@ -0,0 +1,386 @@ + + + + discouraged_direct_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Direct Initialization

+ +

Discouraged direct initialization of types that can be harmful.

+ +
    +
  • Identifier: discouraged_direct_init
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, types: [“Bundle”, “Bundle.init”, “NSError”, “NSError.init”, “UIDevice”, “UIDevice.init”]
  • +
+

Non Triggering Examples

+
let foo = UIDevice.current
+
+
let foo = Bundle.main
+
+
let foo = Bundle(path: "bar")
+
+
let foo = Bundle(identifier: "bar")
+
+
let foo = Bundle.init(path: "bar")
+
+
let foo = Bundle.init(identifier: "bar")
+
+
let foo = NSError(domain: "bar", code: 0)
+
+
let foo = NSError.init(domain: "bar", code: 0)
+
+
func testNSError()
+
+

Triggering Examples

+
↓UIDevice()
+
+
↓Bundle()
+
+
let foo = ↓UIDevice()
+
+
let foo = ↓Bundle()
+
+
let foo = ↓NSError()
+
+
let foo = bar(bundle: ↓Bundle(), device: ↓UIDevice(), error: ↓NSError())
+
+
↓UIDevice.init()
+
+
↓Bundle.init()
+
+
↓NSError.init()
+
+
let foo = ↓UIDevice.init()
+
+
let foo = ↓Bundle.init()
+
+
let foo = bar(bundle: ↓Bundle.init(), device: ↓UIDevice.init(), error: ↓NSError.init())
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_none_name.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_none_name.html new file mode 100644 index 000000000..8c5813cbc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_none_name.html @@ -0,0 +1,472 @@ + + + + discouraged_none_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged None Name

+ +

Discourages name cases/static members none, which can conflict with Optional<T>.none.

+ +
    +
  • Identifier: discouraged_none_name
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum MyEnum {
+    case nOne
+}
+
+
enum MyEnum {
+    case _none
+}
+
+
enum MyEnum {
+    case none_
+}
+
+
enum MyEnum {
+    case none(Any)
+}
+
+
enum MyEnum {
+    case nonenone
+}
+
+
class MyClass {
+    class var nonenone: MyClass { MyClass() }
+}
+
+
class MyClass {
+    static var nonenone = MyClass()
+}
+
+
class MyClass {
+    static let nonenone = MyClass()
+}
+
+
struct MyStruct {
+    static var nonenone = MyStruct()
+}
+
+
struct MyStruct {
+    static let nonenone = MyStruct()
+}
+
+
struct MyStruct {
+    let none = MyStruct()
+}
+
+
struct MyStruct {
+    var none = MyStruct()
+}
+
+
class MyClass {
+    let none = MyClass()
+}
+
+
class MyClass {
+    var none = MyClass()
+}
+
+

Triggering Examples

+
enum MyEnum {
+    case ↓none
+}
+
+
enum MyEnum {
+    case a, ↓none
+}
+
+
enum MyEnum {
+    case ↓none, b
+}
+
+
enum MyEnum {
+    case a, ↓none, b
+}
+
+
enum MyEnum {
+    case a
+    case ↓none
+}
+
+
enum MyEnum {
+    case ↓none
+    case b
+}
+
+
enum MyEnum {
+    case a
+    case ↓none
+    case b
+}
+
+
class MyClass {
+    ↓static let none = MyClass()
+}
+
+
class MyClass {
+    ↓static let none: MyClass = MyClass()
+}
+
+
class MyClass {
+    ↓static var none: MyClass = MyClass()
+}
+
+
class MyClass {
+    ↓class var none: MyClass { MyClass() }
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none: MyStruct = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none: MyStruct = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var a = MyStruct(), none = MyStruct()
+}
+
+
struct MyStruct {
+    ↓static var none = MyStruct(), a = MyStruct()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_object_literal.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_object_literal.html new file mode 100644 index 000000000..07a17cb42 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_object_literal.html @@ -0,0 +1,360 @@ + + + + discouraged_object_literal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Object Literal

+ +

Prefer initializers over object literals.

+ +
    +
  • Identifier: discouraged_object_literal
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, image_literal: true, color_literal: true
  • +
+

Non Triggering Examples

+
let image = UIImage(named: aVariable)
+
+
let image = UIImage(named: "interpolated \(variable)")
+
+
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
+
+
let image = NSImage(named: aVariable)
+
+
let image = NSImage(named: "interpolated \(variable)")
+
+
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
+
+

Triggering Examples

+
let image = ↓#imageLiteral(resourceName: "image.jpg")
+
+
let color = ↓#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_boolean.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_boolean.html new file mode 100644 index 000000000..0b3e04c10 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_boolean.html @@ -0,0 +1,728 @@ + + + + discouraged_optional_boolean Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Optional Boolean

+ +

Prefer non-optional booleans over optional booleans.

+ +
    +
  • Identifier: discouraged_optional_boolean
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var foo: Bool
+
+
var foo: [String: Bool]
+
+
var foo: [Bool]
+
+
let foo: Bool = true
+
+
let foo: Bool = false
+
+
let foo: [String: Bool] = [:]
+
+
let foo: [Bool] = []
+
+
var foo: Bool { return true }
+
+
let foo: Bool { return false }()
+
+
func foo() -> Bool {}
+
+
func foo() -> [String: Bool] {}
+
+
func foo() -> ([Bool]) -> String {}
+
+
func foo(input: Bool = true) {}
+
+
func foo(input: [String: Bool] = [:]) {}
+
+
func foo(input: [Bool] = []) {}
+
+
class Foo {
+    func foo() -> Bool {}
+}
+
+
class Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
class Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
struct Foo {
+    func foo() -> Bool {}
+}
+
+
struct Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
struct Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
enum Foo {
+    func foo() -> Bool {}
+}
+
+
enum Foo {
+    func foo() -> [String: Bool] {}
+}
+
+
enum Foo {
+    func foo() -> ([Bool]) -> String {}
+}
+
+
class Foo {
+    func foo(input: Bool = true) {}
+}
+
+
class Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
class Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+
struct Foo {
+    func foo(input: Bool = true) {}
+}
+
+
struct Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
struct Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+
enum Foo {
+    func foo(input: Bool = true) {}
+}
+
+
enum Foo {
+    func foo(input: [String: Bool] = [:]) {}
+}
+
+
enum Foo {
+    func foo(input: [Bool] = []) {}
+}
+
+

Triggering Examples

+
var foo: ↓Bool?
+
+
var foo: [String: ↓Bool?]
+
+
var foo: [↓Bool?]
+
+
let foo: ↓Bool? = nil
+
+
let foo: [String: ↓Bool?] = [:]
+
+
let foo: [↓Bool?] = []
+
+
let foo = ↓Optional.some(false)
+
+
let foo = ↓Optional.some(true)
+
+
var foo: ↓Bool? { return nil }
+
+
let foo: ↓Bool? { return nil }()
+
+
func foo() -> ↓Bool? {}
+
+
func foo() -> [String: ↓Bool?] {}
+
+
func foo() -> [↓Bool?] {}
+
+
static func foo() -> ↓Bool? {}
+
+
static func foo() -> [String: ↓Bool?] {}
+
+
static func foo() -> [↓Bool?] {}
+
+
func foo() -> (↓Bool?) -> String {}
+
+
func foo() -> ([Int]) -> ↓Bool? {}
+
+
func foo(input: ↓Bool?) {}
+
+
func foo(input: [String: ↓Bool?]) {}
+
+
func foo(input: [↓Bool?]) {}
+
+
static func foo(input: ↓Bool?) {}
+
+
static func foo(input: [String: ↓Bool?]) {}
+
+
static func foo(input: [↓Bool?]) {}
+
+
class Foo {
+    var foo: ↓Bool?
+}
+
+
class Foo {
+    var foo: [String: ↓Bool?]
+}
+
+
class Foo {
+    let foo: ↓Bool? = nil
+}
+
+
class Foo {
+    let foo: [String: ↓Bool?] = [:]
+}
+
+
class Foo {
+    let foo: [↓Bool?] = []
+}
+
+
struct Foo {
+    var foo: ↓Bool?
+}
+
+
struct Foo {
+    var foo: [String: ↓Bool?]
+}
+
+
struct Foo {
+    let foo: ↓Bool? = nil
+}
+
+
struct Foo {
+    let foo: [String: ↓Bool?] = [:]
+}
+
+
struct Foo {
+    let foo: [↓Bool?] = []
+}
+
+
class Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
class Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
struct Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
struct Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
enum Foo {
+    var foo: ↓Bool? { return nil }
+}
+
+
enum Foo {
+    let foo: ↓Bool? { return nil }()
+}
+
+
class Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
class Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
class Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
class Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
class Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
class Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
class Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
class Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
struct Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
struct Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
struct Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
struct Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
struct Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
struct Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
struct Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
struct Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
enum Foo {
+    func foo() -> ↓Bool? {}
+}
+
+
enum Foo {
+    func foo() -> [String: ↓Bool?] {}
+}
+
+
enum Foo {
+    func foo() -> [↓Bool?] {}
+}
+
+
enum Foo {
+    static func foo() -> ↓Bool? {}
+}
+
+
enum Foo {
+    static func foo() -> [String: ↓Bool?] {}
+}
+
+
enum Foo {
+    static func foo() -> [↓Bool?] {}
+}
+
+
enum Foo {
+    func foo() -> (↓Bool?) -> String {}
+}
+
+
enum Foo {
+    func foo() -> ([Int]) -> ↓Bool? {}
+}
+
+
class Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
class Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
class Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
class Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
class Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
class Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
struct Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
struct Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
struct Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
struct Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
struct Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
struct Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
enum Foo {
+    func foo(input: ↓Bool?) {}
+}
+
+
enum Foo {
+    func foo(input: [String: ↓Bool?]) {}
+}
+
+
enum Foo {
+    func foo(input: [↓Bool?]) {}
+}
+
+
enum Foo {
+    static func foo(input: ↓Bool?) {}
+}
+
+
enum Foo {
+    static func foo(input: [String: ↓Bool?]) {}
+}
+
+
enum Foo {
+    static func foo(input: [↓Bool?]) {}
+}
+
+
_ = ↓Bool?.values()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_collection.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_collection.html new file mode 100644 index 000000000..36dea304a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/discouraged_optional_collection.html @@ -0,0 +1,908 @@ + + + + discouraged_optional_collection Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Discouraged Optional Collection

+ +

Prefer empty collection over optional collection.

+ +
    +
  • Identifier: discouraged_optional_collection
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var foo: [Int]
+
+
var foo: [String: Int]
+
+
var foo: Set<String>
+
+
var foo: [String: [String: Int]]
+
+
let foo: [Int] = []
+
+
let foo: [String: Int] = [:]
+
+
let foo: Set<String> = []
+
+
let foo: [String: [String: Int]] = [:]
+
+
var foo: [Int] { return [] }
+
+
func foo() -> [Int] {}
+
+
func foo() -> [String: String] {}
+
+
func foo() -> Set<Int> {}
+
+
func foo() -> ([Int]) -> String {}
+
+
func foo(input: [String] = []) {}
+
+
func foo(input: [String: String] = [:]) {}
+
+
func foo(input: Set<String> = []) {}
+
+
class Foo {
+    func foo() -> [Int] {}
+}
+
+
class Foo {
+    func foo() -> [String: String] {}
+}
+
+
class Foo {
+    func foo() -> Set<Int> {}
+}
+
+
class Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
struct Foo {
+    func foo() -> [Int] {}
+}
+
+
struct Foo {
+    func foo() -> [String: String] {}
+}
+
+
struct Foo {
+    func foo() -> Set<Int> {}
+}
+
+
struct Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
enum Foo {
+    func foo() -> [Int] {}
+}
+
+
enum Foo {
+    func foo() -> [String: String] {}
+}
+
+
enum Foo {
+    func foo() -> Set<Int> {}
+}
+
+
enum Foo {
+    func foo() -> ([Int]) -> String {}
+}
+
+
class Foo {
+    func foo(input: [String] = []) {}
+}
+
+
class Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
class Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+
struct Foo {
+    func foo(input: [String] = []) {}
+}
+
+
struct Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
struct Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+
enum Foo {
+    func foo(input: [String] = []) {}
+}
+
+
enum Foo {
+    func foo(input: [String: String] = [:]) {}
+}
+
+
enum Foo {
+    func foo(input: Set<String> = []) {}
+}
+
+

Triggering Examples

+
↓var foo: [Int]?
+
+
↓var foo: [String: Int]?
+
+
↓var foo: Set<String>?
+
+
↓let foo: [Int]? = nil
+
+
↓let foo: [String: Int]? = nil
+
+
↓let foo: Set<String>? = nil
+
+
↓var foo: [Int]? { return nil }
+
+
↓let foo: [Int]? { return nil }()
+
+
func ↓foo() -> [T]? {}
+
+
func ↓foo() -> [String: String]? {}
+
+
func ↓foo() -> [String: [String: String]]? {}
+
+
func ↓foo() -> [String: [String: String]?] {}
+
+
func ↓foo() -> Set<Int>? {}
+
+
static func ↓foo() -> [T]? {}
+
+
static func ↓foo() -> [String: String]? {}
+
+
static func ↓foo() -> [String: [String: String]]? {}
+
+
static func ↓foo() -> [String: [String: String]?] {}
+
+
static func ↓foo() -> Set<Int>? {}
+
+
func ↓foo() -> ([Int]?) -> String {}
+
+
func ↓foo() -> ([Int]) -> [String]? {}
+
+
func foo(↓input: [String: String]?) {}
+
+
func foo(↓input: [String: [String: String]]?) {}
+
+
func foo(↓input: [String: [String: String]?]) {}
+
+
func foo(↓↓input: [String: [String: String]?]?) {}
+
+
func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+
+
func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+
+
static func foo(↓input: [String: String]?) {}
+
+
static func foo(↓input: [String: [String: String]]?) {}
+
+
static func foo(↓input: [String: [String: String]?]) {}
+
+
static func foo(↓↓input: [String: [String: String]?]?) {}
+
+
static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+
+
static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+
+
class Foo {
+    ↓var foo: [Int]?
+}
+
+
class Foo {
+    ↓var foo: [String: Int]?
+}
+
+
class Foo {
+    ↓var foo: Set<String>?
+}
+
+
class Foo {
+    ↓let foo: [Int]? = nil
+}
+
+
class Foo {
+    ↓let foo: [String: Int]? = nil
+}
+
+
class Foo {
+    ↓let foo: Set<String>? = nil
+}
+
+
struct Foo {
+    ↓var foo: [Int]?
+}
+
+
struct Foo {
+    ↓var foo: [String: Int]?
+}
+
+
struct Foo {
+    ↓var foo: Set<String>?
+}
+
+
struct Foo {
+    ↓let foo: [Int]? = nil
+}
+
+
struct Foo {
+    ↓let foo: [String: Int]? = nil
+}
+
+
struct Foo {
+    ↓let foo: Set<String>? = nil
+}
+
+
class Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
class Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
class Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
class Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
struct Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
struct Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
struct Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
struct Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
enum Foo {
+    ↓var foo: [Int]? { return nil }
+}
+
+
enum Foo {
+    ↓let foo: [Int]? { return nil }()
+}
+
+
enum Foo {
+    ↓var foo: Set<String>? { return nil }
+}
+
+
enum Foo {
+    ↓let foo: Set<String>? { return nil }()
+}
+
+
class Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
class Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
class Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
class Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
class Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
class Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
class Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
struct Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
struct Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
struct Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
struct Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
struct Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
struct Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [T]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: String]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: [String: String]]? {}
+}
+
+
enum Foo {
+    func ↓foo() -> [String: [String: String]?] {}
+}
+
+
enum Foo {
+    func ↓foo() -> Set<Int>? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [T]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: String]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: [String: String]]? {}
+}
+
+
enum Foo {
+    static func ↓foo() -> [String: [String: String]?] {}
+}
+
+
enum Foo {
+    static func ↓foo() -> Set<Int>? {}
+}
+
+
enum Foo {
+    func ↓foo() -> ([Int]?) -> String {}
+}
+
+
enum Foo {
+    func ↓foo() -> ([Int]) -> [String]? {}
+}
+
+
class Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
class Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
class Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
class Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
class Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
class Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
class Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
class Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
class Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
class Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
struct Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
struct Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
struct Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
struct Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
struct Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
struct Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
struct Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
struct Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
struct Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    func foo(↓input: [String: String]?) {}
+}
+
+
enum Foo {
+    func foo(↓input: [String: [String: String]]?) {}
+}
+
+
enum Foo {
+    func foo(↓input: [String: [String: String]?]) {}
+}
+
+
enum Foo {
+    func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
enum Foo {
+    func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    static func foo(↓input: [String: String]?) {}
+}
+
+
enum Foo {
+    static func foo(↓input: [String: [String: String]]?) {}
+}
+
+
enum Foo {
+    static func foo(↓input: [String: [String: String]?]) {}
+}
+
+
enum Foo {
+    static func foo(↓↓input: [String: [String: String]?]?) {}
+}
+
+
enum Foo {
+    static func foo<K, V>(_ dict1: [K: V], ↓_ dict2: [K: V]?) -> [K: V]
+}
+
+
enum Foo {
+    static func foo<K, V>(dict1: [K: V], ↓dict2: [K: V]?) -> [K: V]
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_enum_cases.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_enum_cases.html new file mode 100644 index 000000000..7d7935cee --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_enum_cases.html @@ -0,0 +1,380 @@ + + + + duplicate_enum_cases Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Duplicate Enum Cases

+ +

Enum can’t contain multiple cases with the same name.

+ +
    +
  • Identifier: duplicate_enum_cases
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
enum PictureImport {
+    case addImage(image: UIImage)
+    case addData(data: Data)
+}
+
+
enum A {
+    case add(image: UIImage)
+}
+enum B {
+    case add(image: UIImage)
+}
+
+
enum Tag: String {
+#if CONFIG_A
+    case value = "CONFIG_A"
+#elseif CONFIG_B
+    case value = "CONFIG_B"
+#else
+    case value = "CONFIG_DEFAULT"
+#endif
+}
+
+
enum Target {
+#if os(iOS)
+  case file
+#else
+  case file(URL)
+#endif
+}
+
+

Triggering Examples

+
enum PictureImport {
+    case ↓add(image: UIImage)
+    case addURL(url: URL)
+    case ↓add(data: Data)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_imports.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_imports.html new file mode 100644 index 000000000..2b223b55a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicate_imports.html @@ -0,0 +1,445 @@ + + + + duplicate_imports Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Duplicate Imports

+ +

Imports should be unique.

+ +
    +
  • Identifier: duplicate_imports
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
import A
+import B
+import C
+
+
import A.B
+import A.C
+
+
@_implementationOnly import A
+@_implementationOnly import B
+
+
@testable import A
+@testable import B
+
+
#if DEBUG
+    @testable import KsApi
+#else
+    import KsApi
+#endif
+
+
import A // module
+import B // module
+
+
#if TEST
+func test() {
+}
+
+

Triggering Examples

+
@_implementationOnly import A
+↓@_implementationOnly import A
+
+
+
@testable import A
+↓@testable import A
+
+
+
import A
+#if DEBUG
+    @testable import KsApi
+#else
+    import KsApi
+#endif
+↓import A
+
+
+
import A
+↓import class A.Foo
+
+
+
import A
+↓import enum A.Foo
+
+
+
import A
+↓import func A.Foo
+
+
+
import A
+↓import let A.Foo
+
+
+
import A
+↓import protocol A.Foo
+
+
+
import A
+↓import struct A.Foo
+
+
+
import A
+↓import typealias A.Foo
+
+
+
import A
+↓import var A.Foo
+
+
+
import A.B
+↓import A.B.C
+
+
+
import Foundation
+import Dispatch
+↓import Foundation
+
+
+
import Foundation
+↓import Foundation
+↓import Foundation
+
+
+
import Foundation
+↓import Foundation.NSString
+
+
+
↓import A.B.C
+import A.B
+
+
+
↓import Foundation.NSString
+import Foundation
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html new file mode 100644 index 000000000..e3318557e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/duplicated_key_in_dictionary_literal.html @@ -0,0 +1,398 @@ + + + + duplicated_key_in_dictionary_literal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Duplicated Key in Dictionary Literal

+ +

Dictionary literals with duplicated keys will crash in runtime.

+ +
    +
  • Identifier: duplicated_key_in_dictionary_literal
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
    [
+        1: "1",
+        2: "2"
+    ]
+
+
    [
+        "1": 1,
+        "2": 2
+    ]
+
+
    [
+        foo: "1",
+        bar: "2"
+    ]
+
+
    [
+        UUID(): "1",
+        UUID(): "2"
+    ]
+
+
    [
+        #line: "1",
+        #line: "2"
+    ]
+
+

Triggering Examples

+
    [
+        1: "1",
+        2: "2",
+        ↓1: "one"
+    ]
+
+
    [
+        "1": 1,
+        "2": 2,
+        ↓"2": 2
+    ]
+
+
    [
+        foo: "1",
+        bar: "2",
+        baz: "3",
+        ↓foo: "4",
+        zaz: "5"
+    ]
+
+
    [
+        .one: "1",
+        .two: "2",
+        .three: "3",
+        ↓.one: "1",
+        .four: "4",
+        .five: "5"
+    ]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/dynamic_inline.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/dynamic_inline.html new file mode 100644 index 000000000..4f0304441 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/dynamic_inline.html @@ -0,0 +1,376 @@ + + + + dynamic_inline Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Dynamic Inline

+ +

Avoid using ‘dynamic’ and ‘@inline(__always)’ together.

+ +
    +
  • Identifier: dynamic_inline
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
class C {
+dynamic func f() {}}
+
+
class C {
+@inline(__always) func f() {}}
+
+
class C {
+@inline(never) dynamic func f() {}}
+
+

Triggering Examples

+
class C {
+@inline(__always) dynamic ↓func f() {}
+}
+
+
class C {
+@inline(__always) public dynamic ↓func f() {}
+}
+
+
class C {
+@inline(__always) dynamic internal ↓func f() {}
+}
+
+
class C {
+@inline(__always)
+dynamic ↓func f() {}
+}
+
+
class C {
+@inline(__always)
+dynamic
+↓func f() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_collection_literal.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_collection_literal.html new file mode 100644 index 000000000..b24d019c9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_collection_literal.html @@ -0,0 +1,368 @@ + + + + empty_collection_literal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty Collection Literal

+ +

Prefer checking isEmpty over comparing collection to an empty array or dictionary literal.

+ +
    +
  • Identifier: empty_collection_literal
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
myArray = []
+
+
myArray.isEmpty
+
+
!myArray.isEmpty
+
+
myDict = [:]
+
+

Triggering Examples

+
myArray↓ == []
+
+
myArray↓ != []
+
+
myArray↓ == [ ]
+
+
myDict↓ == [:]
+
+
myDict↓ != [:]
+
+
myDict↓ == [: ]
+
+
myDict↓ == [ :]
+
+
myDict↓ == [ : ]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_count.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_count.html new file mode 100644 index 000000000..680cb62c2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_count.html @@ -0,0 +1,401 @@ + + + + empty_count Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty Count

+ +

Prefer checking isEmpty over comparing count to zero.

+ +
    +
  • Identifier: empty_count
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error, only_after_dot: false
  • +
+

Non Triggering Examples

+
var count = 0
+
+
+
[Int]().isEmpty
+
+
+
[Int]().count > 1
+
+
+
[Int]().count == 1
+
+
+
[Int]().count == 0xff
+
+
+
[Int]().count == 0b01
+
+
+
[Int]().count == 0o07
+
+
+
discount == 0
+
+
+
order.discount == 0
+
+
+

Triggering Examples

+
[Int]().↓count == 0
+
+
+
0 == [Int]().↓count
+
+
+
[Int]().↓count==0
+
+
+
[Int]().↓count > 0
+
+
+
[Int]().↓count != 0
+
+
+
[Int]().↓count == 0x0
+
+
+
[Int]().↓count == 0x00_00
+
+
+
[Int]().↓count == 0b00
+
+
+
[Int]().↓count == 0o00
+
+
+
↓count == 0
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_enum_arguments.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_enum_arguments.html new file mode 100644 index 000000000..7d0daa435 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_enum_arguments.html @@ -0,0 +1,459 @@ + + + + empty_enum_arguments Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty Enum Arguments

+ +

Arguments can be omitted when matching enums with associated values if they are not used.

+ +
    +
  • Identifier: empty_enum_arguments
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch foo {
+case .bar: break
+}
+
+
switch foo {
+case .bar(let x): break
+}
+
+
switch foo {
+case let .bar(x): break
+}
+
+
switch (foo, bar) {
+case (_, _): break
+}
+
+
switch foo {
+case "bar".uppercased(): break
+}
+
+
switch (foo, bar) {
+case (_, _) where !something: break
+}
+
+
switch foo {
+case (let f as () -> String)?: break
+}
+
+
switch foo {
+case .bar(Baz()): break
+}
+
+
switch foo {
+case .bar(.init()): break
+}
+
+
switch foo {
+default: break
+}
+
+
if case .bar = foo {
+}
+
+
guard case .bar = foo else {
+}
+
+
if foo == .bar() {}
+
+
guard foo == .bar() else { return }
+
+
if case .appStore = self.appInstaller, !UIDevice.isSimulator() {
+  viewController.present(self, animated: false)
+} else {
+  UIApplication.shared.open(self.appInstaller.url)
+}
+
+
let updatedUserNotificationSettings = deepLink.filter { nav in
+  guard case .settings(.notifications(_, nil)) = nav else { return false }
+  return true
+}
+
+

Triggering Examples

+
switch foo {
+case .bar↓(_): break
+}
+
+
switch foo {
+case .bar↓(): break
+}
+
+
switch foo {
+case .bar↓(_), .bar2↓(_): break
+}
+
+
switch foo {
+case .bar↓() where method() > 2: break
+}
+
+
switch foo {
+case .bar(.baz↓()): break
+}
+
+
switch foo {
+case .bar(.baz↓(_)): break
+}
+
+
func example(foo: Foo) {
+    switch foo {
+    case case .bar↓(_):
+        break
+    }
+}
+
+
if case .bar↓(_) = foo {
+}
+
+
guard case .bar↓(_) = foo else {
+}
+
+
if case .bar↓() = foo {
+}
+
+
guard case .bar↓() = foo else {
+}
+
+
if case .appStore↓(_) = self.appInstaller, !UIDevice.isSimulator() {
+  viewController.present(self, animated: false)
+} else {
+  UIApplication.shared.open(self.appInstaller.url)
+}
+
+
let updatedUserNotificationSettings = deepLink.filter { nav in
+  guard case .settings(.notifications↓(_, _)) = nav else { return false }
+  return true
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parameters.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parameters.html new file mode 100644 index 000000000..fecd79d52 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parameters.html @@ -0,0 +1,374 @@ + + + + empty_parameters Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty Parameters

+ +

Prefer () -> over Void ->.

+ +
    +
  • Identifier: empty_parameters
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let abc: () -> Void = {}
+
+
+
func foo(completion: () -> Void)
+
+
+
func foo(completion: () throws -> Void)
+
+
+
let foo: (ConfigurationTests) -> Void throws -> Void)
+
+
+
let foo: (ConfigurationTests) ->   Void throws -> Void)
+
+
+
let foo: (ConfigurationTests) ->Void throws -> Void)
+
+
+

Triggering Examples

+
let abc: ↓(Void) -> Void = {}
+
+
+
func foo(completion: ↓(Void) -> Void)
+
+
+
func foo(completion: ↓(Void) throws -> Void)
+
+
+
let foo: ↓(Void) -> () throws -> Void)
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html new file mode 100644 index 000000000..cd5241928 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_parentheses_with_trailing_closure.html @@ -0,0 +1,387 @@ + + + + empty_parentheses_with_trailing_closure Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty Parentheses with Trailing Closure

+ +

When using trailing closures, empty parentheses should be avoided after the method call.

+ +
    +
  • Identifier: empty_parentheses_with_trailing_closure
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2].map { $0 + 1 }
+
+
+
[1, 2].map({ $0 + 1 })
+
+
+
[1, 2].reduce(0) { $0 + $1 }
+
+
[1, 2].map { number in
+ number + 1 
+}
+
+
+
let isEmpty = [1, 2].isEmpty()
+
+
+
UIView.animateWithDuration(0.3, animations: {
+   self.disableInteractionRightView.alpha = 0
+}, completion: { _ in
+   ()
+})
+
+

Triggering Examples

+
[1, 2].map↓() { $0 + 1 }
+
+
+
[1, 2].map↓( ) { $0 + 1 }
+
+
+
[1, 2].map↓() { number in
+ number + 1 
+}
+
+
+
[1, 2].map↓(  ) { number in
+ number + 1 
+}
+
+
+
func foo() -> [Int] {
+    return [1, 2].map↓() { $0 + 1 }
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_string.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_string.html new file mode 100644 index 000000000..75822b8ff --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_string.html @@ -0,0 +1,362 @@ + + + + empty_string Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty String

+ +

Prefer checking isEmpty over comparing string to an empty string literal.

+ +
    +
  • Identifier: empty_string
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
myString.isEmpty
+
+
!myString.isEmpty
+
+
"""
+foo==
+"""
+
+

Triggering Examples

+
myString↓ == ""
+
+
myString↓ != ""
+
+
myString↓==""
+
+
myString↓ == #""#
+
+
myString↓ == ##""##
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_xctest_method.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_xctest_method.html new file mode 100644 index 000000000..d207315f8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/empty_xctest_method.html @@ -0,0 +1,483 @@ + + + + empty_xctest_method Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Empty XCTest Method

+ +

Empty XCTest method should be avoided.

+ +
    +
  • Identifier: empty_xctest_method
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, test_parent_classes: [“QuickSpec”, “XCTestCase”]
  • +
+

Non Triggering Examples

+
class TotoTests: XCTestCase {
+    var foobar: Foobar?
+
+    override func setUp() {
+        super.setUp()
+        foobar = Foobar()
+    }
+
+    override func setUpWithError() throws {
+        foobar = nil
+    }
+
+    override func tearDown() {
+        foobar = nil
+        super.tearDown()
+    }
+
+    func testFoo() {
+        XCTAssertTrue(foobar?.foo)
+    }
+
+    func testBar() {
+        // comment...
+
+        XCTAssertFalse(foobar?.bar)
+
+        // comment...
+    }
+
+    func testBaz() {
+        _ = 4 + 4
+    }
+}
+
+
class Foobar {
+    func setUp() {}
+
+    func tearDown() {}
+
+    func testFoo() {}
+}
+
+
class TotoTests: XCTestCase {
+    func setUp(with object: Foobar) {}
+
+    func tearDown(object: Foobar) {}
+
+    func testFoo(_ foo: Foobar) {}
+
+    func testBar(bar: (String) -> Int) {}
+}
+
+
class TotoTests: XCTestCase {
+    func testFoo() { XCTAssertTrue(foobar?.foo) }
+
+    func testBar() { XCTAssertFalse(foobar?.bar) }
+}
+
+
class TotoTests: XCTestCase {
+    override class var runsForEachTargetApplicationUIConfiguration: Bool { true }
+
+    static var allTests = [("testFoo", testFoo)]
+
+    func testFoo() { XCTAssert(true) }
+}
+
+

Triggering Examples

+
class TotoTests: XCTestCase {
+    override ↓func setUp() {
+    }
+
+    override ↓func tearDown() {
+
+    }
+
+    ↓func testFoo() {
+
+
+    }
+
+    ↓func testBar() {
+
+
+
+    }
+
+    func helperFunction() {
+    }
+}
+
+
class TotoTests: XCTestCase {
+    override ↓func setUp() {}
+
+    override ↓func tearDown() {}
+
+    ↓func testFoo() {}
+
+    func helperFunction() {}
+}
+
+
class TotoTests: XCTestCase {
+    override ↓func setUp() {
+        // comment...
+    }
+
+    override ↓func tearDown() {
+        // comment...
+        // comment...
+    }
+
+    ↓func testFoo() {
+        // comment...
+
+        // comment...
+
+        // comment...
+    }
+
+    ↓func testBar() {
+        /*
+         * comment...
+         *
+         * comment...
+         *
+         * comment...
+         */
+    }
+
+    func helperFunction() {
+    }
+}
+
+
class FooTests: XCTestCase {
+    override ↓func setUp() {}
+}
+
+class BarTests: XCTestCase {
+    ↓func testFoo() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/enum_case_associated_values_count.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/enum_case_associated_values_count.html new file mode 100644 index 000000000..9c9187d57 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/enum_case_associated_values_count.html @@ -0,0 +1,362 @@ + + + + enum_case_associated_values_count Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Enum Case Associated Values Count

+ +

Number of associated values in an enum case should be low

+ +
    +
  • Identifier: enum_case_associated_values_count
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 5, error: 6
  • +
+

Non Triggering Examples

+
enum Employee {
+    case fullTime(name: String, retirement: Date, designation: String, contactNumber: Int)
+    case partTime(name: String, age: Int, contractEndDate: Date)
+}
+
+
enum Barcode {
+    case upc(Int, Int, Int, Int)
+}
+
+

Triggering Examples

+
enum Employee {
+    case ↓fullTime(name: String, retirement: Date, age: Int, designation: String, contactNumber: Int)
+    case ↓partTime(name: String, contractEndDate: Date, age: Int, designation: String, contactNumber: Int)
+}
+
+
enum Barcode {
+    case ↓upc(Int, Int, Int, Int, Int, Int)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/expiring_todo.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/expiring_todo.html new file mode 100644 index 000000000..c942ea530 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/expiring_todo.html @@ -0,0 +1,386 @@ + + + + expiring_todo Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Expiring Todo

+ +

TODOs and FIXMEs should be resolved prior to their expiry date.

+ +
    +
  • Identifier: expiring_todo
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: approaching_expiry_severity: warning, expired_severity: error, bad_formatting_severity: error, approaching_expiry_threshold: 15, date_format: MM/dd/yyyy, date_delimiters: { opening: [, closing: ] }, date_separator: /
  • +
+

Non Triggering Examples

+
// notaTODO:
+
+
+
// notaFIXME:
+
+
+
// TODO: [12/31/9999]
+
+
+
// TODO(note)
+
+
+
// FIXME(note)
+
+
+
/* FIXME: */
+
+
+
/* TODO: */
+
+
+
/** FIXME: */
+
+
+
/** TODO: */
+
+
+

Triggering Examples

+
// TODO: [↓10/14/2019]
+
+
+
// FIXME: [↓10/14/2019]
+
+
+
// FIXME: [↓1/14/2019]
+
+
+
// FIXME: [↓10/14/2019]
+
+
+
// TODO: [↓9999/14/10]
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_acl.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_acl.html new file mode 100644 index 000000000..0a0c8e66d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_acl.html @@ -0,0 +1,436 @@ + + + + explicit_acl Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit ACL

+ +

All declarations should specify Access Control Level keywords explicitly.

+ +
    +
  • Identifier: explicit_acl
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
internal enum A {}
+
+
+
public final class B {}
+
+
+
private struct C {}
+
+
+
internal enum A {
+ internal enum B {}
+}
+
+
internal final class Foo {}
+
+
internal
+class Foo {
+  private let bar = 5
+}
+
+
internal func a() { let a =  }
+
+
+
private func a() { func innerFunction() { } }
+
+
private enum Foo { enum Bar { } }
+
+
private struct C { let d = 5 }
+
+
internal protocol A {
+  func b()
+}
+
+
internal protocol A {
+  var b: Int
+}
+
+
internal class A { deinit {} }
+
+
extension A: Equatable {}
+
+
extension A {}
+
+
extension Foo {
+    internal func bar() {}
+}
+
+
internal enum Foo {
+    case bar
+}
+
+
extension Foo {
+    public var isValid: Bool {
+        let result = true
+        return result
+    }
+}
+
+
extension Foo {
+    private var isValid: Bool {
+        get {
+            return true
+        }
+        set(newValue) {
+            print(newValue)
+        }
+    }
+}
+
+

Triggering Examples

+
↓enum A {}
+
+
+
final ↓class B {}
+
+
+
internal struct C { ↓let d = 5 }
+
+
+
public struct C { ↓let d = 5 }
+
+
+
func a() {}
+
+
+
internal let a = 0
+↓func b() {}
+
+
+
extension Foo {
+    ↓func bar() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_enum_raw_value.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_enum_raw_value.html new file mode 100644 index 000000000..530d7d543 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_enum_raw_value.html @@ -0,0 +1,396 @@ + + + + explicit_enum_raw_value Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit Enum Raw Value

+ +

Enums should be explicitly assigned their raw values.

+ +
    +
  • Identifier: explicit_enum_raw_value
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum Numbers {
+  case int(Int)
+  case short(Int16)
+}
+
+
enum Numbers: Int {
+  case one = 1
+  case two = 2
+}
+
+
enum Numbers: Double {
+  case one = 1.1
+  case two = 2.2
+}
+
+
enum Numbers: String {
+  case one = "one"
+  case two = "two"
+}
+
+
protocol Algebra {}
+enum Numbers: Algebra {
+  case one
+}
+
+

Triggering Examples

+
enum Numbers: Int {
+  case one = 10, ↓two, three = 30
+}
+
+
enum Numbers: NSInteger {
+  case ↓one
+}
+
+
enum Numbers: String {
+  case ↓one
+  case ↓two
+}
+
+
enum Numbers: String {
+   case ↓one, two = "two"
+}
+
+
enum Numbers: Decimal {
+  case ↓one, ↓two
+}
+
+
enum Outer {
+    enum Numbers: Decimal {
+      case ↓one, ↓two
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_init.html new file mode 100644 index 000000000..5043c83de --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_init.html @@ -0,0 +1,394 @@ + + + + explicit_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit Init

+ +

Explicitly calling .init() should be avoided.

+ +
    +
  • Identifier: explicit_init
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
import Foundation
+class C: NSObject {
+    override init() {
+        super.init()
+    }
+}
+
+
struct S {
+    let n: Int
+}
+extension S {
+    init() {
+        self.init(n: 1)
+    }
+}
+
+
[1].flatMap(String.init)
+
+
[String.self].map { $0.init(1) }
+
+
[String.self].map { type in type.init(1) }
+
+
Observable.zip(obs1, obs2, resultSelector: MyType.init).asMaybe()
+
+
_ = GleanMetrics.Tabs.someType.init()
+
+
Observable.zip(
+  obs1,
+  obs2,
+  resultSelector: MyType.init
+).asMaybe()
+
+

Triggering Examples

+
[1].flatMap{String↓.init($0)}
+
+
[String.self].map { Type in Type↓.init(1) }
+
+
func foo() -> [String] {
+    return [1].flatMap { String↓.init($0) }
+}
+
+
_ = GleanMetrics.Tabs.GroupedTabExtra↓.init()
+
+
_ = Set<KsApi.Category>↓.init()
+
+
Observable.zip(
+  obs1,
+  obs2,
+  resultSelector: { MyType↓.init($0, $1) }
+).asMaybe()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_self.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_self.html new file mode 100644 index 000000000..7ad9d07b1 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_self.html @@ -0,0 +1,415 @@ + + + + explicit_self Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit Self

+ +

Instance variables and functions should be explicitly accessed with ‘self.’.

+ +
    +
  • Identifier: explicit_self
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct A {
+    func f1() {}
+    func f2() {
+        self.f1()
+    }
+}
+
+
struct A {
+    let p1: Int
+    func f1() {
+        _ = self.p1
+    }
+}
+
+
@propertyWrapper
+struct Wrapper<Value> {
+    let wrappedValue: Value
+    var projectedValue: [Value] {
+        [self.wrappedValue]
+    }
+}
+struct A {
+    @Wrapper var p1: Int
+    func f1() {
+        self.$p1
+        self._p1
+    }
+}
+func f1() {
+    A(p1: 10).$p1
+}
+
+

Triggering Examples

+
struct A {
+    func f1() {}
+    func f2() {
+        ↓f1()
+    }
+}
+
+
struct A {
+    let p1: Int
+    func f1() {
+        _ = ↓p1
+    }
+}
+
+
struct A {
+    func f1(a b: Int) {}
+    func f2() {
+        ↓f1(a: 0)
+    }
+}
+
+
@propertyWrapper
+struct Wrapper<Value> {
+    let wrappedValue: Value
+    var projectedValue: [Value] {
+        [self.wrappedValue]
+    }
+}
+struct A {
+    @Wrapper var p1: Int
+    func f1() {
+        ↓$p1
+        ↓_p1
+    }
+}
+func f1() {
+    A(p1: 10).$p1
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_top_level_acl.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_top_level_acl.html new file mode 100644 index 000000000..839408fa6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_top_level_acl.html @@ -0,0 +1,385 @@ + + + + explicit_top_level_acl Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit Top Level ACL

+ +

Top-level declarations should specify Access Control Level keywords explicitly.

+ +
    +
  • Identifier: explicit_top_level_acl
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
internal enum A {}
+
+
+
public final class B {}
+
+
+
private struct C {}
+
+
+
internal enum A {
+ enum B {}
+}
+
+
internal final class Foo {}
+
+
internal
+class Foo {}
+
+
internal func a() {}
+
+
+
extension A: Equatable {}
+
+
extension A {}
+
+

Triggering Examples

+
↓enum A {}
+
+
+
final ↓class B {}
+
+
+
↓struct C {}
+
+
+
↓func a() {}
+
+
+
internal let a = 0
+↓func b() {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_type_interface.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_type_interface.html new file mode 100644 index 000000000..acbe5c20c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/explicit_type_interface.html @@ -0,0 +1,384 @@ + + + + explicit_type_interface Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Explicit Type Interface

+ +

Properties should have a type interface

+ +
    +
  • Identifier: explicit_type_interface
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, excluded: [], allow_redundancy: false
  • +
+

Non Triggering Examples

+
class Foo {
+  var myVar: Int? = 0
+}
+
+
class Foo {
+  let myVar: Int? = 0
+}
+
+
class Foo {
+  static var myVar: Int? = 0
+}
+
+
class Foo {
+  class var myVar: Int? = 0
+}
+
+

Triggering Examples

+
class Foo {
+  ↓var myVar = 0
+}
+
+
class Foo {
+  ↓let mylet = 0
+}
+
+
class Foo {
+  ↓static var myStaticVar = 0
+}
+
+
class Foo {
+  ↓class var myClassVar = 0
+}
+
+
class Foo {
+  ↓let myVar = Int(0)
+}
+
+
class Foo {
+  ↓let myVar = Set<Int>(0)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/extension_access_modifier.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/extension_access_modifier.html new file mode 100644 index 000000000..06e5ab335 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/extension_access_modifier.html @@ -0,0 +1,407 @@ + + + + extension_access_modifier Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Extension Access Modifier

+ +

Prefer to use extension access modifiers

+ +
    +
  • Identifier: extension_access_modifier
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
extension Foo: SomeProtocol {
+  public var bar: Int { return 1 }
+}
+
+
extension Foo {
+  private var bar: Int { return 1 }
+  public var baz: Int { return 1 }
+}
+
+
extension Foo {
+  private var bar: Int { return 1 }
+  public func baz() {}
+}
+
+
extension Foo {
+  var bar: Int { return 1 }
+  var baz: Int { return 1 }
+}
+
+
public extension Foo {
+  var bar: Int { return 1 }
+  var baz: Int { return 1 }
+}
+
+
extension Foo {
+  private bar: Int { return 1 }
+  private baz: Int { return 1 }
+}
+
+
extension Foo {
+  open bar: Int { return 1 }
+  open baz: Int { return 1 }
+}
+
+
extension Foo {
+    func setup() {}
+    public func update() {}
+}
+
+

Triggering Examples

+
↓extension Foo {
+   public var bar: Int { return 1 }
+   public var baz: Int { return 1 }
+}
+
+
↓extension Foo {
+   public var bar: Int { return 1 }
+   public func baz() {}
+}
+
+
public extension Foo {
+   public ↓func bar() {}
+   public ↓func baz() {}
+}
+
+
↓extension Foo {
+   public var bar: Int {
+      let value = 1
+      return value
+   }
+
+   public var baz: Int { return 1 }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fallthrough.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fallthrough.html new file mode 100644 index 000000000..9f1916057 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fallthrough.html @@ -0,0 +1,356 @@ + + + + fallthrough Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Fallthrough

+ +

Fallthrough should be avoided.

+ +
    +
  • Identifier: fallthrough
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch foo {
+case .bar, .bar2, .bar3:
+  something()
+}
+
+

Triggering Examples

+
switch foo {
+case .bar:
+  ↓fallthrough
+case .bar2:
+  something()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fatal_error_message.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fatal_error_message.html new file mode 100644 index 000000000..3ca80da9a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/fatal_error_message.html @@ -0,0 +1,360 @@ + + + + fatal_error_message Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Fatal Error Message

+ +

A fatalError call should have a message.

+ +
    +
  • Identifier: fatal_error_message
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo() {
+  fatalError("Foo")
+}
+
+
func foo() {
+  fatalError(x)
+}
+
+

Triggering Examples

+
func foo() {
+  ↓fatalError("")
+}
+
+
func foo() {
+  ↓fatalError()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_header.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_header.html new file mode 100644 index 000000000..e1d897b68 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_header.html @@ -0,0 +1,365 @@ + + + + file_header Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

File Header

+ +

Header comments should be consistent with project patterns. The SWIFTLINT_CURRENT_FILENAME placeholder can optionally be used in the required and forbidden patterns. It will be replaced by the real file name.

+ +
    +
  • Identifier: file_header
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, required_string: None, required_pattern: None, forbidden_string: None, forbidden_pattern: None
  • +
+

Non Triggering Examples

+
let foo = "Copyright"
+
+
let foo = 2 // Copyright
+
+
let foo = 2
+ // Copyright
+
+

Triggering Examples

+
// ↓Copyright
+
+
+
//
+// ↓Copyright
+
+
//
+//  FileHeaderRule.swift
+//  SwiftLint
+//
+//  Created by Marcelo Fabri on 27/11/16.
+//  ↓Copyright © 2016 Realm. All rights reserved.
+//
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_length.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_length.html new file mode 100644 index 000000000..fcf36b1b5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_length.html @@ -0,0 +1,1955 @@ + + + + file_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

File Length

+ +

Files should not span too many lines.

+ +
    +
  • Identifier: file_length
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 400, error: 1000, ignore_comment_only_lines: false
  • +
+

Non Triggering Examples

+
print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+
+
+

Triggering Examples

+
print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+
+
+
print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+print("swiftlint")
+//
+
+
+
print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+print("swiftlint")
+
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name.html new file mode 100644 index 000000000..36e15614a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name.html @@ -0,0 +1,342 @@ + + + + file_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

File Name

+ +

File name should match a type or extension declared in the file (if any).

+ +
    +
  • Identifier: file_name
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (severity) warning, excluded: [“LinuxMain.swift”, “main.swift”], prefix_pattern: , suffix_pattern: +.*, nested_type_separator: .
  • +
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name_no_space.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name_no_space.html new file mode 100644 index 000000000..2b8aa27f3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_name_no_space.html @@ -0,0 +1,342 @@ + + + + file_name_no_space Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

File Name No Space

+ +

File name should not contain any whitespace.

+ +
    +
  • Identifier: file_name_no_space
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (severity) warning, excluded: []
  • +
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_types_order.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_types_order.html new file mode 100644 index 000000000..c97e9e28a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/file_types_order.html @@ -0,0 +1,549 @@ + + + + file_types_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

File Types Order

+ +

Specifies how the types within a file should be ordered.

+ +
    +
  • Identifier: file_types_order
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, order: [[SwiftLintFramework.FileType.supportingType], [SwiftLintFramework.FileType.mainType], [SwiftLintFramework.FileType.extension], [SwiftLintFramework.FileType.previewProvider], [SwiftLintFramework.FileType.libraryContentProvider]]
  • +
+

Non Triggering Examples

+
// Supporting Types
+protocol TestViewControllerDelegate {
+    func didPressTrackedButton()
+}
+
+// Main Type
+class TestViewController: UIViewController {
+    // Type Aliases
+    typealias CompletionHandler = ((TestEnum) -> Void)
+
+    // Subtypes
+    class TestClass {
+        // 10 lines
+    }
+
+    struct TestStruct {
+        // 3 lines
+    }
+
+    enum TestEnum {
+        // 5 lines
+    }
+
+    // Stored Type Properties
+    static let cellIdentifier: String = "AmazingCell"
+
+    // Stored Instance Properties
+    var shouldLayoutView1: Bool!
+    weak var delegate: TestViewControllerDelegate?
+    private var hasLayoutedView1: Bool = false
+    private var hasLayoutedView2: Bool = false
+
+    // Computed Instance Properties
+    private var hasAnyLayoutedView: Bool {
+         return hasLayoutedView1 || hasLayoutedView2
+    }
+
+    // IBOutlets
+    @IBOutlet private var view1: UIView!
+    @IBOutlet private var view2: UIView!
+
+    // Initializers
+    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
+        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+    }
+
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    // Type Methods
+    static func makeViewController() -> TestViewController {
+        // some code
+    }
+
+    // Life-Cycle Methods
+    override func viewDidLoad() {
+        super.viewDidLoad()
+    }
+
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+    }
+
+    // IBActions
+    @IBAction func goNextButtonPressed() {
+        goToNextVc()
+        delegate?.didPressTrackedButton()
+    }
+
+    @objc
+    func goToRandomVcButtonPressed() {
+        goToRandomVc()
+    }
+
+    // MARK: Other Methods
+    func goToNextVc() { /* TODO */ }
+
+    func goToInfoVc() { /* TODO */ }
+
+    func goToRandomVc() {
+        let viewCtrl = getRandomVc()
+        present(viewCtrl, animated: true)
+    }
+
+    private func getRandomVc() -> UIViewController { return UIViewController() }
+
+    // Subscripts
+    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
+        get {
+            return "This is just a test"
+        }
+
+        set {
+            log.warning("Just a test", newValue)
+        }
+    }
+}
+
+// Extensions
+extension TestViewController: UITableViewDataSource {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 1
+    }
+}
+
+
// Only extensions
+extension Foo {}
+extension Bar {
+}
+
+
// Main Type
+struct ContentView: View {
+    var body: some View {
+        Text("Hello, World!")
+    }
+}
+
+// Preview Provider
+struct ContentView_Previews: PreviewProvider {
+    static var previews: some View { ContentView() }
+}
+
+// Library Content Provider
+struct ContentView_LibraryContent: LibraryContentProvider {
+    var views: [LibraryItem] {
+        LibraryItem(ContentView())
+    }
+}
+
+

Triggering Examples

+
↓class TestViewController: UIViewController {}
+
+// Supporting Types
+protocol TestViewControllerDelegate {
+    func didPressTrackedButton()
+}
+
+
// Extensions
+↓extension TestViewController: UITableViewDataSource {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 1
+    }
+}
+
+class TestViewController: UIViewController {}
+
+
// Supporting Types
+protocol TestViewControllerDelegate {
+    func didPressTrackedButton()
+}
+
+↓class TestViewController: UIViewController {}
+
+// Supporting Types
+protocol TestViewControllerDelegate {
+    func didPressTrackedButton()
+}
+
+
// Supporting Types
+protocol TestViewControllerDelegate {
+    func didPressTrackedButton()
+}
+
+// Extensions
+↓extension TestViewController: UITableViewDataSource {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 1
+    }
+}
+
+class TestViewController: UIViewController {}
+
+// Extensions
+extension TestViewController: UITableViewDataSource {
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 1
+    }
+}
+
+
// Preview Provider
+↓struct ContentView_Previews: PreviewProvider {
+    static var previews: some View { ContentView() }
+}
+
+// Main Type
+struct ContentView: View {
+    var body: some View {
+        Text("Hello, World!")
+    }
+}
+
+
// Library Content Provider
+↓struct ContentView_LibraryContent: LibraryContentProvider {
+    var views: [LibraryItem] {
+        LibraryItem(ContentView())
+    }
+}
+
+// Main Type
+struct ContentView: View {
+    var body: some View {
+        Text("Hello, World!")
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/first_where.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/first_where.html new file mode 100644 index 000000000..bb7827c99 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/first_where.html @@ -0,0 +1,388 @@ + + + + first_where Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

First Where

+ +

Prefer using .first(where:) over .filter { }.first in collections.

+ +
    +
  • Identifier: first_where
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
kinds.filter(excludingKinds.contains).isEmpty && kinds.first == .identifier
+
+
+
myList.first(where: { $0 % 2 == 0 })
+
+
+
match(pattern: pattern).filter { $0.first == .identifier }
+
+
+
(myList.filter { $0 == 1 }.suffix(2)).first
+
+
+
collection.filter("stringCol = '3'").first
+
+
realm?.objects(User.self).filter(NSPredicate(format: "email ==[c] %@", email)).first
+
+
if let pause = timeTracker.pauses.filter("beginDate < %@", beginDate).first { print(pause) }
+
+

Triggering Examples

+
↓myList.filter { $0 % 2 == 0 }.first
+
+
+
↓myList.filter({ $0 % 2 == 0 }).first
+
+
+
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first
+
+
+
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).first?.something()
+
+
+
↓myList.filter(someFunction).first
+
+
+
↓myList.filter({ $0 % 2 == 0 })
+.first
+
+
+
(↓myList.filter { $0 == 1 }).first
+
+
+
↓myListOfDict.filter { dict in dict["1"] }.first
+
+
↓myListOfDict.filter { $0["someString"] }.first
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html new file mode 100644 index 000000000..ec263f704 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/flatmap_over_map_reduce.html @@ -0,0 +1,350 @@ + + + + flatmap_over_map_reduce Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

FlatMap over map and reduce

+ +

Prefer flatMap over map followed by reduce([], +).

+ +
    +
  • Identifier: flatmap_over_map_reduce
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = bar.map { $0.count }.reduce(0, +)
+
+
let foo = bar.flatMap { $0.array }
+
+

Triggering Examples

+
let foo = ↓bar.map { $0.array }.reduce([], +)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/for_where.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/for_where.html new file mode 100644 index 000000000..c2b45dc36 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/for_where.html @@ -0,0 +1,421 @@ + + + + for_where Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

For Where

+ +

where clauses are preferred over a single if inside a for.

+ +
    +
  • Identifier: for_where
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, allow_for_as_filter: false
  • +
+

Non Triggering Examples

+
for user in users where user.id == 1 { }
+
+
for user in users {
+  if let id = user.id { }
+}
+
+
for user in users {
+  if var id = user.id { }
+}
+
+
for user in users {
+  if user.id == 1 { } else { }
+}
+
+
for user in users {
+  if user.id == 1 {
+  } else if user.id == 2 { }
+}
+
+
for user in users {
+  if user.id == 1 { }
+  print(user)
+}
+
+
for user in users {
+  let id = user.id
+  if id == 1 { }
+}
+
+
for user in users {
+  if user.id == 1 { }
+  return true
+}
+
+
for user in users {
+  if user.id == 1 && user.age > 18 { }
+}
+
+
for user in users {
+  if user.id == 1, user.age > 18 { }
+}
+
+
for (index, value) in array.enumerated() {
+  if case .valueB(_) = value {
+    return index
+  }
+}
+
+
for user in users {
+  if user.id == 1 { return true }
+}
+
+
for user in users {
+  if user.id == 1 {
+    let derivedValue = calculateValue(from: user)
+    return derivedValue != 0
+  }
+}
+
+

Triggering Examples

+
for user in users {
+  ↓if user.id == 1 { return true }
+}
+
+
for subview in subviews {
+    ↓if !(subview is UIStackView) {
+        subview.removeConstraints(subview.constraints)
+        subview.removeFromSuperview()
+    }
+}
+
+
for subview in subviews {
+    ↓if !(subview is UIStackView) {
+        subview.removeConstraints(subview.constraints)
+        subview.removeFromSuperview()
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_cast.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_cast.html new file mode 100644 index 000000000..8280d9811 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_cast.html @@ -0,0 +1,350 @@ + + + + force_cast Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Force Cast

+ +

Force casts should be avoided.

+ +
    +
  • Identifier: force_cast
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
NSNumber() as? Int
+
+
+

Triggering Examples

+
NSNumber() ↓as! Int
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_try.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_try.html new file mode 100644 index 000000000..97695fad2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_try.html @@ -0,0 +1,352 @@ + + + + force_try Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Force Try

+ +

Force tries should be avoided.

+ +
    +
  • Identifier: force_try
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
func a() throws {}
+do {
+  try a()
+} catch {}
+
+

Triggering Examples

+
func a() throws {}
+↓try! a()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_unwrapping.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_unwrapping.html new file mode 100644 index 000000000..50f28937b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/force_unwrapping.html @@ -0,0 +1,422 @@ + + + + force_unwrapping Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Force Unwrapping

+ +

Force unwrapping should be avoided.

+ +
    +
  • Identifier: force_unwrapping
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
if let url = NSURL(string: query)
+
+
navigationController?.pushViewController(viewController, animated: true)
+
+
let s as! Test
+
+
try! canThrowErrors()
+
+
let object: Any!
+
+
@IBOutlet var constraints: [NSLayoutConstraint]!
+
+
setEditing(!editing, animated: true)
+
+
navigationController.setNavigationBarHidden(!navigationController.navigationBarHidden, animated: true)
+
+
if addedToPlaylist && (!self.selectedFilters.isEmpty || self.searchBar?.text?.isEmpty == false) {}
+
+
print("\(xVar)!")
+
+
var test = (!bar)
+
+
var a: [Int]!
+
+
private var myProperty: (Void -> Void)!
+
+
func foo(_ options: [AnyHashable: Any]!) {
+
+
func foo() -> [Int]!
+
+
func foo() -> [AnyHashable: Any]!
+
+
func foo() -> [Int]! { return [] }
+
+
return self
+
+

Triggering Examples

+
let url = NSURL(string: query)↓!
+
+
navigationController↓!.pushViewController(viewController, animated: true)
+
+
let unwrapped = optional↓!
+
+
return cell↓!
+
+
let url = NSURL(string: "http://www.google.com")↓!
+
+
let dict = ["Boooo": "👻"]
+func bla() -> String {
+    return dict["Boooo"]↓!
+}
+
+
let dict = ["Boooo": "👻"]
+func bla() -> String {
+    return dict["Boooo"]↓!.contains("B")
+}
+
+
let a = dict["abc"]↓!.contains("B")
+
+
dict["abc"]↓!.bar("B")
+
+
if dict["a"]↓!↓!↓!↓! {}
+
+
var foo: [Bool]! = dict["abc"]↓!
+
+
realm.objects(SwiftUTF8Object.self).filter("%K == %@", "柱нǢкƱаم👍", utf8TestString).first↓!
+
+
context("abc") {
+  var foo: [Bool]! = dict["abc"]↓!
+}
+
+
open var computed: String { return foo.bar↓! }
+
+
return self↓!
+
+
[1, 3, 5, 6].first { $0.isMultiple(of: 2) }↓!
+
+
map["a"]↓!↓!
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_body_length.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_body_length.html new file mode 100644 index 000000000..b1c6fbfdd --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_body_length.html @@ -0,0 +1,342 @@ + + + + function_body_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Function Body Length

+ +

Functions bodies should not span too many lines.

+ +
    +
  • Identifier: function_body_length
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 50, error: 100
  • +
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_default_parameter_at_end.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_default_parameter_at_end.html new file mode 100644 index 000000000..a5b0e483d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_default_parameter_at_end.html @@ -0,0 +1,382 @@ + + + + function_default_parameter_at_end Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Function Default Parameter at End

+ +

Prefer to locate parameters with defaults toward the end of the parameter list.

+ +
    +
  • Identifier: function_default_parameter_at_end
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo(baz: String, bar: Int = 0) {}
+
+
func foo(x: String, y: Int = 0, z: CGFloat = 0) {}
+
+
func foo(bar: String, baz: Int = 0, z: () -> Void) {}
+
+
func foo(bar: String, z: () -> Void, baz: Int = 0) {}
+
+
func foo(bar: Int = 0) {}
+
+
func foo() {}
+
+
class A: B {
+  override func foo(bar: Int = 0, baz: String) {}
+
+
func foo(bar: Int = 0, completion: @escaping CompletionHandler) {}
+
+
func foo(a: Int, b: CGFloat = 0) {
+  let block = { (error: Error?) in }
+}
+
+
func foo(a: String, b: String? = nil,
+         c: String? = nil, d: @escaping AlertActionHandler = { _ in }) {}
+
+
override init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
+
+
func handleNotification(_ userInfo: NSDictionary,
+                        userInteraction: Bool = false,
+                        completionHandler: ((UIBackgroundFetchResult) -> Void)?) {}
+
+
func write(withoutNotifying tokens: [NotificationToken] =  {}, _ block: (() throws -> Int)) {}
+
+

Triggering Examples

+
↓func foo(bar: Int = 0, baz: String) {}
+
+
private ↓func foo(bar: Int = 0, baz: String) {}
+
+
public ↓init?(for date: Date = Date(), coordinate: CLLocationCoordinate2D) {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_parameter_count.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_parameter_count.html new file mode 100644 index 000000000..9be635040 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/function_parameter_count.html @@ -0,0 +1,375 @@ + + + + function_parameter_count Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Function Parameter Count

+ +

Number of function parameters should be low.

+ +
    +
  • Identifier: function_parameter_count
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 5, error: 8ignores_default_parameters: true
  • +
+

Non Triggering Examples

+
init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
init (a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
`init`(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
init?(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
init?<T>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
init?<T: String>(a: T, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
func f2(p1: Int, p2: Int) { }
+
+
func f(a: Int, b: Int, c: Int, d: Int, x: Int = 42) {}
+
+
func f(a: [Int], b: Int, c: Int, d: Int, f: Int) -> [Int] {
+    let s = a.flatMap { $0 as? [String: Int] } ?? []}}
+
+
override func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+

Triggering Examples

+
↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
↓func initialValue(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+
+
private ↓func f(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int = 2, g: Int) {}
+
+
struct Foo {
+    init(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}
+    ↓func bar(a: Int, b: Int, c: Int, d: Int, e: Int, f: Int) {}}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/generic_type_name.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/generic_type_name.html new file mode 100644 index 000000000..c4cf3ab9b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/generic_type_name.html @@ -0,0 +1,452 @@ + + + + generic_type_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Generic Type Name

+ +

Generic type name should only contain alphanumeric characters, start with an uppercase character and span between 1 and 20 characters in length.

+ +
    +
  • Identifier: generic_type_name
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (min_length) w/e: 1/0, (max_length) w/e: 20/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true
  • +
+

Non Triggering Examples

+
func foo<T>() {}
+
+
+
func foo<T>() -> T {}
+
+
+
func foo<T, U>(param: U) -> T {}
+
+
+
func foo<T: Hashable, U: Rule>(param: U) -> T {}
+
+
+
struct Foo<T> {}
+
+
+
class Foo<T> {}
+
+
+
enum Foo<T> {}
+
+
+
func run(_ options: NoOptions<CommandantError<()>>) {}
+
+
+
func foo(_ options: Set<type>) {}
+
+
+
func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool
+
+
+
func configureWith(data: Either<MessageThread, (project: Project, backing: Backing)>)
+
+
+
typealias StringDictionary<T> = Dictionary<String, T>
+
+
+
typealias BackwardTriple<T1, T2, T3> = (T3, T2, T1)
+
+
+
typealias DictionaryOfStrings<T : Hashable> = Dictionary<T, String>
+
+
+

Triggering Examples

+
func foo<↓T_Foo>() {}
+
+
+
func foo<T, ↓U_Foo>(param: U_Foo) -> T {}
+
+
+
func foo<↓TTTTTTTTTTTTTTTTTTTTT>() {}
+
+
+
func foo<↓type>() {}
+
+
+
typealias StringDictionary<↓T_Foo> = Dictionary<String, T_Foo>
+
+
+
typealias BackwardTriple<T1, ↓T2_Bar, T3> = (T3, T2_Bar, T1)
+
+
+
typealias DictionaryOfStrings<↓T_Foo: Hashable> = Dictionary<T_Foo, String>
+
+
+
class Foo<↓T_Foo> {}
+
+
+
class Foo<T, ↓U_Foo> {}
+
+
+
class Foo<↓T_Foo, ↓U_Foo> {}
+
+
+
class Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
+
+
+
class Foo<↓type> {}
+
+
+
struct Foo<↓T_Foo> {}
+
+
+
struct Foo<T, ↓U_Foo> {}
+
+
+
struct Foo<↓T_Foo, ↓U_Foo> {}
+
+
+
struct Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
+
+
+
struct Foo<↓type> {}
+
+
+
enum Foo<↓T_Foo> {}
+
+
+
enum Foo<T, ↓U_Foo> {}
+
+
+
enum Foo<↓T_Foo, ↓U_Foo> {}
+
+
+
enum Foo<↓TTTTTTTTTTTTTTTTTTTTT> {}
+
+
+
enum Foo<↓type> {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ibinspectable_in_extension.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ibinspectable_in_extension.html new file mode 100644 index 000000000..f432455a1 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ibinspectable_in_extension.html @@ -0,0 +1,352 @@ + + + + ibinspectable_in_extension Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

IBInspectable in Extension

+ +

Extensions shouldn’t add @IBInspectable properties.

+ +
    +
  • Identifier: ibinspectable_in_extension
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+  @IBInspectable private var x: Int
+}
+
+

Triggering Examples

+
extension Foo {
+  ↓@IBInspectable private var x: Int
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identical_operands.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identical_operands.html new file mode 100644 index 000000000..e5480bd2b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identical_operands.html @@ -0,0 +1,830 @@ + + + + identical_operands Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Identical Operands

+ +

Comparing two identical operands is likely a mistake.

+ +
    +
  • Identifier: identical_operands
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
1 == 2
+
+
foo == bar
+
+
prefixedFoo == foo
+
+
foo.aProperty == foo.anotherProperty
+
+
self.aProperty == self.anotherProperty
+
+
"1 == 1"
+
+
self.aProperty == aProperty
+
+
lhs.aProperty == rhs.aProperty
+
+
lhs.identifier == rhs.identifier
+
+
i == index
+
+
$0 == 0
+
+
keyValues?.count ?? 0 == 0
+
+
string == string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num == num?.byteSwapped
+
+
num == num!.byteSwapped
+
+
1    + 1 ==   1     +    2
+
+
f(  i :   2) ==   f (i: 3 )
+
+
1 != 2
+
+
foo != bar
+
+
prefixedFoo != foo
+
+
foo.aProperty != foo.anotherProperty
+
+
self.aProperty != self.anotherProperty
+
+
"1 != 1"
+
+
self.aProperty != aProperty
+
+
lhs.aProperty != rhs.aProperty
+
+
lhs.identifier != rhs.identifier
+
+
i != index
+
+
$0 != 0
+
+
keyValues?.count ?? 0 != 0
+
+
string != string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num != num?.byteSwapped
+
+
num != num!.byteSwapped
+
+
1    + 1 !=   1     +    2
+
+
f(  i :   2) !=   f (i: 3 )
+
+
1 === 2
+
+
foo === bar
+
+
prefixedFoo === foo
+
+
foo.aProperty === foo.anotherProperty
+
+
self.aProperty === self.anotherProperty
+
+
"1 === 1"
+
+
self.aProperty === aProperty
+
+
lhs.aProperty === rhs.aProperty
+
+
lhs.identifier === rhs.identifier
+
+
i === index
+
+
$0 === 0
+
+
keyValues?.count ?? 0 === 0
+
+
string === string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num === num?.byteSwapped
+
+
num === num!.byteSwapped
+
+
1    + 1 ===   1     +    2
+
+
f(  i :   2) ===   f (i: 3 )
+
+
1 !== 2
+
+
foo !== bar
+
+
prefixedFoo !== foo
+
+
foo.aProperty !== foo.anotherProperty
+
+
self.aProperty !== self.anotherProperty
+
+
"1 !== 1"
+
+
self.aProperty !== aProperty
+
+
lhs.aProperty !== rhs.aProperty
+
+
lhs.identifier !== rhs.identifier
+
+
i !== index
+
+
$0 !== 0
+
+
keyValues?.count ?? 0 !== 0
+
+
string !== string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num !== num?.byteSwapped
+
+
num !== num!.byteSwapped
+
+
1    + 1 !==   1     +    2
+
+
f(  i :   2) !==   f (i: 3 )
+
+
1 > 2
+
+
foo > bar
+
+
prefixedFoo > foo
+
+
foo.aProperty > foo.anotherProperty
+
+
self.aProperty > self.anotherProperty
+
+
"1 > 1"
+
+
self.aProperty > aProperty
+
+
lhs.aProperty > rhs.aProperty
+
+
lhs.identifier > rhs.identifier
+
+
i > index
+
+
$0 > 0
+
+
keyValues?.count ?? 0 > 0
+
+
string > string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num > num?.byteSwapped
+
+
num > num!.byteSwapped
+
+
1    + 1 >   1     +    2
+
+
f(  i :   2) >   f (i: 3 )
+
+
1 >= 2
+
+
foo >= bar
+
+
prefixedFoo >= foo
+
+
foo.aProperty >= foo.anotherProperty
+
+
self.aProperty >= self.anotherProperty
+
+
"1 >= 1"
+
+
self.aProperty >= aProperty
+
+
lhs.aProperty >= rhs.aProperty
+
+
lhs.identifier >= rhs.identifier
+
+
i >= index
+
+
$0 >= 0
+
+
keyValues?.count ?? 0 >= 0
+
+
string >= string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num >= num?.byteSwapped
+
+
num >= num!.byteSwapped
+
+
1    + 1 >=   1     +    2
+
+
f(  i :   2) >=   f (i: 3 )
+
+
1 < 2
+
+
foo < bar
+
+
prefixedFoo < foo
+
+
foo.aProperty < foo.anotherProperty
+
+
self.aProperty < self.anotherProperty
+
+
"1 < 1"
+
+
self.aProperty < aProperty
+
+
lhs.aProperty < rhs.aProperty
+
+
lhs.identifier < rhs.identifier
+
+
i < index
+
+
$0 < 0
+
+
keyValues?.count ?? 0 < 0
+
+
string < string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num < num?.byteSwapped
+
+
num < num!.byteSwapped
+
+
1    + 1 <   1     +    2
+
+
f(  i :   2) <   f (i: 3 )
+
+
1 <= 2
+
+
foo <= bar
+
+
prefixedFoo <= foo
+
+
foo.aProperty <= foo.anotherProperty
+
+
self.aProperty <= self.anotherProperty
+
+
"1 <= 1"
+
+
self.aProperty <= aProperty
+
+
lhs.aProperty <= rhs.aProperty
+
+
lhs.identifier <= rhs.identifier
+
+
i <= index
+
+
$0 <= 0
+
+
keyValues?.count ?? 0 <= 0
+
+
string <= string.lowercased()
+
+
let num: Int? = 0
+_ = num != nil && num <= num?.byteSwapped
+
+
num <= num!.byteSwapped
+
+
1    + 1 <=   1     +    2
+
+
f(  i :   2) <=   f (i: 3 )
+
+
func evaluate(_ mode: CommandMode) -> Result<AutoCorrectOptions, CommandantError<CommandantError<()>>>
+
+
let array = Array<Array<Int>>()
+
+
guard Set(identifiers).count != identifiers.count else { return }
+
+
expect("foo") == "foo"
+
+
type(of: model).cachePrefix == cachePrefix
+
+
histogram[156].0 == 0x003B8D96 && histogram[156].1 == 1
+
+
[Wrapper(type: .three), Wrapper(type: .one)].sorted { "\($0.type)" > "\($1.type)"}
+
+
array.sorted { "\($0)" < "\($1)" }
+
+

Triggering Examples

+
↓1 == 1
+
+
↓foo == foo
+
+
↓foo.aProperty == foo.aProperty
+
+
↓self.aProperty == self.aProperty
+
+
↓$0 == $0
+
+
↓a?.b == a?.b
+
+
if (↓elem == elem) {}
+
+
XCTAssertTrue(↓s3 == s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView == tab.webView
+
+
↓1    + 1 ==   1     +    1
+
+
 ↓f(  i :   2) ==   f (i: 
+ 2 )
+
+
↓1 != 1
+
+
↓foo != foo
+
+
↓foo.aProperty != foo.aProperty
+
+
↓self.aProperty != self.aProperty
+
+
↓$0 != $0
+
+
↓a?.b != a?.b
+
+
if (↓elem != elem) {}
+
+
XCTAssertTrue(↓s3 != s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView != tab.webView
+
+
↓1    + 1 !=   1     +    1
+
+
 ↓f(  i :   2) !=   f (i: 
+ 2 )
+
+
↓1 === 1
+
+
↓foo === foo
+
+
↓foo.aProperty === foo.aProperty
+
+
↓self.aProperty === self.aProperty
+
+
↓$0 === $0
+
+
↓a?.b === a?.b
+
+
if (↓elem === elem) {}
+
+
XCTAssertTrue(↓s3 === s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView === tab.webView
+
+
↓1    + 1 ===   1     +    1
+
+
 ↓f(  i :   2) ===   f (i: 
+ 2 )
+
+
↓1 !== 1
+
+
↓foo !== foo
+
+
↓foo.aProperty !== foo.aProperty
+
+
↓self.aProperty !== self.aProperty
+
+
↓$0 !== $0
+
+
↓a?.b !== a?.b
+
+
if (↓elem !== elem) {}
+
+
XCTAssertTrue(↓s3 !== s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView !== tab.webView
+
+
↓1    + 1 !==   1     +    1
+
+
 ↓f(  i :   2) !==   f (i: 
+ 2 )
+
+
↓1 > 1
+
+
↓foo > foo
+
+
↓foo.aProperty > foo.aProperty
+
+
↓self.aProperty > self.aProperty
+
+
↓$0 > $0
+
+
↓a?.b > a?.b
+
+
if (↓elem > elem) {}
+
+
XCTAssertTrue(↓s3 > s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView > tab.webView
+
+
↓1    + 1 >   1     +    1
+
+
 ↓f(  i :   2) >   f (i: 
+ 2 )
+
+
↓1 >= 1
+
+
↓foo >= foo
+
+
↓foo.aProperty >= foo.aProperty
+
+
↓self.aProperty >= self.aProperty
+
+
↓$0 >= $0
+
+
↓a?.b >= a?.b
+
+
if (↓elem >= elem) {}
+
+
XCTAssertTrue(↓s3 >= s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView >= tab.webView
+
+
↓1    + 1 >=   1     +    1
+
+
 ↓f(  i :   2) >=   f (i: 
+ 2 )
+
+
↓1 < 1
+
+
↓foo < foo
+
+
↓foo.aProperty < foo.aProperty
+
+
↓self.aProperty < self.aProperty
+
+
↓$0 < $0
+
+
↓a?.b < a?.b
+
+
if (↓elem < elem) {}
+
+
XCTAssertTrue(↓s3 < s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView < tab.webView
+
+
↓1    + 1 <   1     +    1
+
+
 ↓f(  i :   2) <   f (i: 
+ 2 )
+
+
↓1 <= 1
+
+
↓foo <= foo
+
+
↓foo.aProperty <= foo.aProperty
+
+
↓self.aProperty <= self.aProperty
+
+
↓$0 <= $0
+
+
↓a?.b <= a?.b
+
+
if (↓elem <= elem) {}
+
+
XCTAssertTrue(↓s3 <= s3)
+
+
if let tab = tabManager.selectedTab, ↓tab.webView <= tab.webView
+
+
↓1    + 1 <=   1     +    1
+
+
 ↓f(  i :   2) <=   f (i: 
+ 2 )
+
+
    return ↓lhs.foo == lhs.foo &&
+           lhs.bar == rhs.bar
+
+
    return lhs.foo == rhs.foo &&
+           ↓lhs.bar == lhs.bar
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identifier_name.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identifier_name.html new file mode 100644 index 000000000..1c143f6d3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/identifier_name.html @@ -0,0 +1,394 @@ + + + + identifier_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Identifier Name

+ +

Identifier names should only contain alphanumeric characters and start with a lowercase character or should only contain capital letters. In an exception to the above, variable names may start with a capital letter when they are declared static and immutable. Variable names should not be too long or too short.

+ +
    +
  • Identifier: identifier_name
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (min_length) w/e: 3/2, (max_length) w/e: 40/60, excluded: [“id”], allowed_symbols: [], validates_start_with_lowercase: true
  • +
+

Non Triggering Examples

+
let myLet = 0
+
+
var myVar = 0
+
+
private let _myLet = 0
+
+
class Abc { static let MyLet = 0 }
+
+
let URL: NSURL? = nil
+
+
let XMLString: String? = nil
+
+
override var i = 0
+
+
enum Foo { case myEnum }
+
+
func isOperator(name: String) -> Bool
+
+
func typeForKind(_ kind: SwiftDeclarationKind) -> String
+
+
func == (lhs: SyntaxToken, rhs: SyntaxToken) -> Bool
+
+
override func IsOperator(name: String) -> Bool
+
+
enum Foo { case `private` }
+
+
enum Foo { case value(String) }
+
+

Triggering Examples

+
↓let MyLet = 0
+
+
↓let _myLet = 0
+
+
private ↓let myLet_ = 0
+
+
↓let myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
+
+
↓var myExtremelyVeryVeryVeryVeryVeryVeryLongVar = 0
+
+
private ↓let _myExtremelyVeryVeryVeryVeryVeryVeryLongLet = 0
+
+
↓let i = 0
+
+
↓var aa = 0
+
+
private ↓let _i = 0
+
+
↓func IsOperator(name: String) -> Bool
+
+
enum Foo { case ↓MyEnum }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/carat.png b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/carat.png new file mode 100755 index 0000000000000000000000000000000000000000..29d2f7fd4955fca6bc6fb740e0373a2c358c398e GIT binary patch literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRo!3HEV4DF?Wlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6JlqAi{-jv*Ddl5#RKJQ5NTUZgiPI4RUKGIKU?u8L&ndhX1t za+0CMVUnT(Gnb}ei=c~x==tMH^F1_tBocXwcoSWoO-SZY-o>!8%^=Bms)(~h;m_U( zXNixk28L}0LS5-jKyq@#2gyS|J&f#pGCLkTc<@2s1dqeyqJ*Rc0tSIETAgmODY;(s z2y|Mcp&2}7rpBprBBB~1qM1`N+}4SoxYVPqsXi&l`rxZp{(w0iSy$Nv5*Vy!RapG^ S^0y4=eg;ohKbLh*2~7a!Pg}VF literal 0 HcmV?d00001 diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/dash.png b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/img/dash.png new file mode 100755 index 0000000000000000000000000000000000000000..6f694c7a012b417908da3687a0a39aa182e91c74 GIT binary patch literal 1338 zcmaJ>U2NM_6t){^r>#wcfL0VSTvuX@)$vd4#5N6WVkc|1rR}naMb)(7I5(};#!el# zbtCASsp?W-qE8zSJoFVdA%-T$WL8RI_B? zd+t5o`T5Q{p6=<|U$?VqCxRe#u}(PwSIl{LRKstfSbPYV7pzFiI$~t4QN;vEC}X4n z7RxDpAOV!j*w8ni4MAK3S~6v&;)g`l$axh<$7|>E5RD*h?RH*K2Y`j8L7%1v@%vZi za7@bt@uOUvisvQJuXPqpaHQCkREqd6M>0WG?6AwXR*T65ziuw$&~q$MS$o zfPyh>s<0l}mI@eh_hd(oB8*1tHZ@ojWl%QM;T+Jdm>k66jW?rZ#Atx!qns4-g&E4v z(=;FQ%W^avW?3J{L@2IeV>_(Ca)Lk1vm70uX*$9Rewm8!AxRF0BcZTNSFka?U@5u^ zDtpMY2lVtCmQm<8@|YxHuf`Qs(;a!QQ=g4=WngL}AQLr> z9JWrdsBIHKHXF!fSydodRsaOc@jgNkSU^x9kY&;UP<}3pZ{joC5f_Tevd>4eG~;)Y z=eZ~qp=5#aaUn*E3OES^BApKTU&mCAU>iEyt^S9?)&v0^j*SWDqjRZr20>6rTPSJ& zlzz0f);`}+^~w}lP1PK7Ew3f7ot#*uJ@>1Yo3J0TdsRKpA+*n9JnDXDrM~YvF`;uS|vAh|-QdmRf4AqG=`U z#v1n_Lxg8;&z#YCU2K`_W{-A zUf_|V)B9U(WZ~PP>)O(JZ|Vc-*qP&Q{c~BE~6izDPQq)#Nu*KOf(n^(VHY9;fiINM65``pc+9*v(mL$bwfCjbc%v9V{8r9iX|O%>Nr%pLD2qT{mty}c=LVleeamv znz3SOSm@kP8jThvOOq(56Yzh*fz(booe!uZij=BJC6+_lbvQ~B8nA2>kXdv_RDtRY z`5QXWWEySCe6vbTs^#f?J!WC*{1~RgVx!nJTJjQyO{dRANgx|FnymtGbD9%JmCh9^y)##j7{Dcqfn*1ta$rG89pJF6w-S7Z037$rr|y0;1Onp_ zGFJdT6Q!1C0AdVB0WOmpuV=AgAQ550Tn+-mivTtYPJmz*#75#_n9oV%!#rSOfmAfy zki%C~=fTp1{O#BLpJ|0jj#m6#|LRWit-vq3PE1z9ZqyvET4sX$-Icqy7t z<=aq5ff86AuBZBu6EjJsYWM0uejufWFTwPA7Su}0Bm$7KFb!q{Um_8~A{LUG#1l(l zSehUda@kU8LIRg9fkk2tZ;~ss5~R+mM<==F7hLHpxqLB>>PQS%Vc7b~?q!%T5+h8Q z4G=4Nzyi5WZ?^gkasJ{?Xhm`JC#WG6$1K2jb@=9&D3EgD#3UhGh#*21rJjulVXjCF zvp76q62jt0zzMG5C7DlfMgPl%C^3+~wf|}Lq=}jz|MmIcQjh1Ok6NjD$Em^Iv26D> z8tt_TnM9~^Tt8mflRGPOrrX|HtT3gG4LEuuk{g2Rn}QgJIa?gZo))!!=o_l9bvD%A zZ`aHajl8#~u?!4f7F#*b*->A=R2L)6!>saz?h>#wTXT-I(XmQ zx{84skS>k=i~i`(6k4C7;Zpfx%dCPVjPayMf8pugtGM=~s=Id1l#8MZJ1-73wV#Q3 zR3>v3%}jbQs1f_Z0xo;%=LILlA+nTpKI4ha%xWW}uqHrNao~&T4AY6m`P$_n-6h*g zhoX+e4n%~gl_lhe#s+AMb7d{5WzvYTa%6Q~si@@4{;s(0zU|H&P3fE+t{7X`S#Cj@ zC#vd}^4pcBD*77Ny5=j$h8EL2_t$O38$SQiJ6fPjJMimypr~MB2(&P0aI|h}$64<0 z>_~duqNjaT=DM^6+N{&B_lED;F2wrl?!4Lk*2((x!fmrcsw+=cI^qttuZ9C}-m~5E z-ryYVpL%^xR#&(0YI5hz<(}F7-p)?FPcyJO-zVO>%9ZDXJH8pnY;GJYFDQ>vd#j_* zRrd}L(r=!g+1#nQwsO?kpS`Qq8`NxE+Zy{gf7*_7J*U2V_|NpLo{iasj7VCg_V9&| ShohtYzipXxh2)4xTkMB!bsTr6|ge_{#vAVj^!DyNA-l zJ&$jDFNv;BTZXX@Qk-7+S5ErF>mkOcZ@lQv>F1VyCEMe2Ud@f<|L%#&QJi${E`2lR zqKFaW2Y$aTRxUY&ae$IHsN;Z;rdZ%CjYLTv!tMi234j-ON=CnvK-1QU|MG$YErn{gHZ@0Q6&?xSyply?S$EVNXH;gp?S5kV2-)$ga^gw`(f4Mm_Y(`RbgRkQTHF2@zL}dCiLk$RoZIc{xZL z_J*d5)Kb;#oKCFyfL*NGSs?y;e(QKvPJe1#G)h5*6E(?L9$nt?UaQJfP^$GDL0PU; z?r}C|);JQ4HES3w5VMlY7x6xfJAzDKlHE~>x;D`Fa=WygYot{pfFehH69o9pK|72W zwC6?t^AnATIJa=kewn=ep?Nk(aZ*pZo}51`S=^)jPRb`~l^VE}08>P3OJtQlXx1K8 z8Q}_u=F*fS;=k=?(fIv#+%811NTx8^}rHwvH%LbYmpFl9p1A{Idh@2x$ zuVp7)VD9}Uc(*(C**!QOdS(6B)$5^Tq5p3q*7un&_Z-NKEiEYg$D{Uq&sa>wj|za5 zJ6M~p)z+E6*X${8j6Ci+sqZ}zxeCAo0gZmZuhl+)Q%1U$Br_`NXcA-3yBdYMha+{o z{?q0Q(kaR2n`M29{!pwpgX6+CPQEgIO%x*0#!TC=c-ZPSkLO>OcmQUao5%-3w)U`F zRz?uGCEKQDh!TQPDmyd;iDX$TkMIe)%61q51Y2b-ie4r00!csilXgKL$txqj|6D(# z@(#!nQ}3R1JGeB3B5Tuqdvyg@*!-bq`9`pmasNGvy9^*+cd1Y*g>HK#rl7i79QQAG zl4SL_wW@WY1d+F?j0gFInGhsRrqvV3SKl{oqW+;9!fu|u@J)h4WM!0Cu02l@p60b#5M9c{dKh=_eRw~yl zWT0gw8RePzf%i8X&twiB|LF0bI@CYE{x1PI;Ylr4RJzU#Zc0j!c07g&q7=_eSd(sH z9VKChd?}^52IKcMqolAWiQH;HSp1Ploa$t zQhg|2sK;%Eb!By`)j9G1w?>`Wt6IK3gB}~uoue(MlRiIoZ#d{pgJZ8b{^{HO8)@%= zX)og3`*D5v1g;*Lz8@Sm(Q|&}PUytlb@Q_dzKFOzKK!Z_&?GO4+JO-)iPH=fs{(`& zZ9{oNn~LUZaeN!>i9p*0N^sHye8nw4xSi!REaP@@^Jy66|)Y9_AFoLlrlkg(42 zVq2J??I(+1*BcSKsTyO7LCho{8tVQm1b>*GQ*H~Mn71Lhy`alw%;D@CU^0)5Ng{cHz@LS7QZ o8uGHYt7)tmZjae5ge5$b`e_;HIklOseoIbqeod19BU-8d00{dbSpWb4 literal 0 HcmV?d00001 diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_getter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_getter.html new file mode 100644 index 000000000..da2fd8c7d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_getter.html @@ -0,0 +1,555 @@ + + + + implicit_getter Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Implicit Getter

+ +

Computed read-only properties and subscripts should avoid using the get keyword.

+ +
    +
  • Identifier: implicit_getter
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+    var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        return 20
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
class Foo {
+    var foo: Int
+}
+
+
class Foo {
+    var foo: Int {
+        return getValueFromDisk()
+    }
+}
+
+
class Foo {
+    var foo: String {
+        return "get"
+    }
+}
+
+
protocol Foo {
+    var foo: Int { get }
+}
+
+
protocol Foo {
+    var foo: Int { get set }
+}
+
+
class Foo {
+    var foo: Int {
+        struct Bar {
+            var bar: Int {
+                get { return 1 }
+                set { _ = newValue }
+            }
+        }
+
+        return Bar().bar
+    }
+}
+
+
var _objCTaggedPointerBits: UInt {
+    @inline(__always) get { return 0 }
+}
+
+
var next: Int? {
+    mutating get {
+        defer { self.count += 1 }
+        return self.count
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set { self._bar = newValue }
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        get { _bar }
+        set(newValue) { self._bar = newValue }
+    }
+}
+
+
extension Float {
+    var clamped: Float {
+        set {
+            self = min(1, max(0, newValue))
+        }
+        get {
+            min(1, max(0, self))
+        }
+    }
+}
+
+
extension Reactive where Base: UITapGestureRecognizer {
+    var tapped: CocoaAction<Base>? {
+        get {
+            return associatedAction.withValue { $0.flatMap { $0.action } }
+        }
+        nonmutating set {
+            setAction(newValue)
+        }
+    }
+}
+
+
extension Test {
+    var foo: Bool {
+        get {
+            bar?.boolValue ?? true // Comment mentioning word set which triggers violation
+        }
+        set {
+            bar = NSNumber(value: newValue as Bool)
+        }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        return 20
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        get { return 3 }
+        set { _abc = newValue }
+    }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get }
+}
+
+
protocol Foo {
+    subscript(i: Int) -> Int { get set }
+}
+
+
class DatabaseEntity {
+    var isSynced: Bool {
+        get async {
+            await database.isEntitySynced(self)
+        }
+    }
+}
+
+
struct Test {
+    subscript(value: Int) -> Int {
+        get throws {
+            if value == 0 {
+                throw NSError()
+            } else {
+                return value
+            }
+        }
+    }
+}
+
+

Triggering Examples

+
class Foo {
+    var foo: Int {
+        ↓get {
+            return 20
+        }
+    }
+}
+
+
class Foo {
+    var foo: Int {
+        ↓get{ return 20 }
+    }
+}
+
+
class Foo {
+    static var foo: Int {
+        ↓get {
+            return 20
+        }
+    }
+}
+
+
var foo: Int {
+    ↓get { return 20 }
+}
+
+
class Foo {
+    @objc func bar() {}
+    var foo: Int {
+        ↓get {
+            return 20
+        }
+    }
+}
+
+
extension Foo {
+    var bar: Bool {
+        ↓get { _bar }
+    }
+}
+
+
class Foo {
+    subscript(i: Int) -> Int {
+        ↓get {
+            return 20
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_return.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_return.html new file mode 100644 index 000000000..dee648596 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicit_return.html @@ -0,0 +1,428 @@ + + + + implicit_return Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Implicit Return

+ +

Prefer implicit returns in closures, functions and getters.

+ +
    +
  • Identifier: implicit_return
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, included: [closure, function, getter]
  • +
+

Non Triggering Examples

+
if foo {
+  return 0
+}
+
+
foo.map { $0 + 1 }
+
+
foo.map({ $0 + 1 })
+
+
foo.map { value in value + 1 }
+
+
[1, 2].first(where: {
+    true
+})
+
+
func foo() -> Int {
+    0
+}
+
+
class Foo {
+    func foo() -> Int { 0 }
+}
+
+
func fetch() -> Data? {
+    do {
+        return try loadData()
+    } catch {
+        return nil
+    }
+}
+
+
var foo: Bool { true }
+
+
class Foo {
+    var bar: Int {
+        get {
+            0
+        }
+    }
+}
+
+
class Foo {
+    static var bar: Int {
+        0
+    }
+}
+
+

Triggering Examples

+
foo.map { value in
+    return value + 1
+}
+
+
foo.map {
+    return $0 + 1
+}
+
+
foo.map({ return $0 + 1})
+
+
[1, 2].first(where: {
+    return true
+})
+
+
func foo() -> Int {
+    return 0
+}
+
+
class Foo {
+    func foo() -> Int { return 0 }
+}
+
+
var foo: Bool { return true }
+
+
class Foo {
+    var bar: Int {
+        get {
+            return 0
+        }
+    }
+}
+
+
class Foo {
+    static var bar: Int {
+        return 0
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html new file mode 100644 index 000000000..f89cb0b36 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/implicitly_unwrapped_optional.html @@ -0,0 +1,376 @@ + + + + implicitly_unwrapped_optional Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Implicitly Unwrapped Optional

+ +

Implicitly unwrapped optionals should be avoided when possible.

+ +
    +
  • Identifier: implicitly_unwrapped_optional
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, mode: allExceptIBOutlets
  • +
+

Non Triggering Examples

+
@IBOutlet private var label: UILabel!
+
+
@IBOutlet var label: UILabel!
+
+
@IBOutlet var label: [UILabel!]
+
+
if !boolean {}
+
+
let int: Int? = 42
+
+
let int: Int? = nil
+
+

Triggering Examples

+
let label: UILabel!
+
+
let IBOutlet: UILabel!
+
+
let labels: [UILabel!]
+
+
var ints: [Int!] = [42, nil, 42]
+
+
let label: IBOutlet!
+
+
let int: Int! = 42
+
+
let int: Int! = nil
+
+
var int: Int! = 42
+
+
let collection: AnyCollection<Int!>
+
+
func foo(int: Int!) {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inclusive_language.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inclusive_language.html new file mode 100644 index 000000000..d39e45946 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inclusive_language.html @@ -0,0 +1,378 @@ + + + + inclusive_language Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Inclusive Language

+ +

Identifiers should use inclusive language that avoids discrimination against groups of people based on race, gender, or socioeconomic status

+ +
    +
  • Identifier: inclusive_language
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, additional_terms: [], override_terms: [], override_allowed_terms: []
  • +
+

Non Triggering Examples

+
let foo = "abc"
+
+
enum AllowList {
+    case foo, bar
+}
+
+
func updateAllowList(add: String) {}
+
+
enum WalletItemType {
+    case visa
+    case mastercard
+}
+
+
func chargeMasterCard(_ card: Card) {}
+
+

Triggering Examples

+
let ↓slave = "abc"
+
+
enum ↓BlackList {
+    case foo, bar
+}
+
+
func ↓updateWhiteList(add: String) {}
+
+
enum ListType {
+    case ↓whitelist
+    case ↓blacklist
+}
+
+
init(↓master: String, ↓slave: String) {}
+
+
final class FooBar {
+    func register<↓Master, ↓Slave>(one: Master, two: Slave) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/indentation_width.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/indentation_width.html new file mode 100644 index 000000000..d416cd20f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/indentation_width.html @@ -0,0 +1,382 @@ + + + + indentation_width Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Indentation Width

+ +

Indent code using either one tab or the configured amount of spaces, unindent to match previous indentations. Don’t indent the first line.

+ +
    +
  • Identifier: indentation_width
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: severity: warning, indentation_width: 4, include_comments: true
  • +
+

Non Triggering Examples

+
firstLine
+secondLine
+
+
firstLine
+    secondLine
+
+
firstLine
+    secondLine
+        thirdLine
+
+        fourthLine
+
+
firstLine
+    secondLine
+        thirdLine
+    //test
+        fourthLine
+
+
firstLine
+    secondLine
+        thirdLine
+fourthLine
+
+

Triggering Examples

+
↓    firstLine
+
+
firstLine
+        secondLine
+
+
firstLine
+    secondLine
+
+↓         fourthLine
+
+
firstLine
+    secondLine
+        thirdLine
+↓ fourthLine
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/index.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/index.html new file mode 100644 index 000000000..c50c460e4 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/index.html @@ -0,0 +1,1020 @@ + + + + SwiftLintFramework Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

SwiftLint

+ +

A tool to enforce Swift style and conventions, loosely based on the now archived GitHub Swift Style Guide. SwiftLint enforces the style guide rules that are generally accepted by the Swift community. These rules are well described in popular style guides like Ray Wenderlich’s Swift Style Guide.

+ +

SwiftLint hooks into Clang and +SourceKit to use the +AST representation +of your source files for more accurate results.

+ +

Build Status +codecov.io

+ +

+ +

This project adheres to the Contributor Covenant Code of Conduct. +By participating, you are expected to uphold this code. Please report +unacceptable behavior to info@realm.io.

+ +
+

Language Switch: 中文, 한국어.

+
+

Installation

+

Using Homebrew:

+
brew install swiftlint
+
+

Using CocoaPods:

+ +

Simply add the following line to your Podfile:

+
pod 'SwiftLint'
+
+ +

This will download the SwiftLint binaries and dependencies in Pods/ during your next +pod install execution and will allow you to invoke it via ${PODS_ROOT}/SwiftLint/swiftlint +in your Script Build Phases.

+ +

This is the recommended way to install a specific version of SwiftLint since it supports +installing a pinned version rather than simply the latest (which is the case with Homebrew).

+ +

Note that this will add the SwiftLint binaries, its dependencies’ binaries, and the Swift binary +library distribution to the Pods/ directory, so checking in this directory to SCM such as +git is discouraged.

+

Using Mint:

+
$ mint install realm/SwiftLint
+
+

Using a pre-built package:

+ +

You can also install SwiftLint by downloading SwiftLint.pkg from the +latest GitHub release and +running it.

+

Installing from source:

+ +

You can also build and install from source by cloning this project and running +make install (Xcode 13.3 or later).

+

Using Bazel

+ +

Put this in your WORKSPACE:

+ +
+ +WORKSPACE + +“`python +load(”@bazel_tools//tools/build_defs/repo:http.bzl", “http_archive”) + +http_archive( + name = “build_bazel_rules_apple”, + sha256 = “f94e6dddf74739ef5cb30f000e13a2a613f6ebfa5e63588305a71fce8a8a9911”, + url = “https://github.com/bazelbuild/rules_apple/releases/download/1.1.3/rules_apple.1.1.3.tar.gz”, +) + +load( + “@build_bazel_rules_apple//apple:repositories.bzl”, + “apple_rules_dependencies”, +) + +apple_rules_dependencies() + +load( + “@build_bazel_rules_swift//swift:repositories.bzl”, + “swift_rules_dependencies”, +) + +swift_rules_dependencies() + +load( + “@build_bazel_rules_swift//swift:extras.bzl”, + “swift_rules_extra_dependencies”, +) + +swift_rules_extra_dependencies() + +http_archive( + name = “SwiftLint”, + sha256 = “7c454ff4abeeecdd9513f6293238a6d9f803b587eb93de147f9aa1be0d8337c4”, + url = “https://github.com/realm/SwiftLint/releases/download/0.49.1/bazel.tar.gz”, +) + +load(“@SwiftLint//bazel:repos.bzl”, “swiftlint_repos”) + +swiftlint_repos() + +load(“@SwiftLint//bazel:deps.bzl”, “swiftlint_deps”) + +swiftlint_deps() +“` + +
+ +

Then you can run SwiftLint in the current directory with this command:

+
bazel run -c opt @SwiftLint//:swiftlint
+
+

Usage

+

Presentation

+ +

To get a high-level overview of recommended ways to integrate SwiftLint into your project, +we encourage you to watch this presentation or read the transcript:

+ +

Presentation

+

Xcode

+ +

Integrate SwiftLint into your Xcode project to get warnings and errors displayed +in the issue navigator.

+ +

To do this select the project in the file navigator, then select the primary app +target, and go to Build Phases. Click the + and select "New Run Script Phase”. +Insert the following as the script:

+ +

+ +

If you installed SwiftLint via Homebrew on Apple Silicon, you might experience this warning:

+
+

Warning

+

SwiftLint not installed, download from https://github.com/realm/SwiftLint

+ +
+ +

That is because Homebrew on Apple Silicon installs the binaries into the /opt/homebrew/bin +folder by default. To instruct Xcode where to find SwiftLint, you can either add +/opt/homebrew/bin to the PATH environment variable in your build phase

+
export PATH="$PATH:/opt/homebrew/bin"
+if which swiftlint > /dev/null; then
+  swiftlint
+else
+  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
+fi
+
+ +

or you can create a symbolic link in /usr/local/bin pointing to the actual binary:

+
ln -s /opt/homebrew/bin/swiftlint /usr/local/bin/swiftlint
+
+ +

You might want to move your SwiftLint phase directly before the ‘Compile Sources’ +step to detect errors quickly before compiling. However, SwiftLint is designed +to run on valid Swift code that cleanly completes the compiler’s parsing stage. +So running SwiftLint before ‘Compile Sources’ might yield some incorrect +results.

+ +

If you wish to fix violations as well, your script could run +swiftlint --fix && swiftlint instead of just swiftlint. This will mean +that all correctable violations are fixed while ensuring warnings show up in +your project for remaining violations.

+ +

If you’ve installed SwiftLint via CocoaPods the script should look like this:

+
"${PODS_ROOT}/SwiftLint/swiftlint"
+
+

Plug-in Support

+ +

SwiftLint can be used as a build tool plug-in for both Xcode projects as well as +Swift packages.

+ +
+

Due to limitations with Swift Package Manager Plug-ins this is only +recommended for projects that have a SwiftLint configuration in their root directory as +there is currently no way to pass any additional options to the SwiftLint executable.

+
+

Xcode

+ +

You can integrate SwiftLint as a Xcode Build Tool Plug-in if you’re working +with a project in Xcode.

+ +

Add SwiftLint as a package dependency to your project without linking any of the +products.

+ +

Select the target you want to add linting to and open the Build Phases inspector. +Open Run Build Tool Plug-ins and select the + button. +Select SwiftLintPlugin from the list and add it to the project.

+ +

+

Swift Package

+ +

You can integrate SwiftLint as a Swift Package Manager Plug-in if you’re working with +a Swift Package with a Package.swift manifest.

+ +

Add SwiftLint as a package dependency to your Package.swift file.
+Add SwiftLint to a target using the plugins parameter.

+
.target(
+    ...
+    plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]
+),
+
+

AppCode

+ +

To integrate SwiftLint with AppCode, install +this plugin and configure +SwiftLint’s installed path in the plugin’s preferences. +The fix action is available via ⌥⏎.

+

Visual Studio Code

+ +

To integrate SwiftLint with vscode, install the +vscode-swiftlint extension from the marketplace.

+

fastlane

+ +

You can use the official swiftlint fastlane action to run SwiftLint as part of your fastlane process.

+
swiftlint(
+    mode: :lint,                            # SwiftLint mode: :lint (default) or :autocorrect
+    executable: "Pods/SwiftLint/swiftlint", # The SwiftLint binary path (optional). Important if you've installed it via CocoaPods
+    path: "/path/to/lint",                  # Specify path to lint (optional)
+    output_file: "swiftlint.result.json",   # The path of the output file (optional)
+    reporter: "json",                       # The custom reporter to use (optional)
+    config_file: ".swiftlint-ci.yml",       # The path of the configuration file (optional)
+    files: [                                # List of files to process (optional)
+        "AppDelegate.swift",
+        "path/to/project/Model.swift"
+    ],
+    ignore_exit_status: true,               # Allow fastlane to continue even if SwiftLint returns a non-zero exit status (Default: false)
+    quiet: true,                            # Don't print status logs like 'Linting ' & 'Done linting' (Default: false)
+    strict: true                            # Fail on warnings? (Default: false)
+)
+
+

Docker

+ +

swiftlint is also available as a Docker image using Ubuntu. +So just the first time you need to pull the docker image using the next command:

+
docker pull ghcr.io/realm/swiftlint:latest
+
+ +

Then following times, you just run swiftlint inside of the docker like:

+
docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
+
+ +

This will execute swiftlint in the folder where you are right now (pwd), showing an output like:

+
$ docker run -it -v `pwd`:`pwd` -w `pwd` ghcr.io/realm/swiftlint:latest
+Linting Swift files in current working directory
+Linting 'RuleDocumentation.swift' (1/490)
+...
+Linting 'YamlSwiftLintTests.swift' (490/490)
+Done linting! Found 0 violations, 0 serious in 490 files.
+
+ +

Here you have more documentation about the usage of Docker Images.

+

Command Line

+
$ swiftlint help
+OVERVIEW: A tool to enforce Swift style and conventions.
+
+USAGE: swiftlint <subcommand>
+
+OPTIONS:
+  --version               Show the version.
+  -h, --help              Show help information.
+
+SUBCOMMANDS:
+  analyze                 Run analysis rules
+  docs                    Open SwiftLint documentation website in the default web browser
+  generate-docs           Generates markdown documentation for all rules
+  lint (default)          Print lint warnings and errors
+  rules                   Display the list of rules and their identifiers
+  version                 Display the current version of SwiftLint
+
+  See 'swiftlint help <subcommand>' for detailed help.
+
+ +

Run swiftlint in the directory containing the Swift files to lint. Directories +will be searched recursively.

+ +

To specify a list of files when using lint or analyze +(like the list of files modified by Xcode specified by the +ExtraBuildPhase Xcode +plugin, or modified files in the working tree based on git ls-files -m), you +can do so by passing the option --use-script-input-files and setting the +following instance variables: SCRIPT_INPUT_FILE_COUNT and +SCRIPT_INPUT_FILE_0, SCRIPT_INPUT_FILE_1…SCRIPT_INPUT_FILE_{SCRIPT_INPUT_FILE_COUNT - 1}.

+ +

These are same environment variables set for input files to +custom Xcode script phases.

+

Working With Multiple Swift Versions

+ +

SwiftLint hooks into SourceKit so it continues working even as Swift evolves!

+ +

This also keeps SwiftLint lean, as it doesn’t need to ship with a full Swift +compiler, it just communicates with the official one you already have installed +on your machine.

+ +

You should always run SwiftLint with the same toolchain you use to compile your +code.

+ +

You may want to override SwiftLint’s default Swift toolchain if you have +multiple toolchains or Xcodes installed.

+ +

Here’s the order in which SwiftLint determines which Swift toolchain to use:

+ +
    +
  • $XCODE_DEFAULT_TOOLCHAIN_OVERRIDE
  • +
  • $TOOLCHAIN_DIR or $TOOLCHAINS
  • +
  • xcrun -find swift
  • +
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • +
  • /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • +
  • ~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • +
  • ~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • +
+ +

sourcekitd.framework is expected to be found in the usr/lib/ subdirectory of +the value passed in the paths above.

+ +

You may also set the TOOLCHAINS environment variable to the reverse-DNS +notation that identifies a Swift toolchain version:

+
$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 swiftlint --fix
+
+ +

On Linux, SourceKit is expected to be located in +/usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH +environment variable.

+

pre-commit

+ +

SwiftLint can be run as a pre-commit hook. +Once installed, add this to the +.pre-commit-config.yaml in the root of your repository:

+
repos:
+  - repo: https://github.com/realm/SwiftLint
+    rev: 0.44.0
+    hooks:
+      - id: swiftlint
+
+ +

Adjust rev to the SwiftLint version of your choice.

+

Rules

+ +

Over 200 rules are included in SwiftLint and the Swift community (that’s you!) +continues to contribute more over time. +Pull requests are encouraged.

+ +

You can find an updated list of rules and more information about them +here.

+ +

You can also check Source/SwiftLintFramework/Rules +directory to see their implementation.

+

Opt-In Rules

+ +

opt_in_rules are disabled by default (i.e., you have to explicitly enable them +in your configuration file).

+ +

Guidelines on when to mark a rule as opt-in:

+ +
    +
  • A rule that can have many false positives (e.g. empty_count)
  • +
  • A rule that is too slow
  • +
  • A rule that is not general consensus or is only useful in some cases +(e.g. force_unwrapping)
  • +
+

Disable rules in code

+ +

Rules can be disabled with a comment inside a source file with the following +format:

+ +

// swiftlint:disable <rule1> [<rule2> <rule3>...]

+ +

The rules will be disabled until the end of the file or until the linter sees a +matching enable comment:

+ +

// swiftlint:enable <rule1> [<rule2> <rule3>...]

+ +

For example:

+
// swiftlint:disable colon
+let noWarning :String = "" // No warning about colons immediately after variable names!
+// swiftlint:enable colon
+let hasWarning :String = "" // Warning generated about colons immediately after variable names
+
+ +

Including the all keyword will disable all rules until the linter sees a matching enable comment:

+ +

// swiftlint:disable all +// swiftlint:enable all

+ +

For example:

+
// swiftlint:disable all
+let noWarning :String = "" // No warning about colons immediately after variable names!
+let i = "" // Also no warning about short identifier names
+// swiftlint:enable all
+let hasWarning :String = "" // Warning generated about colons immediately after variable names
+let y = "" // Warning generated about short identifier names
+
+ +

It’s also possible to modify a disable or enable command by appending +:previous, :this or :next for only applying the command to the previous, +this (current) or next line respectively.

+ +

For example:

+
// swiftlint:disable:next force_cast
+let noWarning = NSNumber() as! Int
+let hasWarning = NSNumber() as! Int
+let noWarning2 = NSNumber() as! Int // swiftlint:disable:this force_cast
+let noWarning3 = NSNumber() as! Int
+// swiftlint:disable:previous force_cast
+
+ +

Run swiftlint rules to print a list of all available rules and their +identifiers.

+

Configuration

+ +

Configure SwiftLint by adding a .swiftlint.yml file from the directory you’ll +run SwiftLint from. The following parameters can be configured:

+ +

Rule inclusion:

+ +
    +
  • disabled_rules: Disable rules from the default enabled set.
  • +
  • opt_in_rules: Enable rules that are not part of the default set.
  • +
  • only_rules: Only the rules specified in this list will be enabled. +Cannot be specified alongside disabled_rules or opt_in_rules.
  • +
  • analyzer_rules: This is an entirely separate list of rules that are only +run by the analyze command. All analyzer rules are opt-in, so this is the +only configurable rule list, there are no equivalents for disabled_rules +only_rules.
  • +
+
# By default, SwiftLint uses a set of sensible default rules you can adjust:
+disabled_rules: # rule identifiers turned on by default to exclude from running
+  - colon
+  - comma
+  - control_statement
+opt_in_rules: # some rules are turned off by default, so you need to opt-in
+  - empty_count # Find all the available rules by running: `swiftlint rules`
+
+# Alternatively, specify all rules explicitly by uncommenting this option:
+# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
+#   - empty_parameters
+#   - vertical_whitespace
+
+included: # paths to include during linting. `--path` is ignored if present.
+  - Source
+excluded: # paths to ignore during linting. Takes precedence over `included`.
+  - Carthage
+  - Pods
+  - Source/ExcludedFolder
+  - Source/ExcludedFile.swift
+  - Source/*/ExcludedFile.swift # Exclude files with a wildcard
+analyzer_rules: # Rules run by `swiftlint analyze`
+  - explicit_self
+
+# configurable rules can be customized from this configuration file
+# binary rules can set their severity level
+force_cast: warning # implicitly
+force_try:
+  severity: warning # explicitly
+# rules that have both warning and error levels, can set just the warning level
+# implicitly
+line_length: 110
+# they can set both implicitly with an array
+type_body_length:
+  - 300 # warning
+  - 400 # error
+# or they can set both explicitly
+file_length:
+  warning: 500
+  error: 1200
+# naming rules can set warnings/errors for min_length and max_length
+# additionally they can set excluded names
+type_name:
+  min_length: 4 # only warning
+  max_length: # warning and error
+    warning: 40
+    error: 50
+  excluded: iPhone # excluded via string
+  allowed_symbols: ["_"] # these are allowed in type names
+identifier_name:
+  min_length: # only min_length
+    error: 4 # only error
+  excluded: # excluded via string array
+    - id
+    - URL
+    - GlobalAPIKey
+reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)
+
+ +

You can also use environment variables in your configuration file, +by using ${SOME_VARIABLE} in a string.

+

Defining Custom Rules

+ +

You can define custom regex-based rules in your configuration file using the +following syntax:

+
custom_rules:
+  pirates_beat_ninjas: # rule identifier
+    included: 
+      - ".*\\.swift" # regex that defines paths to include during linting. optional.
+    excluded: 
+      - ".*Test\\.swift" # regex that defines paths to exclude during linting. optional
+    name: "Pirates Beat Ninjas" # rule name. optional.
+    regex: "([nN]inja)" # matching pattern
+    capture_group: 0 # number of regex capture group to highlight the rule violation at. optional.
+    match_kinds: # SyntaxKinds to match. optional.
+      - comment
+      - identifier
+    message: "Pirates are better than ninjas." # violation message. optional.
+    severity: error # violation severity. optional.
+  no_hiding_in_strings:
+    regex: "([nN]inja)"
+    match_kinds: string
+
+ +

This is what the output would look like:

+ +

+ +

You can filter the matches by providing one or more match_kinds, which will +reject matches that include syntax kinds that are not present in this list. Here +are all the possible syntax kinds:

+ +
    +
  • argument
  • +
  • attribute.builtin
  • +
  • attribute.id
  • +
  • buildconfig.id
  • +
  • buildconfig.keyword
  • +
  • comment
  • +
  • comment.mark
  • +
  • comment.url
  • +
  • doccomment
  • +
  • doccomment.field
  • +
  • identifier
  • +
  • keyword
  • +
  • number
  • +
  • objectliteral
  • +
  • parameter
  • +
  • placeholder
  • +
  • string
  • +
  • string_interpolation_anchor
  • +
  • typeidentifier
  • +
+ +

All syntax kinds used in a snippet of Swift code can be extracted asking +SourceKitten. For example, +sourcekitten syntax --text "struct S {}" delivers

+ +
    +
  • source.lang.swift.syntaxtype.keyword for the struct keyword and
  • +
  • source.lang.swift.syntaxtype.identifier for its name S
  • +
+ +

which match to keyword and identifier in the above list.

+ +

If using custom rules in combination with only_rules, make sure to add +custom_rules as an item under only_rules.

+

Auto-correct

+ +

SwiftLint can automatically correct certain violations. Files on disk are +overwritten with a corrected version.

+ +

Please make sure to have backups of these files before running +swiftlint --fix, otherwise important data may be lost.

+ +

Standard linting is disabled while correcting because of the high likelihood of +violations (or their offsets) being incorrect after modifying a file while +applying corrections.

+

Analyze

+ +

The swiftlint analyze command can lint Swift files using the +full type-checked AST. The compiler log path containing the clean swiftc build +command invocation (incremental builds will fail) must be passed to analyze +via the --compiler-log-path flag. +e.g. --compiler-log-path /path/to/xcodebuild.log

+ +

This can be obtained by

+ +
    +
  1. Cleaning DerivedData (incremental builds won’t work with analyze)
  2. +
  3. Running xcodebuild -workspace {WORKSPACE}.xcworkspace -scheme {SCHEME} > xcodebuild.log
  4. +
  5. Running swiftlint analyze --compiler-log-path xcodebuild.log
  6. +
+ +

Analyzer rules tend to be considerably slower than lint rules.

+

Using Multiple Configuration Files

+ +

SwiftLint offers a variety of ways to include multiple configuration files. +Multiple configuration files get merged into one single configuration that is then applied +just as a single configuration file would get applied.

+ +

There are quite a lot of use cases where using multiple configuration files could be helpful:

+ +

For instance, one could use a team-wide shared SwiftLint configuration while allowing overrides +in each project via a child configuration file.

+ +

Team-Wide Configuration:

+
disabled_rules:
+- force_cast
+
+ +

Project-Specific Configuration:

+
opt_in_rules:
+- force_cast
+
+

Child / Parent Configs (Locally)

+ +

You can specify a child_config and / or a parent_config reference within a configuration file. +These references should be local paths relative to the folder of the configuration file they are specified in. +This even works recursively, as long as there are no cycles and no ambiguities.

+ +

A child config is treated as a refinement and therefore has a higher priority, +while a parent config is considered a base with lower priority in case of conflicts.

+ +

Here’s an example, assuming you have the following file structure:

+
ProjectRoot
+    |_ .swiftlint.yml
+    |_ .swiftlint_refinement.yml
+    |_ Base
+        |_ .swiftlint_base.yml
+
+ +

To include both the refinement and the base file, your .swiftlint.yml should look like this:

+
child_config: .swiftlint_refinement.yml
+parent_config: Base/.swiftlint_base.yml
+
+ +

When merging parent and child configs, included and excluded configurations +are processed carefully to account for differences in the directory location +of the containing configuration files.

+

Child / Parent Configs (Remote)

+ +

Just as you can provide local child_config / parent_config references, instead of +referencing local paths, you can just put urls that lead to configuration files. +In order for SwiftLint to detect these remote references, they must start with http:// or https://.

+ +

The referenced remote configuration files may even recursively reference other +remote configuration files, but aren’t allowed to include local references.

+ +

Using a remote reference, your .swiftlint.yml could look like this:

+
parent_config: https://myteamserver.com/our-base-swiftlint-config.yml
+
+ +

Every time you run SwiftLint and have an Internet connection, SwiftLint tries to get a new version of +every remote configuration that is referenced. If this request times out, a cached version is +used if available. If there is no cached version available, SwiftLint fails – but no worries, a cached version +should be there once SwiftLint has run successfully at least once.

+ +

If needed, the timeouts for the remote configuration fetching can be specified manually via the +configuration file(s) using the remote_timeout / remote_timeout_if_cached specifiers. +These values default to 2 / 1 second(s).

+

Command Line

+ +

Instead of just providing one configuration file when running SwiftLint via the command line, +you can also pass a hierarchy, where the first configuration is treated as a parent, +while the last one is treated as the highest-priority child.

+ +

A simple example including just two configuration files looks like this:

+ +

swiftlint --config .swiftlint.yml --config .swiftlint_child.yml

+

Nested Configurations

+ +

In addition to a main configuration (the .swiftlint.yml file in the root folder), +you can put other configuration files named .swiftlint.yml into the directory structure +that then get merged as a child config, but only with an effect for those files +that are within the same directory as the config or in a deeper directory where +there isn’t another configuration file. In other words: Nested configurations don’t work +recursively – there’s a maximum number of one nested configuration per file +that may be applied in addition to the main configuration.

+ +

.swiftlint.yml files are only considered as a nested configuration if they have not been +used to build the main configuration already (e. g. by having been referenced via something +like child_config: Folder/.swiftlint.yml). Also, parent_config / child_config +specifications of nested configurations are getting ignored because there’s no sense to that.

+ +

If one (or more) SwiftLint file(s) are explicitly specified via the --config parameter, +that configuration will be treated as an override, no matter whether there exist +other .swiftlint.yml files somewhere within the directory. So if you want to use + nested configurations, you can’t use the --config parameter.

+

License

+ +

MIT licensed.

+

About

+ +

+ +

SwiftLint is maintained and funded by Realm Inc. The names and logos for +Realm are trademarks of Realm Inc.

+ +

We :heart: open source software! +See our other open source projects, +read our blog, or say hi on twitter +(@realm).

+ +

+ +

Our thanks to MacStadium for providing a Mac Mini to run our performance +tests.

+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inert_defer.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inert_defer.html new file mode 100644 index 000000000..e54653360 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/inert_defer.html @@ -0,0 +1,373 @@ + + + + inert_defer Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Inert Defer

+ +

If defer is at the end of its parent scope, it will be executed right where it is anyway.

+ +
    +
  • Identifier: inert_defer
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func example3() {
+    defer { /* deferred code */ }
+
+    print("other code")
+}
+
+
func example4() {
+    if condition {
+        defer { /* deferred code */ }
+        print("other code")
+    }
+}
+
+

Triggering Examples

+
func example0() {
+    ↓defer { /* deferred code */ }
+}
+
+
func example1() {
+    ↓defer { /* deferred code */ }
+    // comment
+}
+
+
func example2() {
+    if condition {
+        ↓defer { /* deferred code */ }
+        // comment
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/is_disjoint.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/is_disjoint.html new file mode 100644 index 000000000..8eb0b52a2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/is_disjoint.html @@ -0,0 +1,356 @@ + + + + is_disjoint Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Is Disjoint

+ +

Prefer using Set.isDisjoint(with:) over Set.intersection(_:).isEmpty.

+ +
    +
  • Identifier: is_disjoint
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
_ = Set(syntaxKinds).isDisjoint(with: commentAndStringKindsSet)
+
+
let isObjc = !objcAttributes.isDisjoint(with: dictionary.enclosedSwiftAttributes)
+
+
_ = Set(syntaxKinds).intersection(commentAndStringKindsSet)
+
+
_ = !objcAttributes.intersection(dictionary.enclosedSwiftAttributes)
+
+

Triggering Examples

+
_ = Set(syntaxKinds).↓intersection(commentAndStringKindsSet).isEmpty
+
+
let isObjc = !objcAttributes.↓intersection(dictionary.enclosedSwiftAttributes).isEmpty
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/joined_default_parameter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/joined_default_parameter.html new file mode 100644 index 000000000..c966cd4bc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/joined_default_parameter.html @@ -0,0 +1,359 @@ + + + + joined_default_parameter Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Joined Default Parameter

+ +

Discouraged explicit usage of the default separator.

+ +
    +
  • Identifier: joined_default_parameter
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = bar.joined()
+
+
let foo = bar.joined(separator: ",")
+
+
let foo = bar.joined(separator: toto)
+
+

Triggering Examples

+
let foo = bar.joined(↓separator: "")
+
+
let foo = bar.filter(toto)
+             .joined(↓separator: ""),
+
+
func foo() -> String {
+  return ["1", "2"].joined(↓separator: "")
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.js b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.js new file mode 100755 index 000000000..198441660 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +window.jazzy = {'docset': false} +if (typeof window.dash != 'undefined') { + document.documentElement.className += ' dash' + window.jazzy.docset = true +} +if (navigator.userAgent.match(/xcode/i)) { + document.documentElement.className += ' xcode' + window.jazzy.docset = true +} + +function toggleItem($link, $content) { + var animationDuration = 300; + $link.toggleClass('token-open'); + $content.slideToggle(animationDuration); +} + +function itemLinkToContent($link) { + return $link.parent().parent().next(); +} + +// On doc load + hash-change, open any targetted item +function openCurrentItemIfClosed() { + if (window.jazzy.docset) { + return; + } + var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token'); + $content = itemLinkToContent($link); + if ($content.is(':hidden')) { + toggleItem($link, $content); + } +} + +$(openCurrentItemIfClosed); +$(window).on('hashchange', openCurrentItemIfClosed); + +// On item link ('token') click, toggle its discussion +$('.token').on('click', function(event) { + if (window.jazzy.docset) { + return; + } + var $link = $(this); + toggleItem($link, itemLinkToContent($link)); + + // Keeps the document from jumping to the hash. + var href = $link.attr('href'); + if (history.pushState) { + history.pushState({}, '', href); + } else { + location.hash = href; + } + event.preventDefault(); +}); + +// Clicks on links to the current, closed, item need to open the item +$("a:not('.token')").on('click', function() { + if (location == this.href) { + openCurrentItemIfClosed(); + } +}); + +// KaTeX rendering +if ("katex" in window) { + $($('.math').each( (_, element) => { + katex.render(element.textContent, element, { + displayMode: $(element).hasClass('m-block'), + throwOnError: false, + trust: true + }); + })) +} diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.search.js b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.search.js new file mode 100644 index 000000000..359cdbb8b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jazzy.search.js @@ -0,0 +1,74 @@ +// Jazzy - https://github.com/realm/jazzy +// Copyright Realm Inc. +// SPDX-License-Identifier: MIT + +$(function(){ + var $typeahead = $('[data-typeahead]'); + var $form = $typeahead.parents('form'); + var searchURL = $form.attr('action'); + + function displayTemplate(result) { + return result.name; + } + + function suggestionTemplate(result) { + var t = '
'; + t += '' + result.name + ''; + if (result.parent_name) { + t += '' + result.parent_name + ''; + } + t += '
'; + return t; + } + + $typeahead.one('focus', function() { + $form.addClass('loading'); + + $.getJSON(searchURL).then(function(searchData) { + const searchIndex = lunr(function() { + this.ref('url'); + this.field('name'); + this.field('abstract'); + for (const [url, doc] of Object.entries(searchData)) { + this.add({url: url, name: doc.name, abstract: doc.abstract}); + } + }); + + $typeahead.typeahead( + { + highlight: true, + minLength: 3, + autoselect: true + }, + { + limit: 10, + display: displayTemplate, + templates: { suggestion: suggestionTemplate }, + source: function(query, sync) { + const lcSearch = query.toLowerCase(); + const results = searchIndex.query(function(q) { + q.term(lcSearch, { boost: 100 }); + q.term(lcSearch, { + boost: 10, + wildcard: lunr.Query.wildcard.TRAILING + }); + }).map(function(result) { + var doc = searchData[result.ref]; + doc.url = result.ref; + return doc; + }); + sync(results); + } + } + ); + $form.removeClass('loading'); + $typeahead.trigger('focus'); + }); + }); + + var baseURL = searchURL.slice(0, -"search.json".length); + + $typeahead.on('typeahead:select', function(e, result) { + window.location = baseURL + result.url; + }); +}); diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jquery.min.js b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jquery.min.js new file mode 100644 index 000000000..c4c6022f2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 00){var c=e.utils.clone(r)||{};c.position=[a,l],c.index=s.length,s.push(new e.Token(i.slice(a,o),c))}a=o+1}}return s},e.tokenizer.separator=/[\s\-]+/,e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions=Object.create(null),e.Pipeline.registerFunction=function(t,r){r in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+r),t.label=r,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var r=t.label&&t.label in this.registeredFunctions;r||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var r=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);r.add(i)}),r},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,r)},e.Pipeline.prototype.before=function(t,r){e.Pipeline.warnIfFunctionNotRegistered(r);var i=this._stack.indexOf(t);if(i==-1)throw new Error("Cannot find existingFn");this._stack.splice(i,0,r)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);t!=-1&&this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r1&&(se&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e?2*n:s>e?2*n:sa?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},e.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},e.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t0){var o,a=s.str.charAt(0);a in s.node.edges?o=s.node.edges[a]:(o=new e.TokenSet,s.node.edges[a]=o),1==s.str.length&&(o["final"]=!0),n.push({node:o,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(0!=s.editsRemaining){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new e.TokenSet;s.node.edges["*"]=u}if(0==s.str.length&&(u["final"]=!0),n.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&n.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),1==s.str.length&&(s.node["final"]=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new e.TokenSet;s.node.edges["*"]=l}1==s.str.length&&(l["final"]=!0),n.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var c,h=s.str.charAt(0),d=s.str.charAt(1);d in s.node.edges?c=s.node.edges[d]:(c=new e.TokenSet,s.node.edges[d]=c),1==s.str.length&&(c["final"]=!0),n.push({node:c,editsRemaining:s.editsRemaining-1,str:h+s.str.slice(2)})}}}return i},e.TokenSet.fromString=function(t){for(var r=new e.TokenSet,i=r,n=0,s=t.length;n=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r["char"]]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},e.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},e.Index.prototype.search=function(t){return this.query(function(r){var i=new e.QueryParser(t,r);i.parse()})},e.Index.prototype.query=function(t){for(var r=new e.Query(this.fields),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u1?this._b=1:this._b=e},e.Builder.prototype.k1=function(e){this._k1=e},e.Builder.prototype.add=function(t,r){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return e.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},e.QueryLexer.prototype.width=function(){return this.pos-this.start},e.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},e.QueryLexer.prototype.backup=function(){this.pos-=1},e.QueryLexer.prototype.acceptDigitRun=function(){var t,r;do t=this.next(),r=t.charCodeAt(0);while(r>47&&r<58);t!=e.QueryLexer.EOS&&this.backup()},e.QueryLexer.prototype.more=function(){return this.pos1&&(t.backup(),t.emit(e.QueryLexer.TERM)),t.ignore(),t.more())return e.QueryLexer.lexText},e.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.EDIT_DISTANCE),e.QueryLexer.lexText},e.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(e.QueryLexer.BOOST),e.QueryLexer.lexText},e.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(e.QueryLexer.TERM)},e.QueryLexer.termSeparator=e.tokenizer.separator,e.QueryLexer.lexText=function(t){for(;;){var r=t.next();if(r==e.QueryLexer.EOS)return e.QueryLexer.lexEOS;if(92!=r.charCodeAt(0)){if(":"==r)return e.QueryLexer.lexField;if("~"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexEditDistance;if("^"==r)return t.backup(),t.width()>0&&t.emit(e.QueryLexer.TERM),e.QueryLexer.lexBoost;if("+"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if("-"==r&&1===t.width())return t.emit(e.QueryLexer.PRESENCE),e.QueryLexer.lexText;if(r.match(e.QueryLexer.termSeparator))return e.QueryLexer.lexTerm}else t.escapeCharacter()}},e.QueryParser=function(t,r){this.lexer=new e.QueryLexer(t),this.query=r,this.currentClause={},this.lexemeIdx=0},e.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=e.QueryParser.parseClause;t;)t=t(this);return this.query},e.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},e.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},e.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},e.QueryParser.parseClause=function(t){var r=t.peekLexeme();if(void 0!=r)switch(r.type){case e.QueryLexer.PRESENCE:return e.QueryParser.parsePresence;case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(i+=" with value '"+r.str+"'"),new e.QueryParseError(i,r.start,r.end)}},e.QueryParser.parsePresence=function(t){var r=t.consumeLexeme();if(void 0!=r){switch(r.str){case"-":t.currentClause.presence=e.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=e.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+r.str+"'";throw new e.QueryParseError(i,r.start,r.end)}var n=t.peekLexeme();if(void 0==n){var i="expecting term or field, found nothing";throw new e.QueryParseError(i,r.start,r.end)}switch(n.type){case e.QueryLexer.FIELD:return e.QueryParser.parseField;case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var i="expecting term or field, found '"+n.type+"'";throw new e.QueryParseError(i,n.start,n.end)}}},e.QueryParser.parseField=function(t){var r=t.consumeLexeme();if(void 0!=r){if(t.query.allFields.indexOf(r.str)==-1){var i=t.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),n="unrecognised field '"+r.str+"', possible fields: "+i;throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.fields=[r.str];var s=t.peekLexeme();if(void 0==s){var n="expecting term, found nothing";throw new e.QueryParseError(n,r.start,r.end)}switch(s.type){case e.QueryLexer.TERM:return e.QueryParser.parseTerm;default:var n="expecting term, found '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseTerm=function(t){var r=t.consumeLexeme();if(void 0!=r){t.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(void 0==i)return void t.nextClause();switch(i.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new e.QueryParseError(n,i.start,i.end)}}},e.QueryParser.parseEditDistance=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.editDistance=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},e.QueryParser.parseBoost=function(t){var r=t.consumeLexeme();if(void 0!=r){var i=parseInt(r.str,10);if(isNaN(i)){var n="boost must be numeric";throw new e.QueryParseError(n,r.start,r.end)}t.currentClause.boost=i;var s=t.peekLexeme();if(void 0==s)return void t.nextClause();switch(s.type){case e.QueryLexer.TERM:return t.nextClause(),e.QueryParser.parseTerm;case e.QueryLexer.FIELD:return t.nextClause(),e.QueryParser.parseField;case e.QueryLexer.EDIT_DISTANCE:return e.QueryParser.parseEditDistance;case e.QueryLexer.BOOST:return e.QueryParser.parseBoost;case e.QueryLexer.PRESENCE:return t.nextClause(),e.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+s.type+"'";throw new e.QueryParseError(n,s.start,s.end)}}},function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.lunr=t()}(this,function(){return e})}(); diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/typeahead.jquery.js b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/typeahead.jquery.js new file mode 100644 index 000000000..3a2d2ab03 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/js/typeahead.jquery.js @@ -0,0 +1,1694 @@ +/*! + * typeahead.js 1.3.1 + * https://github.com/corejavascript/typeahead.js + * Copyright 2013-2020 Twitter, Inc. and other contributors; Licensed MIT + */ + + +(function(root, factory) { + if (typeof define === "function" && define.amd) { + define([ "jquery" ], function(a0) { + return factory(a0); + }); + } else if (typeof module === "object" && module.exports) { + module.exports = factory(require("jquery")); + } else { + factory(root["jQuery"]); + } +})(this, function($) { + var _ = function() { + "use strict"; + return { + isMsie: function() { + return /(msie|trident)/i.test(navigator.userAgent) ? navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2] : false; + }, + isBlankString: function(str) { + return !str || /^\s*$/.test(str); + }, + escapeRegExChars: function(str) { + return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); + }, + isString: function(obj) { + return typeof obj === "string"; + }, + isNumber: function(obj) { + return typeof obj === "number"; + }, + isArray: $.isArray, + isFunction: $.isFunction, + isObject: $.isPlainObject, + isUndefined: function(obj) { + return typeof obj === "undefined"; + }, + isElement: function(obj) { + return !!(obj && obj.nodeType === 1); + }, + isJQuery: function(obj) { + return obj instanceof $; + }, + toStr: function toStr(s) { + return _.isUndefined(s) || s === null ? "" : s + ""; + }, + bind: $.proxy, + each: function(collection, cb) { + $.each(collection, reverseArgs); + function reverseArgs(index, value) { + return cb(value, index); + } + }, + map: $.map, + filter: $.grep, + every: function(obj, test) { + var result = true; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (!(result = test.call(null, val, key, obj))) { + return false; + } + }); + return !!result; + }, + some: function(obj, test) { + var result = false; + if (!obj) { + return result; + } + $.each(obj, function(key, val) { + if (result = test.call(null, val, key, obj)) { + return false; + } + }); + return !!result; + }, + mixin: $.extend, + identity: function(x) { + return x; + }, + clone: function(obj) { + return $.extend(true, {}, obj); + }, + getIdGenerator: function() { + var counter = 0; + return function() { + return counter++; + }; + }, + templatify: function templatify(obj) { + return $.isFunction(obj) ? obj : template; + function template() { + return String(obj); + } + }, + defer: function(fn) { + setTimeout(fn, 0); + }, + debounce: function(func, wait, immediate) { + var timeout, result; + return function() { + var context = this, args = arguments, later, callNow; + later = function() { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + } + }; + callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + result = func.apply(context, args); + } + return result; + }; + }, + throttle: function(func, wait) { + var context, args, timeout, result, previous, later; + previous = 0; + later = function() { + previous = new Date(); + timeout = null; + result = func.apply(context, args); + }; + return function() { + var now = new Date(), remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + } else if (!timeout) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }, + stringify: function(val) { + return _.isString(val) ? val : JSON.stringify(val); + }, + guid: function() { + function _p8(s) { + var p = (Math.random().toString(16) + "000000000").substr(2, 8); + return s ? "-" + p.substr(0, 4) + "-" + p.substr(4, 4) : p; + } + return "tt-" + _p8() + _p8(true) + _p8(true) + _p8(); + }, + noop: function() {} + }; + }(); + var WWW = function() { + "use strict"; + var defaultClassNames = { + wrapper: "twitter-typeahead", + input: "tt-input", + hint: "tt-hint", + menu: "tt-menu", + dataset: "tt-dataset", + suggestion: "tt-suggestion", + selectable: "tt-selectable", + empty: "tt-empty", + open: "tt-open", + cursor: "tt-cursor", + highlight: "tt-highlight" + }; + return build; + function build(o) { + var www, classes; + classes = _.mixin({}, defaultClassNames, o); + www = { + css: buildCss(), + classes: classes, + html: buildHtml(classes), + selectors: buildSelectors(classes) + }; + return { + css: www.css, + html: www.html, + classes: www.classes, + selectors: www.selectors, + mixin: function(o) { + _.mixin(o, www); + } + }; + } + function buildHtml(c) { + return { + wrapper: '', + menu: '
' + }; + } + function buildSelectors(classes) { + var selectors = {}; + _.each(classes, function(v, k) { + selectors[k] = "." + v; + }); + return selectors; + } + function buildCss() { + var css = { + wrapper: { + position: "relative", + display: "inline-block" + }, + hint: { + position: "absolute", + top: "0", + left: "0", + borderColor: "transparent", + boxShadow: "none", + opacity: "1" + }, + input: { + position: "relative", + verticalAlign: "top", + backgroundColor: "transparent" + }, + inputWithNoHint: { + position: "relative", + verticalAlign: "top" + }, + menu: { + position: "absolute", + top: "100%", + left: "0", + zIndex: "100", + display: "none" + }, + ltr: { + left: "0", + right: "auto" + }, + rtl: { + left: "auto", + right: " 0" + } + }; + if (_.isMsie()) { + _.mixin(css.input, { + backgroundImage: "url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)" + }); + } + return css; + } + }(); + var EventBus = function() { + "use strict"; + var namespace, deprecationMap; + namespace = "typeahead:"; + deprecationMap = { + render: "rendered", + cursorchange: "cursorchanged", + select: "selected", + autocomplete: "autocompleted" + }; + function EventBus(o) { + if (!o || !o.el) { + $.error("EventBus initialized without el"); + } + this.$el = $(o.el); + } + _.mixin(EventBus.prototype, { + _trigger: function(type, args) { + var $e = $.Event(namespace + type); + this.$el.trigger.call(this.$el, $e, args || []); + return $e; + }, + before: function(type) { + var args, $e; + args = [].slice.call(arguments, 1); + $e = this._trigger("before" + type, args); + return $e.isDefaultPrevented(); + }, + trigger: function(type) { + var deprecatedType; + this._trigger(type, [].slice.call(arguments, 1)); + if (deprecatedType = deprecationMap[type]) { + this._trigger(deprecatedType, [].slice.call(arguments, 1)); + } + } + }); + return EventBus; + }(); + var EventEmitter = function() { + "use strict"; + var splitter = /\s+/, nextTick = getNextTick(); + return { + onSync: onSync, + onAsync: onAsync, + off: off, + trigger: trigger + }; + function on(method, types, cb, context) { + var type; + if (!cb) { + return this; + } + types = types.split(splitter); + cb = context ? bindContext(cb, context) : cb; + this._callbacks = this._callbacks || {}; + while (type = types.shift()) { + this._callbacks[type] = this._callbacks[type] || { + sync: [], + async: [] + }; + this._callbacks[type][method].push(cb); + } + return this; + } + function onAsync(types, cb, context) { + return on.call(this, "async", types, cb, context); + } + function onSync(types, cb, context) { + return on.call(this, "sync", types, cb, context); + } + function off(types) { + var type; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + while (type = types.shift()) { + delete this._callbacks[type]; + } + return this; + } + function trigger(types) { + var type, callbacks, args, syncFlush, asyncFlush; + if (!this._callbacks) { + return this; + } + types = types.split(splitter); + args = [].slice.call(arguments, 1); + while ((type = types.shift()) && (callbacks = this._callbacks[type])) { + syncFlush = getFlush(callbacks.sync, this, [ type ].concat(args)); + asyncFlush = getFlush(callbacks.async, this, [ type ].concat(args)); + syncFlush() && nextTick(asyncFlush); + } + return this; + } + function getFlush(callbacks, context, args) { + return flush; + function flush() { + var cancelled; + for (var i = 0, len = callbacks.length; !cancelled && i < len; i += 1) { + cancelled = callbacks[i].apply(context, args) === false; + } + return !cancelled; + } + } + function getNextTick() { + var nextTickFn; + if (window.setImmediate) { + nextTickFn = function nextTickSetImmediate(fn) { + setImmediate(function() { + fn(); + }); + }; + } else { + nextTickFn = function nextTickSetTimeout(fn) { + setTimeout(function() { + fn(); + }, 0); + }; + } + return nextTickFn; + } + function bindContext(fn, context) { + return fn.bind ? fn.bind(context) : function() { + fn.apply(context, [].slice.call(arguments, 0)); + }; + } + }(); + var highlight = function(doc) { + "use strict"; + var defaults = { + node: null, + pattern: null, + tagName: "strong", + className: null, + wordsOnly: false, + caseSensitive: false, + diacriticInsensitive: false + }; + var accented = { + A: "[AaªÀ-Åà-åĀ-ąǍǎȀ-ȃȦȧᴬᵃḀḁẚẠ-ảₐ℀℁℻⒜Ⓐⓐ㍱-㍴㎀-㎄㎈㎉㎩-㎯㏂㏊㏟㏿Aa]", + B: "[BbᴮᵇḂ-ḇℬ⒝Ⓑⓑ㍴㎅-㎇㏃㏈㏔㏝Bb]", + C: "[CcÇçĆ-čᶜ℀ℂ℃℅℆ℭⅭⅽ⒞Ⓒⓒ㍶㎈㎉㎝㎠㎤㏄-㏇Cc]", + D: "[DdĎďDŽ-džDZ-dzᴰᵈḊ-ḓⅅⅆⅮⅾ⒟Ⓓⓓ㋏㍲㍷-㍹㎗㎭-㎯㏅㏈Dd]", + E: "[EeÈ-Ëè-ëĒ-ěȄ-ȇȨȩᴱᵉḘ-ḛẸ-ẽₑ℡ℯℰⅇ⒠Ⓔⓔ㉐㋍㋎Ee]", + F: "[FfᶠḞḟ℉ℱ℻⒡Ⓕⓕ㎊-㎌㎙ff-fflFf]", + G: "[GgĜ-ģǦǧǴǵᴳᵍḠḡℊ⒢Ⓖⓖ㋌㋍㎇㎍-㎏㎓㎬㏆㏉㏒㏿Gg]", + H: "[HhĤĥȞȟʰᴴḢ-ḫẖℋ-ℎ⒣Ⓗⓗ㋌㍱㎐-㎔㏊㏋㏗Hh]", + I: "[IiÌ-Ïì-ïĨ-İIJijǏǐȈ-ȋᴵᵢḬḭỈ-ịⁱℐℑℹⅈⅠ-ⅣⅥ-ⅨⅪⅫⅰ-ⅳⅵ-ⅸⅺⅻ⒤Ⓘⓘ㍺㏌㏕fiffiIi]", + J: "[JjIJ-ĵLJ-njǰʲᴶⅉ⒥ⒿⓙⱼJj]", + K: "[KkĶķǨǩᴷᵏḰ-ḵK⒦Ⓚⓚ㎄㎅㎉㎏㎑㎘㎞㎢㎦㎪㎸㎾㏀㏆㏍-㏏Kk]", + L: "[LlĹ-ŀLJ-ljˡᴸḶḷḺ-ḽℒℓ℡Ⅼⅼ⒧Ⓛⓛ㋏㎈㎉㏐-㏓㏕㏖㏿flfflLl]", + M: "[MmᴹᵐḾ-ṃ℠™ℳⅯⅿ⒨Ⓜⓜ㍷-㍹㎃㎆㎎㎒㎖㎙-㎨㎫㎳㎷㎹㎽㎿㏁㏂㏎㏐㏔-㏖㏘㏙㏞㏟Mm]", + N: "[NnÑñŃ-ʼnNJ-njǸǹᴺṄ-ṋⁿℕ№⒩Ⓝⓝ㎁㎋㎚㎱㎵㎻㏌㏑Nn]", + O: "[OoºÒ-Öò-öŌ-őƠơǑǒǪǫȌ-ȏȮȯᴼᵒỌ-ỏₒ℅№ℴ⒪Ⓞⓞ㍵㏇㏒㏖Oo]", + P: "[PpᴾᵖṔ-ṗℙ⒫Ⓟⓟ㉐㍱㍶㎀㎊㎩-㎬㎰㎴㎺㏋㏗-㏚Pp]", + Q: "[Qqℚ⒬Ⓠⓠ㏃Qq]", + R: "[RrŔ-řȐ-ȓʳᴿᵣṘ-ṛṞṟ₨ℛ-ℝ⒭Ⓡⓡ㋍㍴㎭-㎯㏚㏛Rr]", + S: "[SsŚ-šſȘșˢṠ-ṣ₨℁℠⒮Ⓢⓢ㎧㎨㎮-㎳㏛㏜stSs]", + T: "[TtŢ-ťȚțᵀᵗṪ-ṱẗ℡™⒯Ⓣⓣ㉐㋏㎔㏏ſtstTt]", + U: "[UuÙ-Üù-üŨ-ųƯưǓǔȔ-ȗᵁᵘᵤṲ-ṷỤ-ủ℆⒰Ⓤⓤ㍳㍺Uu]", + V: "[VvᵛᵥṼ-ṿⅣ-Ⅷⅳ-ⅷ⒱Ⓥⓥⱽ㋎㍵㎴-㎹㏜㏞Vv]", + W: "[WwŴŵʷᵂẀ-ẉẘ⒲Ⓦⓦ㎺-㎿㏝Ww]", + X: "[XxˣẊ-ẍₓ℻Ⅸ-Ⅻⅸ-ⅻ⒳Ⓧⓧ㏓Xx]", + Y: "[YyÝýÿŶ-ŸȲȳʸẎẏẙỲ-ỹ⒴Ⓨⓨ㏉Yy]", + Z: "[ZzŹ-žDZ-dzᶻẐ-ẕℤℨ⒵Ⓩⓩ㎐-㎔Zz]" + }; + return function hightlight(o) { + var regex; + o = _.mixin({}, defaults, o); + if (!o.node || !o.pattern) { + return; + } + o.pattern = _.isArray(o.pattern) ? o.pattern : [ o.pattern ]; + regex = getRegex(o.pattern, o.caseSensitive, o.wordsOnly, o.diacriticInsensitive); + traverse(o.node, hightlightTextNode); + function hightlightTextNode(textNode) { + var match, patternNode, wrapperNode; + if (match = regex.exec(textNode.data)) { + wrapperNode = doc.createElement(o.tagName); + o.className && (wrapperNode.className = o.className); + patternNode = textNode.splitText(match.index); + patternNode.splitText(match[0].length); + wrapperNode.appendChild(patternNode.cloneNode(true)); + textNode.parentNode.replaceChild(wrapperNode, patternNode); + } + return !!match; + } + function traverse(el, hightlightTextNode) { + var childNode, TEXT_NODE_TYPE = 3; + for (var i = 0; i < el.childNodes.length; i++) { + childNode = el.childNodes[i]; + if (childNode.nodeType === TEXT_NODE_TYPE) { + i += hightlightTextNode(childNode) ? 1 : 0; + } else { + traverse(childNode, hightlightTextNode); + } + } + } + }; + function accent_replacer(chr) { + return accented[chr.toUpperCase()] || chr; + } + function getRegex(patterns, caseSensitive, wordsOnly, diacriticInsensitive) { + var escapedPatterns = [], regexStr; + for (var i = 0, len = patterns.length; i < len; i++) { + var escapedWord = _.escapeRegExChars(patterns[i]); + if (diacriticInsensitive) { + escapedWord = escapedWord.replace(/\S/g, accent_replacer); + } + escapedPatterns.push(escapedWord); + } + regexStr = wordsOnly ? "\\b(" + escapedPatterns.join("|") + ")\\b" : "(" + escapedPatterns.join("|") + ")"; + return caseSensitive ? new RegExp(regexStr) : new RegExp(regexStr, "i"); + } + }(window.document); + var Input = function() { + "use strict"; + var specialKeyCodeMap; + specialKeyCodeMap = { + 9: "tab", + 27: "esc", + 37: "left", + 39: "right", + 13: "enter", + 38: "up", + 40: "down" + }; + function Input(o, www) { + var id; + o = o || {}; + if (!o.input) { + $.error("input is missing"); + } + www.mixin(this); + this.$hint = $(o.hint); + this.$input = $(o.input); + this.$menu = $(o.menu); + id = this.$input.attr("id") || _.guid(); + this.$menu.attr("id", id + "_listbox"); + this.$hint.attr({ + "aria-hidden": true + }); + this.$input.attr({ + "aria-owns": id + "_listbox", + role: "combobox", + "aria-autocomplete": "list", + "aria-expanded": false + }); + this.query = this.$input.val(); + this.queryWhenFocused = this.hasFocus() ? this.query : null; + this.$overflowHelper = buildOverflowHelper(this.$input); + this._checkLanguageDirection(); + if (this.$hint.length === 0) { + this.setHint = this.getHint = this.clearHint = this.clearHintIfInvalid = _.noop; + } + this.onSync("cursorchange", this._updateDescendent); + } + Input.normalizeQuery = function(str) { + return _.toStr(str).replace(/^\s*/g, "").replace(/\s{2,}/g, " "); + }; + _.mixin(Input.prototype, EventEmitter, { + _onBlur: function onBlur() { + this.resetInputValue(); + this.trigger("blurred"); + }, + _onFocus: function onFocus() { + this.queryWhenFocused = this.query; + this.trigger("focused"); + }, + _onKeydown: function onKeydown($e) { + var keyName = specialKeyCodeMap[$e.which || $e.keyCode]; + this._managePreventDefault(keyName, $e); + if (keyName && this._shouldTrigger(keyName, $e)) { + this.trigger(keyName + "Keyed", $e); + } + }, + _onInput: function onInput() { + this._setQuery(this.getInputValue()); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + _managePreventDefault: function managePreventDefault(keyName, $e) { + var preventDefault; + switch (keyName) { + case "up": + case "down": + preventDefault = !withModifier($e); + break; + + default: + preventDefault = false; + } + preventDefault && $e.preventDefault(); + }, + _shouldTrigger: function shouldTrigger(keyName, $e) { + var trigger; + switch (keyName) { + case "tab": + trigger = !withModifier($e); + break; + + default: + trigger = true; + } + return trigger; + }, + _checkLanguageDirection: function checkLanguageDirection() { + var dir = (this.$input.css("direction") || "ltr").toLowerCase(); + if (this.dir !== dir) { + this.dir = dir; + this.$hint.attr("dir", dir); + this.trigger("langDirChanged", dir); + } + }, + _setQuery: function setQuery(val, silent) { + var areEquivalent, hasDifferentWhitespace; + areEquivalent = areQueriesEquivalent(val, this.query); + hasDifferentWhitespace = areEquivalent ? this.query.length !== val.length : false; + this.query = val; + if (!silent && !areEquivalent) { + this.trigger("queryChanged", this.query); + } else if (!silent && hasDifferentWhitespace) { + this.trigger("whitespaceChanged", this.query); + } + }, + _updateDescendent: function updateDescendent(event, id) { + this.$input.attr("aria-activedescendant", id); + }, + bind: function() { + var that = this, onBlur, onFocus, onKeydown, onInput; + onBlur = _.bind(this._onBlur, this); + onFocus = _.bind(this._onFocus, this); + onKeydown = _.bind(this._onKeydown, this); + onInput = _.bind(this._onInput, this); + this.$input.on("blur.tt", onBlur).on("focus.tt", onFocus).on("keydown.tt", onKeydown); + if (!_.isMsie() || _.isMsie() > 9) { + this.$input.on("input.tt", onInput); + } else { + this.$input.on("keydown.tt keypress.tt cut.tt paste.tt", function($e) { + if (specialKeyCodeMap[$e.which || $e.keyCode]) { + return; + } + _.defer(_.bind(that._onInput, that, $e)); + }); + } + return this; + }, + focus: function focus() { + this.$input.focus(); + }, + blur: function blur() { + this.$input.blur(); + }, + getLangDir: function getLangDir() { + return this.dir; + }, + getQuery: function getQuery() { + return this.query || ""; + }, + setQuery: function setQuery(val, silent) { + this.setInputValue(val); + this._setQuery(val, silent); + }, + hasQueryChangedSinceLastFocus: function hasQueryChangedSinceLastFocus() { + return this.query !== this.queryWhenFocused; + }, + getInputValue: function getInputValue() { + return this.$input.val(); + }, + setInputValue: function setInputValue(value) { + this.$input.val(value); + this.clearHintIfInvalid(); + this._checkLanguageDirection(); + }, + resetInputValue: function resetInputValue() { + this.setInputValue(this.query); + }, + getHint: function getHint() { + return this.$hint.val(); + }, + setHint: function setHint(value) { + this.$hint.val(value); + }, + clearHint: function clearHint() { + this.setHint(""); + }, + clearHintIfInvalid: function clearHintIfInvalid() { + var val, hint, valIsPrefixOfHint, isValid; + val = this.getInputValue(); + hint = this.getHint(); + valIsPrefixOfHint = val !== hint && hint.indexOf(val) === 0; + isValid = val !== "" && valIsPrefixOfHint && !this.hasOverflow(); + !isValid && this.clearHint(); + }, + hasFocus: function hasFocus() { + return this.$input.is(":focus"); + }, + hasOverflow: function hasOverflow() { + var constraint = this.$input.width() - 2; + this.$overflowHelper.text(this.getInputValue()); + return this.$overflowHelper.width() >= constraint; + }, + isCursorAtEnd: function() { + var valueLength, selectionStart, range; + valueLength = this.$input.val().length; + selectionStart = this.$input[0].selectionStart; + if (_.isNumber(selectionStart)) { + return selectionStart === valueLength; + } else if (document.selection) { + range = document.selection.createRange(); + range.moveStart("character", -valueLength); + return valueLength === range.text.length; + } + return true; + }, + destroy: function destroy() { + this.$hint.off(".tt"); + this.$input.off(".tt"); + this.$overflowHelper.remove(); + this.$hint = this.$input = this.$overflowHelper = $("
"); + }, + setAriaExpanded: function setAriaExpanded(value) { + this.$input.attr("aria-expanded", value); + } + }); + return Input; + function buildOverflowHelper($input) { + return $('').css({ + position: "absolute", + visibility: "hidden", + whiteSpace: "pre", + fontFamily: $input.css("font-family"), + fontSize: $input.css("font-size"), + fontStyle: $input.css("font-style"), + fontVariant: $input.css("font-variant"), + fontWeight: $input.css("font-weight"), + wordSpacing: $input.css("word-spacing"), + letterSpacing: $input.css("letter-spacing"), + textIndent: $input.css("text-indent"), + textRendering: $input.css("text-rendering"), + textTransform: $input.css("text-transform") + }).insertAfter($input); + } + function areQueriesEquivalent(a, b) { + return Input.normalizeQuery(a) === Input.normalizeQuery(b); + } + function withModifier($e) { + return $e.altKey || $e.ctrlKey || $e.metaKey || $e.shiftKey; + } + }(); + var Dataset = function() { + "use strict"; + var keys, nameGenerator; + keys = { + dataset: "tt-selectable-dataset", + val: "tt-selectable-display", + obj: "tt-selectable-object" + }; + nameGenerator = _.getIdGenerator(); + function Dataset(o, www) { + o = o || {}; + o.templates = o.templates || {}; + o.templates.notFound = o.templates.notFound || o.templates.empty; + if (!o.source) { + $.error("missing source"); + } + if (!o.node) { + $.error("missing node"); + } + if (o.name && !isValidName(o.name)) { + $.error("invalid dataset name: " + o.name); + } + www.mixin(this); + this.highlight = !!o.highlight; + this.name = _.toStr(o.name || nameGenerator()); + this.limit = o.limit || 5; + this.displayFn = getDisplayFn(o.display || o.displayKey); + this.templates = getTemplates(o.templates, this.displayFn); + this.source = o.source.__ttAdapter ? o.source.__ttAdapter() : o.source; + this.async = _.isUndefined(o.async) ? this.source.length > 2 : !!o.async; + this._resetLastSuggestion(); + this.$el = $(o.node).attr("role", "presentation").addClass(this.classes.dataset).addClass(this.classes.dataset + "-" + this.name); + } + Dataset.extractData = function extractData(el) { + var $el = $(el); + if ($el.data(keys.obj)) { + return { + dataset: $el.data(keys.dataset) || "", + val: $el.data(keys.val) || "", + obj: $el.data(keys.obj) || null + }; + } + return null; + }; + _.mixin(Dataset.prototype, EventEmitter, { + _overwrite: function overwrite(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (this.async && this.templates.pending) { + this._renderPending(query); + } else if (!this.async && this.templates.notFound) { + this._renderNotFound(query); + } else { + this._empty(); + } + this.trigger("rendered", suggestions, false, this.name); + }, + _append: function append(query, suggestions) { + suggestions = suggestions || []; + if (suggestions.length && this.$lastSuggestion.length) { + this._appendSuggestions(query, suggestions); + } else if (suggestions.length) { + this._renderSuggestions(query, suggestions); + } else if (!this.$lastSuggestion.length && this.templates.notFound) { + this._renderNotFound(query); + } + this.trigger("rendered", suggestions, true, this.name); + }, + _renderSuggestions: function renderSuggestions(query, suggestions) { + var $fragment; + $fragment = this._getSuggestionsFragment(query, suggestions); + this.$lastSuggestion = $fragment.children().last(); + this.$el.html($fragment).prepend(this._getHeader(query, suggestions)).append(this._getFooter(query, suggestions)); + }, + _appendSuggestions: function appendSuggestions(query, suggestions) { + var $fragment, $lastSuggestion; + $fragment = this._getSuggestionsFragment(query, suggestions); + $lastSuggestion = $fragment.children().last(); + this.$lastSuggestion.after($fragment); + this.$lastSuggestion = $lastSuggestion; + }, + _renderPending: function renderPending(query) { + var template = this.templates.pending; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _renderNotFound: function renderNotFound(query) { + var template = this.templates.notFound; + this._resetLastSuggestion(); + template && this.$el.html(template({ + query: query, + dataset: this.name + })); + }, + _empty: function empty() { + this.$el.empty(); + this._resetLastSuggestion(); + }, + _getSuggestionsFragment: function getSuggestionsFragment(query, suggestions) { + var that = this, fragment; + fragment = document.createDocumentFragment(); + _.each(suggestions, function getSuggestionNode(suggestion) { + var $el, context; + context = that._injectQuery(query, suggestion); + $el = $(that.templates.suggestion(context)).data(keys.dataset, that.name).data(keys.obj, suggestion).data(keys.val, that.displayFn(suggestion)).addClass(that.classes.suggestion + " " + that.classes.selectable); + fragment.appendChild($el[0]); + }); + this.highlight && highlight({ + className: this.classes.highlight, + node: fragment, + pattern: query + }); + return $(fragment); + }, + _getFooter: function getFooter(query, suggestions) { + return this.templates.footer ? this.templates.footer({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _getHeader: function getHeader(query, suggestions) { + return this.templates.header ? this.templates.header({ + query: query, + suggestions: suggestions, + dataset: this.name + }) : null; + }, + _resetLastSuggestion: function resetLastSuggestion() { + this.$lastSuggestion = $(); + }, + _injectQuery: function injectQuery(query, obj) { + return _.isObject(obj) ? _.mixin({ + _query: query + }, obj) : obj; + }, + update: function update(query) { + var that = this, canceled = false, syncCalled = false, rendered = 0; + this.cancel(); + this.cancel = function cancel() { + canceled = true; + that.cancel = $.noop; + that.async && that.trigger("asyncCanceled", query, that.name); + }; + this.source(query, sync, async); + !syncCalled && sync([]); + function sync(suggestions) { + if (syncCalled) { + return; + } + syncCalled = true; + suggestions = (suggestions || []).slice(0, that.limit); + rendered = suggestions.length; + that._overwrite(query, suggestions); + if (rendered < that.limit && that.async) { + that.trigger("asyncRequested", query, that.name); + } + } + function async(suggestions) { + suggestions = suggestions || []; + if (!canceled && rendered < that.limit) { + that.cancel = $.noop; + var idx = Math.abs(rendered - that.limit); + rendered += idx; + that._append(query, suggestions.slice(0, idx)); + that.async && that.trigger("asyncReceived", query, that.name); + } + } + }, + cancel: $.noop, + clear: function clear() { + this._empty(); + this.cancel(); + this.trigger("cleared"); + }, + isEmpty: function isEmpty() { + return this.$el.is(":empty"); + }, + destroy: function destroy() { + this.$el = $("
"); + } + }); + return Dataset; + function getDisplayFn(display) { + display = display || _.stringify; + return _.isFunction(display) ? display : displayFn; + function displayFn(obj) { + return obj[display]; + } + } + function getTemplates(templates, displayFn) { + return { + notFound: templates.notFound && _.templatify(templates.notFound), + pending: templates.pending && _.templatify(templates.pending), + header: templates.header && _.templatify(templates.header), + footer: templates.footer && _.templatify(templates.footer), + suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate + }; + function userSuggestionTemplate(context) { + var template = templates.suggestion; + return $(template(context)).attr("id", _.guid()); + } + function suggestionTemplate(context) { + return $('
').attr("id", _.guid()).text(displayFn(context)); + } + } + function isValidName(str) { + return /^[_a-zA-Z0-9-]+$/.test(str); + } + }(); + var Menu = function() { + "use strict"; + function Menu(o, www) { + var that = this; + o = o || {}; + if (!o.node) { + $.error("node is required"); + } + www.mixin(this); + this.$node = $(o.node); + this.query = null; + this.datasets = _.map(o.datasets, initializeDataset); + function initializeDataset(oDataset) { + var node = that.$node.find(oDataset.node).first(); + oDataset.node = node.length ? node : $("
").appendTo(that.$node); + return new Dataset(oDataset, www); + } + } + _.mixin(Menu.prototype, EventEmitter, { + _onSelectableClick: function onSelectableClick($e) { + this.trigger("selectableClicked", $($e.currentTarget)); + }, + _onRendered: function onRendered(type, dataset, suggestions, async) { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetRendered", dataset, suggestions, async); + }, + _onCleared: function onCleared() { + this.$node.toggleClass(this.classes.empty, this._allDatasetsEmpty()); + this.trigger("datasetCleared"); + }, + _propagate: function propagate() { + this.trigger.apply(this, arguments); + }, + _allDatasetsEmpty: function allDatasetsEmpty() { + return _.every(this.datasets, _.bind(function isDatasetEmpty(dataset) { + var isEmpty = dataset.isEmpty(); + this.$node.attr("aria-expanded", !isEmpty); + return isEmpty; + }, this)); + }, + _getSelectables: function getSelectables() { + return this.$node.find(this.selectors.selectable); + }, + _removeCursor: function _removeCursor() { + var $selectable = this.getActiveSelectable(); + $selectable && $selectable.removeClass(this.classes.cursor); + }, + _ensureVisible: function ensureVisible($el) { + var elTop, elBottom, nodeScrollTop, nodeHeight; + elTop = $el.position().top; + elBottom = elTop + $el.outerHeight(true); + nodeScrollTop = this.$node.scrollTop(); + nodeHeight = this.$node.height() + parseInt(this.$node.css("paddingTop"), 10) + parseInt(this.$node.css("paddingBottom"), 10); + if (elTop < 0) { + this.$node.scrollTop(nodeScrollTop + elTop); + } else if (nodeHeight < elBottom) { + this.$node.scrollTop(nodeScrollTop + (elBottom - nodeHeight)); + } + }, + bind: function() { + var that = this, onSelectableClick; + onSelectableClick = _.bind(this._onSelectableClick, this); + this.$node.on("click.tt", this.selectors.selectable, onSelectableClick); + this.$node.on("mouseover", this.selectors.selectable, function() { + that.setCursor($(this)); + }); + this.$node.on("mouseleave", function() { + that._removeCursor(); + }); + _.each(this.datasets, function(dataset) { + dataset.onSync("asyncRequested", that._propagate, that).onSync("asyncCanceled", that._propagate, that).onSync("asyncReceived", that._propagate, that).onSync("rendered", that._onRendered, that).onSync("cleared", that._onCleared, that); + }); + return this; + }, + isOpen: function isOpen() { + return this.$node.hasClass(this.classes.open); + }, + open: function open() { + this.$node.scrollTop(0); + this.$node.addClass(this.classes.open); + }, + close: function close() { + this.$node.attr("aria-expanded", false); + this.$node.removeClass(this.classes.open); + this._removeCursor(); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.attr("dir", dir); + }, + selectableRelativeToCursor: function selectableRelativeToCursor(delta) { + var $selectables, $oldCursor, oldIndex, newIndex; + $oldCursor = this.getActiveSelectable(); + $selectables = this._getSelectables(); + oldIndex = $oldCursor ? $selectables.index($oldCursor) : -1; + newIndex = oldIndex + delta; + newIndex = (newIndex + 1) % ($selectables.length + 1) - 1; + newIndex = newIndex < -1 ? $selectables.length - 1 : newIndex; + return newIndex === -1 ? null : $selectables.eq(newIndex); + }, + setCursor: function setCursor($selectable) { + this._removeCursor(); + if ($selectable = $selectable && $selectable.first()) { + $selectable.addClass(this.classes.cursor); + this._ensureVisible($selectable); + } + }, + getSelectableData: function getSelectableData($el) { + return $el && $el.length ? Dataset.extractData($el) : null; + }, + getActiveSelectable: function getActiveSelectable() { + var $selectable = this._getSelectables().filter(this.selectors.cursor).first(); + return $selectable.length ? $selectable : null; + }, + getTopSelectable: function getTopSelectable() { + var $selectable = this._getSelectables().first(); + return $selectable.length ? $selectable : null; + }, + update: function update(query) { + var isValidUpdate = query !== this.query; + if (isValidUpdate) { + this.query = query; + _.each(this.datasets, updateDataset); + } + return isValidUpdate; + function updateDataset(dataset) { + dataset.update(query); + } + }, + empty: function empty() { + _.each(this.datasets, clearDataset); + this.query = null; + this.$node.addClass(this.classes.empty); + function clearDataset(dataset) { + dataset.clear(); + } + }, + destroy: function destroy() { + this.$node.off(".tt"); + this.$node = $("
"); + _.each(this.datasets, destroyDataset); + function destroyDataset(dataset) { + dataset.destroy(); + } + } + }); + return Menu; + }(); + var Status = function() { + "use strict"; + function Status(options) { + this.$el = $("", { + role: "status", + "aria-live": "polite" + }).css({ + position: "absolute", + padding: "0", + border: "0", + height: "1px", + width: "1px", + "margin-bottom": "-1px", + "margin-right": "-1px", + overflow: "hidden", + clip: "rect(0 0 0 0)", + "white-space": "nowrap" + }); + options.$input.after(this.$el); + _.each(options.menu.datasets, _.bind(function(dataset) { + if (dataset.onSync) { + dataset.onSync("rendered", _.bind(this.update, this)); + dataset.onSync("cleared", _.bind(this.cleared, this)); + } + }, this)); + } + _.mixin(Status.prototype, { + update: function update(event, suggestions) { + var length = suggestions.length; + var words; + if (length === 1) { + words = { + result: "result", + is: "is" + }; + } else { + words = { + result: "results", + is: "are" + }; + } + this.$el.text(length + " " + words.result + " " + words.is + " available, use up and down arrow keys to navigate."); + }, + cleared: function() { + this.$el.text(""); + } + }); + return Status; + }(); + var DefaultMenu = function() { + "use strict"; + var s = Menu.prototype; + function DefaultMenu() { + Menu.apply(this, [].slice.call(arguments, 0)); + } + _.mixin(DefaultMenu.prototype, Menu.prototype, { + open: function open() { + !this._allDatasetsEmpty() && this._show(); + return s.open.apply(this, [].slice.call(arguments, 0)); + }, + close: function close() { + this._hide(); + return s.close.apply(this, [].slice.call(arguments, 0)); + }, + _onRendered: function onRendered() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onRendered.apply(this, [].slice.call(arguments, 0)); + }, + _onCleared: function onCleared() { + if (this._allDatasetsEmpty()) { + this._hide(); + } else { + this.isOpen() && this._show(); + } + return s._onCleared.apply(this, [].slice.call(arguments, 0)); + }, + setLanguageDirection: function setLanguageDirection(dir) { + this.$node.css(dir === "ltr" ? this.css.ltr : this.css.rtl); + return s.setLanguageDirection.apply(this, [].slice.call(arguments, 0)); + }, + _hide: function hide() { + this.$node.hide(); + }, + _show: function show() { + this.$node.css("display", "block"); + } + }); + return DefaultMenu; + }(); + var Typeahead = function() { + "use strict"; + function Typeahead(o, www) { + var onFocused, onBlurred, onEnterKeyed, onTabKeyed, onEscKeyed, onUpKeyed, onDownKeyed, onLeftKeyed, onRightKeyed, onQueryChanged, onWhitespaceChanged; + o = o || {}; + if (!o.input) { + $.error("missing input"); + } + if (!o.menu) { + $.error("missing menu"); + } + if (!o.eventBus) { + $.error("missing event bus"); + } + www.mixin(this); + this.eventBus = o.eventBus; + this.minLength = _.isNumber(o.minLength) ? o.minLength : 1; + this.input = o.input; + this.menu = o.menu; + this.enabled = true; + this.autoselect = !!o.autoselect; + this.active = false; + this.input.hasFocus() && this.activate(); + this.dir = this.input.getLangDir(); + this._hacks(); + this.menu.bind().onSync("selectableClicked", this._onSelectableClicked, this).onSync("asyncRequested", this._onAsyncRequested, this).onSync("asyncCanceled", this._onAsyncCanceled, this).onSync("asyncReceived", this._onAsyncReceived, this).onSync("datasetRendered", this._onDatasetRendered, this).onSync("datasetCleared", this._onDatasetCleared, this); + onFocused = c(this, "activate", "open", "_onFocused"); + onBlurred = c(this, "deactivate", "_onBlurred"); + onEnterKeyed = c(this, "isActive", "isOpen", "_onEnterKeyed"); + onTabKeyed = c(this, "isActive", "isOpen", "_onTabKeyed"); + onEscKeyed = c(this, "isActive", "_onEscKeyed"); + onUpKeyed = c(this, "isActive", "open", "_onUpKeyed"); + onDownKeyed = c(this, "isActive", "open", "_onDownKeyed"); + onLeftKeyed = c(this, "isActive", "isOpen", "_onLeftKeyed"); + onRightKeyed = c(this, "isActive", "isOpen", "_onRightKeyed"); + onQueryChanged = c(this, "_openIfActive", "_onQueryChanged"); + onWhitespaceChanged = c(this, "_openIfActive", "_onWhitespaceChanged"); + this.input.bind().onSync("focused", onFocused, this).onSync("blurred", onBlurred, this).onSync("enterKeyed", onEnterKeyed, this).onSync("tabKeyed", onTabKeyed, this).onSync("escKeyed", onEscKeyed, this).onSync("upKeyed", onUpKeyed, this).onSync("downKeyed", onDownKeyed, this).onSync("leftKeyed", onLeftKeyed, this).onSync("rightKeyed", onRightKeyed, this).onSync("queryChanged", onQueryChanged, this).onSync("whitespaceChanged", onWhitespaceChanged, this).onSync("langDirChanged", this._onLangDirChanged, this); + } + _.mixin(Typeahead.prototype, { + _hacks: function hacks() { + var $input, $menu; + $input = this.input.$input || $("
"); + $menu = this.menu.$node || $("
"); + $input.on("blur.tt", function($e) { + var active, isActive, hasActive; + active = document.activeElement; + isActive = $menu.is(active); + hasActive = $menu.has(active).length > 0; + if (_.isMsie() && (isActive || hasActive)) { + $e.preventDefault(); + $e.stopImmediatePropagation(); + _.defer(function() { + $input.focus(); + }); + } + }); + $menu.on("mousedown.tt", function($e) { + $e.preventDefault(); + }); + }, + _onSelectableClicked: function onSelectableClicked(type, $el) { + this.select($el); + }, + _onDatasetCleared: function onDatasetCleared() { + this._updateHint(); + }, + _onDatasetRendered: function onDatasetRendered(type, suggestions, async, dataset) { + this._updateHint(); + if (this.autoselect) { + var cursorClass = this.selectors.cursor.substr(1); + this.menu.$node.find(this.selectors.suggestion).first().addClass(cursorClass); + } + this.eventBus.trigger("render", suggestions, async, dataset); + }, + _onAsyncRequested: function onAsyncRequested(type, dataset, query) { + this.eventBus.trigger("asyncrequest", query, dataset); + }, + _onAsyncCanceled: function onAsyncCanceled(type, dataset, query) { + this.eventBus.trigger("asynccancel", query, dataset); + }, + _onAsyncReceived: function onAsyncReceived(type, dataset, query) { + this.eventBus.trigger("asyncreceive", query, dataset); + }, + _onFocused: function onFocused() { + this._minLengthMet() && this.menu.update(this.input.getQuery()); + }, + _onBlurred: function onBlurred() { + if (this.input.hasQueryChangedSinceLastFocus()) { + this.eventBus.trigger("change", this.input.getQuery()); + } + }, + _onEnterKeyed: function onEnterKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + if (this.select($selectable)) { + $e.preventDefault(); + $e.stopPropagation(); + } + } else if (this.autoselect) { + if (this.select(this.menu.getTopSelectable())) { + $e.preventDefault(); + $e.stopPropagation(); + } + } + }, + _onTabKeyed: function onTabKeyed(type, $e) { + var $selectable; + if ($selectable = this.menu.getActiveSelectable()) { + this.select($selectable) && $e.preventDefault(); + } else if (this.autoselect) { + if ($selectable = this.menu.getTopSelectable()) { + this.autocomplete($selectable) && $e.preventDefault(); + } + } + }, + _onEscKeyed: function onEscKeyed() { + this.close(); + }, + _onUpKeyed: function onUpKeyed() { + this.moveCursor(-1); + }, + _onDownKeyed: function onDownKeyed() { + this.moveCursor(+1); + }, + _onLeftKeyed: function onLeftKeyed() { + if (this.dir === "rtl" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onRightKeyed: function onRightKeyed() { + if (this.dir === "ltr" && this.input.isCursorAtEnd()) { + this.autocomplete(this.menu.getActiveSelectable() || this.menu.getTopSelectable()); + } + }, + _onQueryChanged: function onQueryChanged(e, query) { + this._minLengthMet(query) ? this.menu.update(query) : this.menu.empty(); + }, + _onWhitespaceChanged: function onWhitespaceChanged() { + this._updateHint(); + }, + _onLangDirChanged: function onLangDirChanged(e, dir) { + if (this.dir !== dir) { + this.dir = dir; + this.menu.setLanguageDirection(dir); + } + }, + _openIfActive: function openIfActive() { + this.isActive() && this.open(); + }, + _minLengthMet: function minLengthMet(query) { + query = _.isString(query) ? query : this.input.getQuery() || ""; + return query.length >= this.minLength; + }, + _updateHint: function updateHint() { + var $selectable, data, val, query, escapedQuery, frontMatchRegEx, match; + $selectable = this.menu.getTopSelectable(); + data = this.menu.getSelectableData($selectable); + val = this.input.getInputValue(); + if (data && !_.isBlankString(val) && !this.input.hasOverflow()) { + query = Input.normalizeQuery(val); + escapedQuery = _.escapeRegExChars(query); + frontMatchRegEx = new RegExp("^(?:" + escapedQuery + ")(.+$)", "i"); + match = frontMatchRegEx.exec(data.val); + match && this.input.setHint(val + match[1]); + } else { + this.input.clearHint(); + } + }, + isEnabled: function isEnabled() { + return this.enabled; + }, + enable: function enable() { + this.enabled = true; + }, + disable: function disable() { + this.enabled = false; + }, + isActive: function isActive() { + return this.active; + }, + activate: function activate() { + if (this.isActive()) { + return true; + } else if (!this.isEnabled() || this.eventBus.before("active")) { + return false; + } else { + this.active = true; + this.eventBus.trigger("active"); + return true; + } + }, + deactivate: function deactivate() { + if (!this.isActive()) { + return true; + } else if (this.eventBus.before("idle")) { + return false; + } else { + this.active = false; + this.close(); + this.eventBus.trigger("idle"); + return true; + } + }, + isOpen: function isOpen() { + return this.menu.isOpen(); + }, + open: function open() { + if (!this.isOpen() && !this.eventBus.before("open")) { + this.input.setAriaExpanded(true); + this.menu.open(); + this._updateHint(); + this.eventBus.trigger("open"); + } + return this.isOpen(); + }, + close: function close() { + if (this.isOpen() && !this.eventBus.before("close")) { + this.input.setAriaExpanded(false); + this.menu.close(); + this.input.clearHint(); + this.input.resetInputValue(); + this.eventBus.trigger("close"); + } + return !this.isOpen(); + }, + setVal: function setVal(val) { + this.input.setQuery(_.toStr(val)); + }, + getVal: function getVal() { + return this.input.getQuery(); + }, + select: function select($selectable) { + var data = this.menu.getSelectableData($selectable); + if (data && !this.eventBus.before("select", data.obj, data.dataset)) { + this.input.setQuery(data.val, true); + this.eventBus.trigger("select", data.obj, data.dataset); + this.close(); + return true; + } + return false; + }, + autocomplete: function autocomplete($selectable) { + var query, data, isValid; + query = this.input.getQuery(); + data = this.menu.getSelectableData($selectable); + isValid = data && query !== data.val; + if (isValid && !this.eventBus.before("autocomplete", data.obj, data.dataset)) { + this.input.setQuery(data.val); + this.eventBus.trigger("autocomplete", data.obj, data.dataset); + return true; + } + return false; + }, + moveCursor: function moveCursor(delta) { + var query, $candidate, data, suggestion, datasetName, cancelMove, id; + query = this.input.getQuery(); + $candidate = this.menu.selectableRelativeToCursor(delta); + data = this.menu.getSelectableData($candidate); + suggestion = data ? data.obj : null; + datasetName = data ? data.dataset : null; + id = $candidate ? $candidate.attr("id") : null; + this.input.trigger("cursorchange", id); + cancelMove = this._minLengthMet() && this.menu.update(query); + if (!cancelMove && !this.eventBus.before("cursorchange", suggestion, datasetName)) { + this.menu.setCursor($candidate); + if (data) { + if (typeof data.val === "string") { + this.input.setInputValue(data.val); + } + } else { + this.input.resetInputValue(); + this._updateHint(); + } + this.eventBus.trigger("cursorchange", suggestion, datasetName); + return true; + } + return false; + }, + destroy: function destroy() { + this.input.destroy(); + this.menu.destroy(); + } + }); + return Typeahead; + function c(ctx) { + var methods = [].slice.call(arguments, 1); + return function() { + var args = [].slice.call(arguments); + _.each(methods, function(method) { + return ctx[method].apply(ctx, args); + }); + }; + } + }(); + (function() { + "use strict"; + var old, keys, methods; + old = $.fn.typeahead; + keys = { + www: "tt-www", + attrs: "tt-attrs", + typeahead: "tt-typeahead" + }; + methods = { + initialize: function initialize(o, datasets) { + var www; + datasets = _.isArray(datasets) ? datasets : [].slice.call(arguments, 1); + o = o || {}; + www = WWW(o.classNames); + return this.each(attach); + function attach() { + var $input, $wrapper, $hint, $menu, defaultHint, defaultMenu, eventBus, input, menu, status, typeahead, MenuConstructor; + _.each(datasets, function(d) { + d.highlight = !!o.highlight; + }); + $input = $(this); + $wrapper = $(www.html.wrapper); + $hint = $elOrNull(o.hint); + $menu = $elOrNull(o.menu); + defaultHint = o.hint !== false && !$hint; + defaultMenu = o.menu !== false && !$menu; + defaultHint && ($hint = buildHintFromInput($input, www)); + defaultMenu && ($menu = $(www.html.menu).css(www.css.menu)); + $hint && $hint.val(""); + $input = prepInput($input, www); + if (defaultHint || defaultMenu) { + $wrapper.css(www.css.wrapper); + $input.css(defaultHint ? www.css.input : www.css.inputWithNoHint); + $input.wrap($wrapper).parent().prepend(defaultHint ? $hint : null).append(defaultMenu ? $menu : null); + } + MenuConstructor = defaultMenu ? DefaultMenu : Menu; + eventBus = new EventBus({ + el: $input + }); + input = new Input({ + hint: $hint, + input: $input, + menu: $menu + }, www); + menu = new MenuConstructor({ + node: $menu, + datasets: datasets + }, www); + status = new Status({ + $input: $input, + menu: menu + }); + typeahead = new Typeahead({ + input: input, + menu: menu, + eventBus: eventBus, + minLength: o.minLength, + autoselect: o.autoselect + }, www); + $input.data(keys.www, www); + $input.data(keys.typeahead, typeahead); + } + }, + isEnabled: function isEnabled() { + var enabled; + ttEach(this.first(), function(t) { + enabled = t.isEnabled(); + }); + return enabled; + }, + enable: function enable() { + ttEach(this, function(t) { + t.enable(); + }); + return this; + }, + disable: function disable() { + ttEach(this, function(t) { + t.disable(); + }); + return this; + }, + isActive: function isActive() { + var active; + ttEach(this.first(), function(t) { + active = t.isActive(); + }); + return active; + }, + activate: function activate() { + ttEach(this, function(t) { + t.activate(); + }); + return this; + }, + deactivate: function deactivate() { + ttEach(this, function(t) { + t.deactivate(); + }); + return this; + }, + isOpen: function isOpen() { + var open; + ttEach(this.first(), function(t) { + open = t.isOpen(); + }); + return open; + }, + open: function open() { + ttEach(this, function(t) { + t.open(); + }); + return this; + }, + close: function close() { + ttEach(this, function(t) { + t.close(); + }); + return this; + }, + select: function select(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.select($el); + }); + return success; + }, + autocomplete: function autocomplete(el) { + var success = false, $el = $(el); + ttEach(this.first(), function(t) { + success = t.autocomplete($el); + }); + return success; + }, + moveCursor: function moveCursoe(delta) { + var success = false; + ttEach(this.first(), function(t) { + success = t.moveCursor(delta); + }); + return success; + }, + val: function val(newVal) { + var query; + if (!arguments.length) { + ttEach(this.first(), function(t) { + query = t.getVal(); + }); + return query; + } else { + ttEach(this, function(t) { + t.setVal(_.toStr(newVal)); + }); + return this; + } + }, + destroy: function destroy() { + ttEach(this, function(typeahead, $input) { + revert($input); + typeahead.destroy(); + }); + return this; + } + }; + $.fn.typeahead = function(method) { + if (methods[method]) { + return methods[method].apply(this, [].slice.call(arguments, 1)); + } else { + return methods.initialize.apply(this, arguments); + } + }; + $.fn.typeahead.noConflict = function noConflict() { + $.fn.typeahead = old; + return this; + }; + function ttEach($els, fn) { + $els.each(function() { + var $input = $(this), typeahead; + (typeahead = $input.data(keys.typeahead)) && fn(typeahead, $input); + }); + } + function buildHintFromInput($input, www) { + return $input.clone().addClass(www.classes.hint).removeData().css(www.css.hint).css(getBackgroundStyles($input)).prop({ + readonly: true, + required: false + }).removeAttr("id name placeholder").removeClass("required").attr({ + spellcheck: "false", + tabindex: -1 + }); + } + function prepInput($input, www) { + $input.data(keys.attrs, { + dir: $input.attr("dir"), + autocomplete: $input.attr("autocomplete"), + spellcheck: $input.attr("spellcheck"), + style: $input.attr("style") + }); + $input.addClass(www.classes.input).attr({ + spellcheck: false + }); + try { + !$input.attr("dir") && $input.attr("dir", "auto"); + } catch (e) {} + return $input; + } + function getBackgroundStyles($el) { + return { + backgroundAttachment: $el.css("background-attachment"), + backgroundClip: $el.css("background-clip"), + backgroundColor: $el.css("background-color"), + backgroundImage: $el.css("background-image"), + backgroundOrigin: $el.css("background-origin"), + backgroundPosition: $el.css("background-position"), + backgroundRepeat: $el.css("background-repeat"), + backgroundSize: $el.css("background-size") + }; + } + function revert($input) { + var www, $wrapper; + www = $input.data(keys.www); + $wrapper = $input.parent().filter(www.selectors.wrapper); + _.each($input.data(keys.attrs), function(val, key) { + _.isUndefined(val) ? $input.removeAttr(key) : $input.attr(key, val); + }); + $input.removeData(keys.typeahead).removeData(keys.www).removeData(keys.attr).removeClass(www.classes.input); + if ($wrapper.length) { + $input.detach().insertAfter($wrapper); + $wrapper.remove(); + } + } + function $elOrNull(obj) { + var isValid, $el; + isValid = _.isJQuery(obj) || _.isElement(obj); + $el = isValid ? $(obj).first() : []; + return $el.length ? $el : null; + } + })(); +}); \ No newline at end of file diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/large_tuple.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/large_tuple.html new file mode 100644 index 000000000..ae2cce249 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/large_tuple.html @@ -0,0 +1,491 @@ + + + + large_tuple Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Large Tuple

+ +

Tuples shouldn’t have too many members. Create a custom type instead.

+ +
    +
  • Identifier: large_tuple
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 2, error: 3
  • +
+

Non Triggering Examples

+
let foo: (Int, Int)
+
+
+
let foo: (start: Int, end: Int)
+
+
+
let foo: (Int, (Int, String))
+
+
+
func foo() -> (Int, Int)
+
+
+
func foo() -> (Int, Int) {}
+
+
+
func foo(bar: String) -> (Int, Int)
+
+
+
func foo(bar: String) -> (Int, Int) {}
+
+
+
func foo() throws -> (Int, Int)
+
+
+
func foo() throws -> (Int, Int) {}
+
+
+
let foo: (Int, Int, Int) -> Void
+
+
+
let foo: (Int, Int, Int) throws -> Void
+
+
+
func foo(bar: (Int, String, Float) -> Void)
+
+
+
func foo(bar: (Int, String, Float) throws -> Void)
+
+
+
var completionHandler: ((_ data: Data?, _ resp: URLResponse?, _ e: NSError?) -> Void)!
+
+
+
func getDictionaryAndInt() -> (Dictionary<Int, String>, Int)?
+
+
+
func getGenericTypeAndInt() -> (Type<Int, String, Float>, Int)?
+
+
+
func foo() async -> (Int, Int)
+
+
+
func foo() async -> (Int, Int) {}
+
+
+
func foo(bar: String) async -> (Int, Int)
+
+
+
func foo(bar: String) async -> (Int, Int) {}
+
+
+
func foo() async throws -> (Int, Int)
+
+
+
func foo() async throws -> (Int, Int) {}
+
+
+
let foo: (Int, Int, Int) async -> Void
+
+
+
let foo: (Int, Int, Int) async throws -> Void
+
+
+
func foo(bar: (Int, String, Float) async -> Void)
+
+
+
func foo(bar: (Int, String, Float) async throws -> Void)
+
+
+
func getDictionaryAndInt() async -> (Dictionary<Int, String>, Int)?
+
+
+
func getGenericTypeAndInt() async -> (Type<Int, String, Float>, Int)?
+
+
+

Triggering Examples

+
let foo: ↓(Int, Int, Int)
+
+
+
let foo: ↓(start: Int, end: Int, value: String)
+
+
+
let foo: (Int, ↓(Int, Int, Int))
+
+
+
func foo(bar: ↓(Int, Int, Int))
+
+
+
func foo() -> ↓(Int, Int, Int)
+
+
+
func foo() -> ↓(Int, Int, Int) {}
+
+
+
func foo(bar: String) -> ↓(Int, Int, Int)
+
+
+
func foo(bar: String) -> ↓(Int, Int, Int) {}
+
+
+
func foo() throws -> ↓(Int, Int, Int)
+
+
+
func foo() throws -> ↓(Int, Int, Int) {}
+
+
+
func foo() throws -> ↓(Int, ↓(String, String, String), Int) {}
+
+
+
func getDictionaryAndInt() -> (Dictionary<Int, ↓(String, String, String)>, Int)?
+
+
+
func foo(bar: ↓(Int, Int, Int)) async
+
+
+
func foo() async -> ↓(Int, Int, Int)
+
+
+
func foo() async -> ↓(Int, Int, Int) {}
+
+
+
func foo(bar: String) async -> ↓(Int, Int, Int)
+
+
+
func foo(bar: String) async -> ↓(Int, Int, Int) {}
+
+
+
func foo() async throws -> ↓(Int, Int, Int)
+
+
+
func foo() async throws -> ↓(Int, Int, Int) {}
+
+
+
func foo() async throws -> ↓(Int, ↓(String, String, String), Int) {}
+
+
+
func getDictionaryAndInt() async -> (Dictionary<Int, ↓(String, String, String)>, Int)?
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/last_where.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/last_where.html new file mode 100644 index 000000000..fe553ec7c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/last_where.html @@ -0,0 +1,380 @@ + + + + last_where Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Last Where

+ +

Prefer using .last(where:) over .filter { }.last in collections.

+ +
    +
  • Identifier: last_where
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
kinds.filter(excludingKinds.contains).isEmpty && kinds.last == .identifier
+
+
+
myList.last(where: { $0 % 2 == 0 })
+
+
+
match(pattern: pattern).filter { $0.last == .identifier }
+
+
+
(myList.filter { $0 == 1 }.suffix(2)).last
+
+
+
collection.filter("stringCol = '3'").last
+
+

Triggering Examples

+
↓myList.filter { $0 % 2 == 0 }.last
+
+
+
↓myList.filter({ $0 % 2 == 0 }).last
+
+
+
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last
+
+
+
↓myList.map { $0 + 1 }.filter({ $0 % 2 == 0 }).last?.something()
+
+
+
↓myList.filter(someFunction).last
+
+
+
↓myList.filter({ $0 % 2 == 0 })
+.last
+
+
+
(↓myList.filter { $0 == 1 }).last
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/leading_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/leading_whitespace.html new file mode 100644 index 000000000..37605fb3f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/leading_whitespace.html @@ -0,0 +1,354 @@ + + + + leading_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Leading Whitespace

+ +

Files should not contain leading whitespace.

+ +
    +
  • Identifier: leading_whitespace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
//
+
+
+

Triggering Examples

+

+//
+
+
+
 //
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html new file mode 100644 index 000000000..ba5058b7a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_cggeometry_functions.html @@ -0,0 +1,424 @@ + + + + legacy_cggeometry_functions Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy CGGeometry Functions

+ +

Struct extension properties and methods are preferred over legacy functions

+ +
    +
  • Identifier: legacy_cggeometry_functions
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
rect.width
+
+
rect.height
+
+
rect.minX
+
+
rect.midX
+
+
rect.maxX
+
+
rect.minY
+
+
rect.midY
+
+
rect.maxY
+
+
rect.isNull
+
+
rect.isEmpty
+
+
rect.isInfinite
+
+
rect.standardized
+
+
rect.integral
+
+
rect.insetBy(dx: 5.0, dy: -7.0)
+
+
rect.offsetBy(dx: 5.0, dy: -7.0)
+
+
rect1.union(rect2)
+
+
rect1.intersect(rect2)
+
+
rect1.contains(rect2)
+
+
rect.contains(point)
+
+
rect1.intersects(rect2)
+
+

Triggering Examples

+
↓CGRectGetWidth(rect)
+
+
↓CGRectGetHeight(rect)
+
+
↓CGRectGetMinX(rect)
+
+
↓CGRectGetMidX(rect)
+
+
↓CGRectGetMaxX(rect)
+
+
↓CGRectGetMinY(rect)
+
+
↓CGRectGetMidY(rect)
+
+
↓CGRectGetMaxY(rect)
+
+
↓CGRectIsNull(rect)
+
+
↓CGRectIsEmpty(rect)
+
+
↓CGRectIsInfinite(rect)
+
+
↓CGRectStandardize(rect)
+
+
↓CGRectIntegral(rect)
+
+
↓CGRectInset(rect, 10, 5)
+
+
↓CGRectOffset(rect, -2, 8.3)
+
+
↓CGRectUnion(rect1, rect2)
+
+
↓CGRectIntersection(rect1, rect2)
+
+
↓CGRectContainsRect(rect1, rect2)
+
+
↓CGRectContainsPoint(rect, point)
+
+
↓CGRectIntersectsRect(rect1, rect2)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constant.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constant.html new file mode 100644 index 000000000..2c26f355b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constant.html @@ -0,0 +1,384 @@ + + + + legacy_constant Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Constant

+ +

Struct-scoped constants are preferred over legacy global constants.

+ +
    +
  • Identifier: legacy_constant
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
CGRect.infinite
+
+
CGPoint.zero
+
+
CGRect.zero
+
+
CGSize.zero
+
+
NSPoint.zero
+
+
NSRect.zero
+
+
NSSize.zero
+
+
CGRect.null
+
+
CGFloat.pi
+
+
Float.pi
+
+

Triggering Examples

+
↓CGRectInfinite
+
+
↓CGPointZero
+
+
↓CGRectZero
+
+
↓CGSizeZero
+
+
↓NSZeroPoint
+
+
↓NSZeroRect
+
+
↓NSZeroSize
+
+
↓CGRectNull
+
+
↓CGFloat(M_PI)
+
+
↓Float(M_PI)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constructor.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constructor.html new file mode 100644 index 000000000..97323339b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_constructor.html @@ -0,0 +1,438 @@ + + + + legacy_constructor Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Constructor

+ +

Swift constructors are preferred over legacy convenience functions.

+ +
    +
  • Identifier: legacy_constructor
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
CGPoint(x: 10, y: 10)
+
+
CGPoint(x: xValue, y: yValue)
+
+
CGSize(width: 10, height: 10)
+
+
CGSize(width: aWidth, height: aHeight)
+
+
CGRect(x: 0, y: 0, width: 10, height: 10)
+
+
CGRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
+
+
CGVector(dx: 10, dy: 10)
+
+
CGVector(dx: deltaX, dy: deltaY)
+
+
NSPoint(x: 10, y: 10)
+
+
NSPoint(x: xValue, y: yValue)
+
+
NSSize(width: 10, height: 10)
+
+
NSSize(width: aWidth, height: aHeight)
+
+
NSRect(x: 0, y: 0, width: 10, height: 10)
+
+
NSRect(x: xVal, y: yVal, width: aWidth, height: aHeight)
+
+
NSRange(location: 10, length: 1)
+
+
NSRange(location: loc, length: len)
+
+
UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
+
+
UIEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
+
+
NSEdgeInsets(top: 0, left: 0, bottom: 10, right: 10)
+
+
NSEdgeInsets(top: aTop, left: aLeft, bottom: aBottom, right: aRight)
+
+
UIOffset(horizontal: 0, vertical: 10)
+
+
UIOffset(horizontal: horizontal, vertical: vertical)
+
+

Triggering Examples

+
↓CGPointMake(10, 10)
+
+
↓CGPointMake(xVal, yVal)
+
+
↓CGPointMake(calculateX(), 10)
+
+
+
↓CGSizeMake(10, 10)
+
+
↓CGSizeMake(aWidth, aHeight)
+
+
↓CGRectMake(0, 0, 10, 10)
+
+
↓CGRectMake(xVal, yVal, width, height)
+
+
↓CGVectorMake(10, 10)
+
+
↓CGVectorMake(deltaX, deltaY)
+
+
↓NSMakePoint(10, 10)
+
+
↓NSMakePoint(xVal, yVal)
+
+
↓NSMakeSize(10, 10)
+
+
↓NSMakeSize(aWidth, aHeight)
+
+
↓NSMakeRect(0, 0, 10, 10)
+
+
↓NSMakeRect(xVal, yVal, width, height)
+
+
↓NSMakeRange(10, 1)
+
+
↓NSMakeRange(loc, len)
+
+
↓UIEdgeInsetsMake(0, 0, 10, 10)
+
+
↓UIEdgeInsetsMake(top, left, bottom, right)
+
+
↓NSEdgeInsetsMake(0, 0, 10, 10)
+
+
↓NSEdgeInsetsMake(top, left, bottom, right)
+
+
↓CGVectorMake(10, 10)
+↓NSMakeRange(10, 1)
+
+
↓UIOffsetMake(0, 10)
+
+
↓UIOffsetMake(horizontal, vertical)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_hashing.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_hashing.html new file mode 100644 index 000000000..8b56b11e5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_hashing.html @@ -0,0 +1,397 @@ + + + + legacy_hashing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Hashing

+ +

Prefer using the hash(into:) function instead of overriding hashValue

+ +
    +
  • Identifier: legacy_hashing
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
struct Foo: Hashable {
+  let bar: Int = 10
+
+  func hash(into hasher: inout Hasher) {
+    hasher.combine(bar)
+  }
+}
+
+
class Foo: Hashable {
+  let bar: Int = 10
+
+  func hash(into hasher: inout Hasher) {
+    hasher.combine(bar)
+  }
+}
+
+
var hashValue: Int { return 1 }
+class Foo: Hashable { 
+ }
+
+
class Foo: Hashable {
+  let bar: String = "Foo"
+
+  public var hashValue: String {
+    return bar
+  }
+}
+
+
class Foo: Hashable {
+  let bar: String = "Foo"
+
+  public var hashValue: String {
+    get { return bar }
+    set { bar = newValue }
+  }
+}
+
+

Triggering Examples

+
struct Foo: Hashable {
+    let bar: Int = 10
+
+    public ↓var hashValue: Int {
+        return bar
+    }
+}
+
+
class Foo: Hashable {
+    let bar: Int = 10
+
+    public ↓var hashValue: Int {
+        return bar
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_multiple.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_multiple.html new file mode 100644 index 000000000..5f5d7a029 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_multiple.html @@ -0,0 +1,375 @@ + + + + legacy_multiple Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Multiple

+ +

Prefer using the isMultiple(of:) function instead of using the remainder operator (%).

+ +
    +
  • Identifier: legacy_multiple
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
cell.contentView.backgroundColor = indexPath.row.isMultiple(of: 2) ? .gray : .white
+
+
guard count.isMultiple(of: 2) else { throw DecodingError.dataCorrupted(...) }
+
+
sanityCheck(bytes > 0 && bytes.isMultiple(of: 4), "capacity must be multiple of 4 bytes")
+
+
guard let i = reversedNumbers.firstIndex(where: { $0.isMultiple(of: 2) }) else { return }
+
+
let constant = 56
+let isMultiple = value.isMultiple(of: constant)
+
+
let constant = 56
+let secret = value % constant == 5
+
+
let secretValue = (value % 3) + 2
+
+

Triggering Examples

+
cell.contentView.backgroundColor = indexPath.row ↓% 2 == 0 ? .gray : .white
+
+
cell.contentView.backgroundColor = 0 == indexPath.row ↓% 2 ? .gray : .white
+
+
cell.contentView.backgroundColor = indexPath.row ↓% 2 != 0 ? .gray : .white
+
+
guard count ↓% 2 == 0 else { throw DecodingError.dataCorrupted(...) }
+
+
sanityCheck(bytes > 0 && bytes ↓% 4 == 0, "capacity must be multiple of 4 bytes")
+
+
guard let i = reversedNumbers.firstIndex(where: { $0 ↓% 2 == 0 }) else { return }
+
+
let constant = 56
+let isMultiple = value ↓% constant == 0
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html new file mode 100644 index 000000000..d9533356e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_nsgeometry_functions.html @@ -0,0 +1,420 @@ + + + + legacy_nsgeometry_functions Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy NSGeometry Functions

+ +

Struct extension properties and methods are preferred over legacy functions

+ +
    +
  • Identifier: legacy_nsgeometry_functions
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
rect.width
+
+
rect.height
+
+
rect.minX
+
+
rect.midX
+
+
rect.maxX
+
+
rect.minY
+
+
rect.midY
+
+
rect.maxY
+
+
rect.isEmpty
+
+
rect.integral
+
+
rect.insetBy(dx: 5.0, dy: -7.0)
+
+
rect.offsetBy(dx: 5.0, dy: -7.0)
+
+
rect1.union(rect2)
+
+
rect1.intersection(rect2)
+
+
rect1.contains(rect2)
+
+
rect.contains(point)
+
+
rect1.intersects(rect2)
+
+

Triggering Examples

+
↓NSWidth(rect)
+
+
↓NSHeight(rect)
+
+
↓NSMinX(rect)
+
+
↓NSMidX(rect)
+
+
↓NSMaxX(rect)
+
+
↓NSMinY(rect)
+
+
↓NSMidY(rect)
+
+
↓NSMaxY(rect)
+
+
↓NSEqualRects(rect1, rect2)
+
+
↓NSEqualSizes(size1, size2)
+
+
↓NSEqualPoints(point1, point2)
+
+
↓NSEdgeInsetsEqual(insets2, insets2)
+
+
↓NSIsEmptyRect(rect)
+
+
↓NSIntegralRect(rect)
+
+
↓NSInsetRect(rect, 10, 5)
+
+
↓NSOffsetRect(rect, -2, 8.3)
+
+
↓NSUnionRect(rect1, rect2)
+
+
↓NSIntersectionRect(rect1, rect2)
+
+
↓NSContainsRect(rect1, rect2)
+
+
↓NSPointInRect(rect, point)
+
+
↓NSIntersectsRect(rect1, rect2)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_objc_type.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_objc_type.html new file mode 100644 index 000000000..434968d14 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_objc_type.html @@ -0,0 +1,377 @@ + + + + legacy_objc_type Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Objective-C Reference Type

+ +

Prefer Swift value types to bridged Objective-C reference types

+ +
    +
  • Identifier: legacy_objc_type
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var array = Array<Int>()
+
+
+
var calendar: Calendar? = nil
+
+
var formatter: NSDataDetector
+
+
var className: String = NSStringFromClass(MyClass.self)
+
+
_ = URLRequest.CachePolicy.reloadIgnoringLocalCacheData
+
+
_ = Notification.Name("com.apple.Music.playerInfo")
+
+

Triggering Examples

+
var array = ↓NSArray()
+
+
var calendar: ↓NSCalendar? = nil
+
+
_ = ↓NSURLRequest.CachePolicy.reloadIgnoringLocalCacheData
+
+
_ = ↓NSNotification.Name("com.apple.Music.playerInfo")
+
+
let keyValuePair: (Int) -> (↓NSString, ↓NSString) = {
+  let n = "\($0)" as ↓NSString; return (n, n)
+}
+dictionary = [↓NSString: ↓NSString](uniqueKeysWithValues:
+  (1...10_000).lazy.map(keyValuePair))
+
+
extension Foundation.Notification.Name {
+    static var reachabilityChanged: Foundation.↓NSNotification.Name {
+        return Foundation.Notification.Name("org.wordpress.reachability.changed")
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_random.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_random.html new file mode 100644 index 000000000..98a8e92e3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/legacy_random.html @@ -0,0 +1,362 @@ + + + + legacy_random Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Legacy Random

+ +

Prefer using type.random(in:) over legacy functions.

+ +
    +
  • Identifier: legacy_random
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
Int.random(in: 0..<10)
+
+
+
Double.random(in: 8.6...111.34)
+
+
+
Float.random(in: 0 ..< 1)
+
+
+

Triggering Examples

+
↓arc4random(10)
+
+
+
↓arc4random_uniform(83)
+
+
+
↓drand48(52)
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/let_var_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/let_var_whitespace.html new file mode 100644 index 000000000..ae1e8cab7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/let_var_whitespace.html @@ -0,0 +1,472 @@ + + + + let_var_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Variable Declaration Whitespace

+ +

Let and var should be separated from other statements by a blank line.

+ +
    +
  • Identifier: let_var_whitespace
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let a = 0
+var x = 1
+
+x = 2
+
+
+
a = 5
+
+var x = 1
+
+
+
struct X {
+    var a = 0
+}
+
+
+
let a = 1 +
+    2
+let b = 5
+
+
+
var x: Int {
+    return 0
+}
+
+
+
var x: Int {
+    let a = 0
+
+    return a
+}
+
+
+
#if os(macOS)
+let a = 0
+#endif
+
+
+
#warning("TODO: remove it")
+let a = 0
+
+
+
#error("TODO: remove it")
+let a = 0
+
+
+
@available(swift 4)
+let a = 0
+
+
+
class C {
+    @objc
+    var s: String = ""
+}
+
+
class C {
+    @objc
+    func a() {}
+}
+
+
class C {
+    var x = 0
+    lazy
+    var y = 0
+}
+
+
+
@available(OSX, introduced: 10.6)
+@available(*, deprecated)
+var x = 0
+
+
+
// swiftlint:disable superfluous_disable_command
+// swiftlint:disable force_cast
+
+let x = bar as! Bar
+
+
    @available(swift 4)
+    @UserDefault("param", defaultValue: true)
+    var isEnabled = true
+
+    @Attribute
+    func f() {}
+
+
var x: Int {
+    let a = 0
+    return a
+}
+
+
+

Triggering Examples

+
var x = 1
+↓x = 2
+
+
+

+a = 5
+↓var x = 1
+
+
+
struct X {
+    let a
+    ↓func x() {}
+}
+
+
+
var x = 0
+↓@objc func f() {}
+
+
+
var x = 0
+↓@objc
+    func f() {}
+
+
+
@objc func f() {
+}
+↓var x = 0
+
+
+
    struct S {
+        func f() {}
+        ↓@Wapper
+        let isNumber = false
+        @Wapper
+        var isEnabled = true
+        ↓func g() {}
+    }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/line_length.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/line_length.html new file mode 100644 index 000000000..b359bf394 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/line_length.html @@ -0,0 +1,362 @@ + + + + line_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Line Length

+ +

Lines should not span too many characters.

+ +
    +
  • Identifier: line_length
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 120, error: 200, ignores urls: false, ignores function declarations: false, ignores comments: false, ignores interpolated strings: false
  • +
+

Non Triggering Examples

+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
+
+
+
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
+
+
+

Triggering Examples

+
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)#colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
+
+
+
#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")#imageLiteral(resourceName: "image.jpg")
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/literal_expression_end_indentation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/literal_expression_end_indentation.html new file mode 100644 index 000000000..730272b2f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/literal_expression_end_indentation.html @@ -0,0 +1,389 @@ + + + + literal_expression_end_indentation Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Literal Expression End Indentation

+ +

Array and dictionary literal end should have the same indentation as the line that started it.

+ +
    +
  • Identifier: literal_expression_end_indentation
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2, 3]
+
+
[1,
+ 2
+]
+
+
[
+   1,
+   2
+]
+
+
[
+   1,
+   2]
+
+
   let x = [
+       1,
+       2
+   ]
+
+
[key: 2, key2: 3]
+
+
[key: 1,
+ key2: 2
+]
+
+
[
+   key: 0,
+   key2: 20
+]
+
+

Triggering Examples

+
let x = [
+   1,
+   2
+   ↓]
+
+
   let x = [
+       1,
+       2
+↓]
+
+
let x = [
+   key: value
+   ↓]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/local_doc_comment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/local_doc_comment.html new file mode 100644 index 000000000..2edde5755 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/local_doc_comment.html @@ -0,0 +1,364 @@ + + + + local_doc_comment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Local Doc Comment

+ +

Doc comments shouldn’t be used in local scopes. Use regular comments.

+ +
    +
  • Identifier: local_doc_comment
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo() {
+  // Local scope documentation should use normal comments.
+  print("foo")
+}
+
+
/// My great property
+var myGreatProperty: String!
+
+
/// Look here for more info: https://github.com.
+var myGreatProperty: String!
+
+
/// Look here for more info:
+/// https://github.com.
+var myGreatProperty: String!
+
+

Triggering Examples

+
func foo() {
+  ↓/// Docstring inside a function declaration
+  print("foo")
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/lower_acl_than_parent.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/lower_acl_than_parent.html new file mode 100644 index 000000000..c1a6e0a60 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/lower_acl_than_parent.html @@ -0,0 +1,416 @@ + + + + lower_acl_than_parent Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Lower ACL than parent

+ +

Ensure declarations have a lower access control level than their enclosing parent

+ +
    +
  • Identifier: lower_acl_than_parent
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
public struct Foo { public func bar() {} }
+
+
internal struct Foo { func bar() {} }
+
+
struct Foo { func bar() {} }
+
+
struct Foo { internal func bar() {} }
+
+
open class Foo { public func bar() {} }
+
+
open class Foo { open func bar() {} }
+
+
fileprivate struct Foo { private func bar() {} }
+
+
private struct Foo { private func bar(id: String) }
+
+
extension Foo { public func bar() {} }
+
+
private struct Foo { fileprivate func bar() {} }
+
+
private func foo(id: String) {}
+
+
private class Foo { func bar() {} }
+
+
public extension Foo { struct Bar { public func baz() {} }}
+
+
public extension Foo { struct Bar { internal func baz() {} }}
+
+
internal extension Foo { struct Bar { internal func baz() {} }}
+
+
extension Foo { struct Bar { internal func baz() {} }}
+
+

Triggering Examples

+
struct Foo { ↓public func bar() {} }
+
+
enum Foo { ↓public func bar() {} }
+
+
public class Foo { ↓open func bar() }
+
+
class Foo { ↓public private(set) var bar: String? }
+
+
private struct Foo { ↓public func bar() {} }
+
+
private class Foo { ↓public func bar() {} }
+
+
private actor Foo { ↓public func bar() {} }
+
+
fileprivate struct Foo { ↓public func bar() {} }
+
+
class Foo { ↓public func bar() {} }
+
+
actor Foo { ↓public func bar() {} }
+
+
private struct Foo { ↓internal func bar() {} }
+
+
fileprivate struct Foo { ↓internal func bar() {} }
+
+
extension Foo { struct Bar { ↓public func baz() {} }}
+
+
internal extension Foo { struct Bar { ↓public func baz() {} }}
+
+
private extension Foo { struct Bar { ↓public func baz() {} }}
+
+
fileprivate extension Foo { struct Bar { ↓public func baz() {} }}
+
+
private extension Foo { struct Bar { ↓internal func baz() {} }}
+
+
fileprivate extension Foo { struct Bar { ↓internal func baz() {} }}
+
+
public extension Foo { struct Bar { struct Baz { ↓public func qux() {} }}}
+
+
final class Foo { ↓public func bar() {} }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/mark.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/mark.html new file mode 100644 index 000000000..ef972bf8c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/mark.html @@ -0,0 +1,419 @@ + + + + mark Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Mark

+ +

MARK comment should be in valid format. e.g. ‘// MARK: …’ or ‘// MARK: - …’

+ +
    +
  • Identifier: mark
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
// MARK: good
+
+
+
// MARK: - good
+
+
+
// MARK: -
+
+
+
// BOOKMARK
+
+
//BOOKMARK
+
+
// BOOKMARKS
+
+
/*
+func test1() {
+}
+//MARK: mark
+func test2() {
+}
+*/
+
+

Triggering Examples

+
↓//MARK: bad
+
+
↓// MARK:bad
+
+
↓//MARK:bad
+
+
↓//  MARK: bad
+
+
↓// MARK:  bad
+
+
↓// MARK: -bad
+
+
↓// MARK:- bad
+
+
↓// MARK:-bad
+
+
↓//MARK: - bad
+
+
↓//MARK:- bad
+
+
↓//MARK: -bad
+
+
↓//MARK:-bad
+
+
↓//Mark: bad
+
+
↓// Mark: bad
+
+
↓// MARK bad
+
+
↓//MARK bad
+
+
↓// MARK - bad
+
+
↓//MARK : bad
+
+
↓// MARKL:
+
+
↓// MARKR 
+
+
↓// MARKK -
+
+
↓/// MARK:
+
+
↓/// MARK bad
+
+
↓//MARK:- Top-Level bad mark
+↓//MARK:- Another bad mark
+struct MarkTest {}
+↓// MARK:- Bad mark
+extension MarkTest {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/missing_docs.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/missing_docs.html new file mode 100644 index 000000000..dc393a872 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/missing_docs.html @@ -0,0 +1,396 @@ + + + + missing_docs Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Missing Docs

+ +

Declarations should be documented.

+ +
    +
  • Identifier: missing_docs
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: open, public, excludes_extensions: true, excludes_inherited_types: true, excludes_trivial_init: false
  • +
+

Non Triggering Examples

+
/// docs
+public class A {
+/// docs
+public func b() {}
+}
+// no docs
+public class B: A { override public func b() {} }
+
+
import Foundation
+// no docs
+public class B: NSObject {
+// no docs
+override public var description: String { fatalError() } }
+
+
/// docs
+public class A {
+    deinit {}
+}
+
+
public extension A {}
+
+
/// docs
+public class A {
+    public init() {}
+}
+
+

Triggering Examples

+
public func a() {}
+
+
+
// regular comment
+public func a() {}
+
+
+
/* regular comment */
+public func a() {}
+
+
+
/// docs
+public protocol A {
+// no docs
+var b: Int { get } }
+/// docs
+public struct C: A {
+
+public let b: Int
+}
+
+
/// docs
+public class A {
+    public init(argument: String) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/modifier_order.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/modifier_order.html new file mode 100644 index 000000000..6bb2d5d57 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/modifier_order.html @@ -0,0 +1,531 @@ + + + + modifier_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Modifier Order

+ +

Modifier order should be consistent.

+ +
    +
  • Identifier: modifier_order
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, preferred_modifier_order: [override, acl, setterACL, dynamic, mutators, lazy, final, required, convenience, typeMethods, owned]
  • +
+

Non Triggering Examples

+
public class Foo {
+   public required convenience init() {}
+}
+
+
public class Foo {
+   public static let bar = 42
+}
+
+
public class Foo {
+   public static var bar: Int {
+       return
+   }
+}
+
+
public class Foo {
+   public class var bar: Int {
+       return 42
+   }
+}
+
+
public class Bar {
+   public class var foo: String {
+       return "foo"
+   }
+}
+public class Foo: Bar {
+   override public final class var foo: String {
+       return "bar"
+   }
+}
+
+
open class Bar {
+   public var foo: Int? {
+       return 42
+   }
+}
+open class Foo: Bar {
+   override public var foo: Int? {
+       return 43
+   }
+}
+
+
open class Bar {
+   open class func foo() -> Int {
+       return 42
+   }
+}
+class Foo: Bar {
+   override open class func foo() -> Int {
+       return 43
+   }
+}
+
+
protocol Foo: class {}
+class Bar {
+    public private(set) weak var foo: Foo?
+}
+
+
@objc
+public final class Foo: NSObject {}
+
+
@objcMembers
+public final class Foo: NSObject {}
+
+
@objc
+override public private(set) weak var foo: Bar?
+
+
@objc
+public final class Foo: NSObject {}
+
+
@objc
+open final class Foo: NSObject {
+   open weak var weakBar: NSString? = nil
+}
+
+
public final class Foo {}
+
+
class Bar {
+   func bar() {}
+}
+
+
internal class Foo: Bar {
+   override internal func bar() {}
+}
+
+
public struct Foo {
+   internal weak var weakBar: NSObject? = nil
+}
+
+
class Foo {
+   internal lazy var bar: String = "foo"
+}
+
+

Triggering Examples

+
class Foo {
+   convenience required public init() {}
+}
+
+
public class Foo {
+   static public let bar = 42
+}
+
+
public class Foo {
+   static public var bar: Int {
+       return 42
+   }
+}
+
+
public class Foo {
+   class public var bar: Int {
+       return 42
+   }
+}
+
+
public class RootFoo {
+   class public var foo: String {
+       return "foo"
+   }
+}
+public class Foo: RootFoo {
+   override final class public var foo: String
+       return "bar"
+   }
+}
+
+
open class Bar {
+   public var foo: Int? {
+       return 42
+   }
+}
+open class Foo: Bar {
+    public override var foo: Int? {
+       return 43
+   }
+}
+
+
protocol Foo: class {}
+    class Bar {
+        private(set) public weak var foo: Foo?
+}
+
+
open class Bar {
+   open class func foo() -> Int {
+       return 42
+   }
+}
+class Foo: Bar {
+   class open override func foo() -> Int {
+       return 43
+   }
+}
+
+
open class Bar {
+   open class func foo() -> Int {
+       return 42
+   }
+}
+class Foo: Bar {
+   open override class func foo() -> Int {
+       return 43
+   }
+}
+
+
@objc
+final public class Foo: NSObject {}
+
+
@objcMembers
+final public class Foo: NSObject {}
+
+
@objc
+final open class Foo: NSObject {
+   weak open var weakBar: NSString? = nil
+}
+
+
final public class Foo {}
+
+
internal class Foo: Bar {
+   internal override func bar() {}
+}
+
+
public struct Foo {
+   weak internal var weakBar: NSObjetc? = nil
+}
+
+
class Foo {
+   lazy internal var bar: String = "foo"
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments.html new file mode 100644 index 000000000..bcd5571de --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments.html @@ -0,0 +1,405 @@ + + + + multiline_arguments Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Arguments

+ +

Arguments should be either on the same line, or one per line.

+ +
    +
  • Identifier: multiline_arguments
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, first_argument_location: any_line, only_enforce_after_first_closure_on_first_line: false
  • +
+

Non Triggering Examples

+
foo()
+
+
foo(
+)
+
+
foo { }
+
+
foo {
+
+}
+
+
foo(0)
+
+
foo(0, 1)
+
+
foo(0, 1) { }
+
+
foo(0, param1: 1)
+
+
foo(0, param1: 1) { }
+
+
foo(param1: 1)
+
+
foo(param1: 1) { }
+
+
foo(param1: 1, param2: true) { }
+
+
foo(param1: 1, param2: true, param3: [3]) { }
+
+
foo(param1: 1, param2: true, param3: [3]) {
+    bar()
+}
+
+
foo(param1: 1,
+    param2: true,
+    param3: [3])
+
+
foo(
+    param1: 1, param2: true, param3: [3]
+)
+
+
foo(
+    param1: 1,
+    param2: true,
+    param3: [3]
+)
+
+

Triggering Examples

+
foo(0,
+    param1: 1, ↓param2: true, ↓param3: [3])
+
+
foo(0, ↓param1: 1,
+    param2: true, ↓param3: [3])
+
+
foo(0, ↓param1: 1, ↓param2: true,
+    param3: [3])
+
+
foo(
+    0, ↓param1: 1,
+    param2: true, ↓param3: [3]
+)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments_brackets.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments_brackets.html new file mode 100644 index 000000000..e526f1369 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_arguments_brackets.html @@ -0,0 +1,452 @@ + + + + multiline_arguments_brackets Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Arguments Brackets

+ +

Multiline arguments should have their surrounding brackets in a new line.

+ +
    +
  • Identifier: multiline_arguments_brackets
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
foo(param1: "Param1", param2: "Param2", param3: "Param3")
+
+
foo(
+    param1: "Param1", param2: "Param2", param3: "Param3"
+)
+
+
func foo(
+    param1: "Param1",
+    param2: "Param2",
+    param3: "Param3"
+)
+
+
foo { param1, param2 in
+    print("hello world")
+}
+
+
foo(
+    bar(
+        x: 5,
+        y: 7
+    )
+)
+
+
AlertViewModel.AlertAction(title: "some title", style: .default) {
+    AlertManager.shared.presentNextDebugAlert()
+}
+
+
public final class Logger {
+    public static let shared = Logger(outputs: [
+        OSLoggerOutput(),
+        ErrorLoggerOutput()
+    ])
+}
+
+
let errors = try self.download([
+    (description: description, priority: priority),
+])
+
+
return SignalProducer({ observer, _ in
+    observer.sendCompleted()
+}).onMainQueue()
+
+
SomeType(a: [
+    1, 2, 3
+], b: [1, 2])
+
+
SomeType(
+  a: 1
+) { print("completion") }
+
+
SomeType(
+  a: 1
+) {
+  print("completion")
+}
+
+
SomeType(
+  a: .init() { print("completion") }
+)
+
+
SomeType(
+  a: .init() {
+    print("completion")
+  }
+)
+
+
SomeType(
+  a: 1
+) {} onError: {}
+
+

Triggering Examples

+
foo(↓param1: "Param1", param2: "Param2",
+         param3: "Param3"
+)
+
+
foo(
+    param1: "Param1",
+    param2: "Param2",
+    param3: "Param3"↓)
+
+
foo(↓param1: "Param1",
+    param2: "Param2",
+    param3: "Param3"↓)
+
+
foo(↓bar(
+    x: 5,
+    y: 7
+)
+)
+
+
foo(
+    bar(
+        x: 5,
+        y: 7
+)↓)
+
+
SomeOtherType(↓a: [
+        1, 2, 3
+    ],
+    b: "two"↓)
+
+
SomeOtherType(
+  a: 1↓) {}
+
+
SomeOtherType(
+  a: 1↓) {
+  print("completion")
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_function_chains.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_function_chains.html new file mode 100644 index 000000000..0dec68d4b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_function_chains.html @@ -0,0 +1,411 @@ + + + + multiline_function_chains Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Function Chains

+ +

Chained function calls should be either on the same line, or one per line.

+ +
    +
  • Identifier: multiline_function_chains
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let evenSquaresSum = [20, 17, 35, 4].filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)
+
+
let evenSquaresSum = [20, 17, 35, 4]
+    .filter { $0 % 2 == 0 }.map { $0 * $0 }.reduce(0, +)",
+
+
let chain = a
+    .b(1, 2, 3)
+    .c { blah in
+        print(blah)
+    }
+    .d()
+
+
let chain = a.b(1, 2, 3)
+    .c { blah in
+        print(blah)
+    }
+    .d()
+
+
let chain = a.b(1, 2, 3)
+    .c { blah in print(blah) }
+    .d()
+
+
let chain = a.b(1, 2, 3)
+    .c(.init(
+        a: 1,
+        b, 2,
+        c, 3))
+    .d()
+
+
self.viewModel.outputs.postContextualNotification
+  .observeForUI()
+  .observeValues {
+    NotificationCenter.default.post(
+      Notification(
+        name: .ksr_showNotificationsDialog,
+        userInfo: [UserInfoKeys.context: PushNotificationDialog.Context.pledge,
+                   UserInfoKeys.viewController: self]
+     )
+    )
+  }
+
+
let remainingIDs = Array(Set(self.currentIDs).subtracting(Set(response.ids)))
+
+
self.happeningNewsletterOn = self.updateCurrentUser
+    .map { $0.newsletters.happening }.skipNil().skipRepeats()
+
+

Triggering Examples

+
let evenSquaresSum = [20, 17, 35, 4]
+    .filter { $0 % 2 == 0 }↓.map { $0 * $0 }
+    .reduce(0, +)
+
+
let evenSquaresSum = a.b(1, 2, 3)
+    .c { blah in
+        print(blah)
+    }↓.d()
+
+
let evenSquaresSum = a.b(1, 2, 3)
+    .c(2, 3, 4)↓.d()
+
+
let evenSquaresSum = a.b(1, 2, 3)↓.c { blah in
+        print(blah)
+    }
+    .d()
+
+
a.b {
+//  ““
+}↓.e()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_literal_brackets.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_literal_brackets.html new file mode 100644 index 000000000..76a6c9f44 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_literal_brackets.html @@ -0,0 +1,418 @@ + + + + multiline_literal_brackets Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Literal Brackets

+ +

Multiline literals should have their surrounding brackets in a new line.

+ +
    +
  • Identifier: multiline_literal_brackets
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let trio = ["harry", "ronald", "hermione"]
+let houseCup = ["gryffindor": 460, "hufflepuff": 370, "ravenclaw": 410, "slytherin": 450]
+
+
let trio = [
+    "harry",
+    "ronald",
+    "hermione"
+]
+let houseCup = [
+    "gryffindor": 460,
+    "hufflepuff": 370,
+    "ravenclaw": 410,
+    "slytherin": 450
+]
+
+
let trio = [
+    "harry", "ronald", "hermione"
+]
+let houseCup = [
+    "gryffindor": 460, "hufflepuff": 370,
+    "ravenclaw": 410, "slytherin": 450
+]
+
+
    _ = [
+        1,
+        2,
+        3,
+        4,
+        5, 6,
+        7, 8, 9
+    ]
+
+

Triggering Examples

+
let trio = [↓"harry",
+            "ronald",
+            "hermione"
+]
+
+
let houseCup = [↓"gryffindor": 460, "hufflepuff": 370,
+                "ravenclaw": 410, "slytherin": 450
+]
+
+
let houseCup = [↓"gryffindor": 460,
+                "hufflepuff": 370,
+                "ravenclaw": 410,
+                "slytherin": 450↓]
+
+
let trio = [
+    "harry",
+    "ronald",
+    "hermione"↓]
+
+
let houseCup = [
+    "gryffindor": 460, "hufflepuff": 370,
+    "ravenclaw": 410, "slytherin": 450↓]
+
+
class Hogwarts {
+    let houseCup = [
+        "gryffindor": 460, "hufflepuff": 370,
+        "ravenclaw": 410, "slytherin": 450↓]
+}
+
+
    _ = [
+        1,
+        2,
+        3,
+        4,
+        5, 6,
+        7, 8, 9↓]
+
+
    _ = [↓1, 2, 3,
+         4, 5, 6,
+         7, 8, 9
+    ]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters.html new file mode 100644 index 000000000..4fe2d1e02 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters.html @@ -0,0 +1,702 @@ + + + + multiline_parameters Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Parameters

+ +

Functions and methods parameters should be either on the same line, or one per line.

+ +
    +
  • Identifier: multiline_parameters
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, allowsSingleLine: true
  • +
+

Non Triggering Examples

+
func foo() { }
+
+
func foo(param1: Int) { }
+
+
func foo(param1: Int, param2: Bool) { }
+
+
func foo(param1: Int, param2: Bool, param3: [String]) { }
+
+
func foo(param1: Int,
+         param2: Bool,
+         param3: [String]) { }
+
+
func foo(_ param1: Int, param2: Int, param3: Int) -> (Int) -> Int {
+   return { x in x + param1 + param2 + param3 }
+}
+
+
static func foo() { }
+
+
static func foo(param1: Int) { }
+
+
static func foo(param1: Int, param2: Bool) { }
+
+
static func foo(param1: Int, param2: Bool, param3: [String]) { }
+
+
static func foo(param1: Int,
+                param2: Bool,
+                param3: [String]) { }
+
+
protocol Foo {
+    func foo() { }
+}
+
+
protocol Foo {
+    func foo(param1: Int) { }
+}
+
+
protocol Foo {
+    func foo(param1: Int, param2: Bool) { }
+}
+
+
protocol Foo {
+    func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   func foo(param1: Int,
+            param2: Bool,
+            param3: [String]) { }
+}
+
+
protocol Foo {
+    static func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   static func foo(param1: Int,
+                   param2: Bool,
+                   param3: [String]) { }
+}
+
+
protocol Foo {
+    class func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: [String]) { }
+}
+
+
enum Foo {
+    func foo() { }
+}
+
+
enum Foo {
+    func foo(param1: Int) { }
+}
+
+
enum Foo {
+    func foo(param1: Int, param2: Bool) { }
+}
+
+
enum Foo {
+    func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
enum Foo {
+   func foo(param1: Int,
+            param2: Bool,
+            param3: [String]) { }
+}
+
+
enum Foo {
+    static func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
enum Foo {
+   static func foo(param1: Int,
+                   param2: Bool,
+                   param3: [String]) { }
+}
+
+
struct Foo {
+    func foo() { }
+}
+
+
struct Foo {
+    func foo(param1: Int) { }
+}
+
+
struct Foo {
+    func foo(param1: Int, param2: Bool) { }
+}
+
+
struct Foo {
+    func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
struct Foo {
+   func foo(param1: Int,
+            param2: Bool,
+            param3: [String]) { }
+}
+
+
struct Foo {
+    static func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
struct Foo {
+   static func foo(param1: Int,
+                   param2: Bool,
+                   param3: [String]) { }
+}
+
+
class Foo {
+    func foo() { }
+}
+
+
class Foo {
+    func foo(param1: Int) { }
+}
+
+
class Foo {
+    func foo(param1: Int, param2: Bool) { }
+}
+
+
class Foo {
+    func foo(param1: Int, param2: Bool, param3: [String]) { }
+    }
+
+
class Foo {
+   func foo(param1: Int,
+            param2: Bool,
+            param3: [String]) { }
+}
+
+
class Foo {
+    class func foo(param1: Int, param2: Bool, param3: [String]) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: [String]) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping (Int) -> Void = { _ in }) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping ((Int) -> Void)? = nil) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping ((Int) -> Void)? = { _ in }) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: @escaping ((Int) -> Void)? = { _ in },
+                  param3: Bool) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: @escaping ((Int) -> Void)? = { _ in },
+                  param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping (Int) -> Void = { (x: Int) in }) { }
+}
+
+
class Foo {
+   class func foo(param1: Int,
+                  param2: Bool,
+                  param3: @escaping (Int, (Int) -> Void) -> Void = { (x: Int, f: (Int) -> Void) in }) { }
+}
+
+
class Foo {
+   init(param1: Int,
+        param2: Bool,
+        param3: @escaping ((Int) -> Void)? = { _ in }) { }
+}
+
+
func foo() { }
+
+
func foo(param1: Int) { }
+
+
protocol Foo {
+    func foo(param1: Int,
+             param2: Bool,
+             param3: [String]) { }
+}
+
+
protocol Foo {
+    func foo(
+        param1: Int
+    ) { }
+}
+
+
protocol Foo {
+    func foo(
+        param1: Int,
+        param2: Bool,
+        param3: [String]
+    ) { }
+}
+
+

Triggering Examples

+
func ↓foo(_ param1: Int,
+          param2: Int, param3: Int) -> (Int) -> Int {
+   return { x in x + param1 + param2 + param3 }
+}
+
+
protocol Foo {
+   func ↓foo(param1: Int,
+             param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   func ↓foo(param1: Int, param2: Bool,
+             param3: [String]) { }
+}
+
+
protocol Foo {
+   static func ↓foo(param1: Int,
+                    param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   static func ↓foo(param1: Int, param2: Bool,
+                    param3: [String]) { }
+}
+
+
protocol Foo {
+   class func ↓foo(param1: Int,
+                   param2: Bool, param3: [String]) { }
+}
+
+
protocol Foo {
+   class func ↓foo(param1: Int, param2: Bool,
+                   param3: [String]) { }
+}
+
+
enum Foo {
+   func ↓foo(param1: Int,
+             param2: Bool, param3: [String]) { }
+}
+
+
enum Foo {
+   func ↓foo(param1: Int, param2: Bool,
+             param3: [String]) { }
+}
+
+
enum Foo {
+   static func ↓foo(param1: Int,
+                    param2: Bool, param3: [String]) { }
+}
+
+
enum Foo {
+   static func ↓foo(param1: Int, param2: Bool,
+                    param3: [String]) { }
+}
+
+
struct Foo {
+   func ↓foo(param1: Int,
+             param2: Bool, param3: [String]) { }
+}
+
+
struct Foo {
+   func ↓foo(param1: Int, param2: Bool,
+             param3: [String]) { }
+}
+
+
struct Foo {
+   static func ↓foo(param1: Int,
+                    param2: Bool, param3: [String]) { }
+}
+
+
struct Foo {
+   static func ↓foo(param1: Int, param2: Bool,
+                    param3: [String]) { }
+}
+
+
class Foo {
+   func ↓foo(param1: Int,
+             param2: Bool, param3: [String]) { }
+}
+
+
class Foo {
+   func ↓foo(param1: Int, param2: Bool,
+             param3: [String]) { }
+}
+
+
class Foo {
+   class func ↓foo(param1: Int,
+                   param2: Bool, param3: [String]) { }
+}
+
+
class Foo {
+   class func ↓foo(param1: Int, param2: Bool,
+                   param3: [String]) { }
+}
+
+
class Foo {
+   class func ↓foo(param1: Int,
+                  param2: Bool, param3: @escaping (Int, Int) -> Void = { _, _ in }) { }
+}
+
+
class Foo {
+   class func ↓foo(param1: Int,
+                  param2: Bool, param3: @escaping (Int) -> Void = { (x: Int) in }) { }
+}
+
+
class Foo {
+  ↓init(param1: Int, param2: Bool,
+        param3: @escaping ((Int) -> Void)? = { _ in }) { }
+}
+
+
func ↓foo(param1: Int, param2: Bool) { }
+
+
func ↓foo(param1: Int, param2: Bool, param3: [String]) { }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters_brackets.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters_brackets.html new file mode 100644 index 000000000..a57dfcfec --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiline_parameters_brackets.html @@ -0,0 +1,406 @@ + + + + multiline_parameters_brackets Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiline Parameters Brackets

+ +

Multiline parameters should have their surrounding brackets in a new line.

+ +
    +
  • Identifier: multiline_parameters_brackets
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo(param1: String, param2: String, param3: String)
+
+
func foo(
+    param1: String, param2: String, param3: String
+)
+
+
func foo(
+    param1: String,
+    param2: String,
+    param3: String
+)
+
+
class SomeType {
+    func foo(param1: String, param2: String, param3: String)
+}
+
+
class SomeType {
+    func foo(
+        param1: String, param2: String, param3: String
+    )
+}
+
+
class SomeType {
+    func foo(
+        param1: String,
+        param2: String,
+        param3: String
+    )
+}
+
+
func foo<T>(param1: T, param2: String, param3: String) -> T { /* some code */ }
+
+
    func foo(a: [Int] = [
+        1
+    ])
+
+

Triggering Examples

+
func foo(↓param1: String, param2: String,
+         param3: String
+)
+
+
func foo(
+    param1: String,
+    param2: String,
+    param3: String↓)
+
+
class SomeType {
+    func foo(↓param1: String, param2: String,
+             param3: String
+    )
+}
+
+
class SomeType {
+    func foo(
+        param1: String,
+        param2: String,
+        param3: String↓)
+}
+
+
func foo<T>(↓param1: T, param2: String,
+         param3: String
+) -> T
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html new file mode 100644 index 000000000..2a4006682 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/multiple_closures_with_trailing_closure.html @@ -0,0 +1,378 @@ + + + + multiple_closures_with_trailing_closure Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Multiple Closures with Trailing Closure

+ +

Trailing closure syntax should not be used when passing more than one closure argument.

+ +
    +
  • Identifier: multiple_closures_with_trailing_closure
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
foo.map { $0 + 1 }
+
+
+
foo.reduce(0) { $0 + $1 }
+
+
+
if let foo = bar.map({ $0 + 1 }) {
+
+}
+
+
+
foo.something(param1: { $0 }, param2: { $0 + 1 })
+
+
+
UIView.animate(withDuration: 1.0) {
+    someView.alpha = 0.0
+}
+
+
foo.method { print(0) } arg2: { print(1) }
+
+
foo.methodWithParenArgs((0, 1), arg2: (0, 1, 2)) { $0 } arg4: { $0 }
+
+

Triggering Examples

+
foo.something(param1: { $0 }) ↓{ $0 + 1 }
+
+
UIView.animate(withDuration: 1.0, animations: {
+    someView.alpha = 0.0
+}) ↓{ _ in
+    someView.removeFromSuperview()
+}
+
+
foo.multipleTrailing(arg1: { $0 }) { $0 } arg3: { $0 }
+
+
foo.methodWithParenArgs(param1: { $0 }, param2: (0, 1), (0, 1)) { $0 }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nesting.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nesting.html new file mode 100644 index 000000000..848645a68 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nesting.html @@ -0,0 +1,1033 @@ + + + + nesting Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Nesting

+ +

Types should be nested at most 1 level deep, and functions should be nested at most 2 levels deep.

+ +
    +
  • Identifier: nesting
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (type_level) w: 1, (function_level) w: 2, (check_nesting_in_closures_and_statements) true, (always_allow_one_type_in_functions) false
  • +
+

Non Triggering Examples

+
    class Example_0 {
+        class Example_1 {}
+    }
+
+
    var example: Int {
+        class Example_0 {
+            class Example_1 {}
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            class Example_0 {
+                class Example_1 {}
+            }
+        }
+    }
+
+
    extension Example_0 {
+        class Example_1 {}
+    }
+
+
    struct Example_0 {
+        struct Example_1 {}
+    }
+
+
    var example: Int {
+        struct Example_0 {
+            struct Example_1 {}
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            struct Example_0 {
+                struct Example_1 {}
+            }
+        }
+    }
+
+
    extension Example_0 {
+        struct Example_1 {}
+    }
+
+
    enum Example_0 {
+        enum Example_1 {}
+    }
+
+
    var example: Int {
+        enum Example_0 {
+            enum Example_1 {}
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            enum Example_0 {
+                enum Example_1 {}
+            }
+        }
+    }
+
+
    extension Example_0 {
+        enum Example_1 {}
+    }
+
+
    func f_0() {
+        func f_1() {
+            func f_2() {}
+        }
+    }
+
+
    var example: Int {
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            func f_0() {
+                func f_1() {
+                    func f_2() {}
+                }
+            }
+        }
+    }
+
+
    extension Example_0 {
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    switch example {
+    case .exampleCase:
+        class Example_0 {
+            class Example_1 {}
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        class Example_0 {
+            class Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        class Example_0 {
+            class Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    })
+
+
    switch example {
+    case .exampleCase:
+        struct Example_0 {
+            struct Example_1 {}
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        struct Example_0 {
+            struct Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        struct Example_0 {
+            struct Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    })
+
+
    switch example {
+    case .exampleCase:
+        enum Example_0 {
+            enum Example_1 {}
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        enum Example_0 {
+            enum Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        enum Example_0 {
+            enum Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {}
+            }
+        }
+    })
+
+
    class Example_0 {
+        func f_0() {
+            class Example_1 {
+                func f_1() {
+                    func f_2() {}
+                }
+            }
+        }
+    }
+
+
    class Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                class Example_1 {
+                    func f_1() {
+                        func f_2() {}
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    class Example_1 {
+                        func f_1() {
+                            func f_2() {}
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+
    struct Example_0 {
+        func f_0() {
+            struct Example_1 {
+                func f_1() {
+                    func f_2() {}
+                }
+            }
+        }
+    }
+
+
    struct Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                struct Example_1 {
+                    func f_1() {
+                        func f_2() {}
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    struct Example_1 {
+                        func f_1() {
+                            func f_2() {}
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+
    enum Example_0 {
+        func f_0() {
+            enum Example_1 {
+                func f_1() {
+                    func f_2() {}
+                }
+            }
+        }
+    }
+
+
    enum Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                enum Example_1 {
+                    func f_1() {
+                        func f_2() {}
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    enum Example_1 {
+                        func f_1() {
+                            func f_2() {}
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+

Triggering Examples

+
    class Example_0 {
+        class Example_1 {
+            ↓class Example_2 {}
+        }
+    }
+
+
    var example: Int {
+        class Example_0 {
+            class Example_1 {
+                ↓class Example_2 {}
+            }
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            class Example_0 {
+                class Example_1 {
+                    ↓class Example_2 {}
+                }
+            }
+        }
+    }
+
+
    extension Example_0 {
+        class Example_1 {
+            ↓class Example_2 {}
+        }
+    }
+
+
    struct Example_0 {
+        struct Example_1 {
+            ↓struct Example_2 {}
+        }
+    }
+
+
    var example: Int {
+        struct Example_0 {
+            struct Example_1 {
+                ↓struct Example_2 {}
+            }
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            struct Example_0 {
+                struct Example_1 {
+                    ↓struct Example_2 {}
+                }
+            }
+        }
+    }
+
+
    extension Example_0 {
+        struct Example_1 {
+            ↓struct Example_2 {}
+        }
+    }
+
+
    enum Example_0 {
+        enum Example_1 {
+            ↓enum Example_2 {}
+        }
+    }
+
+
    var example: Int {
+        enum Example_0 {
+            enum Example_1 {
+                ↓enum Example_2 {}
+            }
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            enum Example_0 {
+                enum Example_1 {
+                    ↓enum Example_2 {}
+                }
+            }
+        }
+    }
+
+
    extension Example_0 {
+        enum Example_1 {
+            ↓enum Example_2 {}
+        }
+    }
+
+
    func f_0() {
+        func f_1() {
+            func f_2() {
+                ↓func f_3() {}
+            }
+        }
+    }
+
+
    var example: Int {
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+        return 5
+    }
+
+
    var example: Int = 5 {
+        didSet {
+            func f_0() {
+                func f_1() {
+                    func f_2() {
+                        ↓func f_3() {}
+                    }
+                }
+            }
+        }
+    }
+
+
    extension Example_0 {
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    switch example {
+    case .exampleCase:
+        class Example_0 {
+            class Example_1 {
+                ↓class Example_2 {}
+            }
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        class Example_0 {
+            class Example_1 {
+                ↓class Example_2 {}
+            }
+            }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        class Example_0 {
+            class Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    })
+
+
    switch example {
+    case .exampleCase:
+        struct Example_0 {
+            struct Example_1 {
+                ↓struct Example_2 {}
+            }
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        struct Example_0 {
+            struct Example_1 {
+                ↓struct Example_2 {}
+            }
+            }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        struct Example_0 {
+            struct Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    })
+
+
    switch example {
+    case .exampleCase:
+        enum Example_0 {
+            enum Example_1 {
+                ↓enum Example_2 {}
+            }
+        }
+    default:
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    var exampleClosure: () -> Void = {
+        enum Example_0 {
+            enum Example_1 {
+                ↓enum Example_2 {}
+            }
+            }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    }
+
+
    exampleFunc(closure: {
+        enum Example_0 {
+            enum Example_1 {}
+        }
+        func f_0() {
+            func f_1() {
+                func f_2() {
+                    ↓func f_3() {}
+                }
+            }
+        }
+    })
+
+
    class Example_0 {
+        func f_0() {
+            class Example_1 {
+                func f_1() {
+                    func f_2() {
+                        ↓class Example_2 {}
+                        ↓func f_3() {}
+                    }
+                }
+            }
+        }
+    }
+
+
    class Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                class Example_1 {
+                    func f_1() {
+                        func f_2() {
+                            ↓class Example_2 {}
+                            ↓func f_3() {}
+                        }
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    class Example_1 {
+                        func f_1() {
+                            func f_2() {
+                                ↓class Example_2 {}
+                                ↓func f_3() {}
+                            }
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+
    struct Example_0 {
+        func f_0() {
+            struct Example_1 {
+                func f_1() {
+                    func f_2() {
+                        ↓struct Example_2 {}
+                        ↓func f_3() {}
+                    }
+                }
+            }
+        }
+    }
+
+
    struct Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                struct Example_1 {
+                    func f_1() {
+                        func f_2() {
+                            ↓struct Example_2 {}
+                            ↓func f_3() {}
+                        }
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    struct Example_1 {
+                        func f_1() {
+                            func f_2() {
+                                ↓struct Example_2 {}
+                                ↓func f_3() {}
+                            }
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+
    enum Example_0 {
+        func f_0() {
+            enum Example_1 {
+                func f_1() {
+                    func f_2() {
+                        ↓enum Example_2 {}
+                        ↓func f_3() {}
+                    }
+                }
+            }
+        }
+    }
+
+
    enum Example_0 {
+        func f_0() {
+            switch example {
+            case .exampleCase:
+                enum Example_1 {
+                    func f_1() {
+                        func f_2() {
+                            ↓enum Example_2 {}
+                            ↓func f_3() {}
+                        }
+                    }
+                }
+            default:
+                exampleFunc(closure: {
+                    enum Example_1 {
+                        func f_1() {
+                            func f_2() {
+                                ↓enum Example_2 {}
+                                ↓func f_3() {}
+                            }
+                        }
+                    }
+                })
+            }
+        }
+    }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nimble_operator.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nimble_operator.html new file mode 100644 index 000000000..f633ad07a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nimble_operator.html @@ -0,0 +1,426 @@ + + + + nimble_operator Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Nimble Operator

+ +

Prefer Nimble operator overloads over free matcher functions.

+ +
    +
  • Identifier: nimble_operator
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
expect(seagull.squawk) != "Hi!"
+
+
+
expect("Hi!") == "Hi!"
+
+
+
expect(10) > 2
+
+
+
expect(10) >= 10
+
+
+
expect(10) < 11
+
+
+
expect(10) <= 10
+
+
+
expect(x) === x
+
+
expect(10) == 10
+
+
expect(success) == true
+
+
expect(value) == nil
+
+
expect(value) != nil
+
+
expect(object.asyncFunction()).toEventually(equal(1))
+
+
+
expect(actual).to(haveCount(expected))
+
+
+
foo.method {
+    expect(value).to(equal(expectedValue), description: "Failed")
+    return Bar(value: ())
+}
+
+

Triggering Examples

+
↓expect(seagull.squawk).toNot(equal("Hi"))
+
+
+
↓expect(12).toNot(equal(10))
+
+
+
↓expect(10).to(equal(10))
+
+
+
↓expect(10, line: 1).to(equal(10))
+
+
+
↓expect(10).to(beGreaterThan(8))
+
+
+
↓expect(10).to(beGreaterThanOrEqualTo(10))
+
+
+
↓expect(10).to(beLessThan(11))
+
+
+
↓expect(10).to(beLessThanOrEqualTo(10))
+
+
+
↓expect(x).to(beIdenticalTo(x))
+
+
+
↓expect(success).to(beTrue())
+
+
+
↓expect(success).to(beFalse())
+
+
+
↓expect(value).to(beNil())
+
+
+
↓expect(value).toNot(beNil())
+
+
+
expect(10) > 2
+ ↓expect(10).to(beGreaterThan(2))
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_extension_access_modifier.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_extension_access_modifier.html new file mode 100644 index 000000000..80b6a2791 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_extension_access_modifier.html @@ -0,0 +1,361 @@ + + + + no_extension_access_modifier Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

No Extension Access Modifier

+ +

Prefer not to use extension access modifiers

+ +
    +
  • Identifier: no_extension_access_modifier
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
extension String {}
+
+

+
+ extension String {}
+
+

Triggering Examples

+
↓private extension String {}
+
+
↓public 
+ extension String {}
+
+
↓open extension String {}
+
+
↓internal extension String {}
+
+
↓fileprivate extension String {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_fallthrough_only.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_fallthrough_only.html new file mode 100644 index 000000000..69a96de21 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_fallthrough_only.html @@ -0,0 +1,480 @@ + + + + no_fallthrough_only Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

No Fallthrough Only

+ +

Fallthroughs can only be used if the case contains at least one other statement.

+ +
    +
  • Identifier: no_fallthrough_only
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch myvar {
+case 1:
+    var a = 1
+    fallthrough
+case 2:
+    var a = 2
+}
+
+
switch myvar {
+case "a":
+    var one = 1
+    var two = 2
+    fallthrough
+case "b": /* comment */
+    var three = 3
+}
+
+
switch myvar {
+case 1:
+    let one = 1
+case 2:
+    // comment
+    var two = 2
+}
+
+
switch myvar {
+case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
+    var three = 3
+    fallthrough
+default:
+    var three = 4
+}
+
+
switch myvar {
+case .alpha:
+    var one = 1
+case .beta:
+    var three = 3
+    fallthrough
+default:
+    var four = 4
+}
+
+
let aPoint = (1, -1)
+switch aPoint {
+case let (x, y) where x == y:
+    let A = "A"
+case let (x, y) where x == -y:
+    let B = "B"
+    fallthrough
+default:
+    let C = "C"
+}
+
+
switch myvar {
+case MyFun(with: { $1 }):
+    let one = 1
+    fallthrough
+case "abc":
+    let two = 2
+}
+
+
switch enumInstance {
+case .caseA:
+    print("it's a")
+case .caseB:
+    fallthrough
+@unknown default:
+    print("it's not a")
+}
+
+

Triggering Examples

+
switch myvar {
+case 1:
+    ↓fallthrough
+case 2:
+    var a = 1
+}
+
+
switch myvar {
+case 1:
+    var a = 2
+case 2:
+    ↓fallthrough
+case 3:
+    var a = 3
+}
+
+
switch myvar {
+case 1: // comment
+    ↓fallthrough
+}
+
+
switch myvar {
+case 1: /* multi
+    line
+    comment */
+    ↓fallthrough
+case 2:
+    var a = 2
+}
+
+
switch myvar {
+case MyFunc(x: [1, 2, YourFunc(a: 23)], y: 2):
+    ↓fallthrough
+default:
+    var three = 4
+}
+
+
switch myvar {
+case .alpha:
+    var one = 1
+case .beta:
+    ↓fallthrough
+case .gamma:
+    var three = 3
+default:
+    var four = 4
+}
+
+
let aPoint = (1, -1)
+switch aPoint {
+case let (x, y) where x == y:
+    let A = "A"
+case let (x, y) where x == -y:
+    ↓fallthrough
+default:
+    let B = "B"
+}
+
+
switch myvar {
+case MyFun(with: { $1 }):
+    ↓fallthrough
+case "abc":
+    let two = 2
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_grouping_extension.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_grouping_extension.html new file mode 100644 index 000000000..aa009ed27 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_grouping_extension.html @@ -0,0 +1,372 @@ + + + + no_grouping_extension Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

No Grouping Extension

+ +

Extensions shouldn’t be used to group code within the same source file.

+ +
    +
  • Identifier: no_grouping_extension
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol Food {}
+extension Food {}
+
+
+
class Apples {}
+extension Oranges {}
+
+
+
class Box<T> {}
+extension Box where T: Vegetable {}
+
+
+

Triggering Examples

+
enum Fruit {}
+↓extension Fruit {}
+
+
+
↓extension Tea: Error {}
+struct Tea {}
+
+
+
class Ham { class Spam {}}
+↓extension Ham.Spam {}
+
+
+
extension External { struct Gotcha {}}
+↓extension External.Gotcha {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_magic_numbers.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_magic_numbers.html new file mode 100644 index 000000000..5344cc4c2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_magic_numbers.html @@ -0,0 +1,388 @@ + + + + no_magic_numbers Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

No Magic Numbers

+ +

Magic numbers should be replaced by named constants.

+ +
    +
  • Identifier: no_magic_numbers
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var foo = 123
+
+
static let bar: Double = 0.123
+
+
let a = b + 1.0
+
+
array[0] + array[1] 
+
+
let foo = 1_000.000_01
+
+
// array[1337]
+
+
baz("9999")
+
+
func foo() {
+    let x: Int = 2
+    let y = 3
+    let vector = [x, y, -1]
+}
+
+
class A {
+    var foo: Double = 132
+    static let bar: Double = 0.98
+}
+
+
@available(iOS 13, *)
+func version() {
+    if #available(iOS 13, OSX 10.10, *) {
+        return
+    }
+}
+
+

Triggering Examples

+
foo(↓321)
+
+
bar(↓1_000.005_01)
+
+
array[↓42]
+
+
let box = array[↓12 + ↓14]
+
+
let a = b + ↓2.0
+
+
Color.primary.opacity(isAnimate ? ↓0.1 : ↓1.5)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_space_in_method_call.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_space_in_method_call.html new file mode 100644 index 000000000..43fd1a26f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/no_space_in_method_call.html @@ -0,0 +1,378 @@ + + + + no_space_in_method_call Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

No Space in Method Call

+ +

Don’t add a space between the method name and the parentheses.

+ +
    +
  • Identifier: no_space_in_method_call
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
foo()
+
+
object.foo()
+
+
object.foo(1)
+
+
object.foo(value: 1)
+
+
object.foo { print($0 }
+
+
list.sorted { $0.0 < $1.0 }.map { $0.value }
+
+
self.init(rgb: (Int) (colorInt))
+
+
Button {
+    print("Button tapped")
+} label: {
+    Text("Button")
+}
+
+

Triggering Examples

+
foo↓ ()
+
+
object.foo↓ ()
+
+
object.foo↓ (1)
+
+
object.foo↓ (value: 1)
+
+
object.foo↓ () {}
+
+
object.foo↓     ()
+
+
object.foo↓     (value: 1) { x in print(x) }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/notification_center_detachment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/notification_center_detachment.html new file mode 100644 index 000000000..da915cb71 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/notification_center_detachment.html @@ -0,0 +1,362 @@ + + + + notification_center_detachment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Notification Center Detachment

+ +

An object should only remove itself as an observer in deinit.

+ +
    +
  • Identifier: notification_center_detachment
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+   deinit {
+       NotificationCenter.default.removeObserver(self)
+   }
+}
+
+
class Foo {
+   func bar() {
+       NotificationCenter.default.removeObserver(otherObject)
+   }
+}
+
+

Triggering Examples

+
class Foo {
+   func bar() {
+       ↓NotificationCenter.default.removeObserver(self)
+   }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html new file mode 100644 index 000000000..149983d4c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/ns_number_init_as_function_reference.html @@ -0,0 +1,356 @@ + + + + ns_number_init_as_function_reference Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

NSNumber Init as Function Reference

+ +

Passing NSNumber.init or NSDecimalNumber.init as a function reference is dangerous as it can cause the wrong initializer to be used, causing crashes. Use .init(value:) instead.

+ +
    +
  • Identifier: ns_number_init_as_function_reference
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[0, 0.2].map(NSNumber.init(value:))
+
+
[0, 0.2].map { NSNumber(value: $0) }
+
+
[0, 0.2].map(NSDecimalNumber.init(value:))
+
+
[0, 0.2].map { NSDecimalNumber(value: $0) }
+
+

Triggering Examples

+
[0, 0.2].map(↓NSNumber.init)
+
+
[0, 0.2].map(↓NSDecimalNumber.init)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_key.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_key.html new file mode 100644 index 000000000..7529ac5db --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_key.html @@ -0,0 +1,365 @@ + + + + nslocalizedstring_key Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

NSLocalizedString Key

+ +

Static strings should be used as key/comment in NSLocalizedString in order for genstrings to work.

+ +
    +
  • Identifier: nslocalizedstring_key
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
NSLocalizedString("key", comment: "")
+
+
NSLocalizedString("key" + "2", comment: "")
+
+
NSLocalizedString("key", comment: "comment")
+
+
NSLocalizedString("This is a multi-" +
+    "line string", comment: "")
+
+
let format = NSLocalizedString("%@, %@.", comment: "Accessibility label for a post in the post list." +
+" The parameters are the title, and date respectively." +
+" For example, "Let it Go, 1 hour ago."")
+
+

Triggering Examples

+
NSLocalizedString(↓method(), comment: "")
+
+
NSLocalizedString(↓"key_\(param)", comment: "")
+
+
NSLocalizedString("key", comment: ↓"comment with \(param)")
+
+
NSLocalizedString(↓"key_\(param)", comment: ↓method())
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html new file mode 100644 index 000000000..0f49d7600 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nslocalizedstring_require_bundle.html @@ -0,0 +1,363 @@ + + + + nslocalizedstring_require_bundle Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

NSLocalizedString Require Bundle

+ +

Calls to NSLocalizedString should specify the bundle which contains the strings file.

+ +
    +
  • Identifier: nslocalizedstring_require_bundle
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
NSLocalizedString("someKey", bundle: .main, comment: "test")
+
+
NSLocalizedString("someKey", tableName: "a",
+                  bundle: Bundle(for: A.self),
+                  comment: "test")
+
+
NSLocalizedString("someKey", tableName: "xyz",
+                  bundle: someBundle, value: "test"
+                  comment: "test")
+
+
arbitraryFunctionCall("something")
+
+

Triggering Examples

+
↓NSLocalizedString("someKey", comment: "test")
+
+
↓NSLocalizedString("someKey", tableName: "a", comment: "test")
+
+
↓NSLocalizedString("someKey", tableName: "xyz",
+                  value: "test", comment: "test")
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html new file mode 100644 index 000000000..209eaa362 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/nsobject_prefer_isequal.html @@ -0,0 +1,416 @@ + + + + nsobject_prefer_isequal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

NSObject Prefer isEqual

+ +

NSObject subclasses should implement isEqual instead of ==.

+ +
    +
  • Identifier: nsobject_prefer_isequal
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class AClass: NSObject {
+}
+
+
@objc class AClass: SomeNSObjectSubclass {
+}
+
+
class AClass: Equatable {
+    static func ==(lhs: AClass, rhs: AClass) -> Bool {
+        return true
+    }
+
+
class AClass: NSObject {
+    override func isEqual(_ object: Any?) -> Bool {
+        return true
+    }
+}
+
+
@objc class AClass: SomeNSObjectSubclass {
+    override func isEqual(_ object: Any?) -> Bool {
+        return false
+    }
+}
+
+
class AClass: NSObject {
+    static func ==(lhs: AClass, rhs: BClass) -> Bool {
+        return true
+    }
+}
+
+
struct AStruct: Equatable {
+    static func ==(lhs: AStruct, rhs: AStruct) -> Bool {
+        return false
+    }
+}
+
+
enum AnEnum: Equatable {
+    static func ==(lhs: AnEnum, rhs: AnEnum) -> Bool {
+        return true
+    }
+}
+
+

Triggering Examples

+
class AClass: NSObject {
+    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
+        return false
+    }
+}
+
+
@objc class AClass: SomeOtherNSObjectSubclass {
+    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
+        return true
+    }
+}
+
+
class AClass: NSObject, Equatable {
+    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
+        return false
+    }
+}
+
+
class AClass: NSObject {
+    override func isEqual(_ object: Any?) -> Bool {
+        guard let other = object as? AClass else {
+            return false
+        }
+        return true
+    }
+
+    ↓static func ==(lhs: AClass, rhs: AClass) -> Bool {
+        return false
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/number_separator.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/number_separator.html new file mode 100644 index 000000000..12d147303 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/number_separator.html @@ -0,0 +1,506 @@ + + + + number_separator Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Number Separator

+ +

Underscores should be used as thousand separator in large decimal numbers.

+ +
    +
  • Identifier: number_separator
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, minimum_length: 0, minimum_fraction_length: none
  • +
+

Non Triggering Examples

+
let foo = -100
+
+
let foo = -1_000
+
+
let foo = -1_000_000
+
+
let foo = -1.0001
+
+
let foo = -1_000_000.0000001
+
+
let binary = -0b10000
+
+
let binary = -0b1000_0001
+
+
let hex = -0xA
+
+
let hex = -0xAA_BB
+
+
let octal = -0o21
+
+
let octal = -0o21_1
+
+
let exp = -1_000_000.000000e2
+
+
let foo: Double = -(200)
+
+
let foo: Double = -(200 / 447.214)
+
+
let foo = -6.2832e-6
+
+
let foo = +100
+
+
let foo = +1_000
+
+
let foo = +1_000_000
+
+
let foo = +1.0001
+
+
let foo = +1_000_000.0000001
+
+
let binary = +0b10000
+
+
let binary = +0b1000_0001
+
+
let hex = +0xA
+
+
let hex = +0xAA_BB
+
+
let octal = +0o21
+
+
let octal = +0o21_1
+
+
let exp = +1_000_000.000000e2
+
+
let foo: Double = +(200)
+
+
let foo: Double = +(200 / 447.214)
+
+
let foo = +6.2832e-6
+
+
let foo = 100
+
+
let foo = 1_000
+
+
let foo = 1_000_000
+
+
let foo = 1.0001
+
+
let foo = 1_000_000.0000001
+
+
let binary = 0b10000
+
+
let binary = 0b1000_0001
+
+
let hex = 0xA
+
+
let hex = 0xAA_BB
+
+
let octal = 0o21
+
+
let octal = 0o21_1
+
+
let exp = 1_000_000.000000e2
+
+
let foo: Double = (200)
+
+
let foo: Double = (200 / 447.214)
+
+
let foo = 6.2832e-6
+
+

Triggering Examples

+
let foo = -↓10_0
+
+
let foo = -↓1000
+
+
let foo = -↓1000e2
+
+
let foo = -↓1000E2
+
+
let foo = -↓1__000
+
+
let foo = -↓1.0001
+
+
let foo = -↓1_000_000.000000_1
+
+
let foo = -↓1000000.000000_1
+
+
let foo = -↓6.2832e-6
+
+
let foo = +↓10_0
+
+
let foo = +↓1000
+
+
let foo = +↓1000e2
+
+
let foo = +↓1000E2
+
+
let foo = +↓1__000
+
+
let foo = +↓1.0001
+
+
let foo = +↓1_000_000.000000_1
+
+
let foo = +↓1000000.000000_1
+
+
let foo = +↓6.2832e-6
+
+
let foo = ↓10_0
+
+
let foo = ↓1000
+
+
let foo = ↓1000e2
+
+
let foo = ↓1000E2
+
+
let foo = ↓1__000
+
+
let foo = ↓1.0001
+
+
let foo = ↓1_000_000.000000_1
+
+
let foo = ↓1000000.000000_1
+
+
let foo = ↓6.2832e-6
+
+
let foo: Double = -(↓100000)
+
+
let foo: Double = -(↓10.000000_1)
+
+
let foo: Double = -(↓123456 / ↓447.214214)
+
+
let foo: Double = +(↓100000)
+
+
let foo: Double = +(↓10.000000_1)
+
+
let foo: Double = +(↓123456 / ↓447.214214)
+
+
let foo: Double = (↓100000)
+
+
let foo: Double = (↓10.000000_1)
+
+
let foo: Double = (↓123456 / ↓447.214214)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/object_literal.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/object_literal.html new file mode 100644 index 000000000..fb2d19578 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/object_literal.html @@ -0,0 +1,392 @@ + + + + object_literal Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Object Literal

+ +

Prefer object literals over image and color inits.

+ +
    +
  • Identifier: object_literal
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, image_literal: true, color_literal: true
  • +
+

Non Triggering Examples

+
let image = #imageLiteral(resourceName: "image.jpg")
+
+
let color = #colorLiteral(red: 0.9607843161, green: 0.7058823705, blue: 0.200000003, alpha: 1)
+
+
let image = UIImage(named: aVariable)
+
+
let image = UIImage(named: "interpolated \(variable)")
+
+
let color = UIColor(red: value, green: value, blue: value, alpha: 1)
+
+
let image = NSImage(named: aVariable)
+
+
let image = NSImage(named: "interpolated \(variable)")
+
+
let color = NSColor(red: value, green: value, blue: value, alpha: 1)
+
+

Triggering Examples

+
let image = ↓UIImage(named: "foo")
+
+
let color = ↓UIColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
+
+
let color = ↓UIColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
+
+
let color = ↓UIColor(white: 0.5, alpha: 1)
+
+
let image = ↓NSImage(named: "foo")
+
+
let color = ↓NSColor(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
+
+
let color = ↓NSColor(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
+
+
let color = ↓NSColor(white: 0.5, alpha: 1)
+
+
let image = ↓UIImage.init(named: "foo")
+
+
let color = ↓UIColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
+
+
let color = ↓UIColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
+
+
let color = ↓UIColor.init(white: 0.5, alpha: 1)
+
+
let image = ↓NSImage.init(named: "foo")
+
+
let color = ↓NSColor.init(red: 0.3, green: 0.3, blue: 0.3, alpha: 1)
+
+
let color = ↓NSColor.init(red: 100 / 255.0, green: 50 / 255.0, blue: 0, alpha: 1)
+
+
let color = ↓NSColor.init(white: 0.5, alpha: 1)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/opening_brace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/opening_brace.html new file mode 100644 index 000000000..e6acfb21d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/opening_brace.html @@ -0,0 +1,484 @@ + + + + opening_brace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Opening Brace Spacing

+ +

Opening braces should be preceded by a single space and on the same line as the declaration.

+ +
    +
  • Identifier: opening_brace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, allowMultilineFunc: false
  • +
+

Non Triggering Examples

+
func abc() {
+}
+
+
[].map() { $0 }
+
+
[].map({ })
+
+
if let a = b { }
+
+
while a == b { }
+
+
guard let a = b else { }
+
+
if
+    let a = b,
+    let c = d
+    where a == c
+{ }
+
+
while
+    let a = b,
+    let c = d
+    where a == c
+{ }
+
+
guard
+    let a = b,
+    let c = d
+    where a == c else
+{ }
+
+
struct Rule {}
+
+
+
struct Parent {
+    struct Child {
+        let foo: Int
+    }
+}
+
+
+
func f(rect: CGRect) {
+    {
+        let centre = CGPoint(x: rect.midX, y: rect.midY)
+        print(centre)
+    }()
+}
+
+
func f(rect: CGRect) -> () -> Void {
+    {
+        let centre = CGPoint(x: rect.midX, y: rect.midY)
+        print(centre)
+    }
+}
+
+
func f() -> () -> Void {
+    {}
+}
+
+

Triggering Examples

+
func abc()↓{
+}
+
+
func abc()
+    ↓{ }
+
+
func abc(a: A
+    b: B)
+↓{
+
+
[].map()↓{ $0 }
+
+
[].map( ↓{ } )
+
+
if let a = b↓{ }
+
+
while a == b↓{ }
+
+
guard let a = b else↓{ }
+
+
if
+    let a = b,
+    let c = d
+    where a == c↓{ }
+
+
while
+    let a = b,
+    let c = d
+    where a == c↓{ }
+
+
guard
+    let a = b,
+    let c = d
+    where a == c else↓{ }
+
+
struct Rule↓{}
+
+
+
struct Rule
+↓{
+}
+
+
+
struct Rule
+
+    ↓{
+}
+
+
+
struct Parent {
+    struct Child
+    ↓{
+        let foo: Int
+    }
+}
+
+
+
// Get the current thread's TLS pointer. On first call for a given thread,
+// creates and initializes a new one.
+internal static func getPointer()
+  -> UnsafeMutablePointer<_ThreadLocalStorage>
+{ // <- here
+  return _swift_stdlib_threadLocalStorageGet().assumingMemoryBound(
+    to: _ThreadLocalStorage.self)
+}
+
+
func run_Array_method1x(_ N: Int) {
+  let existentialArray = array!
+  for _ in 0 ..< N * 100 {
+    for elt in existentialArray {
+      if !elt.doIt()  {
+        fatalError("expected true")
+      }
+    }
+  }
+}
+
+func run_Array_method2x(_ N: Int) {
+
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_usage_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_usage_whitespace.html new file mode 100644 index 000000000..139f83e4e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_usage_whitespace.html @@ -0,0 +1,528 @@ + + + + operator_usage_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Operator Usage Whitespace

+ +

Operators should be surrounded by a single whitespace when they are being used.

+ +
    +
  • Identifier: operator_usage_whitespace
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, lines_look_around: 2, skip_aligned_constants: true, allowed_no_space_operators: [“…”, “..<”]
  • +
+

Non Triggering Examples

+
let foo = 1 + 2
+
+
+
let foo = 1 > 2
+
+
+
let foo = !false
+
+
+
let foo: Int?
+
+
+
let foo: Array<String>
+
+
+
let model = CustomView<Container<Button>, NSAttributedString>()
+
+
+
let foo: [String]
+
+
+
let foo = 1 + 
+  2
+
+
+
let range = 1...3
+
+
+
let range = 1 ... 3
+
+
+
let range = 1..<3
+
+
+
#if swift(>=3.0)
+    foo()
+#endif
+
+
+
array.removeAtIndex(-200)
+
+
+
let name = "image-1"
+
+
+
button.setImage(#imageLiteral(resourceName: "image-1"), for: .normal)
+
+
+
let doubleValue = -9e-11
+
+
+
let foo = GenericType<(UIViewController) -> Void>()
+
+
+
let foo = Foo<Bar<T>, Baz>()
+
+
+
let foo = SignalProducer<Signal<Value, Error>, Error>([ self.signal, next ]).flatten(.concat)
+
+
+
"let foo =  1"
+
+
  enum Enum {
+  case hello   = 1
+  case hello2  = 1
+  }
+
+
let something = Something<GenericParameter1,
+                          GenericParameter2>()
+
+
return path.flatMap { path in
+    return compileCommands[path] ??
+        compileCommands[path.path(relativeTo: FileManager.default.currentDirectoryPath)]
+}
+
+
internal static func == (lhs: Vertix, rhs: Vertix) -> Bool {
+    return lhs.filePath == rhs.filePath
+        && lhs.originalRemoteString == rhs.originalRemoteString
+        && lhs.rootDirectory == rhs.rootDirectory
+}
+
+
internal static func == (lhs: Vertix, rhs: Vertix) -> Bool {
+    return lhs.filePath == rhs.filePath &&
+        lhs.originalRemoteString == rhs.originalRemoteString &&
+        lhs.rootDirectory == rhs.rootDirectory
+}
+
+
private static let pattern =
+    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
+    "|" +                       // or
+    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
+
+
private static let pattern =
+    "\\S\(mainPatternGroups)" + // Regexp will match if expression not begin with comma
+    "|"                       + // or
+    "\(mainPatternGroups)"      // Regexp will match if expression begins with comma
+
+
typealias Foo = Bar
+
+
protocol A {
+    associatedtype B = C
+}
+
+
tabbedViewController.title = nil
+
+

Triggering Examples

+
let foo = 1↓+2
+
+
+
let foo = 1↓   + 2
+
+
+
let foo = 1↓   +    2
+
+
+
let foo = 1↓ +    2
+
+
+
let foo↓=1↓+2
+
+
+
let foo↓=1 + 2
+
+
+
let foo↓=bar
+
+
+
let range = 1↓ ..<  3
+
+
+
let foo = bar↓   ?? 0
+
+
+
let foo = bar↓ !=  0
+
+
+
let foo = bar↓ !==  bar2
+
+
+
let v8 = Int8(1)↓  << 6
+
+
+
let v8 = 1↓ <<  (6)
+
+
+
let v8 = 1↓ <<  (6)
+ let foo = 1 > 2
+
+
+
let foo↓  = [1]
+
+
+
let foo↓  = "1"
+
+
+
let foo↓ =  "1"
+
+
+
  enum Enum {
+  case one↓  =  1
+  case two  = 1
+  }
+
+
  enum Enum {
+  case one  = 1
+  case two↓  =  1
+  }
+
+
  enum Enum {
+  case one↓   = 1
+  case two↓  = 1
+  }
+
+
typealias Foo↓ =  Bar
+
+
protocol A {
+    associatedtype B↓  = C
+}
+
+
tabbedViewController.title↓  = nil
+
+
let foo = bar ? 0↓:1
+
+
let foo = bar↓ ?   0 : 1
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_whitespace.html new file mode 100644 index 000000000..acd1c4a51 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/operator_whitespace.html @@ -0,0 +1,371 @@ + + + + operator_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Operator Function Whitespace

+ +

Operators should be surrounded by a single whitespace when defining them.

+ +
    +
  • Identifier: operator_whitespace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func <| (lhs: Int, rhs: Int) -> Int {}
+
+
+
func <|< <A>(lhs: A, rhs: A) -> A {}
+
+
+
func abc(lhs: Int, rhs: Int) -> Int {}
+
+
+

Triggering Examples

+
↓func <|(lhs: Int, rhs: Int) -> Int {}
+
+
+
↓func <|<<A>(lhs: A, rhs: A) -> A {}
+
+
+
↓func <|  (lhs: Int, rhs: Int) -> Int {}
+
+
+
↓func <|<  <A>(lhs: A, rhs: A) -> A {}
+
+
+
↓func  <| (lhs: Int, rhs: Int) -> Int {}
+
+
+
↓func  <|< <A>(lhs: A, rhs: A) -> A {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/optional_enum_case_matching.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/optional_enum_case_matching.html new file mode 100644 index 000000000..bf5a910a7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/optional_enum_case_matching.html @@ -0,0 +1,396 @@ + + + + optional_enum_case_matching Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Optional Enum Case Match

+ +

Matching an enum case against an optional enum without ‘?’ is supported on Swift 5.1 and above.

+ +
    +
  • Identifier: optional_enum_case_matching
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch foo {
+ case .bar: break
+ case .baz: break
+ default: break
+}
+
+
switch foo {
+ case (.bar, .baz): break
+ case (.bar, _): break
+ case (_, .baz): break
+ default: break
+}
+
+
switch (x, y) {
+case (.c, _?):
+    break
+case (.c, nil):
+    break
+case (_, _):
+    break
+}
+
+

Triggering Examples

+
switch foo {
+ case .bar↓?: break
+ case .baz: break
+ default: break
+}
+
+
switch foo {
+ case Foo.bar↓?: break
+ case .baz: break
+ default: break
+}
+
+
switch foo {
+ case .bar↓?, .baz↓?: break
+ default: break
+}
+
+
switch foo {
+ case .bar↓? where x > 1: break
+ case .baz: break
+ default: break
+}
+
+
switch foo {
+ case (.bar↓?, .baz↓?): break
+ case (.bar↓?, _): break
+ case (_, .bar↓?): break
+ default: break
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/orphaned_doc_comment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/orphaned_doc_comment.html new file mode 100644 index 000000000..36471f40c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/orphaned_doc_comment.html @@ -0,0 +1,368 @@ + + + + orphaned_doc_comment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Orphaned Doc Comment

+ +

A doc comment should be attached to a declaration.

+ +
    +
  • Identifier: orphaned_doc_comment
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
/// My great property
+var myGreatProperty: String!
+
+
//////////////////////////////////////
+//
+// Copyright header.
+//
+//////////////////////////////////////
+
+
/// Look here for more info: https://github.com.
+var myGreatProperty: String!
+
+
/// Look here for more info:
+/// https://github.com.
+var myGreatProperty: String!
+
+

Triggering Examples

+
↓/// My great property
+// Not a doc string
+var myGreatProperty: String!
+
+
↓/// Look here for more info: https://github.com.
+// Not a doc string
+var myGreatProperty: String!
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/overridden_super_call.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/overridden_super_call.html new file mode 100644 index 000000000..9c3b07992 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/overridden_super_call.html @@ -0,0 +1,396 @@ + + + + overridden_super_call Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Overridden methods call super

+ +

Some overridden methods should always call super

+ +
    +
  • Identifier: overridden_super_call
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, excluded: [], included: [“*”]
  • +
+

Non Triggering Examples

+
class VC: UIViewController {
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+    }
+}
+
+
class VC: UIViewController {
+    override func viewWillAppear(_ animated: Bool) {
+        self.method1()
+        super.viewWillAppear(animated)
+        self.method2()
+    }
+}
+
+
class VC: UIViewController {
+    override func loadView() {
+    }
+}
+
+
class Some {
+    func viewWillAppear(_ animated: Bool) {
+    }
+}
+
+
class VC: UIViewController {
+    override func viewDidLoad() {
+    defer {
+        super.viewDidLoad()
+        }
+    }
+}
+
+

Triggering Examples

+
class VC: UIViewController {
+    override func viewWillAppear(_ animated: Bool) {↓
+        //Not calling to super
+        self.method()
+    }
+}
+
+
class VC: UIViewController {
+    override func viewWillAppear(_ animated: Bool) {↓
+        super.viewWillAppear(animated)
+        //Other code
+        super.viewWillAppear(animated)
+    }
+}
+
+
class VC: UIViewController {
+    override func didReceiveMemoryWarning() {↓
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/override_in_extension.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/override_in_extension.html new file mode 100644 index 000000000..938f22845 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/override_in_extension.html @@ -0,0 +1,381 @@ + + + + override_in_extension Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Override in Extension

+ +

Extensions shouldn’t override declarations.

+ +
    +
  • Identifier: override_in_extension
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
extension Person {
+  var age: Int { return 42 }
+}
+
+
+
extension Person {
+  func celebrateBirthday() {}
+}
+
+
+
class Employee: Person {
+  override func celebrateBirthday() {}
+}
+
+
+
class Foo: NSObject {}
+extension Foo {
+    override var description: String { return "" }
+}
+
+
struct Foo {
+    class Bar: NSObject {}
+}
+extension Foo.Bar {
+    override var description: String { return "" }
+}
+
+

Triggering Examples

+
extension Person {
+  override ↓var age: Int { return 42 }
+}
+
+
+
extension Person {
+  override ↓func celebrateBirthday() {}
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/pattern_matching_keywords.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/pattern_matching_keywords.html new file mode 100644 index 000000000..b62338a64 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/pattern_matching_keywords.html @@ -0,0 +1,420 @@ + + + + pattern_matching_keywords Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Pattern Matching Keywords

+ +

Combine multiple pattern matching bindings by moving keywords out of tuples.

+ +
    +
  • Identifier: pattern_matching_keywords
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch foo {
+    default: break
+}
+
+
switch foo {
+    case 1: break
+}
+
+
switch foo {
+    case bar: break
+}
+
+
switch foo {
+    case let (x, y): break
+}
+
+
switch foo {
+    case .foo(let x): break
+}
+
+
switch foo {
+    case let .foo(x, y): break
+}
+
+
switch foo {
+    case .foo(let x), .bar(let x): break
+}
+
+
switch foo {
+    case .foo(let x, var y): break
+}
+
+
switch foo {
+    case var (x, y): break
+}
+
+
switch foo {
+    case .foo(var x): break
+}
+
+
switch foo {
+    case var .foo(x, y): break
+}
+
+

Triggering Examples

+
switch foo {
+    case (↓let x,  ↓let y): break
+}
+
+
switch foo {
+    case (↓let x,  ↓let y, .foo): break
+}
+
+
switch foo {
+    case (↓let x,  ↓let y, _): break
+}
+
+
switch foo {
+    case .foo(↓let x, ↓let y): break
+}
+
+
switch foo {
+    case (.yamlParsing(↓let x), .yamlParsing(↓let y)): break
+}
+
+
switch foo {
+    case (↓var x,  ↓var y): break
+}
+
+
switch foo {
+    case .foo(↓var x, ↓var y): break
+}
+
+
switch foo {
+    case (.yamlParsing(↓var x), .yamlParsing(↓var y)): break
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_nimble.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_nimble.html new file mode 100644 index 000000000..bd11c7db7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_nimble.html @@ -0,0 +1,360 @@ + + + + prefer_nimble Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prefer Nimble

+ +

Prefer Nimble matchers over XCTAssert functions.

+ +
    +
  • Identifier: prefer_nimble
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
expect(foo) == 1
+
+
expect(foo).to(equal(1))
+
+

Triggering Examples

+
↓XCTAssertTrue(foo)
+
+
↓XCTAssertEqual(foo, 2)
+
+
↓XCTAssertNotEqual(foo, 2)
+
+
↓XCTAssertNil(foo)
+
+
↓XCTAssert(foo)
+
+
↓XCTAssertGreaterThan(foo, 10)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_in_static_references.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_in_static_references.html new file mode 100644 index 000000000..b2a76922b --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_in_static_references.html @@ -0,0 +1,401 @@ + + + + prefer_self_in_static_references Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prefer Self in Static References

+ +

Use Self to refer to the surrounding type name.

+ +
    +
  • Identifier: prefer_self_in_static_references
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
    class C {
+        static let primes = [2, 3, 5, 7]
+        func isPrime(i: Int) -> Bool { Self.primes.contains(i) }
+
+
    struct T {
+        static let i = 0
+    }
+    struct S {
+        static let i = 0
+    }
+    extension T {
+        static let j = S.i + T.i
+        static let k = { T.j }()
+    }
+
+
    class `Self` {
+        static let i = 0
+        func f() -> Int { Self.i }
+    }
+
+

Triggering Examples

+
    class C {
+        struct S {
+            static let i = 2
+            let h = ↓S.i
+        }
+        static let i = 1
+        let h = C.i
+        var j: Int { ↓C.i }
+        func f() -> Int { ↓C.i + h }
+    }
+
+
    struct S {
+        let j: Int
+        static let i = 1
+        static func f() -> Int { ↓S.i }
+        func g() -> Any { ↓S.self }
+        func h() -> S { ↓S(j: 2) }
+        func i() -> KeyPath<S, Int> { \↓S.j }
+        func j(@Wrap(-↓S.i, ↓S.i) n: Int = ↓S.i) {}
+    }
+
+
    struct S {
+        struct T {
+            static let i = 3
+        }
+        struct R {
+            static let j = S.T.i
+        }
+        static let h = ↓S.T.i + ↓S.R.j
+    }
+
+
    enum E {
+        case A
+        static func f() -> E { ↓E.A }
+        static func g() -> E { ↓E.f() }
+    }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html new file mode 100644 index 000000000..1fb565385 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_self_type_over_type_of_self.html @@ -0,0 +1,386 @@ + + + + prefer_self_type_over_type_of_self Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prefer Self Type Over Type of Self

+ +

Prefer Self over type(of: self) when accessing properties or calling methods.

+ +
    +
  • Identifier: prefer_self_type_over_type_of_self
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+    func bar() {
+        Self.baz()
+    }
+}
+
+
class Foo {
+    func bar() {
+        print(Self.baz)
+    }
+}
+
+
class A {
+    func foo(param: B) {
+        type(of: param).bar()
+    }
+}
+
+
class A {
+    func foo() {
+        print(type(of: self))
+    }
+}
+
+

Triggering Examples

+
class Foo {
+    func bar() {
+        ↓type(of: self).baz()
+    }
+}
+
+
class Foo {
+    func bar() {
+        print(↓type(of: self).baz)
+    }
+}
+
+
class Foo {
+    func bar() {
+        print(↓Swift.type(of: self).baz)
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html new file mode 100644 index 000000000..1603e7bf5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefer_zero_over_explicit_init.html @@ -0,0 +1,368 @@ + + + + prefer_zero_over_explicit_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prefer Zero Over Explicit Init

+ +

Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0))

+ +
    +
  • Identifier: prefer_zero_over_explicit_init
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
CGRect(x: 0, y: 0, width: 0, height: 1)
+
+
CGPoint(x: 0, y: -1)
+
+
CGSize(width: 2, height: 4)
+
+
CGVector(dx: -5, dy: 0)
+
+
UIEdgeInsets(top: 0, left: 1, bottom: 0, right: 1)
+
+

Triggering Examples

+
↓CGPoint(x: 0, y: 0)
+
+
↓CGPoint(x: 0.000000, y: 0)
+
+
↓CGPoint(x: 0.000000, y: 0.000)
+
+
↓CGRect(x: 0, y: 0, width: 0, height: 0)
+
+
↓CGSize(width: 0, height: 0)
+
+
↓CGVector(dx: 0, dy: 0)
+
+
↓UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html new file mode 100644 index 000000000..2e917b1b6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prefixed_toplevel_constant.html @@ -0,0 +1,416 @@ + + + + prefixed_toplevel_constant Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prefixed Top-Level Constant

+ +

Top-level constants should be prefixed by k.

+ +
    +
  • Identifier: prefixed_toplevel_constant
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, only_private: false
  • +
+

Non Triggering Examples

+
private let kFoo = 20.0
+
+
public let kFoo = false
+
+
internal let kFoo = "Foo"
+
+
let kFoo = true
+
+
let Foo = true
+
+
struct Foo {
+   let bar = 20.0
+}
+
+
private var foo = 20.0
+
+
public var foo = false
+
+
internal var foo = "Foo"
+
+
var foo = true
+
+
var foo = true, bar = true
+
+
var foo = true, let kFoo = true
+
+
let
+   kFoo = true
+
+
var foo: Int {
+   return a + b
+}
+
+
let kFoo = {
+   return a + b
+}()
+
+
var foo: String {
+    let bar = ""
+    return bar
+}
+
+
if condition() {
+    let result = somethingElse()
+    print(result)
+    exit()
+}
+
+
[1, 2, 3, 1000, 4000].forEach { number in
+    let isSmall = number < 10
+    if isSmall {
+        print("\(number) is a small number")
+    }
+}
+
+

Triggering Examples

+
private let ↓Foo = 20.0
+
+
public let ↓Foo = false
+
+
internal let ↓Foo = "Foo"
+
+
let ↓Foo = true
+
+
let ↓foo = 2, ↓bar = true
+
+
let
+    ↓foo = true
+
+
let ↓foo = {
+   return a + b
+}()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_action.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_action.html new file mode 100644 index 000000000..1f2301a26 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_action.html @@ -0,0 +1,429 @@ + + + + private_action Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Private Actions

+ +

IBActions should be private.

+ +
    +
  • Identifier: private_action
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+    @IBAction private func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
struct Foo {
+    @IBAction private func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
class Foo {
+    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
struct Foo {
+    @IBAction fileprivate func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
private extension Foo {
+    @IBAction func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
fileprivate extension Foo {
+    @IBAction func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+

Triggering Examples

+
class Foo {
+    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
struct Foo {
+    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
class Foo {
+    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
struct Foo {
+    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
class Foo {
+    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
struct Foo {
+    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
extension Foo {
+    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
extension Foo {
+    @IBAction public ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
extension Foo {
+    @IBAction internal ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
public extension Foo {
+    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+
internal extension Foo {
+    @IBAction ↓func barButtonTapped(_ sender: UIButton) {}
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_outlet.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_outlet.html new file mode 100644 index 000000000..4a0f3a3ac --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_outlet.html @@ -0,0 +1,419 @@ + + + + private_outlet Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Private Outlets

+ +

IBOutlets should be private to avoid leaking UIKit to higher layers.

+ +
    +
  • Identifier: private_outlet
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, allow_private_set: false
  • +
+

Non Triggering Examples

+
class Foo {
+  @IBOutlet private var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet private var label: UILabel!
+}
+
+
+
class Foo {
+  var notAnOutlet: UILabel
+}
+
+
+
class Foo {
+  @IBOutlet weak private var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet private weak var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet fileprivate weak var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet private(set) var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet private(set) var label: UILabel!
+}
+
+
+
class Foo {
+  @IBOutlet weak private(set) var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet private(set) weak var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet fileprivate(set) weak var label: UILabel?
+}
+
+
+

Triggering Examples

+
class Foo {
+  @IBOutlet ↓var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet ↓var label: UILabel!
+}
+
+
+
class Foo {
+  @IBOutlet private(set) ↓var label: UILabel?
+}
+
+
+
class Foo {
+  @IBOutlet fileprivate(set) ↓var label: UILabel?
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_over_fileprivate.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_over_fileprivate.html new file mode 100644 index 000000000..79e65a65a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_over_fileprivate.html @@ -0,0 +1,380 @@ + + + + private_over_fileprivate Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Private over fileprivate

+ +

Prefer private over fileprivate declarations.

+ +
    +
  • Identifier: private_over_fileprivate
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, validate_extensions: false
  • +
+

Non Triggering Examples

+
extension String {}
+
+
private extension String {}
+
+
public 
+ enum MyEnum {}
+
+
open extension 
+ String {}
+
+
internal extension String {}
+
+
extension String {
+  fileprivate func Something(){}
+}
+
+
class MyClass {
+  fileprivate let myInt = 4
+}
+
+
class MyClass {
+  fileprivate(set) var myInt = 4
+}
+
+
struct Outter {
+  struct Inter {
+    fileprivate struct Inner {}
+  }
+}
+
+

Triggering Examples

+
↓fileprivate enum MyEnum {}
+
+
↓fileprivate class MyClass {
+  fileprivate(set) var myInt = 4
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_subject.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_subject.html new file mode 100644 index 000000000..dc9069b42 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_subject.html @@ -0,0 +1,494 @@ + + + + private_subject Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Private Combine Subject

+ +

Combine Subject should be private.

+ +
    +
  • Identifier: private_subject
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
final class Foobar {
+    private let goodSubject = PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    private let goodSubject: PassthroughSubject<Bool, Never>
+}
+
+
final class Foobar {
+    fileprivate let goodSubject: PassthroughSubject<Bool, Never>
+}
+
+
final class Foobar {
+    private let goodSubject: PassthroughSubject<Bool, Never> = .ini()
+}
+
+
final class Foobar {
+    private let goodSubject = CurrentValueSubject<Bool, Never>(false)
+}
+
+
final class Foobar {
+    private let goodSubject: CurrentValueSubject<Bool, Never>
+}
+
+
final class Foobar {
+    fileprivate let goodSubject: CurrentValueSubject<String, Never>
+}
+
+
final class Foobar {
+    private let goodSubject: CurrentValueSubject<String, Never> = .ini("toto")
+}
+
+
final class Foobar {
+    private let goodSubject = PassthroughSubject<Set<String>, Never>()
+}
+
+
final class Foobar {
+    private let goodSubject: PassthroughSubject<Set<String>, Never> = .init()
+}
+
+
final class Foobar {
+    private let goodSubject: CurrentValueSubject<Set<String>, Never> = .init([])
+}
+
+
final class Foobar {
+    private let goodSubject =
+        PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    private let goodSubject:
+        PassthroughSubject<Bool, Never> = .ini()
+}
+
+
final class Foobar {
+    private let goodSubject =
+        CurrentValueSubject<Bool, Never>(true)
+}
+
+

Triggering Examples

+
final class Foobar {
+    let ↓badSubject = PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    let ↓badSubject: PassthroughSubject<Bool, Never>
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject: PassthroughSubject<Bool, Never>
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    let goodSubject: PassthroughSubject<Bool, Never> = .ini()
+}
+
+
final class Foobar {
+    private let goodSubject: PassthroughSubject<Bool, Never>
+    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
+    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject = PassthroughSubject<Bool, Never>()
+    private let goodSubject: PassthroughSubject<Bool, Never>
+    private(set) let ↓anotherBadSubject = PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    let ↓badSubject = CurrentValueSubject<Bool, Never>(true)
+}
+
+
final class Foobar {
+    let ↓badSubject: CurrentValueSubject<Bool, Never>
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject: CurrentValueSubject<Bool, Never>
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
+}
+
+
final class Foobar {
+    let goodSubject: CurrentValueSubject<String, Never> = .init("toto")
+}
+
+
final class Foobar {
+    private let goodSubject: CurrentValueSubject<Bool, Never>
+    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
+    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(false)
+}
+
+
final class Foobar {
+    private(set) let ↓badSubject = CurrentValueSubject<Bool, Never>(false)
+    private let goodSubject: CurrentValueSubject<Bool, Never>
+    private(set) let ↓anotherBadSubject = CurrentValueSubject<Bool, Never>(true)
+}
+
+
final class Foobar {
+    let ↓badSubject = PassthroughSubject<Set<String>, Never>()
+}
+
+
final class Foobar {
+    let ↓badSubject: PassthroughSubject<Set<String>, Never> = .init()
+}
+
+
final class Foobar {
+    let ↓badSubject: CurrentValueSubject<Set<String>, Never> = .init([])
+}
+
+
final class Foobar {
+    let ↓badSubject =
+        PassthroughSubject<Bool, Never>()
+}
+
+
final class Foobar {
+    let ↓badSubject:
+        PassthroughSubject<Bool, Never> = .ini()
+}
+
+
final class Foobar {
+    let ↓badSubject =
+        CurrentValueSubject<Bool, Never>(true)
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_unit_test.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_unit_test.html new file mode 100644 index 000000000..c10835675 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/private_unit_test.html @@ -0,0 +1,415 @@ + + + + private_unit_test Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Private Unit Test

+ +

Unit tests marked private are silently skipped.

+ +
    +
  • Identifier: private_unit_test
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: XCTestCase
  • +
+

Non Triggering Examples

+
class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
internal class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
public class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
@objc private class FooTest: XCTestCase {
+    @objc private func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
private class Foo: NSObject {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
private class Foo {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+}
+
+
public class FooTest: XCTestCase {
+    private func test1(param: Int) {}
+    private func test2() -> String { "" }
+    private func atest() {}
+    private static func test3() {}
+}
+
+

Triggering Examples

+
private ↓class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+    private func test4() {}
+}
+
+
class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+    private ↓func test4() {}
+}
+
+
internal class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+    private ↓func test4() {}
+}
+
+
public class FooTest: XCTestCase {
+    func test1() {}
+    internal func test2() {}
+    public func test3() {}
+    private ↓func test4() {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_interface_builder.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_interface_builder.html new file mode 100644 index 000000000..da5cd8b73 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_interface_builder.html @@ -0,0 +1,360 @@ + + + + prohibited_interface_builder Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prohibited Interface Builder

+ +

Creating views using Interface Builder should be avoided.

+ +
    +
  • Identifier: prohibited_interface_builder
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class ViewController: UIViewController {
+    var label: UILabel!
+}
+
+
class ViewController: UIViewController {
+    @objc func buttonTapped(_ sender: UIButton) {}
+}
+
+

Triggering Examples

+
class ViewController: UIViewController {
+    @IBOutlet ↓var label: UILabel!
+}
+
+
class ViewController: UIViewController {
+    @IBAction ↓func buttonTapped(_ sender: UIButton) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_super_call.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_super_call.html new file mode 100644 index 000000000..ae9d72340 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/prohibited_super_call.html @@ -0,0 +1,393 @@ + + + + prohibited_super_call Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Prohibited calls to super

+ +

Some methods should not call super

+ +
    +
  • Identifier: prohibited_super_call
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, excluded: [[]], included: [[“*”]]
  • +
+

Non Triggering Examples

+
class VC: UIViewController {
+    override func loadView() {
+    }
+}
+
+
class NSView {
+    func updateLayer() {
+        self.method1()
+    }
+}
+
+
public class FileProviderExtension: NSFileProviderExtension {
+    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {
+        guard let identifier = persistentIdentifierForItem(at: url) else {
+            completionHandler(NSFileProviderError(.noSuchItem))
+            return
+        }
+    }
+}
+
+

Triggering Examples

+
class VC: UIViewController {
+    override func loadView() {↓
+        super.loadView()
+    }
+}
+
+
class VC: NSFileProviderExtension {
+    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {↓
+        self.method1()
+        super.providePlaceholder(at:url, completionHandler: completionHandler)
+    }
+}
+
+
class VC: NSView {
+    override func updateLayer() {↓
+        self.method1()
+        super.updateLayer()
+        self.method2()
+    }
+}
+
+
class VC: NSView {
+    override func updateLayer() {↓
+        defer {
+            super.updateLayer()
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/protocol_property_accessors_order.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/protocol_property_accessors_order.html new file mode 100644 index 000000000..564c10362 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/protocol_property_accessors_order.html @@ -0,0 +1,360 @@ + + + + protocol_property_accessors_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Protocol Property Accessors Order

+ +

When declaring properties in protocols, the order of accessors should be get set.

+ +
    +
  • Identifier: protocol_property_accessors_order
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
protocol Foo {
+ var bar: String { get set }
+ }
+
+
protocol Foo {
+ var bar: String { get }
+ }
+
+
protocol Foo {
+ var bar: String { set }
+ }
+
+

Triggering Examples

+
protocol Foo {
+ var bar: String { ↓set get }
+ }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_call.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_call.html new file mode 100644 index 000000000..07e7b7001 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_call.html @@ -0,0 +1,605 @@ + + + + quick_discouraged_call Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Quick Discouraged Call

+ +

Discouraged call inside ‘describe’ and/or ‘context’ block.

+ +
    +
  • Identifier: quick_discouraged_call
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           beforeEach {
+               let foo = Foo()
+               foo.toto()
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           beforeEach {
+               let foo = Foo()
+               foo.toto()
+           }
+           afterEach {
+               let foo = Foo()
+               foo.toto()
+           }
+           describe("bar") {
+           }
+           context("bar") {
+           }
+           it("bar") {
+               let foo = Foo()
+               foo.toto()
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+          itBehavesLike("bar")
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           it("does something") {
+               let foo = Foo()
+               foo.toto()
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       context("foo") {
+           afterEach { toto.append(foo) }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       xcontext("foo") {
+           afterEach { toto.append(foo) }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       xdescribe("foo") {
+           afterEach { toto.append(foo) }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           xit("does something") {
+               let foo = Foo()
+               foo.toto()
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       fcontext("foo") {
+           afterEach { toto.append(foo) }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       fdescribe("foo") {
+           afterEach { toto.append(foo) }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           fit("does something") {
+               let foo = Foo()
+               foo.toto()
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       fitBehavesLike("foo")
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       xitBehavesLike("foo")
+   }
+}
+
+

Triggering Examples

+
class TotoTests {
+   override func spec() {
+       describe("foo") {
+           let foo = Foo()
+       }
+   }
+}
+class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           context("foo") {
+               let foo = ↓Foo()
+           }
+           context("bar") {
+               let foo = ↓Foo()
+               ↓foo.bar()
+               it("does something") {
+                   let foo = Foo()
+                   foo.toto()
+               }
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           context("foo") {
+               context("foo") {
+                   beforeEach {
+                       let foo = Foo()
+                       foo.toto()
+                   }
+                   it("bar") {
+                   }
+                   context("foo") {
+                       let foo = ↓Foo()
+                   }
+               }
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       context("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       sharedExamples("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           ↓foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       context("foo") {
+           ↓foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       sharedExamples("foo") {
+           ↓foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       xdescribe("foo") {
+           let foo = ↓Foo()
+       }
+       fdescribe("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       xcontext("foo") {
+           let foo = ↓Foo()
+       }
+       fcontext("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+
class TotoTests: QuickSpecSubclass {
+   override func spec() {
+       xcontext("foo") {
+           let foo = ↓Foo()
+       }
+       fcontext("foo") {
+           let foo = ↓Foo()
+       }
+   }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html new file mode 100644 index 000000000..5dc5fa0bb --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_focused_test.html @@ -0,0 +1,413 @@ + + + + quick_discouraged_focused_test Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Quick Discouraged Focused Test

+ +

Discouraged focused test. Other tests won’t run while this one is focused.

+ +
    +
  • Identifier: quick_discouraged_focused_test
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           describe("bar") { }
+           context("bar") {
+               it("bar") { }
+           }
+           it("bar") { }
+           itBehavesLike("bar")
+       }
+   }
+}
+
+

Triggering Examples

+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓fdescribe("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓fcontext("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓fit("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           ↓fit("bar") { }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       context("foo") {
+           ↓fit("bar") { }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           context("bar") {
+               ↓fit("toto") { }
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓fitBehavesLike("foo")
+   }
+}
+
+
class TotoTests: QuickSpecSubclass {
+   override func spec() {
+       ↓fitBehavesLike("foo")
+   }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html new file mode 100644 index 000000000..f0d737bb1 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/quick_discouraged_pending_test.html @@ -0,0 +1,419 @@ + + + + quick_discouraged_pending_test Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Quick Discouraged Pending Test

+ +

Discouraged pending test. This test won’t run while it’s marked as pending.

+ +
    +
  • Identifier: quick_discouraged_pending_test
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           describe("bar") { }
+           context("bar") {
+               it("bar") { }
+           }
+           it("bar") { }
+           itBehavesLike("bar")
+       }
+   }
+}
+
+

Triggering Examples

+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓xdescribe("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓xcontext("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓xit("foo") { }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           ↓xit("bar") { }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       context("foo") {
+           ↓xit("bar") { }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       describe("foo") {
+           context("bar") {
+               ↓xit("toto") { }
+           }
+       }
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓pending("foo")
+   }
+}
+
+
class TotoTests: QuickSpec {
+   override func spec() {
+       ↓xitBehavesLike("foo")
+   }
+}
+
+
class TotoTests: QuickSpecSubclass {
+   override func spec() {
+       ↓xitBehavesLike("foo")
+   }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html new file mode 100644 index 000000000..27ddeed2f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/raw_value_for_camel_cased_codable_enum.html @@ -0,0 +1,409 @@ + + + + raw_value_for_camel_cased_codable_enum Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Raw Value For Camel Cased Codable Enum

+ +

Camel cased cases of Codable String enums should have raw value.

+ +
    +
  • Identifier: raw_value_for_camel_cased_codable_enum
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum Numbers: Codable {
+  case int(Int)
+  case short(Int16)
+}
+
+
enum Numbers: Int, Codable {
+  case one = 1
+  case two = 2
+}
+
+
enum Numbers: Double, Codable {
+  case one = 1.1
+  case two = 2.2
+}
+
+
enum Numbers: String, Codable {
+  case one = "one"
+  case two = "two"
+}
+
+
enum Status: String, Codable {
+    case OK, ACCEPTABLE
+}
+
+
enum Status: String, Codable {
+    case ok
+    case maybeAcceptable = "maybe_acceptable"
+}
+
+
enum Status: String {
+    case ok
+    case notAcceptable
+    case maybeAcceptable = "maybe_acceptable"
+}
+
+
enum Status: Int, Codable {
+    case ok
+    case notAcceptable
+    case maybeAcceptable = -1
+}
+
+

Triggering Examples

+
enum Status: String, Codable {
+    case ok
+    case ↓notAcceptable
+    case maybeAcceptable = "maybe_acceptable"
+}
+
+
enum Status: String, Decodable {
+   case ok
+   case ↓notAcceptable
+   case maybeAcceptable = "maybe_acceptable"
+}
+
+
enum Status: String, Encodable {
+   case ok
+   case ↓notAcceptable
+   case maybeAcceptable = "maybe_acceptable"
+}
+
+
enum Status: String, Codable {
+    case ok
+    case ↓notAcceptable
+    case maybeAcceptable = "maybe_acceptable"
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_boolean.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_boolean.html new file mode 100644 index 000000000..37b33544f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_boolean.html @@ -0,0 +1,364 @@ + + + + reduce_boolean Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Reduce Boolean

+ +

Prefer using .allSatisfy() or .contains() over reduce(true) or reduce(false)

+ +
    +
  • Identifier: reduce_boolean
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
nums.reduce(0) { $0.0 + $0.1 }
+
+
nums.reduce(0.0) { $0.0 + $0.1 }
+
+

Triggering Examples

+
let allNines = nums.↓reduce(true) { $0.0 && $0.1 == 9 }
+
+
let anyNines = nums.↓reduce(false) { $0.0 || $0.1 == 9 }
+
+
let allValid = validators.↓reduce(true) { $0 && $1(input) }
+
+
let anyValid = validators.↓reduce(false) { $0 || $1(input) }
+
+
let allNines = nums.↓reduce(true, { $0.0 && $0.1 == 9 })
+
+
let anyNines = nums.↓reduce(false, { $0.0 || $0.1 == 9 })
+
+
let allValid = validators.↓reduce(true, { $0 && $1(input) })
+
+
let anyValid = validators.↓reduce(false, { $0 || $1(input) })
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_into.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_into.html new file mode 100644 index 000000000..b5d30e3c3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/reduce_into.html @@ -0,0 +1,419 @@ + + + + reduce_into Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Reduce Into

+ +

Prefer reduce(into:_:) over reduce(_:_:) for copy-on-write types

+ +
    +
  • Identifier: reduce_into
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = values.reduce(into: "abc") { $0 += "\($1)" }
+
+
values.reduce(into: Array<Int>()) { result, value in
+    result.append(value)
+}
+
+
let rows = violations.enumerated().reduce(into: "") { rows, indexAndViolation in
+    rows.append(generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1))
+}
+
+
zip(group, group.dropFirst()).reduce(into: []) { result, pair in
+    result.append(pair.0 + pair.1)
+}
+
+
let foo = values.reduce(into: [String: Int]()) { result, value in
+    result["\(value)"] = value
+}
+
+
let foo = values.reduce(into: Dictionary<String, Int>.init()) { result, value in
+    result["\(value)"] = value
+}
+
+
let foo = values.reduce(into: [Int](repeating: 0, count: 10)) { result, value in
+    result.append(value)
+}
+
+
let foo = values.reduce(MyClass()) { result, value in
+    result.handleValue(value)
+    return result
+}
+
+

Triggering Examples

+
let bar = values.↓reduce("abc") { $0 + "\($1)" }
+
+
values.↓reduce(Array<Int>()) { result, value in
+    result += [value]
+}
+
+
[1, 2, 3].↓reduce(Set<Int>()) { acc, value in
+    var result = acc
+    result.insert(value)
+    return result
+}
+
+
let rows = violations.enumerated().↓reduce("") { rows, indexAndViolation in
+    return rows + generateSingleRow(for: indexAndViolation.1, at: indexAndViolation.0 + 1)
+}
+
+
zip(group, group.dropFirst()).↓reduce([]) { result, pair in
+    result + [pair.0 + pair.1]
+}
+
+
let foo = values.↓reduce([String: Int]()) { result, value in
+    var result = result
+    result["\(value)"] = value
+    return result
+}
+
+
let bar = values.↓reduce(Dictionary<String, Int>.init()) { result, value in
+    var result = result
+    result["\(value)"] = value
+    return result
+}
+
+
let bar = values.↓reduce([Int](repeating: 0, count: 10)) { result, value in
+    return result + [value]
+}
+
+
extension Data {
+    var hexString: String {
+        return ↓reduce("") { (output, byte) -> String in
+            output + String(format: "%02x", byte)
+        }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_discardable_let.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_discardable_let.html new file mode 100644 index 000000000..3a86181a8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_discardable_let.html @@ -0,0 +1,366 @@ + + + + redundant_discardable_let Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Discardable Let

+ +

Prefer _ = foo() over let _ = foo() when discarding a result from a function.

+ +
    +
  • Identifier: redundant_discardable_let
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
_ = foo()
+
+
+
if let _ = foo() { }
+
+
+
guard let _ = foo() else { return }
+
+
+
let _: ExplicitType = foo()
+
+
while let _ = SplashStyle(rawValue: maxValue) { maxValue += 1 }
+
+
+
async let _ = await foo()
+
+

Triggering Examples

+
↓let _ = foo()
+
+
+
if _ = foo() { ↓let _ = bar() }
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_nil_coalescing.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_nil_coalescing.html new file mode 100644 index 000000000..cc9049cbe --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_nil_coalescing.html @@ -0,0 +1,350 @@ + + + + redundant_nil_coalescing Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Nil Coalescing

+ +

nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant

+ +
    +
  • Identifier: redundant_nil_coalescing
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var myVar: Int?; myVar ?? 0
+
+
+

Triggering Examples

+
var myVar: Int? = nil; myVar ↓?? nil
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_objc_attribute.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_objc_attribute.html new file mode 100644 index 000000000..3b827dc9e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_objc_attribute.html @@ -0,0 +1,485 @@ + + + + redundant_objc_attribute Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant @objc Attribute

+ +

Objective-C attribute (@objc) is redundant in declaration.

+ +
    +
  • Identifier: redundant_objc_attribute
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
@objc private var foo: String? {}
+
+
@IBInspectable private var foo: String? {}
+
+
@objc private func foo(_ sender: Any) {}
+
+
@IBAction private func foo(_ sender: Any) {}
+
+
@GKInspectable private var foo: String! {}
+
+
private @GKInspectable var foo: String! {}
+
+
@NSManaged var foo: String!
+
+
@objc @NSCopying var foo: String!
+
+
@objcMembers
+class Foo {
+    var bar: Any?
+    @objc
+    class Bar {
+        @objc
+        var foo: Any?
+    }
+}
+
+
@objc
+extension Foo {
+    var bar: Int {
+        return 0
+    }
+}
+
+
extension Foo {
+    @objc
+    var bar: Int { return 0 }
+}
+
+
@objc @IBDesignable
+extension Foo {
+    var bar: Int { return 0 }
+}
+
+
@IBDesignable
+extension Foo {
+    @objc
+    var bar: Int { return 0 }
+    var fooBar: Int { return 1 }
+}
+
+
@objcMembers
+class Foo: NSObject {
+    @objc
+    private var bar: Int {
+        return 0
+    }
+}
+
+
@objcMembers
+class Foo {
+    class Bar: NSObject {
+        @objc var foo: Any
+    }
+}
+
+
@objcMembers
+class Foo {
+    @objc class Bar {}
+}
+
+
extension BlockEditorSettings {
+    @objc(addElementsObject:)
+    @NSManaged public func addToElements(_ value: BlockEditorSettingElement)
+}
+
+

Triggering Examples

+
↓@objc @IBInspectable private var foo: String? {}
+
+
@IBInspectable ↓@objc private var foo: String? {}
+
+
↓@objc @IBAction private func foo(_ sender: Any) {}
+
+
@IBAction ↓@objc private func foo(_ sender: Any) {}
+
+
↓@objc @GKInspectable private var foo: String! {}
+
+
@GKInspectable ↓@objc private var foo: String! {}
+
+
↓@objc @NSManaged private var foo: String!
+
+
@NSManaged ↓@objc private var foo: String!
+
+
↓@objc @IBDesignable class Foo {}
+
+
@objcMembers
+class Foo {
+    ↓@objc var bar: Any?
+}
+
+
@objcMembers
+class Foo {
+    ↓@objc var bar: Any?
+    ↓@objc var foo: Any?
+    @objc
+    class Bar {
+        @objc
+        var foo: Any?
+    }
+}
+
+
@objc
+extension Foo {
+    ↓@objc
+    var bar: Int {
+        return 0
+    }
+}
+
+
@objc @IBDesignable
+extension Foo {
+    ↓@objc
+    var bar: Int {
+        return 0
+    }
+}
+
+
@objcMembers
+class Foo {
+    @objcMembers
+    class Bar: NSObject {
+        ↓@objc var foo: Any
+    }
+}
+
+
@objc
+extension Foo {
+    ↓@objc
+    private var bar: Int {
+        return 0
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_optional_initialization.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_optional_initialization.html new file mode 100644 index 000000000..fb63628a6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_optional_initialization.html @@ -0,0 +1,405 @@ + + + + redundant_optional_initialization Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Optional Initialization

+ +

Initializing an optional variable with nil is redundant.

+ +
    +
  • Identifier: redundant_optional_initialization
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var myVar: Int?
+
+
+
let myVar: Int? = nil
+
+
+
var myVar: Int? = 0
+
+
+
func foo(bar: Int? = 0) { }
+
+
+
var myVar: Optional<Int>
+
+
+
let myVar: Optional<Int> = nil
+
+
+
var myVar: Optional<Int> = 0
+
+
+
var foo: Int? {
+  if bar != nil { }
+  return 0
+}
+
+
var foo: Int? = {
+  if bar != nil { }
+  return 0
+}()
+
+
lazy var test: Int? = nil
+
+
func funcName() {
+  var myVar: String?
+}
+
+
func funcName() {
+  let myVar: String? = nil
+}
+
+

Triggering Examples

+
var myVar: Int?↓ = nil
+
+
+
var myVar: Optional<Int>↓ = nil
+
+
+
var myVar: Int?↓=nil
+
+
+
var myVar: Optional<Int>↓=nil
+)
+
+
var myVar: String?↓ = nil {
+  didSet { print("didSet") }
+}
+
+
func funcName() {
+    var myVar: String?↓ = nil
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_set_access_control.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_set_access_control.html new file mode 100644 index 000000000..34cf1dd23 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_set_access_control.html @@ -0,0 +1,384 @@ + + + + redundant_set_access_control Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Set Access Control Rule

+ +

Property setter access level shouldn’t be explicit if it’s the same as the variable access level.

+ +
    +
  • Identifier: redundant_set_access_control
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
private(set) public var foo: Int
+
+
public let foo: Int
+
+
public var foo: Int
+
+
var foo: Int
+
+
private final class A {
+  private(set) var value: Int
+}
+
+
extension Color {
+    public internal(set) static var someColor = Color.anotherColor
+}
+
+

Triggering Examples

+
↓private(set) private var foo: Int
+
+
↓fileprivate(set) fileprivate var foo: Int
+
+
↓internal(set) internal var foo: Int
+
+
↓public(set) public var foo: Int
+
+
open class Foo {
+  ↓open(set) open var bar: Int
+}
+
+
class A {
+  ↓internal(set) var value: Int
+}
+
+
internal class A {
+  ↓internal(set) var value: Int
+}
+
+
fileprivate class A {
+  ↓fileprivate(set) var value: Int
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_string_enum_value.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_string_enum_value.html new file mode 100644 index 000000000..b0a2924f9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_string_enum_value.html @@ -0,0 +1,381 @@ + + + + redundant_string_enum_value Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant String Enum Value

+ +

String enum values can be omitted when they are equal to the enumcase name.

+ +
    +
  • Identifier: redundant_string_enum_value
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
enum Numbers: String {
+  case one
+  case two
+}
+
+
enum Numbers: Int {
+  case one = 1
+  case two = 2
+}
+
+
enum Numbers: String {
+  case one = "ONE"
+  case two = "TWO"
+}
+
+
enum Numbers: String {
+  case one = "ONE"
+  case two = "two"
+}
+
+
enum Numbers: String {
+  case one, two
+}
+
+

Triggering Examples

+
enum Numbers: String {
+  case one = ↓"one"
+  case two = ↓"two"
+}
+
+
enum Numbers: String {
+  case one = ↓"one", two = ↓"two"
+}
+
+
enum Numbers: String {
+  case one, two = ↓"two"
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_type_annotation.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_type_annotation.html new file mode 100644 index 000000000..b224295d6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_type_annotation.html @@ -0,0 +1,391 @@ + + + + redundant_type_annotation Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Type Annotation

+ +

Variables should not have redundant type annotation

+ +
    +
  • Identifier: redundant_type_annotation
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var url = URL()
+
+
var url: CustomStringConvertible = URL()
+
+
@IBInspectable var color: UIColor = UIColor.white
+
+
enum Direction {
+    case up
+    case down
+}
+
+var direction: Direction = .up
+
+
enum Direction {
+    case up
+    case down
+}
+
+var direction = Direction.up
+
+

Triggering Examples

+
var url↓:URL=URL()
+
+
var url↓:URL = URL(string: "")
+
+
var url↓: URL = URL()
+
+
let url↓: URL = URL()
+
+
lazy var url↓: URL = URL()
+
+
let alphanumerics↓: CharacterSet = CharacterSet.alphanumerics
+
+
class ViewController: UIViewController {
+  func someMethod() {
+    let myVar↓: Int = Int(5)
+  }
+}
+
+
var isEnabled↓: Bool = true
+
+
enum Direction {
+    case up
+    case down
+}
+
+var direction↓: Direction = Direction.up
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_void_return.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_void_return.html new file mode 100644 index 000000000..1a403ad91 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/redundant_void_return.html @@ -0,0 +1,399 @@ + + + + redundant_void_return Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Redundant Void Return

+ +

Returning Void in a function declaration is redundant.

+ +
    +
  • Identifier: redundant_void_return
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo() {}
+
+
+
func foo() -> Int {}
+
+
+
func foo() -> Int -> Void {}
+
+
+
func foo() -> VoidResponse
+
+
+
let foo: (Int) -> Void
+
+
+
func foo() -> Int -> () {}
+
+
+
let foo: (Int) -> ()
+
+
+
func foo() -> ()?
+
+
+
func foo() -> ()!
+
+
+
func foo() -> Void?
+
+
+
func foo() -> Void!
+
+
+
struct A {
+    subscript(key: String) {
+        print(key)
+    }
+}
+
+

Triggering Examples

+
func foo()↓ -> Void {}
+
+
+
protocol Foo {
+  func foo()↓ -> Void
+}
+
+
func foo()↓ -> () {}
+
+
+
func foo()↓ -> ( ) {}
+
+
protocol Foo {
+  func foo()↓ -> ()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_deinit.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_deinit.html new file mode 100644 index 000000000..01750d33c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_deinit.html @@ -0,0 +1,389 @@ + + + + required_deinit Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Required Deinit

+ +

Classes should have an explicit deinit method.

+ +
    +
  • Identifier: required_deinit
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Apple {
+    deinit { }
+}
+
+
enum Banana { }
+
+
protocol Cherry { }
+
+
struct Damson { }
+
+
class Outer {
+    deinit { print("Deinit Outer") }
+    class Inner {
+        deinit { print("Deinit Inner") }
+    }
+}
+
+

Triggering Examples

+
↓class Apple { }
+
+
↓class Banana: NSObject, Equatable { }
+
+
↓class Cherry {
+    // deinit { }
+}
+
+
↓class Damson {
+    func deinitialize() { }
+}
+
+
class Outer {
+    func hello() -> String { return "outer" }
+    deinit { }
+    ↓class Inner {
+        func hello() -> String { return "inner" }
+    }
+}
+
+
↓class Outer {
+    func hello() -> String { return "outer" }
+    class Inner {
+        func hello() -> String { return "inner" }
+        deinit { }
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_enum_case.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_enum_case.html new file mode 100644 index 000000000..46e33205d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/required_enum_case.html @@ -0,0 +1,387 @@ + + + + required_enum_case Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Required Enum Case

+ +

Enums conforming to a specified protocol must implement a specific case(s).

+ +
    +
  • Identifier: required_enum_case
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: No protocols configured. In config add ‘required_enum_case’ to ‘opt_in_rules’ and config using :
  • +
+ +

‘required_enum_case: + {Protocol Name}: + {Case Name}:{warning|error} + {Case Name}:{warning|error}

+

Non Triggering Examples

+
enum MyNetworkResponse: String, NetworkResponsable {
+    case success, error, notConnected
+}
+
+
enum MyNetworkResponse: String, NetworkResponsable {
+    case success, error, notConnected(error: Error)
+}
+
+
enum MyNetworkResponse: String, NetworkResponsable {
+    case success
+    case error
+    case notConnected
+}
+
+
enum MyNetworkResponse: String, NetworkResponsable {
+    case success
+    case error
+    case notConnected(error: Error)
+}
+
+

Triggering Examples

+
↓enum MyNetworkResponse: String, NetworkResponsable {
+    case success, error
+}
+
+
↓enum MyNetworkResponse: String, NetworkResponsable {
+    case success, error
+}
+
+
↓enum MyNetworkResponse: String, NetworkResponsable {
+    case success
+    case error
+}
+
+
↓enum MyNetworkResponse: String, NetworkResponsable {
+    case success
+    case error
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_arrow_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_arrow_whitespace.html new file mode 100644 index 000000000..89f91941a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_arrow_whitespace.html @@ -0,0 +1,416 @@ + + + + return_arrow_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Returning Whitespace

+ +

Return arrow and return type should be separated by a single space or on a separate line.

+ +
    +
  • Identifier: return_arrow_whitespace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func abc() -> Int {}
+
+
+
func abc() -> [Int] {}
+
+
+
func abc() -> (Int, Int) {}
+
+
+
var abc = {(param: Int) -> Void in }
+
+
+
func abc() ->
+    Int {}
+
+
+
func abc()
+    -> Int {}
+
+
+
func reallyLongFunctionMethods<T>(withParam1: Int, param2: String, param3: Bool) where T: AGenericConstraint
+    -> Int {
+    return 1
+}
+
+
typealias SuccessBlock = ((Data) -> Void)
+
+

Triggering Examples

+
func abc()↓->Int {}
+
+
+
func abc()↓->[Int] {}
+
+
+
func abc()↓->(Int, Int) {}
+
+
+
func abc()↓-> Int {}
+
+
+
func abc()↓->   Int {}
+
+
+
func abc()↓ ->Int {}
+
+
+
func abc()↓  ->  Int {}
+
+
+
var abc = {(param: Int)↓ ->Bool in }
+
+
+
var abc = {(param: Int)↓->Bool in }
+
+
+
typealias SuccessBlock = ((Data)↓->Void)
+
+
func abc()
+  ↓->  Int {}
+
+
+
func abc()
+ ↓->  Int {}
+
+
+
func abc()↓  ->
+  Int {}
+
+
+
func abc()↓  ->
+Int {}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_value_from_void_function.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_value_from_void_function.html new file mode 100644 index 000000000..c29b05c2f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/return_value_from_void_function.html @@ -0,0 +1,540 @@ + + + + return_value_from_void_function Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Return Value from Void Function

+ +

Returning values from Void functions should be avoided.

+ +
    +
  • Identifier: return_value_from_void_function
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func foo() {
+    return
+}
+
+
func foo() {
+    return /* a comment */
+}
+
+
func foo() -> Int {
+    return 1
+}
+
+
func foo() -> Void {
+    if condition {
+        return
+    }
+    bar()
+}
+
+
func foo() {
+    return;
+    bar()
+}
+
+
func test() {}
+
+
init?() {
+    guard condition else {
+        return nil
+    }
+}
+
+
init?(arg: String?) {
+    guard arg != nil else {
+        return nil
+    }
+}
+
+
func test() {
+    guard condition else {
+        return
+    }
+}
+
+
func test() -> Result<String, Error> {
+    func other() {}
+    func otherVoid() -> Void {}
+}
+
+
func test() -> Int? {
+    return nil
+}
+
+
func test() {
+    if bar {
+        print("")
+        return
+    }
+    let foo = [1, 2, 3].filter { return true }
+    return
+}
+
+
func test() {
+    guard foo else {
+        bar()
+        return
+    }
+}
+
+
func spec() {
+    var foo: Int {
+        return 0
+    }
+
+

Triggering Examples

+
func foo() {
+    ↓return bar()
+}
+
+
func foo() {
+    ↓return self.bar()
+}
+
+
func foo() -> Void {
+    ↓return bar()
+}
+
+
func foo() -> Void {
+    ↓return /* comment */ bar()
+}
+
+
func foo() {
+    ↓return
+    self.bar()
+}
+
+
func foo() {
+    variable += 1
+    ↓return
+    variable += 1
+}
+
+
func initThing() {
+    guard foo else {
+        ↓return print("")
+    }
+}
+
+
// Leading comment
+func test() {
+    guard condition else {
+        ↓return assertionfailure("")
+    }
+}
+
+
func test() -> Result<String, Error> {
+    func other() {
+        guard false else {
+            ↓return assertionfailure("")
+        }
+    }
+    func otherVoid() -> Void {}
+}
+
+
func test() {
+    guard conditionIsTrue else {
+        sideEffects()
+        return // comment
+    }
+    guard otherCondition else {
+        ↓return assertionfailure("")
+    }
+    differentSideEffect()
+}
+
+
func test() {
+    guard otherCondition else {
+        ↓return assertionfailure(""); // comment
+    }
+    differentSideEffect()
+}
+
+
func test() {
+  if x {
+    ↓return foo()
+  }
+  bar()
+}
+
+
func test() {
+  switch x {
+    case .a:
+      ↓return foo() // return to skip baz()
+    case .b:
+      bar()
+  }
+  baz()
+}
+
+
func test() {
+  if check {
+    if otherCheck {
+      ↓return foo()
+    }
+  }
+  bar()
+}
+
+
func test() {
+    ↓return foo()
+}
+
+
func test() {
+  ↓return foo({
+    return bar()
+  })
+}
+
+
func test() {
+  guard x else {
+    ↓return foo()
+  }
+  bar()
+}
+
+
func test() {
+  let closure: () -> () = {
+    return assert()
+  }
+  if check {
+    if otherCheck {
+      return // comments are fine
+    }
+  }
+  ↓return foo()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/rule-directory.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/rule-directory.html new file mode 100644 index 000000000..751783307 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/rule-directory.html @@ -0,0 +1,558 @@ + + + + Rule Directory Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Rule Directory

+

Default Rules

+ + +

Opt-In Rules

+ + + +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/search.json b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/search.json new file mode 100644 index 000000000..121c413a2 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/search.json @@ -0,0 +1 @@ +{"Structs/XcodeReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"XcodeReporter"},"Structs/XcodeReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"XcodeReporter"},"Structs/XcodeReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"XcodeReporter"},"Structs/XcodeReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"XcodeReporter"},"Structs/SonarQubeReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"SonarQubeReporter"},"Structs/SonarQubeReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"SonarQubeReporter"},"Structs/SonarQubeReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"SonarQubeReporter"},"Structs/SonarQubeReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"SonarQubeReporter"},"Structs/GitLabJUnitReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"GitLabJUnitReporter"},"Structs/GitLabJUnitReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"GitLabJUnitReporter"},"Structs/GitLabJUnitReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"GitLabJUnitReporter"},"Structs/GitLabJUnitReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"GitLabJUnitReporter"},"Structs/ReasonedRuleViolation.html#/s:18SwiftLintFramework21ReasonedRuleViolationV8position0A6Syntax16AbsolutePositionVvp":{"name":"position","abstract":"

The violation’s position.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:18SwiftLintFramework21ReasonedRuleViolationV6reasonSSSgvp":{"name":"reason","abstract":"

A specific reason for the violation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:18SwiftLintFramework21ReasonedRuleViolationV8severityAA0F8SeverityOSgvp":{"name":"severity","abstract":"

The violation’s severity.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:18SwiftLintFramework21ReasonedRuleViolationV8position6reason8severityAC0A6Syntax16AbsolutePositionV_SSSgAA0F8SeverityOSgtcfc":{"name":"init(position:reason:severity:)","abstract":"

Creates a ReasonedRuleViolation.

","parent_name":"ReasonedRuleViolation"},"Structs/ReasonedRuleViolation.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ReasonedRuleViolation"},"Structs/YamlParser.html#/s:18SwiftLintFramework10YamlParserV5parse_3envSDySSypGSS_SDyS2SGtKFZ":{"name":"parse(_:env:)","abstract":"

Parses the input YAML string as an untyped dictionary.

","parent_name":"YamlParser"},"Structs/Version.html#/s:18SwiftLintFramework7VersionV5valueSSvp":{"name":"value","abstract":"

The string value for this version.

","parent_name":"Version"},"Structs/Version.html#/s:18SwiftLintFramework7VersionV7currentACvpZ":{"name":"current","abstract":"

The current SwiftLint version.

","parent_name":"Version"},"Structs/SwiftVersion.html#/s:SY8RawValueQa":{"name":"RawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValue03RawB0Qzvp":{"name":"rawValue","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SY8rawValuexSg03RawB0Qz_tcfc":{"name":"init(rawValue:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV4fiveACvpZ":{"name":"five","abstract":"

Swift 5.0.x - https://swift.org/download/#swift-50

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV10fiveDotOneACvpZ":{"name":"fiveDotOne","abstract":"

Swift 5.1.x - https://swift.org/download/#swift-51

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV10fiveDotTwoACvpZ":{"name":"fiveDotTwo","abstract":"

Swift 5.2.x - https://swift.org/download/#swift-52

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV12fiveDotThreeACvpZ":{"name":"fiveDotThree","abstract":"

Swift 5.3.x - https://swift.org/download/#swift-53

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV11fiveDotFourACvpZ":{"name":"fiveDotFour","abstract":"

Swift 5.4.x - https://swift.org/download/#swift-54

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV11fiveDotFiveACvpZ":{"name":"fiveDotFive","abstract":"

Swift 5.5.x - https://swift.org/download/#swift-55

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV10fiveDotSixACvpZ":{"name":"fiveDotSix","abstract":"

Swift 5.6.x - https://swift.org/download/#swift-56

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV12fiveDotSevenACvpZ":{"name":"fiveDotSeven","abstract":"

Swift 5.7.x - https://swift.org/download/#swift-57

","parent_name":"SwiftVersion"},"Structs/SwiftVersion.html#/s:18SwiftLintFramework0A7VersionV7currentACvpZ":{"name":"current","abstract":"

The current detected Swift compiler version, based on the currently accessible SourceKit version.

","parent_name":"SwiftVersion"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV5value012SourceKittenC00dE0Vvp":{"name":"value","abstract":"

The raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV4kind012SourceKittenC00D4KindOSgvp":{"name":"kind","abstract":"

The syntax kind associated with is token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV5valueAC012SourceKittenC00dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxToken from the raw SyntaxToken obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV5range012SourceKittenC09ByteRangeVvp":{"name":"range","abstract":"

The byte range in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV6offset012SourceKittenC09ByteCountVvp":{"name":"offset","abstract":"

The starting byte offset in a source file for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxToken.html#/s:18SwiftLintFramework0aB11SyntaxTokenV6length012SourceKittenC09ByteCountVvp":{"name":"length","abstract":"

The length in bytes for this token.

","parent_name":"SwiftLintSyntaxToken"},"Structs/SwiftLintSyntaxMap.html#/s:18SwiftLintFramework0aB9SyntaxMapV5value012SourceKittenC00dE0Vvp":{"name":"value","abstract":"

The raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:18SwiftLintFramework0aB9SyntaxMapV6tokensSayAA0abD5TokenVGvp":{"name":"tokens","abstract":"

The SwiftLint-specific syntax tokens for this syntax map.

","parent_name":"SwiftLintSyntaxMap"},"Structs/SwiftLintSyntaxMap.html#/s:18SwiftLintFramework0aB9SyntaxMapV5valueAC012SourceKittenC00dE0V_tcfc":{"name":"init(value:)","abstract":"

Creates a SwiftLintSyntaxMap from the raw SyntaxMap obtained by SourceKitten.

","parent_name":"SwiftLintSyntaxMap"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV14ruleIdentifierSSvp":{"name":"ruleIdentifier","abstract":"

The identifier of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV15ruleDescriptionSSvp":{"name":"ruleDescription","abstract":"

The description of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV8ruleNameSSvp":{"name":"ruleName","abstract":"

The name of the rule that generated this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV8severityAA0E8SeverityOvp":{"name":"severity","abstract":"

The severity of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV8locationAA8LocationVvp":{"name":"location","abstract":"

The location of this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV6reasonSSvp":{"name":"reason","abstract":"

The justification for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV11descriptionSSvp":{"name":"description","abstract":"

A printable description for this violation.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV15ruleDescription8severity8location6reasonAcA04RuleG0V_AA0E8SeverityOAA8LocationVSSSgtcfc":{"name":"init(ruleDescription:severity:location:reason:)","abstract":"

Creates a StyleViolation by specifying its properties directly.

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV4with8severityAcA0E8SeverityO_tF":{"name":"with(severity:)","abstract":"

Returns the same violation, but with the severity that is passed in

","parent_name":"StyleViolation"},"Structs/StyleViolation.html#/s:18SwiftLintFramework14StyleViolationV4with8locationAcA8LocationV_tF":{"name":"with(location:)","abstract":"

Returns the same violation, but with the location that is passed in

","parent_name":"StyleViolation"},"Structs/RuleParameter.html#/s:18SwiftLintFramework13RuleParameterV8severityAA17ViolationSeverityOvp":{"name":"severity","abstract":"

The severity that should be assigned to the violation of this parameter’s value is met.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:18SwiftLintFramework13RuleParameterV5valuexvp":{"name":"value","abstract":"

The value to configure the rule.

","parent_name":"RuleParameter"},"Structs/RuleParameter.html#/s:18SwiftLintFramework13RuleParameterV8severity5valueACyxGAA17ViolationSeverityO_xtcfc":{"name":"init(severity:value:)","abstract":"

Creates a RuleParameter by specifying its properties directly.

","parent_name":"RuleParameter"},"Structs/RuleList.html#/s:18SwiftLintFramework8RuleListV4listSDySSAA0D0_pXpGvp":{"name":"list","abstract":"

The rules contained in this list.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:18SwiftLintFramework8RuleListV5rulesAcA0D0_pXpd_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:18SwiftLintFramework8RuleListV5rulesACSayAA0D0_pXpG_tcfc":{"name":"init(rules:)","abstract":"

Creates a RuleList by specifying all its rules.

","parent_name":"RuleList"},"Structs/RuleList.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleList"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV10identifierSSvp":{"name":"identifier","abstract":"

The rule’s unique identifier, to be used in configuration files and SwiftLint commands.","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV4nameSSvp":{"name":"name","abstract":"

The rule’s human-readable name. Should be short, descriptive and formatted in Title Case. May contain spaces.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV11descriptionSSvp":{"name":"description","abstract":"

The rule’s verbose description. Should read as a sentence or short paragraph. Good things to include are an","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV4kindAA0D4KindOvp":{"name":"kind","abstract":"

The RuleKind that best categorizes this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV21nonTriggeringExamplesSayAA7ExampleVGvp":{"name":"nonTriggeringExamples","abstract":"

Swift source examples that do not trigger a violation for this rule. Used for documentation purposes to inform","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV18triggeringExamplesSayAA7ExampleVGvp":{"name":"triggeringExamples","abstract":"

Swift source examples that do trigger one or more violations for this rule. Used for documentation purposes to","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV11correctionsSDyAA7ExampleVAFGvp":{"name":"corrections","abstract":"

Pairs of Swift source examples, where keys are examples that trigger violations for this rule, and the values","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV17deprecatedAliasesShySSGvp":{"name":"deprecatedAliases","abstract":"

Any previous iteration of the rule’s identifier that was previously shipped with SwiftLint.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV03minA7VersionAA0aG0Vvp":{"name":"minSwiftVersion","abstract":"

The oldest version of the Swift compiler supported by this rule.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV18requiresFileOnDiskSbvp":{"name":"requiresFileOnDisk","abstract":"

Whether or not this rule can only be executed on a file physically on-disk. Typically necessary for rules","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV07consoleE0SSvp":{"name":"consoleDescription","abstract":"

The console-printable string for this description.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV14allIdentifiersSaySSGvp":{"name":"allIdentifiers","abstract":"

All identifiers that have been used to uniquely identify this rule in past and current SwiftLint versions.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:18SwiftLintFramework15RuleDescriptionV10identifier4name11description4kind03minA7Version21nonTriggeringExamples010triggeringN011corrections17deprecatedAliases18requiresFileOnDiskACSS_S2SAA0D4KindOAA0aK0VSayAA7ExampleVGATSDyA2SGShySSGSbtcfc":{"name":"init(identifier:name:description:kind:minSwiftVersion:nonTriggeringExamples:triggeringExamples:corrections:deprecatedAliases:requiresFileOnDisk:)","abstract":"

Creates a RuleDescription by specifying all its properties directly.

","parent_name":"RuleDescription"},"Structs/RuleDescription.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"RuleDescription"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV5startAA8LocationVvp":{"name":"start","abstract":"

The location describing the start of the region. All locations that are less than this value","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV3endAA8LocationVvp":{"name":"end","abstract":"

The location describing the end of the region. All locations that are greater than this value","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV23disabledRuleIdentifiersShyAA0F10IdentifierOGvp":{"name":"disabledRuleIdentifiers","abstract":"

All SwiftLint rule identifiers that are disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV5start3end23disabledRuleIdentifiersAcA8LocationV_AHShyAA0H10IdentifierOGtcfc":{"name":"init(start:end:disabledRuleIdentifiers:)","abstract":"

Creates a Region by setting explicit values for all its properties.

","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV8containsySbAA8LocationVF":{"name":"contains(_:)","abstract":"

Whether the specific location is contained in this region.

","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV13isRuleEnabledySbAA0F0_pF":{"name":"isRuleEnabled(_:)","abstract":"

Whether the specified rule is enabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV14isRuleDisabledySbAA0F0_pF":{"name":"isRuleDisabled(_:)","abstract":"

Whether the specified rule is disabled in this region.

","parent_name":"Region"},"Structs/Region.html#/s:18SwiftLintFramework6RegionV26deprecatedAliasesDisabling4ruleShySSGAA4Rule_p_tF":{"name":"deprecatedAliasesDisabling(rule:)","abstract":"

Returns the deprecated rule aliases that are disabling the specified rule in this region.","parent_name":"Region"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4fileSSSgvp":{"name":"file","abstract":"

The file path on disk for this location.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4lineSiSgvp":{"name":"line","abstract":"

The line offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV9characterSiSgvp":{"name":"character","abstract":"

The character offset in the file for this location. 1-indexed.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV11descriptionSSvp":{"name":"description","abstract":"

A lossless printable description of this location.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV12relativeFileSSSgvp":{"name":"relativeFile","abstract":"

The file path for this location relative to the current working directory.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4file4line9characterACSSSg_SiSgAHtcfc":{"name":"init(file:line:character:)","abstract":"

Creates a Location by specifying its properties directly.

","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4file10byteOffsetAcA0aB4FileC_012SourceKittenC09ByteCountVtcfc":{"name":"init(file:byteOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a byte-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4file8positionAcA0aB4FileC_0A6Syntax16AbsolutePositionVtcfc":{"name":"init(file:position:)","abstract":"

Creates a Location based on a SwiftLintFile and a SwiftSyntax AbsolutePosition into the file.","parent_name":"Location"},"Structs/Location.html#/s:18SwiftLintFramework8LocationV4file15characterOffsetAcA0aB4FileC_Sitcfc":{"name":"init(file:characterOffset:)","abstract":"

Creates a Location based on a SwiftLintFile and a UTF8 character-offset into the file.","parent_name":"Location"},"Structs/Location.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Location"},"Structs/CollectedLinter.html#/s:18SwiftLintFramework15CollectedLinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:18SwiftLintFramework15CollectedLinterV15styleViolations5usingSayAA14StyleViolationVGAA11RuleStorageC_tF":{"name":"styleViolations(using:)","abstract":"

Computes or retrieves style violations.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:18SwiftLintFramework15CollectedLinterV27styleViolationsAndRuleTimes5usingSayAA14StyleViolationVG_SaySS2id_Sd4timetGtAA0I7StorageC_tF":{"name":"styleViolationsAndRuleTimes(using:)","abstract":"

Computes or retrieves style violations and the time spent executing each rule.

","parent_name":"CollectedLinter"},"Structs/CollectedLinter.html#/s:18SwiftLintFramework15CollectedLinterV6format7useTabs11indentWidthySb_SitF":{"name":"format(useTabs:indentWidth:)","abstract":"

Formats the file associated with this linter.

","parent_name":"CollectedLinter"},"Structs/Linter.html#/s:18SwiftLintFramework6LinterV4fileAA0aB4FileCvp":{"name":"file","abstract":"

The file to lint with this linter.

","parent_name":"Linter"},"Structs/Linter.html#/s:18SwiftLintFramework6LinterV12isCollectingSbvp":{"name":"isCollecting","abstract":"

Whether or not this linter will be used to collect information from several files.

","parent_name":"Linter"},"Structs/Linter.html#/s:18SwiftLintFramework6LinterV4file13configuration5cache17compilerArgumentsAcA0aB4FileC_AA13ConfigurationVAA0D5CacheCSgSaySSGtcfc":{"name":"init(file:configuration:cache:compilerArguments:)","abstract":"

Creates a Linter by specifying its properties directly.

","parent_name":"Linter"},"Structs/Linter.html#/s:18SwiftLintFramework6LinterV7collect4intoAA09CollectedD0VAA11RuleStorageC_tF":{"name":"collect(into:)","abstract":"

Returns a linter capable of checking for violations after running each rule’s collection step.

","parent_name":"Linter"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV4codeSSvp":{"name":"code","abstract":"

The contents of the example

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV13configurationypSgvp":{"name":"configuration","abstract":"

The untyped configuration to apply to the rule, if deviating from the default configuration.","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV20testMultiByteOffsetsSbvp":{"name":"testMultiByteOffsets","abstract":"

Whether the example should be tested by prepending multibyte grapheme clusters

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV11testOnLinuxSbvp":{"name":"testOnLinux","abstract":"

Whether the example should be tested on Linux

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV4files12StaticStringVvp":{"name":"file","abstract":"

The path to the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV4lineSuvp":{"name":"line","abstract":"

The line in the file where the example was created

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV_13configuration20testMultiByteOffsets0F17WrappingInComment0fjK6String0F14DisableCommand0F7OnLinux4file4line24excludeFromDocumentationACSS_ypSgS5bs06StaticM0VSuSbtcfc":{"name":"init(_:configuration:testMultiByteOffsets:testWrappingInComment:testWrappingInString:testDisableCommand:testOnLinux:file:line:excludeFromDocumentation:)","abstract":"

Create a new Example with the specified code, file, and line.

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV4with4codeACSS_tF":{"name":"with(code:)","abstract":"

Returns the same example, but with the code that is passed in

","parent_name":"Example"},"Structs/Example.html#/s:18SwiftLintFramework7ExampleV24removingViolationMarkersACyF":{"name":"removingViolationMarkers()","abstract":"

Returns a copy of the Example with all instances of the “↓” character removed.

","parent_name":"Example"},"Structs/Example.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Example"},"Structs/Example.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Example"},"Structs/Example.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"Example"},"Structs/Command/Modifier.html#/s:18SwiftLintFramework7CommandV8ModifierO8previousyA2EmF":{"name":"previous","abstract":"

The command should only apply to the line preceding its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:18SwiftLintFramework7CommandV8ModifierO4thisyA2EmF":{"name":"this","abstract":"

The command should only apply to the same line as its definition.

","parent_name":"Modifier"},"Structs/Command/Modifier.html#/s:18SwiftLintFramework7CommandV8ModifierO4nextyA2EmF":{"name":"next","abstract":"

The command should only apply to the line following its definition.

","parent_name":"Modifier"},"Structs/Command/Action.html#/s:18SwiftLintFramework7CommandV6ActionO6enableyA2EmF":{"name":"enable","abstract":"

The rule(s) associated with this command should be enabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html#/s:18SwiftLintFramework7CommandV6ActionO7disableyA2EmF":{"name":"disable","abstract":"

The rule(s) associated with this command should be disabled by the SwiftLint engine.

","parent_name":"Action"},"Structs/Command/Action.html":{"name":"Action","abstract":"

The action (verb) that SwiftLint should perform when interpreting this command.

","parent_name":"Command"},"Structs/Command/Modifier.html":{"name":"Modifier","abstract":"

The modifier for a command, used to modify its scope.

","parent_name":"Command"},"Structs/Command.html#/s:18SwiftLintFramework7CommandV6action15ruleIdentifiers4line9character8modifier15trailingCommentA2C6ActionO_ShyAA14RuleIdentifierOGS2iSgAC8ModifierOSgSSSgtcfc":{"name":"init(action:ruleIdentifiers:line:character:modifier:trailingComment:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/Command.html#/s:18SwiftLintFramework7CommandV12actionString4line9characterACSgSS_S2itcfc":{"name":"init(actionString:line:character:)","abstract":"

Creates a command based on the specified parameters.

","parent_name":"Command"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV5valueSDySS0deC00D16KitRepresentable_pGvp":{"name":"value","abstract":"

The underlying SourceKitten dictionary.

","parent_name":"SourceKittenDictionary"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV12substructureSayACGvp":{"name":"substructure","abstract":"

The cached substructure for this dictionary. Empty if there is no substructure.

","parent_name":"SourceKittenDictionary"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV14expressionKindAA0a10ExpressionH0OSgvp":{"name":"expressionKind","abstract":"

The kind of Swift expression represented by this dictionary, if it is an expression.

","parent_name":"SourceKittenDictionary"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV15declarationKind0deC00a11DeclarationH0OSgvp":{"name":"declarationKind","abstract":"

The kind of Swift declaration represented by this dictionary, if it is a declaration.

","parent_name":"SourceKittenDictionary"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV13statementKind0deC009StatementH0OSgvp":{"name":"statementKind","abstract":"

The kind of Swift statement represented by this dictionary, if it is a statement.

","parent_name":"SourceKittenDictionary"},"Structs/SourceKittenDictionary.html#/s:18SwiftLintFramework22SourceKittenDictionaryV13accessibilityAA18AccessControlLevelOSgvp":{"name":"accessibility","abstract":"

The accessibility level for this dictionary, if it is a declaration.

","parent_name":"SourceKittenDictionary"},"Structs/Configuration/RulesMode.html#/s:18SwiftLintFramework13ConfigurationV9RulesModeO7defaultyAEShySSG_AGtcAEmF":{"name":"default(disabled:optIn:)","abstract":"

The default rules mode, which will enable all rules that aren’t defined as being opt-in","parent_name":"RulesMode"},"Structs/Configuration/RulesMode.html#/s:18SwiftLintFramework13ConfigurationV9RulesModeO4onlyyAEShySSGcAEmF":{"name":"only(_:)","abstract":"

Only enable the rules explicitly listed.

","parent_name":"RulesMode"},"Structs/Configuration/RulesMode.html#/s:18SwiftLintFramework13ConfigurationV9RulesModeO10allEnabledyA2EmF":{"name":"allEnabled","abstract":"

Enable all available rules.

","parent_name":"RulesMode"},"Structs/Configuration/IndentationStyle.html#/s:18SwiftLintFramework13ConfigurationV16IndentationStyleO4tabsyA2EmF":{"name":"tabs","abstract":"

Swift source code should be indented using tabs.

","parent_name":"IndentationStyle"},"Structs/Configuration/IndentationStyle.html#/s:18SwiftLintFramework13ConfigurationV16IndentationStyleO6spacesyAESi_tcAEmF":{"name":"spaces(count:)","abstract":"

Swift source code should be indented using spaces with count spaces per indentation level.

","parent_name":"IndentationStyle"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV7defaultACvpZ":{"name":"default","abstract":"

The default Configuration resulting from an empty configuration file.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV15defaultFileNameSSvpZ":{"name":"defaultFileName","abstract":"

The default file name to look for user-defined configurations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV13includedPathsSaySSGvp":{"name":"includedPaths","abstract":"

The paths that should be included when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV13excludedPathsSaySSGvp":{"name":"excludedPaths","abstract":"

The paths that should be excluded when linting

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV11indentationAC16IndentationStyleOvp":{"name":"indentation","abstract":"

The style to use when indenting Swift source code.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV16warningThresholdSiSgvp":{"name":"warningThreshold","abstract":"

The threshold for the number of warnings to tolerate before treating the lint as having failed.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV8reporterSSvp":{"name":"reporter","abstract":"

The identifier for the Reporter to use to report style violations.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV9cachePathSSSgvp":{"name":"cachePath","abstract":"

The location of the persisted cache to use with this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV22allowZeroLintableFilesSbvp":{"name":"allowZeroLintableFiles","abstract":"

Allow or disallow SwiftLint to exit successfully when passed only ignored or unlintable files.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV013basedOnCustomD5FilesSbvp":{"name":"basedOnCustomConfigurationFiles","abstract":"

This value is true iff the --config parameter was used to specify (a) configuration file(s)","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV5rulesSayAA4Rule_pGvp":{"name":"rules","abstract":"

All rules enabled in this configuration

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV13rootDirectorySSvp":{"name":"rootDirectory","abstract":"

The root directory is the directory that included & excluded paths relate to.","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV9rulesModeAC05RulesF0Ovp":{"name":"rulesMode","abstract":"

The rules mode used for this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV18configurationFiles14enableAllRules9cachePath27ignoreParentAndChildConfigs20mockedNetworkResults25useDefaultConfigOnFailureACSaySSG_SbSSSgSbSDyS2SGSbSgtcfc":{"name":"init(configurationFiles:enableAllRules:cachePath:ignoreParentAndChildConfigs:mockedNetworkResults:useDefaultConfigOnFailure:)","abstract":"

Creates a Configuration with convenience parameters.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV31withPrecomputedCacheDescriptionACyF":{"name":"withPrecomputedCacheDescription()","abstract":"

Returns a copy of the current Configuration with its computedCacheDescription property set to the value of","parent_name":"Configuration"},"Structs/Configuration/IndentationStyle.html":{"name":"IndentationStyle","abstract":"

The style of indentation used in a Swift project.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV13lintableFiles6inPath12forceExclude15excludeByPrefixSayAA0aB4FileCGSS_S2btF":{"name":"lintableFiles(inPath:forceExclude:excludeByPrefix:)","abstract":"

Returns the files that can be linted by SwiftLint in the specified parent path.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV19filterExcludedPaths11fileManager2inSaySSGAA012LintableFileI0_p_AGdtF":{"name":"filterExcludedPaths(fileManager:in:)","abstract":"

Returns an array of file paths after removing the excluded paths as defined by this configuration.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV27filterExcludedPathsByPrefix2inSaySSGAFd_tF":{"name":"filterExcludedPathsByPrefix(in:)","abstract":"

Returns the file paths that are excluded by this configuration using filtering by absolute path prefix.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV13configuration3forAcA0aB4FileC_tF":{"name":"configuration(for:)","abstract":"

Returns a new configuration that applies to the specified file by merging the current configuration with any","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV4dict8ruleList14enableAllRules9cachePathACSDySSypG_AA04RuleG0VSbSSSgtKcfc":{"name":"init(dict:ruleList:enableAllRules:cachePath:)","abstract":"

Creates a Configuration value based on the specified parameters.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:18SwiftLintFramework13ConfigurationV14configuredRule5forIDAA0F0_pSgSS_tF":{"name":"configuredRule(forID:)","abstract":"

Returns the rule for the specified ID, if configured in this configuration.

","parent_name":"Configuration"},"Structs/Configuration/RulesMode.html":{"name":"RulesMode","abstract":"

Represents how a Configuration object can be configured with regards to rules.

","parent_name":"Configuration"},"Structs/Configuration.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"Configuration"},"Structs/Configuration.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"Configuration"},"Structs/RuleListDocumentation.html#/s:18SwiftLintFramework21RuleListDocumentationVyAcA0dE0Vcfc":{"name":"init(_:)","abstract":"

Creates a RuleListDocumentation instance from a RuleList.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html#/s:18SwiftLintFramework21RuleListDocumentationV5write2toy10Foundation3URLV_tKF":{"name":"write(to:)","abstract":"

Write the rule list documentation as markdown files to the specified directory.

","parent_name":"RuleListDocumentation"},"Structs/RuleListDocumentation.html":{"name":"RuleListDocumentation","abstract":"

User-facing documentation for a SwiftLint RuleList.

"},"Structs/Configuration.html":{"name":"Configuration","abstract":"

The configuration struct for SwiftLint. User-defined in the .swiftlint.yml file, drives the behavior of SwiftLint.

"},"Structs/SourceKittenDictionary.html":{"name":"SourceKittenDictionary","abstract":"

A collection of keys and values as parsed out of SourceKit, with many conveniences for accessing SwiftLint-specific"},"Structs/Command.html":{"name":"Command","abstract":"

A SwiftLint-interpretable command to modify SwiftLint’s behavior embedded as comments in source code.

"},"Structs/Example.html":{"name":"Example","abstract":"

Captures code and context information for an example of a triggering or"},"Structs/Linter.html":{"name":"Linter","abstract":"

Represents a file that can be linted for style violations and corrections after being collected.

"},"Structs/CollectedLinter.html":{"name":"CollectedLinter","abstract":"

Represents a file that can compute style violations and corrections for a list of rules.

"},"Structs/Location.html":{"name":"Location","abstract":"

The placement of a segment of Swift in a collection of source files.

"},"Structs/Region.html":{"name":"Region","abstract":"

A contiguous region of Swift source code.

"},"Structs/RuleDescription.html":{"name":"RuleDescription","abstract":"

A detailed description for a SwiftLint rule. Used for both documentation and testing purposes.

"},"Structs/RuleList.html":{"name":"RuleList","abstract":"

A list of available SwiftLint rules.

"},"Structs/RuleParameter.html":{"name":"RuleParameter","abstract":"

A configuration parameter for rules.

"},"Structs/StyleViolation.html":{"name":"StyleViolation","abstract":"

A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.

"},"Structs/SwiftLintSyntaxMap.html":{"name":"SwiftLintSyntaxMap","abstract":"

Represents a Swift file’s syntax information.

"},"Structs/SwiftLintSyntaxToken.html":{"name":"SwiftLintSyntaxToken","abstract":"

A SwiftLint-aware Swift syntax token.

"},"Structs/SwiftVersion.html":{"name":"SwiftVersion","abstract":"

A value describing the version of the Swift compiler.

"},"Structs/Version.html":{"name":"Version","abstract":"

A type describing the SwiftLint version.

"},"Structs/YamlParser.html":{"name":"YamlParser","abstract":"

An interface for parsing YAML.

"},"Structs/ReasonedRuleViolation.html":{"name":"ReasonedRuleViolation","abstract":"

A violation produced by ViolationsSyntaxVisitors.

"},"Structs/GitLabJUnitReporter.html":{"name":"GitLabJUnitReporter","abstract":"

Reports violations as JUnit XML supported by GitLab.

"},"Structs/SonarQubeReporter.html":{"name":"SonarQubeReporter","abstract":"

Reports violations in SonarQube import format.

"},"Structs/XcodeReporter.html":{"name":"XcodeReporter","abstract":"

Reports violations in the format Xcode uses to display in the IDE. (default)

"},"Protocols/SwiftSyntaxRule.html#/s:18SwiftLintFramework0A10SyntaxRuleP11makeVisitor4fileAA010ViolationsdG0CAA0aB4FileC_tF":{"name":"makeVisitor(file:)","abstract":"

Produce a ViolationsSyntaxVisitor for the given file.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:18SwiftLintFramework0A10SyntaxRuleP13makeViolation4file9violationAA05StyleG0VAA0aB4FileC_AA08ReasonedeG0VtF":{"name":"makeViolation(file:violation:)","abstract":"

Produce a violation for the given file and absolute position.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:18SwiftLintFramework0A10SyntaxRuleP10preprocess10syntaxTree0aD0010SourceFileD0VSgAH_tF":{"name":"preprocess(syntaxTree:)","abstract":"

Gives a chance for the rule to do some pre-processing on the syntax tree.","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:18SwiftLintFramework0A10SyntaxRulePAAE15disabledRegions4fileSay0aD011SourceRangeVGAA0aB4FileC_tF":{"name":"disabledRegions(file:)","abstract":"

Returns the source ranges in the specified file where this rule is disabled.

","parent_name":"SwiftSyntaxRule"},"Protocols/SwiftSyntaxRule.html#/s:18SwiftLintFramework4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"SwiftSyntaxRule"},"Protocols/ViolationsSyntaxRewriter.html#/s:18SwiftLintFramework24ViolationsSyntaxRewriterP19correctionPositionsSay0aE016AbsolutePositionVGvp":{"name":"correctionPositions","abstract":"

Positions in a source file where corrections were applied.

","parent_name":"ViolationsSyntaxRewriter"},"Protocols/SeverityBasedRuleConfiguration.html#/s:18SwiftLintFramework30SeverityBasedRuleConfigurationP08severityG0AA0dG0Vvp":{"name":"severityConfiguration","abstract":"

The configuration of a rule’s severity.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/SeverityBasedRuleConfiguration.html#/s:18SwiftLintFramework30SeverityBasedRuleConfigurationPAAE8severityAA09ViolationD0Ovp":{"name":"severity","abstract":"

The severity of a rule.

","parent_name":"SeverityBasedRuleConfiguration"},"Protocols/RuleConfiguration.html#/s:18SwiftLintFramework17RuleConfigurationP18consoleDescriptionSSvp":{"name":"consoleDescription","abstract":"

A human-readable description for this configuration and its applied values.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:18SwiftLintFramework17RuleConfigurationP5apply13configurationyyp_tKF":{"name":"apply(configuration:)","abstract":"

Apply an untyped configuration to the current value.

","parent_name":"RuleConfiguration"},"Protocols/RuleConfiguration.html#/s:18SwiftLintFramework17RuleConfigurationP9isEqualToySbAaB_pF":{"name":"isEqualTo(_:)","abstract":"

Whether the specified configuration is equivalent to the current value.

","parent_name":"RuleConfiguration"},"Protocols/AnalyzerRule.html#/s:18SwiftLintFramework4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"AnalyzerRule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP11descriptionAA0D11DescriptionVvpZ":{"name":"description","abstract":"

A verbose description of many of this rule’s properties.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP24configurationDescriptionSSvp":{"name":"configurationDescription","abstract":"

A description of how this rule has been configured to run.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RulePxycfc":{"name":"init()","abstract":"

A default initializer for rules. All rules need to be trivially initializable.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP13configurationxyp_tKcfc":{"name":"init(configuration:)","abstract":"

Creates a rule by applying its configuration.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","abstract":"

Executes the rule on a file and returns any violations to the rule’s expectations.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP9isEqualToySbAaB_pF":{"name":"isEqualTo(_:)","abstract":"

Whether or not the specified rule is equivalent to the current rule.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","abstract":"

Collects information for the specified file in a storage object, to be analyzed by a CollectedLinter.

","parent_name":"Rule"},"Protocols/Rule.html#/s:18SwiftLintFramework4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"Rule"},"Protocols/Reporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","abstract":"

The unique identifier for this reporter.

","parent_name":"Reporter"},"Protocols/Reporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","abstract":"

Whether or not this reporter can output incrementally as violations are found or if all violations must be","parent_name":"Reporter"},"Protocols/Reporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","abstract":"

Return a string with the report for the specified violations.

","parent_name":"Reporter"},"Protocols/ConfigurationProviderRule.html#/s:18SwiftLintFramework25ConfigurationProviderRuleP0D4TypeQa":{"name":"ConfigurationType","abstract":"

The type of configuration used to configure this rule.

","parent_name":"ConfigurationProviderRule"},"Protocols/ConfigurationProviderRule.html#/s:18SwiftLintFramework25ConfigurationProviderRuleP13configuration0D4TypeQzvp":{"name":"configuration","abstract":"

This rule’s configuration.

","parent_name":"ConfigurationProviderRule"},"Protocols/ConfigurationProviderRule.html#/s:18SwiftLintFramework4RuleP13configurationxyp_tKcfc":{"name":"init(configuration:)","parent_name":"ConfigurationProviderRule"},"Protocols/ConfigurationProviderRule.html#/s:18SwiftLintFramework4RuleP9isEqualToySbAaB_pF":{"name":"isEqualTo(_:)","parent_name":"ConfigurationProviderRule"},"Protocols/ConfigurationProviderRule.html#/s:18SwiftLintFramework4RuleP24configurationDescriptionSSvp":{"name":"configurationDescription","parent_name":"ConfigurationProviderRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework14CollectingRuleP8FileInfoQa":{"name":"FileInfo","abstract":"

The kind of information to collect for each file being linted for this rule.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework14CollectingRuleP11collectInfo3for17compilerArguments04FileG0QzAA0abK0C_SaySSGtF":{"name":"collectInfo(for:compilerArguments:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework14CollectingRuleP11collectInfo3for04FileG0QzAA0abI0C_tF":{"name":"collectInfo(for:)","abstract":"

Collects information for the specified file, to be analyzed by a CollectedLinter.

","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework14CollectingRuleP8validate4file13collectedInfo17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SDyAL0nI0QzGSaySSGtF":{"name":"validate(file:collectedInfo:compilerArguments:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework14CollectingRuleP8validate4file13collectedInfoSayAA14StyleViolationVGAA0aB4FileC_SDyAK0lI0QzGtF":{"name":"validate(file:collectedInfo:)","abstract":"

Executes the rule on a file after collecting file info for all files and returns any violations to the rule’s","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework4RuleP11collectInfo3for4into17compilerArgumentsyAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"collectInfo(for:into:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework4RuleP8validate4file5using17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_AA0D7StorageCSaySSGtF":{"name":"validate(file:using:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"CollectingRule"},"Protocols/CollectingRule.html#/s:18SwiftLintFramework4RuleP8validate4file17compilerArgumentsSayAA14StyleViolationVGAA0aB4FileC_SaySSGtF":{"name":"validate(file:compilerArguments:)","parent_name":"CollectingRule"},"Protocols/ASTRule.html#/s:18SwiftLintFramework7ASTRuleP8KindTypeQa":{"name":"KindType","abstract":"

The kind of token being recursed over.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:18SwiftLintFramework7ASTRuleP8validate4file4kind10dictionarySayAA14StyleViolationVGAA0aB4FileC_8KindTypeQzAA22SourceKittenDictionaryVtF":{"name":"validate(file:kind:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:18SwiftLintFramework7ASTRuleP4kind4from8KindTypeQzSgAA22SourceKittenDictionaryV_tF":{"name":"kind(from:)","abstract":"

Get the kind from the specified dictionary.

","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:18SwiftLintFramework4RuleP8validate4fileSayAA14StyleViolationVGAA0aB4FileC_tF":{"name":"validate(file:)","parent_name":"ASTRule"},"Protocols/ASTRule.html#/s:18SwiftLintFramework7ASTRulePAAE8validate4file10dictionarySayAA14StyleViolationVGAA0aB4FileC_AA22SourceKittenDictionaryVtF":{"name":"validate(file:dictionary:)","abstract":"

Executes the rule on a file and a subset of its AST structure, returning any violations to the rule’s","parent_name":"ASTRule"},"Protocols/LintableFileManager.html#/s:18SwiftLintFramework19LintableFileManagerP07filesToB06inPath13rootDirectorySaySSGSS_SSSgtF":{"name":"filesToLint(inPath:rootDirectory:)","abstract":"

Returns all files that can be linted in the specified path. If the path is relative, it will be appended to the","parent_name":"LintableFileManager"},"Protocols/LintableFileManager.html#/s:18SwiftLintFramework19LintableFileManagerP16modificationDate03forE6AtPath10Foundation0H0VSgSS_tF":{"name":"modificationDate(forFileAtPath:)","abstract":"

Returns the date when the file at the specified path was last modified. Returns nil if the file cannot be","parent_name":"LintableFileManager"},"Protocols/LintableFileManager.html":{"name":"LintableFileManager","abstract":"

An interface for enumerating files that can be linted by SwiftLint.

"},"Protocols/ASTRule.html":{"name":"ASTRule","abstract":"

A rule that leverages the Swift source’s pre-typechecked Abstract Syntax Tree to recurse into the source’s"},"Protocols.html#/s:18SwiftLintFramework17AnyCollectingRuleP":{"name":"AnyCollectingRule","abstract":"

Type-erased protocol used to check whether a rule is collectable.

"},"Protocols/CollectingRule.html":{"name":"CollectingRule","abstract":"

A rule that requires knowledge of all other files being linted.

"},"Protocols/ConfigurationProviderRule.html":{"name":"ConfigurationProviderRule","abstract":"

A rule that is user-configurable.

"},"Protocols/Reporter.html":{"name":"Reporter","abstract":"

An interface for reporting violations as strings.

"},"Protocols/Rule.html":{"name":"Rule","abstract":"

An executable value that can identify issues (violations) in Swift source code.

"},"Protocols.html#/s:18SwiftLintFramework9OptInRuleP":{"name":"OptInRule","abstract":"

A rule that is not enabled by default. Rules conforming to this need to be explicitly enabled by users.

"},"Protocols.html#/s:18SwiftLintFramework17SourceKitFreeRuleP":{"name":"SourceKitFreeRule","abstract":"

A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.

"},"Protocols/AnalyzerRule.html":{"name":"AnalyzerRule","abstract":"

A rule that can operate on the post-typechecked AST using compiler arguments. Performs rules that are more like"},"Protocols/RuleConfiguration.html":{"name":"RuleConfiguration","abstract":"

A configuration value for a rule to allow users to modify its behavior.

"},"Protocols/SeverityBasedRuleConfiguration.html":{"name":"SeverityBasedRuleConfiguration","abstract":"

A configuration for a rule that allows to configure at least the severity.

"},"Protocols/ViolationsSyntaxRewriter.html":{"name":"ViolationsSyntaxRewriter","abstract":"

A SwiftSyntax SyntaxRewriter that produces absolute positions where corrections were applied.

"},"Protocols/SwiftSyntaxRule.html":{"name":"SwiftSyntaxRule","abstract":"

A SwiftLint Rule backed by SwiftSyntax that does not use SourceKit requests.

"},"Functions.html#/s:18SwiftLintFramework11queuedPrintyyxlF":{"name":"queuedPrint(_:)","abstract":"

A thread-safe version of Swift’s standard print().

"},"Functions.html#/s:18SwiftLintFramework16queuedPrintErroryySSF":{"name":"queuedPrintError(_:)","abstract":"

A thread-safe, newline-terminated version of fputs(..., stderr).

"},"Functions.html#/s:18SwiftLintFramework16queuedFatalError_4file4lines5NeverOSS_s12StaticStringVSutF":{"name":"queuedFatalError(_:file:line:)","abstract":"

A thread-safe, newline-terminated version of fatalError(...) that doesn’t leak"},"Functions.html#/s:18SwiftLintFramework12reporterFrom10identifierAA8Reporter_pXpSS_tF":{"name":"reporterFrom(identifier:)","abstract":"

Returns the reporter with the specified identifier. Traps if the specified identifier doesn’t correspond to any"},"Extensions/String.html#/s:SS18SwiftLintFrameworkE24absolutePathStandardizedSSyF":{"name":"absolutePathStandardized()","abstract":"

Returns a new string, converting the path to a canonical absolute path.

","parent_name":"String"},"Extensions/String.html#/s:SS18SwiftLintFrameworkE16countOccurrences2ofSiSJ_tF":{"name":"countOccurrences(of:)","abstract":"

Count the number of occurrences of the given character in self

","parent_name":"String"},"Extensions/String.html#/s:SS18SwiftLintFrameworkE4path10relativeToS2S_tF":{"name":"path(relativeTo:)","abstract":"

If self is a path, this method can be used to get a path expression relative to a root directory

","parent_name":"String"},"Extensions/FileManager.html#/s:18SwiftLintFramework19LintableFileManagerP07filesToB06inPath13rootDirectorySaySSGSS_SSSgtF":{"name":"filesToLint(inPath:rootDirectory:)","parent_name":"FileManager"},"Extensions/FileManager.html#/s:18SwiftLintFramework19LintableFileManagerP16modificationDate03forE6AtPath10Foundation0H0VSgSS_tF":{"name":"modificationDate(forFileAtPath:)","parent_name":"FileManager"},"Extensions/FileManager.html":{"name":"FileManager"},"Extensions/String.html":{"name":"String"},"Enums/ViolationSeverity.html#/s:18SwiftLintFramework17ViolationSeverityO7warningyA2CmF":{"name":"warning","abstract":"

Non-fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having succeeded.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:18SwiftLintFramework17ViolationSeverityO5erroryA2CmF":{"name":"error","abstract":"

Fatal. If using SwiftLint as an Xcode build phase, Xcode will mark the build as having failed.

","parent_name":"ViolationSeverity"},"Enums/ViolationSeverity.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"ViolationSeverity"},"Enums/RuleListError.html#/s:18SwiftLintFramework13RuleListErrorO24duplicatedConfigurationsyAcA0D0_pXp_tcACmF":{"name":"duplicatedConfigurations(rule:)","abstract":"

The rule list contains more than one configuration for the specified rule.

","parent_name":"RuleListError"},"Enums/RuleKind.html#/s:18SwiftLintFramework8RuleKindO4lintyA2CmF":{"name":"lint","abstract":"

Describes rules that validate Swift source conventions.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:18SwiftLintFramework8RuleKindO9idiomaticyA2CmF":{"name":"idiomatic","abstract":"

Describes rules that validate common practices in the Swift community.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:18SwiftLintFramework8RuleKindO5styleyA2CmF":{"name":"style","abstract":"

Describes rules that validate stylistic choices.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:18SwiftLintFramework8RuleKindO7metricsyA2CmF":{"name":"metrics","abstract":"

Describes rules that validate magnitudes or measurements of Swift source.

","parent_name":"RuleKind"},"Enums/RuleKind.html#/s:18SwiftLintFramework8RuleKindO11performanceyA2CmF":{"name":"performance","abstract":"

Describes rules that validate that code patterns with poor performance are avoided.

","parent_name":"RuleKind"},"Enums/RuleIdentifier.html#/s:18SwiftLintFramework14RuleIdentifierO3allyA2CmF":{"name":"all","abstract":"

Special identifier that should be treated as referring to ‘all’ SwiftLint rules. One helpful usecase is in","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:18SwiftLintFramework14RuleIdentifierO6singleyACSS_tcACmF":{"name":"single(identifier:)","abstract":"

Represents a single SwiftLint rule with the specified identifier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:18SwiftLintFramework14RuleIdentifierO20stringRepresentationSSvp":{"name":"stringRepresentation","abstract":"

The spelling of the string for this idenfitier.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:18SwiftLintFramework14RuleIdentifierOyACSScfc":{"name":"init(_:)","abstract":"

Creates a RuleIdentifier by its string representation.

","parent_name":"RuleIdentifier"},"Enums/RuleIdentifier.html#/s:s26ExpressibleByStringLiteralP06stringD0x0cD4TypeQz_tcfc":{"name":"init(stringLiteral:)","parent_name":"RuleIdentifier"},"Enums/ConfigurationError.html#/s:18SwiftLintFramework18ConfigurationErrorO07unknownD0yA2CmF":{"name":"unknownConfiguration","abstract":"

The configuration didn’t match internal expectations.

","parent_name":"ConfigurationError"},"Enums/ConfigurationError.html#/s:18SwiftLintFramework18ConfigurationErrorO28ambiguousMatchKindParametersyA2CmF":{"name":"ambiguousMatchKindParameters","abstract":"

The configuration had both match_kind and excluded_match_kind parameters.

","parent_name":"ConfigurationError"},"Enums/ConfigurationError.html#/s:18SwiftLintFramework18ConfigurationErrorO7genericyACSScACmF":{"name":"generic(_:)","abstract":"

A generic configuration error specified by a string.

","parent_name":"ConfigurationError"},"Enums/ConfigurationError.html#/s:18SwiftLintFramework18ConfigurationErrorO19initialFileNotFoundyACSS_tcACmF":{"name":"initialFileNotFound(path:)","abstract":"

The initial configuration file was not found.

","parent_name":"ConfigurationError"},"Enums/AccessControlLevel.html#/s:18SwiftLintFramework18AccessControlLevelO7privateyA2CmF":{"name":"private","abstract":"

Accessible by the declaration’s immediate lexical scope.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:18SwiftLintFramework18AccessControlLevelO11fileprivateyA2CmF":{"name":"fileprivate","abstract":"

Accessible by the declaration’s same file.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:18SwiftLintFramework18AccessControlLevelO8internalyA2CmF":{"name":"internal","abstract":"

Accessible by the declaration’s same module, or modules importing it with the @testable attribute.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:18SwiftLintFramework18AccessControlLevelO6publicyA2CmF":{"name":"public","abstract":"

Accessible by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:18SwiftLintFramework18AccessControlLevelO4openyA2CmF":{"name":"open","abstract":"

Accessible and customizable (via subclassing or overrides) by the declaration’s same program.

","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"AccessControlLevel"},"Enums/AccessControlLevel.html#/s:SL1loiySbx_xtFZ":{"name":"<(_:_:)","parent_name":"AccessControlLevel"},"Enums/ExecutableInfo.html#/s:18SwiftLintFramework14ExecutableInfoO7buildIDSSSgvpZ":{"name":"buildID","abstract":"

A stable identifier for this executable. Uses the Mach-O header UUID on macOS. Nil on Linux.

","parent_name":"ExecutableInfo"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO4callyA2CmF":{"name":"call","abstract":"

A call to a named function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO8argumentyA2CmF":{"name":"argument","abstract":"

An argument value for a function or closure.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO5arrayyA2CmF":{"name":"array","abstract":"

An Array expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO10dictionaryyA2CmF":{"name":"dictionary","abstract":"

A Dictionary expression.

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO13objectLiteralyA2CmF":{"name":"objectLiteral","abstract":"

An object literal expression. https://developer.apple.com/swift/blog/?id=33

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO7closureyA2CmF":{"name":"closure","abstract":"

A closure expression. https://docs.swift.org/swift-book/LanguageGuide/Closures.html

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html#/s:18SwiftLintFramework0A14ExpressionKindO5tupleyA2CmF":{"name":"tuple","abstract":"

A tuple expression. https://docs.swift.org/swift-book/ReferenceManual/Types.html#ID448

","parent_name":"SwiftExpressionKind"},"Enums/SwiftExpressionKind.html":{"name":"SwiftExpressionKind","abstract":"

The kind of expression for a contiguous set of Swift source tokens.

"},"Enums/ExecutableInfo.html":{"name":"ExecutableInfo","abstract":"

Information about this executable.

"},"Enums/AccessControlLevel.html":{"name":"AccessControlLevel","abstract":"

The accessibility of a Swift source declaration.

"},"Enums/ConfigurationError.html":{"name":"ConfigurationError","abstract":"

All possible configuration errors.

"},"Enums/RuleIdentifier.html":{"name":"RuleIdentifier","abstract":"

An identifier representing a SwiftLint rule, or all rules.

"},"Enums/RuleKind.html":{"name":"RuleKind","abstract":"

All the possible rule kinds (categories).

"},"Enums/RuleListError.html":{"name":"RuleListError","abstract":"

All possible rule list configuration errors.

"},"Enums/ViolationSeverity.html":{"name":"ViolationSeverity","abstract":"

The magnitude of a StyleViolation.

"},"Global%20Variables.html#/s:18SwiftLintFramework15primaryRuleListAA0eF0Vvp":{"name":"primaryRuleList","abstract":"

The rule list containing all available rules built into SwiftLint.

"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ActorDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE09ClassDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE08EnumDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE013ExtensionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012FunctionDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012VariableDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE012ProtocolDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/ViolationsSyntaxVisitor.html#/s:18SwiftLintFramework23ViolationsSyntaxVisitorC5visity0aE00eF12ContinueKindOAE010StructDeclE0VF":{"name":"visit(_:)","parent_name":"ViolationsSyntaxVisitor"},"Classes/RuleStorage.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"RuleStorage"},"Classes/RuleStorage.html#/s:18SwiftLintFramework11RuleStorageCACycfc":{"name":"init()","abstract":"

Creates a RuleStorage with no initial stored data.

","parent_name":"RuleStorage"},"Classes/LinterCache.html#/s:18SwiftLintFramework11LinterCacheC13configuration11fileManagerAcA13ConfigurationV_AA012LintableFileH0_ptcfc":{"name":"init(configuration:fileManager:)","abstract":"

Creates a LinterCache by specifying a SwiftLint configuration and a file manager.

","parent_name":"LinterCache"},"Classes/LinterCache.html#/s:18SwiftLintFramework11LinterCacheC4saveyyKF":{"name":"save()","abstract":"

Persists the cache to disk.

","parent_name":"LinterCache"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC4fileAC012SourceKittenC00D0C_tcfc":{"name":"init(file:)","abstract":"

Creates a SwiftLintFile with a SourceKitten File.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC4pathACSgSS_tcfc":{"name":"init(path:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk.","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC20pathDeferringReadingACSS_tcfc":{"name":"init(pathDeferringReading:)","abstract":"

Creates a SwiftLintFile by specifying its path on disk. Unlike the SwiftLintFile(path:) initializer, this","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC8contentsACSS_tcfc":{"name":"init(contents:)","abstract":"

Creates a SwiftLintFile that is not backed by a file on disk by specifying its contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC4pathSSSgvp":{"name":"path","abstract":"

The path on disk for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC8contentsSSvp":{"name":"contents","abstract":"

The file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC10stringView012SourceKittenC006StringF0Vvp":{"name":"stringView","abstract":"

A string view into the contents of this file optimized for string manipulation operations.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC5linesSay012SourceKittenC04LineVGvp":{"name":"lines","abstract":"

The parsed lines for this file’s contents.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:18SwiftLintFramework0aB4FileC15invalidateCacheyyF":{"name":"invalidateCache()","abstract":"

Invalidates all cached data for this file.

","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SQ2eeoiySbx_xtFZ":{"name":"==(_:_:)","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html#/s:SH4hash4intoys6HasherVz_tF":{"name":"hash(into:)","parent_name":"SwiftLintFile"},"Classes/SwiftLintFile.html":{"name":"SwiftLintFile","abstract":"

A unit of Swift source code, either on disk or in memory.

"},"Classes/LinterCache.html":{"name":"LinterCache","abstract":"

A persisted cache for storing and retrieving linter results.

"},"Classes/RuleStorage.html":{"name":"RuleStorage","abstract":"

A storage mechanism for aggregating the results of CollectingRules.

"},"Classes/ViolationsSyntaxVisitor.html":{"name":"ViolationsSyntaxVisitor","abstract":"

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

"},"swift-syntax-dashboard.html":{"name":"Swift Syntax Dashboard"},"accessibility_label_for_image.html":{"name":"accessibility_label_for_image"},"accessibility_trait_for_button.html":{"name":"accessibility_trait_for_button"},"anonymous_argument_in_multiline_closure.html":{"name":"anonymous_argument_in_multiline_closure"},"anyobject_protocol.html":{"name":"anyobject_protocol"},"array_init.html":{"name":"array_init"},"attributes.html":{"name":"attributes"},"balanced_xctest_lifecycle.html":{"name":"balanced_xctest_lifecycle"},"block_based_kvo.html":{"name":"block_based_kvo"},"capture_variable.html":{"name":"capture_variable"},"class_delegate_protocol.html":{"name":"class_delegate_protocol"},"closing_brace.html":{"name":"closing_brace"},"closure_body_length.html":{"name":"closure_body_length"},"closure_end_indentation.html":{"name":"closure_end_indentation"},"closure_parameter_position.html":{"name":"closure_parameter_position"},"closure_spacing.html":{"name":"closure_spacing"},"collection_alignment.html":{"name":"collection_alignment"},"colon.html":{"name":"colon"},"comma.html":{"name":"comma"},"comma_inheritance.html":{"name":"comma_inheritance"},"comment_spacing.html":{"name":"comment_spacing"},"compiler_protocol_init.html":{"name":"compiler_protocol_init"},"computed_accessors_order.html":{"name":"computed_accessors_order"},"conditional_returns_on_newline.html":{"name":"conditional_returns_on_newline"},"contains_over_filter_count.html":{"name":"contains_over_filter_count"},"contains_over_filter_is_empty.html":{"name":"contains_over_filter_is_empty"},"contains_over_first_not_nil.html":{"name":"contains_over_first_not_nil"},"contains_over_range_nil_comparison.html":{"name":"contains_over_range_nil_comparison"},"control_statement.html":{"name":"control_statement"},"convenience_type.html":{"name":"convenience_type"},"custom_rules.html":{"name":"custom_rules"},"cyclomatic_complexity.html":{"name":"cyclomatic_complexity"},"deployment_target.html":{"name":"deployment_target"},"discarded_notification_center_observer.html":{"name":"discarded_notification_center_observer"},"discouraged_assert.html":{"name":"discouraged_assert"},"discouraged_direct_init.html":{"name":"discouraged_direct_init"},"discouraged_none_name.html":{"name":"discouraged_none_name"},"discouraged_object_literal.html":{"name":"discouraged_object_literal"},"discouraged_optional_boolean.html":{"name":"discouraged_optional_boolean"},"discouraged_optional_collection.html":{"name":"discouraged_optional_collection"},"duplicate_enum_cases.html":{"name":"duplicate_enum_cases"},"duplicate_imports.html":{"name":"duplicate_imports"},"duplicated_key_in_dictionary_literal.html":{"name":"duplicated_key_in_dictionary_literal"},"dynamic_inline.html":{"name":"dynamic_inline"},"empty_collection_literal.html":{"name":"empty_collection_literal"},"empty_count.html":{"name":"empty_count"},"empty_enum_arguments.html":{"name":"empty_enum_arguments"},"empty_parameters.html":{"name":"empty_parameters"},"empty_parentheses_with_trailing_closure.html":{"name":"empty_parentheses_with_trailing_closure"},"empty_string.html":{"name":"empty_string"},"empty_xctest_method.html":{"name":"empty_xctest_method"},"enum_case_associated_values_count.html":{"name":"enum_case_associated_values_count"},"expiring_todo.html":{"name":"expiring_todo"},"explicit_acl.html":{"name":"explicit_acl"},"explicit_enum_raw_value.html":{"name":"explicit_enum_raw_value"},"explicit_init.html":{"name":"explicit_init"},"explicit_self.html":{"name":"explicit_self"},"explicit_top_level_acl.html":{"name":"explicit_top_level_acl"},"explicit_type_interface.html":{"name":"explicit_type_interface"},"extension_access_modifier.html":{"name":"extension_access_modifier"},"fallthrough.html":{"name":"fallthrough"},"fatal_error_message.html":{"name":"fatal_error_message"},"file_header.html":{"name":"file_header"},"file_length.html":{"name":"file_length"},"file_name.html":{"name":"file_name"},"file_name_no_space.html":{"name":"file_name_no_space"},"file_types_order.html":{"name":"file_types_order"},"first_where.html":{"name":"first_where"},"flatmap_over_map_reduce.html":{"name":"flatmap_over_map_reduce"},"for_where.html":{"name":"for_where"},"force_cast.html":{"name":"force_cast"},"force_try.html":{"name":"force_try"},"force_unwrapping.html":{"name":"force_unwrapping"},"function_body_length.html":{"name":"function_body_length"},"function_default_parameter_at_end.html":{"name":"function_default_parameter_at_end"},"function_parameter_count.html":{"name":"function_parameter_count"},"generic_type_name.html":{"name":"generic_type_name"},"ibinspectable_in_extension.html":{"name":"ibinspectable_in_extension"},"identical_operands.html":{"name":"identical_operands"},"identifier_name.html":{"name":"identifier_name"},"implicit_getter.html":{"name":"implicit_getter"},"implicit_return.html":{"name":"implicit_return"},"implicitly_unwrapped_optional.html":{"name":"implicitly_unwrapped_optional"},"inclusive_language.html":{"name":"inclusive_language"},"indentation_width.html":{"name":"indentation_width"},"inert_defer.html":{"name":"inert_defer"},"is_disjoint.html":{"name":"is_disjoint"},"joined_default_parameter.html":{"name":"joined_default_parameter"},"large_tuple.html":{"name":"large_tuple"},"last_where.html":{"name":"last_where"},"leading_whitespace.html":{"name":"leading_whitespace"},"legacy_cggeometry_functions.html":{"name":"legacy_cggeometry_functions"},"legacy_constant.html":{"name":"legacy_constant"},"legacy_constructor.html":{"name":"legacy_constructor"},"legacy_hashing.html":{"name":"legacy_hashing"},"legacy_multiple.html":{"name":"legacy_multiple"},"legacy_nsgeometry_functions.html":{"name":"legacy_nsgeometry_functions"},"legacy_objc_type.html":{"name":"legacy_objc_type"},"legacy_random.html":{"name":"legacy_random"},"let_var_whitespace.html":{"name":"let_var_whitespace"},"line_length.html":{"name":"line_length"},"literal_expression_end_indentation.html":{"name":"literal_expression_end_indentation"},"local_doc_comment.html":{"name":"local_doc_comment"},"lower_acl_than_parent.html":{"name":"lower_acl_than_parent"},"mark.html":{"name":"mark"},"missing_docs.html":{"name":"missing_docs"},"modifier_order.html":{"name":"modifier_order"},"multiline_arguments.html":{"name":"multiline_arguments"},"multiline_arguments_brackets.html":{"name":"multiline_arguments_brackets"},"multiline_function_chains.html":{"name":"multiline_function_chains"},"multiline_literal_brackets.html":{"name":"multiline_literal_brackets"},"multiline_parameters.html":{"name":"multiline_parameters"},"multiline_parameters_brackets.html":{"name":"multiline_parameters_brackets"},"multiple_closures_with_trailing_closure.html":{"name":"multiple_closures_with_trailing_closure"},"nesting.html":{"name":"nesting"},"nimble_operator.html":{"name":"nimble_operator"},"no_extension_access_modifier.html":{"name":"no_extension_access_modifier"},"no_fallthrough_only.html":{"name":"no_fallthrough_only"},"no_grouping_extension.html":{"name":"no_grouping_extension"},"no_magic_numbers.html":{"name":"no_magic_numbers"},"no_space_in_method_call.html":{"name":"no_space_in_method_call"},"notification_center_detachment.html":{"name":"notification_center_detachment"},"ns_number_init_as_function_reference.html":{"name":"ns_number_init_as_function_reference"},"nslocalizedstring_key.html":{"name":"nslocalizedstring_key"},"nslocalizedstring_require_bundle.html":{"name":"nslocalizedstring_require_bundle"},"nsobject_prefer_isequal.html":{"name":"nsobject_prefer_isequal"},"number_separator.html":{"name":"number_separator"},"object_literal.html":{"name":"object_literal"},"opening_brace.html":{"name":"opening_brace"},"operator_usage_whitespace.html":{"name":"operator_usage_whitespace"},"operator_whitespace.html":{"name":"operator_whitespace"},"optional_enum_case_matching.html":{"name":"optional_enum_case_matching"},"orphaned_doc_comment.html":{"name":"orphaned_doc_comment"},"overridden_super_call.html":{"name":"overridden_super_call"},"override_in_extension.html":{"name":"override_in_extension"},"pattern_matching_keywords.html":{"name":"pattern_matching_keywords"},"prefer_nimble.html":{"name":"prefer_nimble"},"prefer_self_in_static_references.html":{"name":"prefer_self_in_static_references"},"prefer_self_type_over_type_of_self.html":{"name":"prefer_self_type_over_type_of_self"},"prefer_zero_over_explicit_init.html":{"name":"prefer_zero_over_explicit_init"},"prefixed_toplevel_constant.html":{"name":"prefixed_toplevel_constant"},"private_action.html":{"name":"private_action"},"private_outlet.html":{"name":"private_outlet"},"private_over_fileprivate.html":{"name":"private_over_fileprivate"},"private_subject.html":{"name":"private_subject"},"private_unit_test.html":{"name":"private_unit_test"},"prohibited_interface_builder.html":{"name":"prohibited_interface_builder"},"prohibited_super_call.html":{"name":"prohibited_super_call"},"protocol_property_accessors_order.html":{"name":"protocol_property_accessors_order"},"quick_discouraged_call.html":{"name":"quick_discouraged_call"},"quick_discouraged_focused_test.html":{"name":"quick_discouraged_focused_test"},"quick_discouraged_pending_test.html":{"name":"quick_discouraged_pending_test"},"raw_value_for_camel_cased_codable_enum.html":{"name":"raw_value_for_camel_cased_codable_enum"},"reduce_boolean.html":{"name":"reduce_boolean"},"reduce_into.html":{"name":"reduce_into"},"redundant_discardable_let.html":{"name":"redundant_discardable_let"},"redundant_nil_coalescing.html":{"name":"redundant_nil_coalescing"},"redundant_objc_attribute.html":{"name":"redundant_objc_attribute"},"redundant_optional_initialization.html":{"name":"redundant_optional_initialization"},"redundant_set_access_control.html":{"name":"redundant_set_access_control"},"redundant_string_enum_value.html":{"name":"redundant_string_enum_value"},"redundant_type_annotation.html":{"name":"redundant_type_annotation"},"redundant_void_return.html":{"name":"redundant_void_return"},"required_deinit.html":{"name":"required_deinit"},"required_enum_case.html":{"name":"required_enum_case"},"return_arrow_whitespace.html":{"name":"return_arrow_whitespace"},"return_value_from_void_function.html":{"name":"return_value_from_void_function"},"self_binding.html":{"name":"self_binding"},"self_in_property_initialization.html":{"name":"self_in_property_initialization"},"shorthand_operator.html":{"name":"shorthand_operator"},"shorthand_optional_binding.html":{"name":"shorthand_optional_binding"},"single_test_class.html":{"name":"single_test_class"},"sorted_first_last.html":{"name":"sorted_first_last"},"sorted_imports.html":{"name":"sorted_imports"},"statement_position.html":{"name":"statement_position"},"static_operator.html":{"name":"static_operator"},"strict_fileprivate.html":{"name":"strict_fileprivate"},"strong_iboutlet.html":{"name":"strong_iboutlet"},"superfluous_disable_command.html":{"name":"superfluous_disable_command"},"switch_case_alignment.html":{"name":"switch_case_alignment"},"switch_case_on_newline.html":{"name":"switch_case_on_newline"},"syntactic_sugar.html":{"name":"syntactic_sugar"},"test_case_accessibility.html":{"name":"test_case_accessibility"},"todo.html":{"name":"todo"},"toggle_bool.html":{"name":"toggle_bool"},"trailing_closure.html":{"name":"trailing_closure"},"trailing_comma.html":{"name":"trailing_comma"},"trailing_newline.html":{"name":"trailing_newline"},"trailing_semicolon.html":{"name":"trailing_semicolon"},"trailing_whitespace.html":{"name":"trailing_whitespace"},"type_body_length.html":{"name":"type_body_length"},"type_contents_order.html":{"name":"type_contents_order"},"type_name.html":{"name":"type_name"},"typesafe_array_init.html":{"name":"typesafe_array_init"},"unavailable_condition.html":{"name":"unavailable_condition"},"unavailable_function.html":{"name":"unavailable_function"},"unneeded_break_in_switch.html":{"name":"unneeded_break_in_switch"},"unneeded_parentheses_in_closure_argument.html":{"name":"unneeded_parentheses_in_closure_argument"},"unowned_variable_capture.html":{"name":"unowned_variable_capture"},"untyped_error_in_catch.html":{"name":"untyped_error_in_catch"},"unused_capture_list.html":{"name":"unused_capture_list"},"unused_closure_parameter.html":{"name":"unused_closure_parameter"},"unused_control_flow_label.html":{"name":"unused_control_flow_label"},"unused_declaration.html":{"name":"unused_declaration"},"unused_enumerated.html":{"name":"unused_enumerated"},"unused_import.html":{"name":"unused_import"},"unused_optional_binding.html":{"name":"unused_optional_binding"},"unused_setter_value.html":{"name":"unused_setter_value"},"valid_ibinspectable.html":{"name":"valid_ibinspectable"},"vertical_parameter_alignment.html":{"name":"vertical_parameter_alignment"},"vertical_parameter_alignment_on_call.html":{"name":"vertical_parameter_alignment_on_call"},"vertical_whitespace.html":{"name":"vertical_whitespace"},"vertical_whitespace_between_cases.html":{"name":"vertical_whitespace_between_cases"},"vertical_whitespace_closing_braces.html":{"name":"vertical_whitespace_closing_braces"},"vertical_whitespace_opening_braces.html":{"name":"vertical_whitespace_opening_braces"},"void_function_in_ternary.html":{"name":"void_function_in_ternary"},"void_return.html":{"name":"void_return"},"weak_delegate.html":{"name":"weak_delegate"},"xct_specific_matcher.html":{"name":"xct_specific_matcher"},"xctfail_message.html":{"name":"xctfail_message"},"yoda_condition.html":{"name":"yoda_condition"},"Structs/MarkdownReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"MarkdownReporter"},"Structs/MarkdownReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"MarkdownReporter"},"Structs/MarkdownReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"MarkdownReporter"},"Structs/MarkdownReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"MarkdownReporter"},"Structs/JUnitReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"JUnitReporter"},"Structs/JUnitReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"JUnitReporter"},"Structs/JUnitReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"JUnitReporter"},"Structs/JUnitReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"JUnitReporter"},"Structs/JSONReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"JSONReporter"},"Structs/JSONReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"JSONReporter"},"Structs/JSONReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"JSONReporter"},"Structs/JSONReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"JSONReporter"},"Structs/HTMLReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"HTMLReporter"},"Structs/HTMLReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"HTMLReporter"},"Structs/HTMLReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"HTMLReporter"},"Structs/HTMLReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"HTMLReporter"},"Structs/GitHubActionsLoggingReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"GitHubActionsLoggingReporter"},"Structs/GitHubActionsLoggingReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"GitHubActionsLoggingReporter"},"Structs/GitHubActionsLoggingReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"GitHubActionsLoggingReporter"},"Structs/GitHubActionsLoggingReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"GitHubActionsLoggingReporter"},"Structs/EmojiReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"EmojiReporter"},"Structs/EmojiReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"EmojiReporter"},"Structs/EmojiReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"EmojiReporter"},"Structs/EmojiReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"EmojiReporter"},"Structs/CodeClimateReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"CodeClimateReporter"},"Structs/CodeClimateReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"CodeClimateReporter"},"Structs/CodeClimateReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"CodeClimateReporter"},"Structs/CodeClimateReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"CodeClimateReporter"},"Structs/CheckstyleReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"CheckstyleReporter"},"Structs/CheckstyleReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"CheckstyleReporter"},"Structs/CheckstyleReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"CheckstyleReporter"},"Structs/CheckstyleReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"CheckstyleReporter"},"Structs/CSVReporter.html#/s:18SwiftLintFramework8ReporterP10identifierSSvpZ":{"name":"identifier","parent_name":"CSVReporter"},"Structs/CSVReporter.html#/s:18SwiftLintFramework8ReporterP10isRealtimeSbvpZ":{"name":"isRealtime","parent_name":"CSVReporter"},"Structs/CSVReporter.html#/s:s23CustomStringConvertibleP11descriptionSSvp":{"name":"description","parent_name":"CSVReporter"},"Structs/CSVReporter.html#/s:18SwiftLintFramework8ReporterP14generateReportySSSayAA14StyleViolationVGFZ":{"name":"generateReport(_:)","parent_name":"CSVReporter"},"Structs/CSVReporter.html":{"name":"CSVReporter","abstract":"

Reports violations as a newline-separated string of comma-separated values (CSV).

"},"Structs/CheckstyleReporter.html":{"name":"CheckstyleReporter","abstract":"

Reports violations as XML conforming to the Checkstyle specification, as defined here:"},"Structs/CodeClimateReporter.html":{"name":"CodeClimateReporter","abstract":"

Reports violations as a JSON array in Code Climate format.

"},"Structs/EmojiReporter.html":{"name":"EmojiReporter","abstract":"

Reports violations in the format that’s both fun and easy to read.

"},"Structs/GitHubActionsLoggingReporter.html":{"name":"GitHubActionsLoggingReporter","abstract":"

Reports violations in the format GitHub-hosted virtual machine for Actions can recognize as messages.

"},"Structs/HTMLReporter.html":{"name":"HTMLReporter","abstract":"

Reports violations as HTML.

"},"Structs/JSONReporter.html":{"name":"JSONReporter","abstract":"

Reports violations as a JSON array.

"},"Structs/JUnitReporter.html":{"name":"JUnitReporter","abstract":"

Reports violations as JUnit XML.

"},"Structs/MarkdownReporter.html":{"name":"MarkdownReporter","abstract":"

Reports violations as markdown formated (with tables).

"},"rule-directory.html":{"name":"Rule Directory"},"Rules.html":{"name":"Rules"},"Reporters.html":{"name":"Reporters"},"Guides.html":{"name":"Guides","abstract":"

The following guides are available globally.

"},"Classes.html":{"name":"Classes","abstract":"

The following classes are available globally.

"},"Global%20Variables.html":{"name":"Global Variables","abstract":"

The following global variables are available globally.

"},"Enums.html":{"name":"Enumerations","abstract":"

The following enumerations are available globally.

"},"Extensions.html":{"name":"Extensions","abstract":"

The following extensions are available globally.

"},"Functions.html":{"name":"Functions","abstract":"

The following functions are available globally.

"},"Protocols.html":{"name":"Protocols","abstract":"

The following protocols are available globally.

"},"Structs.html":{"name":"Structures","abstract":"

The following structures are available globally.

"}} \ No newline at end of file diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_binding.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_binding.html new file mode 100644 index 000000000..877fc8378 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_binding.html @@ -0,0 +1,372 @@ + + + + self_binding Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Self Binding

+ +

Re-bind self to a consistent identifier name.

+ +
    +
  • Identifier: self_binding
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, bindIdentifier: self
  • +
+

Non Triggering Examples

+
if let self = self { return }
+
+
guard let self = self else else { return }
+
+
if let this = this { return }
+
+
guard let this = this else else { return }
+
+
if let this = self { return }
+
+
guard let this = self else else { return }
+
+

Triggering Examples

+
if let ↓`self` = self { return }
+
+
guard let ↓`self` = self else else { return }
+
+
if let ↓this = self { return }
+
+
guard let ↓this = self else else { return }
+
+
if let ↓self = self { return }
+
+
guard let ↓self = self else { return }
+
+
if let ↓self { return }
+
+
guard let ↓self else { return }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_in_property_initialization.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_in_property_initialization.html new file mode 100644 index 000000000..fde89c849 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/self_in_property_initialization.html @@ -0,0 +1,392 @@ + + + + self_in_property_initialization Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Self in Property Initialization

+ +

self refers to the unapplied NSObject.self() method, which is likely not expected. Make the variable lazy to be able to refer to the current instance or use ClassName.self.

+ +
    +
  • Identifier: self_in_property_initialization
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class View: UIView {
+    let button: UIButton = {
+        return UIButton()
+    }()
+}
+
+
class View: UIView {
+    lazy var button: UIButton = {
+        let button = UIButton()
+        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
+        return button
+    }()
+}
+
+
class View: UIView {
+    var button: UIButton = {
+        let button = UIButton()
+        button.addTarget(otherObject, action: #selector(didTapButton), for: .touchUpInside)
+        return button
+    }()
+}
+
+
class View: UIView {
+    private let collectionView: UICollectionView = {
+        let layout = UICollectionViewFlowLayout()
+        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.registerReusable(Cell.self)
+
+        return collectionView
+    }()
+}
+
+

Triggering Examples

+
class View: UIView {
+    ↓var button: UIButton = {
+        let button = UIButton()
+        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
+        return button
+    }()
+}
+
+
class View: UIView {
+    ↓let button: UIButton = {
+        let button = UIButton()
+        button.addTarget(self, action: #selector(didTapButton), for: .touchUpInside)
+        return button
+    }()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_operator.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_operator.html new file mode 100644 index 000000000..893bb0467 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_operator.html @@ -0,0 +1,495 @@ + + + + shorthand_operator Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Shorthand Operator

+ +

Prefer shorthand operators (+=, -=, *=, /=) over doing the operation and assigning.

+ +
    +
  • Identifier: shorthand_operator
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: error
  • +
+

Non Triggering Examples

+
foo -= 1
+
+
foo -= variable
+
+
foo -= bar.method()
+
+
self.foo = foo - 1
+
+
foo = self.foo - 1
+
+
page = ceilf(currentOffset - pageWidth)
+
+
foo = aMethod(foo - bar)
+
+
foo = aMethod(bar - foo)
+
+
public func -= (lhs: inout Foo, rhs: Int) {
+    lhs = lhs - rhs
+}
+
+
foo /= 1
+
+
foo /= variable
+
+
foo /= bar.method()
+
+
self.foo = foo / 1
+
+
foo = self.foo / 1
+
+
page = ceilf(currentOffset / pageWidth)
+
+
foo = aMethod(foo / bar)
+
+
foo = aMethod(bar / foo)
+
+
public func /= (lhs: inout Foo, rhs: Int) {
+    lhs = lhs / rhs
+}
+
+
foo += 1
+
+
foo += variable
+
+
foo += bar.method()
+
+
self.foo = foo + 1
+
+
foo = self.foo + 1
+
+
page = ceilf(currentOffset + pageWidth)
+
+
foo = aMethod(foo + bar)
+
+
foo = aMethod(bar + foo)
+
+
public func += (lhs: inout Foo, rhs: Int) {
+    lhs = lhs + rhs
+}
+
+
foo *= 1
+
+
foo *= variable
+
+
foo *= bar.method()
+
+
self.foo = foo * 1
+
+
foo = self.foo * 1
+
+
page = ceilf(currentOffset * pageWidth)
+
+
foo = aMethod(foo * bar)
+
+
foo = aMethod(bar * foo)
+
+
public func *= (lhs: inout Foo, rhs: Int) {
+    lhs = lhs * rhs
+}
+
+
var helloWorld = "world!"
+ helloWorld = "Hello, " + helloWorld
+
+
angle = someCheck ? angle : -angle
+
+
seconds = seconds * 60 + value
+
+

Triggering Examples

+
↓foo = foo - 1
+
+
+
↓foo = foo - aVariable
+
+
+
↓foo = foo - bar.method()
+
+
+
↓foo.aProperty = foo.aProperty - 1
+
+
+
↓self.aProperty = self.aProperty - 1
+
+
+
↓foo = foo / 1
+
+
+
↓foo = foo / aVariable
+
+
+
↓foo = foo / bar.method()
+
+
+
↓foo.aProperty = foo.aProperty / 1
+
+
+
↓self.aProperty = self.aProperty / 1
+
+
+
↓foo = foo + 1
+
+
+
↓foo = foo + aVariable
+
+
+
↓foo = foo + bar.method()
+
+
+
↓foo.aProperty = foo.aProperty + 1
+
+
+
↓self.aProperty = self.aProperty + 1
+
+
+
↓foo = foo * 1
+
+
+
↓foo = foo * aVariable
+
+
+
↓foo = foo * bar.method()
+
+
+
↓foo.aProperty = foo.aProperty * 1
+
+
+
↓self.aProperty = self.aProperty * 1
+
+
+
↓n = n + i / outputLength
+
+
↓n = n - i / outputLength
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_optional_binding.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_optional_binding.html new file mode 100644 index 000000000..71d68f620 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/shorthand_optional_binding.html @@ -0,0 +1,366 @@ + + + + shorthand_optional_binding Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Shorthand Optional Binding

+ +

Use shorthand syntax for optional binding

+ +
    +
  • Identifier: shorthand_optional_binding
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.7.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
    if let i {}
+    if let i = a {}
+    guard let i = f() else {}
+    if var i = i() {}
+    if let i = i as? Foo {}
+    guard let `self` = self else {}
+    while var i { i = nil }
+
+

Triggering Examples

+
    if ↓let i = i {}
+    if ↓let self = self {}
+    if ↓var `self` = `self` {}
+    if i > 0, ↓let j = j {}
+    if ↓let i = i, ↓var j = j {}
+
+
    guard ↓let i = i else {}
+    guard ↓let self = self else {}
+    guard ↓var `self` = `self` else {}
+    guard i > 0, ↓let j = j else {}
+    guard ↓let i = i, ↓var j = j else {}
+
+
    while ↓var i = i { i = nil }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/single_test_class.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/single_test_class.html new file mode 100644 index 000000000..5eed2254a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/single_test_class.html @@ -0,0 +1,378 @@ + + + + single_test_class Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Single Test Class

+ +

Test files should contain a single QuickSpec or XCTestCase class.

+ +
    +
  • Identifier: single_test_class
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, test_parent_classes: [“QuickSpec”, “XCTestCase”]
  • +
+

Non Triggering Examples

+
class FooTests {  }
+
+
+
class FooTests: QuickSpec {  }
+
+
+
class FooTests: XCTestCase {  }
+
+
+

Triggering Examples

+
↓class FooTests: QuickSpec {  }
+↓class BarTests: QuickSpec {  }
+
+
↓class FooTests: QuickSpec {  }
+↓class BarTests: QuickSpec {  }
+↓class TotoTests: QuickSpec {  }
+
+
↓class FooTests: XCTestCase {  }
+↓class BarTests: XCTestCase {  }
+
+
↓class FooTests: XCTestCase {  }
+↓class BarTests: XCTestCase {  }
+↓class TotoTests: XCTestCase {  }
+
+
↓class FooTests: QuickSpec {  }
+↓class BarTests: XCTestCase {  }
+
+
↓class FooTests: QuickSpec {  }
+↓class BarTests: XCTestCase {  }
+class TotoTests {  }
+
+
final ↓class FooTests: QuickSpec {  }
+↓class BarTests: XCTestCase {  }
+class TotoTests {  }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_first_last.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_first_last.html new file mode 100644 index 000000000..44b096ca5 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_first_last.html @@ -0,0 +1,414 @@ + + + + sorted_first_last Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Min or Max over Sorted First or Last

+ +

Prefer using min() or max() over sorted().first or sorted().last

+ +
    +
  • Identifier: sorted_first_last
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: performance
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let min = myList.min()
+
+
+
let min = myList.min(by: { $0 < $1 })
+
+
+
let min = myList.min(by: >)
+
+
+
let max = myList.max()
+
+
+
let max = myList.max(by: { $0 < $1 })
+
+
+
let message = messages.sorted(byKeyPath: #keyPath(Message.timestamp)).last
+
+
let message = messages.sorted(byKeyPath: "timestamp", ascending: false).first
+
+
myList.sorted().firstIndex(of: key)
+
+
myList.sorted().lastIndex(of: key)
+
+
myList.sorted().firstIndex(where: someFunction)
+
+
myList.sorted().lastIndex(where: someFunction)
+
+
myList.sorted().firstIndex { $0 == key }
+
+
myList.sorted().lastIndex { $0 == key }
+
+

Triggering Examples

+
↓myList.sorted().first
+
+
+
↓myList.sorted(by: { $0.description < $1.description }).first
+
+
+
↓myList.sorted(by: >).first
+
+
+
↓myList.map { $0 + 1 }.sorted().first
+
+
+
↓myList.sorted(by: someFunction).first
+
+
+
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.first
+
+
+
↓myList.sorted().last
+
+
+
↓myList.sorted().last?.something()
+
+
+
↓myList.sorted(by: { $0.description < $1.description }).last
+
+
+
↓myList.map { $0 + 1 }.sorted().last
+
+
+
↓myList.sorted(by: someFunction).last
+
+
+
↓myList.map { $0 + 1 }.sorted { $0.description < $1.description }.last
+
+
+
↓myList.map { $0 + 1 }.sorted { $0.first < $1.first }.last
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_imports.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_imports.html new file mode 100644 index 000000000..2a47968a8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/sorted_imports.html @@ -0,0 +1,406 @@ + + + + sorted_imports Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Sorted Imports

+ +

Imports should be sorted.

+ +
    +
  • Identifier: sorted_imports
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
import AAA
+import BBB
+import CCC
+import DDD
+
+
import Alamofire
+import API
+
+
import labc
+import Ldef
+
+
import BBB
+// comment
+import AAA
+import CCC
+
+
@testable import AAA
+import   CCC
+
+
import AAA
+@testable import   CCC
+
+
import EEE.A
+import FFF.B
+#if os(Linux)
+import DDD.A
+import EEE.B
+#else
+import CCC
+import DDD.B
+#endif
+import AAA
+import BBB
+
+

Triggering Examples

+
import AAA
+import ZZZ
+import ↓BBB
+import CCC
+
+
import DDD
+// comment
+import CCC
+import ↓AAA
+
+
@testable import CCC
+import   ↓AAA
+
+
import CCC
+@testable import   ↓AAA
+
+
import FFF.B
+import ↓EEE.A
+#if os(Linux)
+import DDD.A
+import EEE.B
+#else
+import DDD.B
+import ↓CCC
+#endif
+import AAA
+import BBB
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/statement_position.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/statement_position.html new file mode 100644 index 000000000..1fb8974c6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/statement_position.html @@ -0,0 +1,372 @@ + + + + statement_position Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Statement Position

+ +

Else and catch should be on the same line, one space after the previous declaration.

+ +
    +
  • Identifier: statement_position
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (statement_mode) default, (severity) warning
  • +
+

Non Triggering Examples

+
} else if {
+
+
} else {
+
+
} catch {
+
+
"}else{"
+
+
struct A { let catchphrase: Int }
+let a = A(
+ catchphrase: 0
+)
+
+
struct A { let `catch`: Int }
+let a = A(
+ `catch`: 0
+)
+
+

Triggering Examples

+
↓}else if {
+
+
↓}  else {
+
+
↓}
+catch {
+
+
↓}
+      catch {
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/static_operator.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/static_operator.html new file mode 100644 index 000000000..e20af9ac7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/static_operator.html @@ -0,0 +1,398 @@ + + + + static_operator Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Static Operator

+ +

Operators should be declared as static functions, not free functions.

+ +
    +
  • Identifier: static_operator
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class A: Equatable {
+  static func == (lhs: A, rhs: A) -> Bool {
+    return false
+  }
+
+
class A<T>: Equatable {
+    static func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
+        return false
+    }
+
+
public extension Array where Element == Rule {
+  static func == (lhs: Array, rhs: Array) -> Bool {
+    if lhs.count != rhs.count { return false }
+    return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
+  }
+}
+
+
private extension Optional where Wrapped: Comparable {
+  static func < (lhs: Optional, rhs: Optional) -> Bool {
+    switch (lhs, rhs) {
+    case let (lhs?, rhs?):
+      return lhs < rhs
+    case (nil, _?):
+      return true
+    default:
+      return false
+    }
+  }
+}
+
+

Triggering Examples

+
↓func == (lhs: A, rhs: A) -> Bool {
+  return false
+}
+
+
↓func == <T>(lhs: A<T>, rhs: A<T>) -> Bool {
+  return false
+}
+
+
↓func == (lhs: [Rule], rhs: [Rule]) -> Bool {
+  if lhs.count != rhs.count { return false }
+  return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
+}
+
+
private ↓func < <T: Comparable>(lhs: T?, rhs: T?) -> Bool {
+  switch (lhs, rhs) {
+  case let (lhs?, rhs?):
+    return lhs < rhs
+  case (nil, _?):
+    return true
+  default:
+    return false
+  }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strict_fileprivate.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strict_fileprivate.html new file mode 100644 index 000000000..f1ed9e4b4 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strict_fileprivate.html @@ -0,0 +1,382 @@ + + + + strict_fileprivate Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Strict fileprivate

+ +

fileprivate should be avoided.

+ +
    +
  • Identifier: strict_fileprivate
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
extension String {}
+
+
private extension String {}
+
+
public
+extension String {}
+
+
open extension
+  String {}
+
+
internal extension String {}
+
+

Triggering Examples

+
↓fileprivate extension String {}
+
+
↓fileprivate
+  extension String {}
+
+
↓fileprivate extension
+  String {}
+
+
extension String {
+  ↓fileprivate func Something(){}
+}
+
+
class MyClass {
+  ↓fileprivate let myInt = 4
+}
+
+
class MyClass {
+  ↓fileprivate(set) var myInt = 4
+}
+
+
struct Outter {
+  struct Inter {
+    ↓fileprivate struct Inner {}
+  }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strong_iboutlet.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strong_iboutlet.html new file mode 100644 index 000000000..ad59812f6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/strong_iboutlet.html @@ -0,0 +1,364 @@ + + + + strong_iboutlet Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Strong IBOutlet

+ +

@IBOutlets shouldn’t be declared as weak.

+ +
    +
  • Identifier: strong_iboutlet
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class ViewController: UIViewController {
+    @IBOutlet var label: UILabel?
+}
+
+
class ViewController: UIViewController {
+    weak var label: UILabel?
+}
+
+

Triggering Examples

+
class ViewController: UIViewController {
+    @IBOutlet ↓weak var label: UILabel?
+}
+
+
class ViewController: UIViewController {
+    @IBOutlet ↓unowned var label: UILabel!
+}
+
+
class ViewController: UIViewController {
+    @IBOutlet ↓weak var textField: UITextField?
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/superfluous_disable_command.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/superfluous_disable_command.html new file mode 100644 index 000000000..431253af8 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/superfluous_disable_command.html @@ -0,0 +1,342 @@ + + + + superfluous_disable_command Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Superfluous Disable Command

+ +

SwiftLint ‘disable’ commands are superfluous when the disabled rule would not have triggered a violation in the disabled region. Use “ - ” if you wish to document a command.

+ +
    +
  • Identifier: superfluous_disable_command
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/swift-syntax-dashboard.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/swift-syntax-dashboard.html new file mode 100644 index 000000000..a8c4a53f7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/swift-syntax-dashboard.html @@ -0,0 +1,571 @@ + + + + Swift Syntax Dashboard Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Swift Syntax Dashboard

+ +

Efforts are actively under way to migrate most rules off SourceKit to use SwiftSyntax instead.

+ +

Rules written using SwiftSyntax tend to be significantly faster and have fewer false positives +than rules that use SourceKit to get source structure information.

+ +

47 out of 215 (21%) +of SwiftLint’s linter rules use SourceKit.

+

Rules Using SourceKit

+

Enabled By Default (16)

+ + +

Opt-In (31)

+ + +

Rules Not Using SourceKit

+

Enabled By Default (75)

+ + +

Opt-In (93)

+ + + +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_alignment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_alignment.html new file mode 100644 index 000000000..5c40e28c0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_alignment.html @@ -0,0 +1,420 @@ + + + + switch_case_alignment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Switch and Case Statement Alignment

+ +

Case statements should vertically align with their enclosing switch statement, or indented if configured otherwise.

+ +
    +
  • Identifier: switch_case_alignment
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, indented_cases: false
  • +
+

Non Triggering Examples

+
switch someBool {
+case true: // case 1
+    print('red')
+case false:
+    /*
+    case 2
+    */
+    if case let .someEnum(val) = someFunc() {
+        print('blue')
+    }
+}
+enum SomeEnum {
+    case innocent
+}
+
+
if aBool {
+    switch someBool {
+    case true:
+        print('red')
+    case false:
+        print('blue')
+    }
+}
+
+
switch someInt {
+// comments ignored
+case 0:
+    // zero case
+    print('Zero')
+case 1:
+    print('One')
+default:
+    print('Some other number')
+}
+
+

Triggering Examples

+
switch someBool {
+    ↓case true:
+        print("red")
+    ↓case false:
+        print("blue")
+}
+
+
if aBool {
+    switch someBool {
+        ↓case true:
+            print('red')
+        ↓case false:
+            print('blue')
+    }
+}
+
+
switch someInt {
+    ↓case 0:
+        print('Zero')
+    ↓case 1:
+        print('One')
+    ↓default:
+        print('Some other number')
+}
+
+
switch someBool {
+case true:
+    print('red')
+    ↓case false:
+        print('blue')
+}
+
+
if aBool {
+    switch someBool {
+        ↓case true:
+        print('red')
+    case false:
+    print('blue')
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_on_newline.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_on_newline.html new file mode 100644 index 000000000..6786256af --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/switch_case_on_newline.html @@ -0,0 +1,458 @@ + + + + switch_case_on_newline Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Switch Case on Newline

+ +

Cases inside a switch should always be on a newline

+ +
    +
  • Identifier: switch_case_on_newline
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
/*case 1: */return true
+
+
//case 1:
+ return true
+
+
let x = [caseKey: value]
+
+
let x = [key: .default]
+
+
if case let .someEnum(value) = aFunction([key: 2]) { }
+
+
guard case let .someEnum(value) = aFunction([key: 2]) { }
+
+
for case let .someEnum(value) = aFunction([key: 2]) { }
+
+
enum Environment {
+ case development
+}
+
+
enum Environment {
+ case development(url: URL)
+}
+
+
enum Environment {
+ case development(url: URL) // staging
+}
+
+
switch foo {
+    case 1:
+ return true
+}
+
+
switch foo {
+    default:
+ return true
+}
+
+
switch foo {
+    case let value:
+ return true
+}
+
+
switch foo {
+    case .myCase: // error from network
+ return true
+}
+
+
switch foo {
+    case let .myCase(value) where value > 10:
+ return false
+}
+
+
switch foo {
+    case let .myCase(value)
+ where value > 10:
+ return false
+}
+
+
switch foo {
+    case let .myCase(code: lhsErrorCode, description: _)
+ where lhsErrorCode > 10:
+return false
+}
+
+
switch foo {
+    case #selector(aFunction(_:)):
+ return false
+
+}
+
+
do {
+  let loadedToken = try tokenManager.decodeToken(from: response)
+  return loadedToken
+} catch { throw error }
+
+

Triggering Examples

+
switch foo {
+    ↓case 1: return true
+}
+
+
switch foo {
+    ↓case let value: return true
+}
+
+
switch foo {
+    ↓default: return true
+}
+
+
switch foo {
+    ↓case "a string": return false
+}
+
+
switch foo {
+    ↓case .myCase: return false // error from network
+}
+
+
switch foo {
+    ↓case let .myCase(value) where value > 10: return false
+}
+
+
switch foo {
+    ↓case #selector(aFunction(_:)): return false
+
+}
+
+
switch foo {
+    ↓case let .myCase(value)
+ where value > 10: return false
+}
+
+
switch foo {
+    ↓case .first,
+ .second: return false
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/syntactic_sugar.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/syntactic_sugar.html new file mode 100644 index 000000000..7df8d27b7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/syntactic_sugar.html @@ -0,0 +1,424 @@ + + + + syntactic_sugar Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Syntactic Sugar

+ +

Shorthand syntactic sugar should be used, i.e. [Int] instead of Array.

+ +
    +
  • Identifier: syntactic_sugar
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let x: [Int]
+
+
let x: [Int: String]
+
+
let x: Int?
+
+
func x(a: [Int], b: Int) -> [Int: Any]
+
+
let x: Int!
+
+
extension Array {
+  func x() { }
+}
+
+
extension Dictionary {
+  func x() { }
+}
+
+
let x: CustomArray<String>
+
+
var currentIndex: Array<OnboardingPage>.Index?
+
+
func x(a: [Int], b: Int) -> Array<Int>.Index
+
+
unsafeBitCast(nonOptionalT, to: Optional<T>.self)
+
+
unsafeBitCast(someType, to: Swift.Array<T>.self)
+
+
IndexingIterator<Array<Dictionary<String, AnyObject>>>.self
+
+
let y = Optional<String>.Type
+
+
type is Optional<String>.Type
+
+
let x: Foo.Optional<String>
+
+
let x = case Optional<Any>.none = obj
+
+
let a = Swift.Optional<String?>.none
+
+

Triggering Examples

+
let x: ↓Array<String>
+
+
let x: ↓Dictionary<Int, String>
+
+
let x: ↓Optional<Int>
+
+
let x: ↓Swift.Array<String>
+
+
func x(a: ↓Array<Int>, b: Int) -> [Int: Any]
+
+
func x(a: ↓Swift.Array<Int>, b: Int) -> [Int: Any]
+
+
func x(a: [Int], b: Int) -> ↓Dictionary<Int, String>
+
+
let x = y as? ↓Array<[String: Any]>
+
+
let x = Box<Array<T>>()
+
+
func x() -> Box<↓Array<T>>
+
+
func x() -> ↓Dictionary<String, Any>?
+
+
typealias Document = ↓Dictionary<String, T?>
+
+
func x(_ y: inout ↓Array<T>)
+
+
let x:↓Dictionary<String, ↓Dictionary<Int, Int>>
+
+
func x() -> Any { return ↓Dictionary<Int, String>()}
+
+
let x = ↓Array<String>.array(of: object)
+
+
let x = ↓Swift.Array<String>.array(of: object)
+
+
@_specialize(where S == ↓Array<Character>)
+public init<S: Sequence>(_ elements: S)
+
+
let dict: [String: Any] = [:]
+_ = dict["key"] as? ↓Optional<String?> ?? Optional<String?>.none
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/test_case_accessibility.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/test_case_accessibility.html new file mode 100644 index 000000000..beae792c3 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/test_case_accessibility.html @@ -0,0 +1,438 @@ + + + + test_case_accessibility Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Test case accessibility

+ +

Test cases should only contain private non-test members.

+ +
    +
  • Identifier: test_case_accessibility
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, allowed_prefixes: [], test_parent_classes: [“QuickSpec”, “XCTestCase”]
  • +
+

Non Triggering Examples

+
let foo: String?
+
+
let foo: String?
+
+class FooTests: XCTestCase {
+    static let allTests: [String] = []
+
+    private let foo: String {
+        let nestedMember = "hi"
+        return nestedMember
+    }
+
+    override static func setUp() {
+        super.setUp()
+    }
+
+    override func setUp() {
+        super.setUp()
+    }
+
+    override func setUpWithError() throws {
+        try super.setUpWithError()
+    }
+
+    override static func tearDown() {
+        super.tearDown()
+    }
+
+    override func tearDown() {
+        super.tearDown()
+    }
+
+    override func tearDownWithError() {
+        try super.tearDownWithError()
+    }
+
+    override func someFutureXCTestFunction() {
+        super.someFutureXCTestFunction()
+    }
+
+    func testFoo() {
+        XCTAssertTrue(true)
+    }
+
+    func testBar() {
+        func nestedFunc() {}
+    }
+
+    private someFunc(hasParam: Bool) {}
+}
+
+
class FooTests: XCTestCase {
+    private struct MockSomething: Something {}
+}
+
+
class FooTests: XCTestCase {
+    func allowedPrefixTestFoo() {}
+}
+
+
class Foobar {
+    func setUp() {}
+
+    func tearDown() {}
+
+    func testFoo() {}
+}
+
+

Triggering Examples

+
class FooTests: XCTestCase {
+    ↓typealias Bar = Foo.Bar
+
+    ↓var foo: String?
+    ↓let bar: String?
+
+    ↓static func foo() {}
+
+    ↓func setUp(withParam: String) {}
+
+    ↓func foobar() {}
+
+    ↓func not_testBar() {}
+
+    ↓enum Nested {}
+
+    ↓static func testFoo() {}
+
+    ↓static func allTests() {}
+
+    ↓func testFoo(hasParam: Bool) {}
+}
+
+final class BarTests: XCTestCase {
+    ↓class Nested {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/todo.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/todo.html new file mode 100644 index 000000000..38020ab42 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/todo.html @@ -0,0 +1,374 @@ + + + + todo Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Todo

+ +

TODOs and FIXMEs should be resolved.

+ +
    +
  • Identifier: todo
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
// notaTODO:
+
+
+
// notaFIXME:
+
+
+

Triggering Examples

+
// ↓TODO:
+
+
+
// ↓FIXME:
+
+
+
// ↓TODO(note)
+
+
+
// ↓FIXME(note)
+
+
+
/* ↓FIXME: */
+
+
+
/* ↓TODO: */
+
+
+
/** ↓FIXME: */
+
+
+
/** ↓TODO: */
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/toggle_bool.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/toggle_bool.html new file mode 100644 index 000000000..5aa60189e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/toggle_bool.html @@ -0,0 +1,368 @@ + + + + toggle_bool Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Toggle Bool

+ +

Prefer someBool.toggle() over someBool = !someBool.

+ +
    +
  • Identifier: toggle_bool
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
isHidden.toggle()
+
+
+
view.clipsToBounds.toggle()
+
+
+
func foo() { abc.toggle() }
+
+
view.clipsToBounds = !clipsToBounds
+
+
+
disconnected = !connected
+
+
+
result = !result.toggle()
+
+

Triggering Examples

+
↓isHidden = !isHidden
+
+
+
↓view.clipsToBounds = !view.clipsToBounds
+
+
+
func foo() { ↓abc = !abc }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_closure.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_closure.html new file mode 100644 index 000000000..3ab6c1ac0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_closure.html @@ -0,0 +1,380 @@ + + + + trailing_closure Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Trailing Closure

+ +

Trailing closure syntax should be used whenever possible.

+ +
    +
  • Identifier: trailing_closure
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, only_single_muted_parameter: false
  • +
+

Non Triggering Examples

+
foo.map { $0 + 1 }
+
+
+
foo.bar()
+
+
+
foo.reduce(0) { $0 + 1 }
+
+
+
if let foo = bar.map({ $0 + 1 }) { }
+
+
+
foo.something(param1: { $0 }, param2: { $0 + 1 })
+
+
+
offsets.sorted { $0.offset < $1.offset }
+
+
+
foo.something({ return 1 }())
+
+
foo.something({ return $0 }(1))
+
+
foo.something(0, { return 1 }())
+
+

Triggering Examples

+
↓foo.map({ $0 + 1 })
+
+
+
↓foo.reduce(0, combine: { $0 + 1 })
+
+
+
↓offsets.sorted(by: { $0.offset < $1.offset })
+
+
+
↓foo.something(0, { $0 + 1 })
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_comma.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_comma.html new file mode 100644 index 000000000..d20565865 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_comma.html @@ -0,0 +1,409 @@ + + + + trailing_comma Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Trailing Comma

+ +

Trailing commas in arrays and dictionaries should be avoided/enforced.

+ +
    +
  • Identifier: trailing_comma
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, mandatory_comma: false
  • +
+

Non Triggering Examples

+
let foo = [1, 2, 3]
+
+
+
let foo = []
+
+
+
let foo = [:]
+
+
+
let foo = [1: 2, 2: 3]
+
+
+
let foo = [Void]()
+
+
+
let example = [ 1,
+ 2
+ // 3,
+]
+
+
foo([1: "\(error)"])
+
+
+
let foo = [Int]()
+
+
+

Triggering Examples

+
let foo = [1, 2, 3↓,]
+
+
+
let foo = [1, 2, 3↓, ]
+
+
+
let foo = [1, 2, 3   ↓,]
+
+
+
let foo = [1: 2, 2: 3↓, ]
+
+
+
struct Bar {
+ let foo = [1: 2, 2: 3↓, ]
+}
+
+
+
let foo = [1, 2, 3↓,] + [4, 5, 6↓,]
+
+
+
let example = [ 1,
+2↓,
+ // 3,
+]
+
+
let foo = ["אבג", "αβγ", "🇺🇸"↓,]
+
+
+
class C {
+ #if true
+ func f() {
+ let foo = [1, 2, 3↓,]
+ }
+ #endif
+}
+
+
foo([1: "\(error)"↓,])
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_newline.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_newline.html new file mode 100644 index 000000000..ae1ec6400 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_newline.html @@ -0,0 +1,353 @@ + + + + trailing_newline Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Trailing Newline

+ +

Files should have a single trailing newline.

+ +
    +
  • Identifier: trailing_newline
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let a = 0
+
+
+

Triggering Examples

+
let a = 0
+
+
let a = 0
+
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_semicolon.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_semicolon.html new file mode 100644 index 000000000..c1dde716a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_semicolon.html @@ -0,0 +1,356 @@ + + + + trailing_semicolon Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Trailing Semicolon

+ +

Lines should not have trailing semicolons.

+ +
    +
  • Identifier: trailing_semicolon
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let a = 0
+
+
+
let a = 0; let b = 0
+
+

Triggering Examples

+
let a = 0↓;
+
+
+
let a = 0↓;
+let b = 1
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_whitespace.html new file mode 100644 index 000000000..5e384d110 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/trailing_whitespace.html @@ -0,0 +1,365 @@ + + + + trailing_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Trailing Whitespace

+ +

Lines should not have trailing whitespace.

+ +
    +
  • Identifier: trailing_whitespace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, ignores_empty_lines: false, ignores_comments: true
  • +
+

Non Triggering Examples

+
let name: String
+
+
+
//
+
+
+
// 
+
+
+
let name: String //
+
+
+
let name: String // 
+
+
+

Triggering Examples

+
let name: String 
+
+
+
/* */ let name: String 
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_body_length.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_body_length.html new file mode 100644 index 000000000..8bef98734 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_body_length.html @@ -0,0 +1,5444 @@ + + + + type_body_length Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Type Body Length

+ +

Type bodies should not span too many lines.

+ +
    +
  • Identifier: type_body_length
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: metrics
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning: 250, error: 350
  • +
+

Non Triggering Examples

+
class Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
class Abc {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
class Abc {
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+}
+
+
+
class Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+
+/* this is
+a multiline comment
+*/
+}
+
+
+
struct Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
struct Abc {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
struct Abc {
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+}
+
+
+
struct Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+
+/* this is
+a multiline comment
+*/
+}
+
+
+
enum Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
enum Abc {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
enum Abc {
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+}
+
+
+
enum Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+
+/* this is
+a multiline comment
+*/
+}
+
+
+
actor Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
actor Abc {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+
+
actor Abc {
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+// this is a comment
+}
+
+
+
actor Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+
+/* this is
+a multiline comment
+*/
+}
+
+
+

Triggering Examples

+
↓class Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
↓struct Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
↓enum Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+
↓actor Abc {
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+let abc = 0
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_contents_order.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_contents_order.html new file mode 100644 index 000000000..382700d9c --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_contents_order.html @@ -0,0 +1,565 @@ + + + + type_contents_order Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Type Contents Order

+ +

Specifies the order of subtypes, properties, methods & more within a type.

+ +
    +
  • Identifier: type_contents_order
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, order: [[SwiftLintFramework.TypeContent.case], [SwiftLintFramework.TypeContent.typeAlias, SwiftLintFramework.TypeContent.associatedType], [SwiftLintFramework.TypeContent.subtype], [SwiftLintFramework.TypeContent.typeProperty], [SwiftLintFramework.TypeContent.instanceProperty], [SwiftLintFramework.TypeContent.ibInspectable], [SwiftLintFramework.TypeContent.ibOutlet], [SwiftLintFramework.TypeContent.initializer], [SwiftLintFramework.TypeContent.typeMethod], [SwiftLintFramework.TypeContent.viewLifeCycleMethod], [SwiftLintFramework.TypeContent.ibAction], [SwiftLintFramework.TypeContent.otherMethod], [SwiftLintFramework.TypeContent.subscript], [SwiftLintFramework.TypeContent.deinitializer]]
  • +
+

Non Triggering Examples

+
class TestViewController: UIViewController {
+    // Type Aliases
+    typealias CompletionHandler = ((TestEnum) -> Void)
+
+    // Subtypes
+    class TestClass {
+        // 10 lines
+    }
+
+    struct TestStruct {
+        // 3 lines
+    }
+
+    enum TestEnum {
+        // 5 lines
+    }
+
+    // Type Properties
+    static let cellIdentifier: String = "AmazingCell"
+
+    // Instance Properties
+    var shouldLayoutView1: Bool!
+    weak var delegate: TestViewControllerDelegate?
+    private var hasLayoutedView1: Bool = false
+    private var hasLayoutedView2: Bool = false
+
+    private var hasAnyLayoutedView: Bool {
+         return hasLayoutedView1 || hasLayoutedView2
+    }
+
+    // IBOutlets
+    @IBOutlet private var view1: UIView!
+    @IBOutlet private var view2: UIView!
+
+    // Initializers
+    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
+        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+    }
+
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+
+    // Type Methods
+    static func makeViewController() -> TestViewController {
+        // some code
+    }
+
+    // View Life-Cycle Methods
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        view1.setNeedsLayout()
+        view1.layoutIfNeeded()
+        hasLayoutedView1 = true
+    }
+
+    override func willMove(toParent parent: UIViewController?) {
+        super.willMove(toParent: parent)
+        if parent == nil {
+            viewModel.willMoveToParent()
+        }
+    }
+
+    override func viewDidLayoutSubviews() {
+        super.viewDidLayoutSubviews()
+
+        view2.setNeedsLayout()
+        view2.layoutIfNeeded()
+        hasLayoutedView2 = true
+    }
+
+    // IBActions
+    @IBAction func goNextButtonPressed() {
+        goToNextVc()
+        delegate?.didPressTrackedButton()
+    }
+
+    // Other Methods
+    func goToNextVc() { /* TODO */ }
+
+    func goToInfoVc() { /* TODO */ }
+
+    func goToRandomVc() {
+        let viewCtrl = getRandomVc()
+        present(viewCtrl, animated: true)
+    }
+
+    private func getRandomVc() -> UIViewController { return UIViewController() }
+
+    // Subscripts
+    subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
+        get {
+            return "This is just a test"
+        }
+
+        set {
+            log.warning("Just a test", newValue)
+        }
+    }
+
+    deinit {
+        log.debug("deinit")
+    },
+}
+
+

Triggering Examples

+
class TestViewController: UIViewController {
+    // Subtypes
+    ↓class TestClass {
+        // 10 lines
+    }
+
+    // Type Aliases
+    typealias CompletionHandler = ((TestEnum) -> Void)
+}
+
+
class TestViewController: UIViewController {
+    // Stored Type Properties
+    ↓static let cellIdentifier: String = "AmazingCell"
+
+    // Subtypes
+    class TestClass {
+        // 10 lines
+    }
+}
+
+
class TestViewController: UIViewController {
+    // Stored Instance Properties
+    ↓var shouldLayoutView1: Bool!
+
+    // Stored Type Properties
+    static let cellIdentifier: String = "AmazingCell"
+}
+
+
class TestViewController: UIViewController {
+    // IBOutlets
+    @IBOutlet private ↓var view1: UIView!
+
+    // Computed Instance Properties
+    private var hasAnyLayoutedView: Bool {
+         return hasLayoutedView1 || hasLayoutedView2
+    }
+}
+
+
class TestViewController: UIViewController {
+
+    // deinitializer
+    ↓deinit {
+        log.debug("deinit")
+    }
+
+    // Initializers
+    override ↓init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
+        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
+    }
+
+    // IBOutlets
+    @IBOutlet private var view1: UIView!
+    @IBOutlet private var view2: UIView!
+}
+
+
class TestViewController: UIViewController {
+    // View Life-Cycle Methods
+    override ↓func viewDidLoad() {
+        super.viewDidLoad()
+
+        view1.setNeedsLayout()
+        view1.layoutIfNeeded()
+        hasLayoutedView1 = true
+    }
+
+    // Type Methods
+    static func makeViewController() -> TestViewController {
+        // some code
+    }
+}
+
+
class TestViewController: UIViewController {
+    // IBActions
+    @IBAction ↓func goNextButtonPressed() {
+        goToNextVc()
+        delegate?.didPressTrackedButton()
+    }
+
+    // View Life-Cycle Methods
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        view1.setNeedsLayout()
+        view1.layoutIfNeeded()
+        hasLayoutedView1 = true
+    }
+}
+
+
class TestViewController: UIViewController {
+    // Other Methods
+    ↓func goToNextVc() { /* TODO */ }
+
+    // IBActions
+    @IBAction func goNextButtonPressed() {
+        goToNextVc()
+        delegate?.didPressTrackedButton()
+    }
+}
+
+
class TestViewController: UIViewController {
+    // Subscripts
+    ↓subscript(_ someIndexThatIsNotEvenUsed: Int) -> String {
+        get {
+            return "This is just a test"
+        }
+
+        set {
+            log.warning("Just a test", newValue)
+        }
+    }
+
+    // MARK: Other Methods
+    func goToNextVc() { /* TODO */ }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_name.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_name.html new file mode 100644 index 000000000..cf9877a2f --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/type_name.html @@ -0,0 +1,411 @@ + + + + type_name Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Type Name

+ +

Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 40 characters in length. +Private types may start with an underscore.

+ +
    +
  • Identifier: type_name
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: (min_length) w/e: 3/0, (max_length) w/e: 40/1000, excluded: [], allowed_symbols: [], validates_start_with_lowercase: true, validate_protocols: true
  • +
+

Non Triggering Examples

+
class MyType {}
+
+
private struct _MyType {}
+
+
enum AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
+
+
typealias Foo = Void
+
+
private typealias Foo = Void
+
+
protocol Foo {
+  associatedtype Bar
+}
+
+
protocol Foo {
+  associatedtype Bar: Equatable
+}
+
+
enum MyType {
+case value
+}
+
+
protocol P {}
+
+
struct SomeStruct {
+  enum `Type` {
+    case x, y, z
+  }
+}
+
+

Triggering Examples

+
class ↓myType {}
+
+
enum ↓_MyType {}
+
+
private struct ↓MyType_ {}
+
+
struct ↓My {}
+
+
struct ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA {}
+
+
class ↓MyView_Previews
+
+
private struct ↓_MyView_Previews
+
+
typealias ↓X = Void
+
+
private typealias ↓Foo_Bar = Void
+
+
private typealias ↓foo = Void
+
+
typealias ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = Void
+
+
protocol Foo {
+  associatedtype ↓X
+}
+
+
protocol Foo {
+  associatedtype ↓Foo_Bar: Equatable
+}
+
+
protocol Foo {
+  associatedtype ↓AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+}
+
+
protocol ↓X {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/typesafe_array_init.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/typesafe_array_init.html new file mode 100644 index 000000000..039efa9c1 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/typesafe_array_init.html @@ -0,0 +1,372 @@ + + + + typesafe_array_init Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Type-safe Array Init

+ +

Prefer using Array(seq) over seq.map { $0 } to convert a sequence into an Array.

+ +
    +
  • Identifier: typesafe_array_init
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
    enum MyError: Error {}
+    let myResult: Result<String, MyError> = .success("")
+    let result: Result<Any, MyError> = myResult.map { $0 }
+
+
    struct IntArray {
+        let elements = [1, 2, 3]
+        func map<T>(_ transformer: (Int) throws -> T) rethrows -> [T] {
+            try elements.map(transformer)
+        }
+    }
+    let ints = IntArray()
+    let intsCopy = ints.map { $0 }
+
+

Triggering Examples

+
    func f<Seq: Sequence>(s: Seq) -> [Seq.Element] {
+        s.↓map({ $0 })
+    }
+
+
    func f(array: [Int]) -> [Int] {
+        array.↓map { $0 }
+    }
+
+
    let myInts = [1, 2, 3].↓map { return $0 }
+
+
    struct Generator: Sequence, IteratorProtocol {
+        func next() -> Int? { nil }
+    }
+    let array = Generator().↓map { i in i }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_condition.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_condition.html new file mode 100644 index 000000000..8d0e01035 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_condition.html @@ -0,0 +1,382 @@ + + + + unavailable_condition Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unavailable Condition

+ +

Use #unavailable/#available instead of #available/#unavailable with an empty body.

+ +
    +
  • Identifier: unavailable_condition
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.6.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
if #unavailable(iOS 13) {
+  loadMainWindow()
+}
+
+
if #available(iOS 9.0, *) {
+  doSomething()
+} else {
+  legacyDoSomething()
+}
+
+
if #available(macOS 11.0, *) {
+   // Do nothing
+} else if #available(macOS 10.15, *) {
+   print("do some stuff")
+}
+
+

Triggering Examples

+
if ↓#available(iOS 14.0) {
+
+} else {
+  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
+}
+
+
if ↓#available(iOS 14.0) {
+  // we don't need to do anything here
+} else {
+  oldIos13TrackingLogic(isEnabled: ASIdentifierManager.shared().isAdvertisingTrackingEnabled)
+}
+
+
if ↓#available(iOS 13, *) {} else {
+  loadMainWindow()
+}
+
+
if ↓#unavailable(iOS 13) {
+  // Do nothing
+} else if i < 2 {
+  loadMainWindow()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_function.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_function.html new file mode 100644 index 000000000..f06b4cc94 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unavailable_function.html @@ -0,0 +1,393 @@ + + + + unavailable_function Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unavailable Function

+ +

Unimplemented functions should be marked as unavailable.

+ +
    +
  • Identifier: unavailable_function
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class ViewController: UIViewController {
+  @available(*, unavailable)
+  public required init?(coder aDecoder: NSCoder) {
+    preconditionFailure("init(coder:) has not been implemented")
+  }
+}
+
+
func jsonValue(_ jsonString: String) -> NSObject {
+   let data = jsonString.data(using: .utf8)!
+   let result = try! JSONSerialization.jsonObject(with: data, options: [])
+   if let dict = (result as? [String: Any])?.bridge() {
+    return dict
+   } else if let array = (result as? [Any])?.bridge() {
+    return array
+   }
+   fatalError()
+}
+
+
func resetOnboardingStateAndCrash() -> Never {
+    resetUserDefaults()
+    // Crash the app to re-start the onboarding flow.
+    fatalError("Onboarding re-start crash.")
+}
+
+

Triggering Examples

+
class ViewController: UIViewController {
+  public required ↓init?(coder aDecoder: NSCoder) {
+    fatalError("init(coder:) has not been implemented")
+  }
+}
+
+
class ViewController: UIViewController {
+  public required ↓init?(coder aDecoder: NSCoder) {
+    let reason = "init(coder:) has not been implemented"
+    fatalError(reason)
+  }
+}
+
+
class ViewController: UIViewController {
+  public required ↓init?(coder aDecoder: NSCoder) {
+    preconditionFailure("init(coder:) has not been implemented")
+  }
+}
+
+
↓func resetOnboardingStateAndCrash() {
+    resetUserDefaults()
+    // Crash the app to re-start the onboarding flow.
+    fatalError("Onboarding re-start crash.")
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_break_in_switch.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_break_in_switch.html new file mode 100644 index 000000000..6c221706e --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_break_in_switch.html @@ -0,0 +1,405 @@ + + + + unneeded_break_in_switch Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unneeded Break in Switch

+ +

Avoid using unneeded break statements.

+ +
    +
  • Identifier: unneeded_break_in_switch
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
switch foo {
+case .bar:
+    break
+}
+
+
switch foo {
+default:
+    break
+}
+
+
switch foo {
+case .bar:
+    for i in [0, 1, 2] { break }
+}
+
+
switch foo {
+case .bar:
+    if true { break }
+}
+
+
switch foo {
+case .bar:
+    something()
+}
+
+
let items = [Int]()
+for item in items {
+    if bar() {
+        do {
+            try foo()
+        } catch {
+            bar()
+            break
+        }
+    }
+}
+
+

Triggering Examples

+
switch foo {
+case .bar:
+    something()
+    ↓break
+}
+
+
switch foo {
+case .bar:
+    something()
+    ↓break // comment
+}
+
+
switch foo {
+default:
+    something()
+    ↓break
+}
+
+
switch foo {
+case .foo, .foo2 where condition:
+    something()
+    ↓break
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html new file mode 100644 index 000000000..464a6cab7 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unneeded_parentheses_in_closure_argument.html @@ -0,0 +1,395 @@ + + + + unneeded_parentheses_in_closure_argument Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unneeded Parentheses in Closure Argument

+ +

Parentheses are not needed when declaring closure arguments.

+ +
    +
  • Identifier: unneeded_parentheses_in_closure_argument
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let foo = { (bar: Int) in }
+
+
+
let foo = { bar, _  in }
+
+
+
let foo = { bar in }
+
+
+
let foo = { bar -> Bool in return true }
+
+
+
DispatchQueue.main.async { () -> Void in
+    doSomething()
+}
+
+

Triggering Examples

+
call(arg: { ↓(bar) in })
+
+
+
call(arg: { ↓(bar, _) in })
+
+
+
let foo = { ↓(bar) -> Bool in return true }
+
+
+
foo.map { ($0, $0) }.forEach { ↓(x, y) in }
+
+
foo.bar { [weak self] ↓(x, y) in }
+
+
[].first { ↓(temp) in
+    [].first { ↓(temp) in
+        [].first { ↓(temp) in
+            _ = temp
+            return false
+        }
+        return false
+    }
+    return false
+}
+
+
[].first { temp in
+    [].first { ↓(temp) in
+        [].first { ↓(temp) in
+            _ = temp
+            return false
+        }
+        return false
+    }
+    return false
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unowned_variable_capture.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unowned_variable_capture.html new file mode 100644 index 000000000..8b420ea49 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unowned_variable_capture.html @@ -0,0 +1,362 @@ + + + + unowned_variable_capture Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unowned Variable Capture

+ +

Prefer capturing references as weak to avoid potential crashes.

+ +
    +
  • Identifier: unowned_variable_capture
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
foo { [weak self] in _ }
+
+
foo { [weak self] param in _ }
+
+
foo { [weak bar] in _ }
+
+
foo { [weak bar] param in _ }
+
+
foo { bar in _ }
+
+
foo { $0 }
+
+

Triggering Examples

+
foo { [↓unowned self] in _ }
+
+
foo { [↓unowned bar] in _ }
+
+
foo { [bar, ↓unowned self] in _ }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/untyped_error_in_catch.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/untyped_error_in_catch.html new file mode 100644 index 000000000..0e260ab61 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/untyped_error_in_catch.html @@ -0,0 +1,399 @@ + + + + untyped_error_in_catch Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Untyped Error in Catch

+ +

Catch statements should not declare error variables without type casting.

+ +
    +
  • Identifier: untyped_error_in_catch
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
do {
+  try foo()
+} catch {}
+
+
do {
+  try foo()
+} catch Error.invalidOperation {
+} catch {}
+
+
do {
+  try foo()
+} catch let error as MyError {
+} catch {}
+
+
do {
+  try foo()
+} catch var error as MyError {
+} catch {}
+
+
do {
+    try something()
+} catch let e where e.code == .fileError {
+    // can be ignored
+} catch {
+    print(error)
+}
+
+

Triggering Examples

+
do {
+  try foo()
+} ↓catch var error {}
+
+
do {
+  try foo()
+} ↓catch let error {}
+
+
do {
+  try foo()
+} ↓catch let someError {}
+
+
do {
+  try foo()
+} ↓catch var someError {}
+
+
do {
+  try foo()
+} ↓catch let e {}
+
+
do {
+  try foo()
+} ↓catch(let error) {}
+
+
do {
+  try foo()
+} ↓catch (let error) {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_capture_list.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_capture_list.html new file mode 100644 index 000000000..47033fc0d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_capture_list.html @@ -0,0 +1,434 @@ + + + + unused_capture_list Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Capture List

+ +

Unused reference in a capture list should be removed.

+ +
    +
  • Identifier: unused_capture_list
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2].map {
+    [ weak
+      delegate,
+      unowned
+      self
+    ] num in
+    delegate.handle(num)
+}
+
+
[1, 2].map { [weak self] num in
+    self?.handle(num)
+}
+
+
let failure: Failure = { [weak self, unowned delegate = self.delegate!] foo in
+    delegate.handle(foo, self)
+}
+
+
numbers.forEach({
+    [weak handler] in
+    handler?.handle($0)
+})
+
+
withEnvironment(apiService: MockService(fetchProjectResponse: project)) {
+    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
+        device.handle()
+    }
+}
+
+
{ [foo] _ in foo.bar() }()
+
+
sizes.max().flatMap { [(offset: offset, size: $0)] } ?? []
+
+
[1, 2].map { [self] num in
+    handle(num)
+}
+
+
[1, 2].map { [unowned self] num in
+    handle(num)
+}
+
+
[1, 2].map { [self, unowned delegate = self.delegate!] num in
+    delegate.handle(num)
+}
+
+
[1, 2].map { [unowned self, unowned delegate = self.delegate!] num in
+    delegate.handle(num)
+}
+
+
[1, 2].map {
+    [ weak
+      delegate,
+      self
+    ] num in
+    delegate.handle(num)
+}
+
+
rx.onViewDidAppear.subscribe(onNext: { [unowned self] in
+      doSomething()
+}).disposed(by: disposeBag)
+
+

Triggering Examples

+
[1, 2].map { [↓weak self] num in
+    print(num)
+}
+
+
let failure: Failure = { [weak self, ↓unowned delegate = self.delegate!] foo in
+    self?.handle(foo)
+}
+
+
let failure: Failure = { [↓weak self, ↓unowned delegate = self.delegate!] foo in
+    print(foo)
+}
+
+
numbers.forEach({
+    [weak handler] in
+    print($0)
+})
+
+
numbers.forEach({
+    [self, ↓weak handler] in
+    print($0)
+})
+
+
withEnvironment(apiService: MockService(fetchProjectResponse: project)) { [↓foo] in
+    [Device.phone4_7inch, Device.phone5_8inch, Device.pad].forEach { device in
+        device.handle()
+    }
+}
+
+
{ [↓foo] in _ }()
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_closure_parameter.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_closure_parameter.html new file mode 100644 index 000000000..33d1e43a6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_closure_parameter.html @@ -0,0 +1,482 @@ + + + + unused_closure_parameter Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Closure Parameter

+ +

Unused parameter in a closure should be replaced with _.

+ +
    +
  • Identifier: unused_closure_parameter
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
[1, 2].map { $0 + 1 }
+
+
+
[1, 2].map({ $0 + 1 })
+
+
+
[1, 2].map { number in
+ number + 1 
+}
+
+
+
[1, 2].map { _ in
+ 3 
+}
+
+
+
[1, 2].something { number, idx in
+ return number * idx
+}
+
+
+
let isEmpty = [1, 2].isEmpty()
+
+
+
violations.sorted(by: { lhs, rhs in 
+ return lhs.location > rhs.location
+})
+
+
+
rlmConfiguration.migrationBlock.map { rlmMigration in
+return { migration, schemaVersion in
+rlmMigration(migration.rlmMigration, schemaVersion)
+}
+}
+
+
genericsFunc { (a: Type, b) in
+a + b
+}
+
+
+
var label: UILabel = { (lbl: UILabel) -> UILabel in
+   lbl.backgroundColor = .red
+   return lbl
+}(UILabel())
+
+
+
hoge(arg: num) { num in
+  return num
+}
+
+
+
({ (manager: FileManager) in
+  print(manager)
+})(FileManager.default)
+
+
withPostSideEffect { input in
+    if true { print("\(input)") }
+}
+
+
viewModel?.profileImage.didSet(weak: self) { (self, profileImage) in
+    self.profileImageView.image = profileImage
+}
+
+
let failure: Failure = { task, error in
+    observer.sendFailed(error, task)
+}
+
+
List($names) { $name in
+    Text(name)
+}
+
+
List($names) { $name in
+    TextField($name)
+}
+
+
_ = ["a"].filter { `class` in `class`.hasPrefix("a") }
+
+
let closure: (Int) -> Void = { `foo` in _ = foo }
+
+
let closure: (Int) -> Void = { foo in _ = `foo` }
+
+

Triggering Examples

+
[1, 2].map { ↓number in
+ return 3
+}
+
+
+
[1, 2].map { ↓number in
+ return numberWithSuffix
+}
+
+
+
[1, 2].map { ↓number in
+ return 3 // number
+}
+
+
+
[1, 2].map { ↓number in
+ return 3 "number"
+}
+
+
+
[1, 2].something { number, ↓idx in
+ return number
+}
+
+
+
genericsFunc { (↓number: TypeA, idx: TypeB) in return idx
+}
+
+
+
hoge(arg: num) { ↓num in
+}
+
+
+
fooFunc { ↓아 in
+ }
+
+
func foo () {
+ bar { ↓number in
+ return 3
+}
+
+
+
viewModel?.profileImage.didSet(weak: self) { (↓self, profileImage) in
+    profileImageView.image = profileImage
+}
+
+
let failure: Failure = { ↓task, error in
+    observer.sendFailed(error)
+}
+
+
List($names) { ↓$name in
+    Text("Foo")
+}
+
+
let class1 = "a"
+_ = ["a"].filter { ↓`class` in `class1`.hasPrefix("a") }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_control_flow_label.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_control_flow_label.html new file mode 100644 index 000000000..4d4aa76dc --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_control_flow_label.html @@ -0,0 +1,387 @@ + + + + unused_control_flow_label Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Control Flow Label

+ +

Unused control flow label should be removed.

+ +
    +
  • Identifier: unused_control_flow_label
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
loop: while true { break loop }
+
+
loop: while true { continue loop }
+
+
loop:
+    while true { break loop }
+
+
while true { break }
+
+
loop: for x in array { break loop }
+
+
label: switch number {
+case 1: print("1")
+case 2: print("2")
+default: break label
+}
+
+
loop: repeat {
+    if x == 10 {
+        break loop
+    }
+} while true
+
+

Triggering Examples

+
↓loop: while true { break }
+
+
↓loop: while true { break loop1 }
+
+
↓loop: while true { break outerLoop }
+
+
↓loop: for x in array { break }
+
+
↓label: switch number {
+case 1: print("1")
+case 2: print("2")
+default: break
+}
+
+
↓loop: repeat {
+    if x == 10 {
+        break
+    }
+} while true
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_declaration.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_declaration.html new file mode 100644 index 000000000..b615776ff --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_declaration.html @@ -0,0 +1,604 @@ + + + + unused_declaration Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Declaration

+ +

Declarations should be referenced at least once within all files linted.

+ +
    +
  • Identifier: unused_declaration
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: severity: error, include_public_and_open: false, related_usrs_to_skip: [“s:7SwiftUI15PreviewProviderP”]
  • +
+

Non Triggering Examples

+
let kConstant = 0
+_ = kConstant
+
+
enum Change<T> {
+  case insert(T)
+  case delete(T)
+}
+
+extension Sequence {
+  func deletes<T>() -> [T] where Element == Change<T> {
+    return compactMap { operation in
+      if case .delete(let value) = operation {
+        return value
+      } else {
+        return nil
+      }
+    }
+  }
+}
+
+let changes = [Change.insert(0), .delete(0)]
+_ = changes.deletes()
+
+
struct Item: Codable {}
+struct ResponseModel: Codable {
+    let items: [Item]
+
+    enum CodingKeys: String, CodingKey {
+        case items = "ResponseItems"
+    }
+}
+
+_ = ResponseModel(items: [Item()]).items
+
+
class ResponseModel {
+    @objc func foo() {
+    }
+}
+_ = ResponseModel()
+
+
public func foo() {}
+
+
protocol Foo {}
+
+extension Foo {
+    func bar() {}
+}
+
+struct MyStruct: Foo {}
+MyStruct().bar()
+
+
import XCTest
+class MyTests: XCTestCase {
+    func testExample() {}
+}
+
+
import XCTest
+open class BestTestCase: XCTestCase {}
+class MyTests: BestTestCase {
+    func testExample() {}
+}
+
+
enum Component {
+  case string(StaticString)
+  indirect case array([Component])
+  indirect case optional(Component?)
+}
+
+@resultBuilder
+struct ComponentBuilder {
+  static func buildBlock(_ components: Component...) -> Component {
+    return .array(components)
+  }
+
+  static func buildExpression(_ string: StaticString) -> Component {
+    return .string(string)
+  }
+
+  static func buildOptional(_ component: Component?) -> Component {
+    return .optional(component)
+  }
+
+  static func buildEither(first component: Component) -> Component {
+    return component
+  }
+
+  static func buildEither(second component: Component) -> Component {
+    return component
+  }
+
+  static func buildArray(_ components: [Component]) -> Component {
+    return .array(components)
+  }
+
+  static func buildLimitedAvailability(_ component: Component) -> Component {
+    return component
+  }
+
+  static func buildFinalResult(_ component: Component) -> Component {
+    return component
+  }
+
+  static func buildPartialBlock(first component: Component) -> Component {
+    return component
+  }
+
+  static func buildPartialBlock(accumulated component: Component, next: Component) -> Component {
+    return component
+  }
+}
+
+func acceptComponentBuilder(@ComponentBuilder _ body: () -> Component) {
+  print(body())
+}
+
+acceptComponentBuilder {
+  "hello"
+}
+
+
import Cocoa
+
+@NSApplicationMain
+final class AppDelegate: NSObject, NSApplicationDelegate {
+    func applicationWillFinishLaunching(_ notification: Notification) {}
+    func applicationWillBecomeActive(_ notification: Notification) {}
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @IBAction private func foo() {}
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @objc func foo() {}
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @IBInspectable private var innerPaddingWidth: Int {
+        set { self.backgroundView.innerPaddingWidth = newValue }
+        get { return self.backgroundView.innerPaddingWidth }
+    }
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @IBOutlet private var bar: NSObject! {
+        set { fatalError() }
+        get { fatalError() }
+    }
+
+    @IBOutlet private var baz: NSObject! {
+        willSet { print("willSet") }
+    }
+
+    @IBOutlet private var buzz: NSObject! {
+        didSet { print("didSet") }
+    }
+}
+
+

Triggering Examples

+
let ↓kConstant = 0
+
+
struct Item {}
+struct ↓ResponseModel: Codable {
+    let ↓items: [Item]
+
+    enum ↓CodingKeys: String {
+        case items = "ResponseItems"
+    }
+}
+
+
class ↓ResponseModel {
+    func ↓foo() {
+    }
+}
+
+
public func ↓foo() {}
+
+
protocol Foo {
+    func ↓bar1()
+}
+
+extension Foo {
+    func bar1() {}
+    func ↓bar2() {}
+}
+
+struct MyStruct: Foo {}
+_ = MyStruct()
+
+
import XCTest
+class ↓MyTests: NSObject {
+    func ↓testExample() {}
+}
+
+
enum Component {
+  case string(StaticString)
+  indirect case array([Component])
+  indirect case optional(Component?)
+}
+
+struct ComponentBuilder {
+  func ↓buildExpression(_ string: StaticString) -> Component {
+    return .string(string)
+  }
+
+  func ↓buildBlock(_ components: Component...) -> Component {
+    return .array(components)
+  }
+
+  func ↓buildIf(_ value: Component?) -> Component {
+    return .optional(value)
+  }
+
+  static func ↓buildABear(_ components: Component...) -> Component {
+    return .array(components)
+  }
+}
+
+_ = ComponentBuilder()
+
+
import Cocoa
+
+@NSApplicationMain
+final class AppDelegate: NSObject, NSApplicationDelegate {
+    func ↓appWillFinishLaunching(_ notification: Notification) {}
+    func applicationWillBecomeActive(_ notification: Notification) {}
+}
+
+
import Cocoa
+
+final class ↓AppDelegate: NSObject, NSApplicationDelegate {
+    func applicationWillFinishLaunching(_ notification: Notification) {}
+    func applicationWillBecomeActive(_ notification: Notification) {}
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @IBOutlet var ↓bar: NSObject!
+}
+
+
import Foundation
+
+public final class Foo: NSObject {
+    @IBInspectable var ↓bar: String!
+}
+
+
import Foundation
+
+final class Foo: NSObject {}
+final class ↓Bar {
+    var ↓foo = Foo()
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_enumerated.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_enumerated.html new file mode 100644 index 000000000..5b76d8c70 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_enumerated.html @@ -0,0 +1,383 @@ + + + + unused_enumerated Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Enumerated

+ +

When the index or the item is not used, .enumerated() can be removed.

+ +
    +
  • Identifier: unused_enumerated
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
for (idx, foo) in bar.enumerated() { }
+
+
+
for (_, foo) in bar.enumerated().something() { }
+
+
+
for (_, foo) in bar.something() { }
+
+
+
for foo in bar.enumerated() { }
+
+
+
for foo in bar { }
+
+
+
for (idx, _) in bar.enumerated().something() { }
+
+
+
for (idx, _) in bar.something() { }
+
+
+
for idx in bar.indices { }
+
+
+
for (section, (event, _)) in data.enumerated() {}
+
+
+

Triggering Examples

+
for (↓_, foo) in bar.enumerated() { }
+
+
+
for (↓_, foo) in abc.bar.enumerated() { }
+
+
+
for (↓_, foo) in abc.something().enumerated() { }
+
+
+
for (idx, ↓_) in bar.enumerated() { }
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_import.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_import.html new file mode 100644 index 000000000..98f6a0e8a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_import.html @@ -0,0 +1,391 @@ + + + + unused_import Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Import

+ +

All imported modules should be required to make the file compile.

+ +
    +
  • Identifier: unused_import
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: lint
  • +
  • Analyzer rule: Yes
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: severity: warning, require_explicit_imports: false, allowed_transitive_imports: [], always_keep_imports: []
  • +
+

Non Triggering Examples

+
import Dispatch // This is used
+dispatchMain()
+
+
@testable import Dispatch
+dispatchMain()
+
+
import Foundation
+@objc
+class A {}
+
+
import UnknownModule
+func foo(error: Swift.Error) {}
+
+
import Foundation
+import ObjectiveC
+let 👨‍👩‍👧‍👦 = #selector(NSArray.contains(_:))
+👨‍👩‍👧‍👦 == 👨‍👩‍👧‍👦
+
+

Triggering Examples

+
↓import Dispatch
+struct A {
+  static func dispatchMain() {}
+}
+A.dispatchMain()
+
+
↓import Foundation // This is unused
+struct A {
+  static func dispatchMain() {}
+}
+A.dispatchMain()
+↓import Dispatch
+
+
+
↓import Foundation
+dispatchMain()
+
+
↓import Foundation
+// @objc
+class A {}
+
+
↓import Foundation
+import UnknownModule
+func foo(error: Swift.Error) {}
+
+
↓import Swift
+↓import SwiftShims
+func foo(error: Swift.Error) {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_optional_binding.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_optional_binding.html new file mode 100644 index 000000000..4bf31c059 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_optional_binding.html @@ -0,0 +1,399 @@ + + + + unused_optional_binding Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Optional Binding

+ +

Prefer != nil over let _ =

+ +
    +
  • Identifier: unused_optional_binding
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, ignore_optional_try: false
  • +
+

Non Triggering Examples

+
if let bar = Foo.optionalValue {
+}
+
+
+
if let (_, second) = getOptionalTuple() {
+}
+
+
+
if let (_, asd, _) = getOptionalTuple(), let bar = Foo.optionalValue {
+}
+
+
+
if foo() { let _ = bar() }
+
+
+
if foo() { _ = bar() }
+
+
+
if case .some(_) = self {}
+
+
if let point = state.find({ _ in true }) {}
+
+

Triggering Examples

+
if let ↓_ = Foo.optionalValue {
+}
+
+
+
if let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {
+}
+
+
+
guard let a = Foo.optionalValue, let ↓_ = Foo.optionalValue2 {
+}
+
+
+
if let (first, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {
+}
+
+
+
if let (first, _) = getOptionalTuple(), let ↓_ = Foo.optionalValue {
+}
+
+
+
if let (_, second) = getOptionalTuple(), let ↓_ = Foo.optionalValue {
+}
+
+
+
if let ↓(_, _, _) = getOptionalTuple(), let bar = Foo.optionalValue {
+}
+
+
+
func foo() {
+if let ↓_ = bar {
+}
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_setter_value.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_setter_value.html new file mode 100644 index 000000000..046bde4af --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/unused_setter_value.html @@ -0,0 +1,433 @@ + + + + unused_setter_value Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Unused Setter Value

+ +

Setter value is not used.

+ +
    +
  • Identifier: unused_setter_value
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    set {
+        Persister.shared.aValue = newValue
+    }
+}
+
+
var aValue: String {
+    set {
+        Persister.shared.aValue = newValue
+    }
+    get {
+        return Persister.shared.aValue
+    }
+}
+
+
var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    set(value) {
+        Persister.shared.aValue = value
+    }
+}
+
+
override var aValue: String {
+ get {
+     return Persister.shared.aValue
+ }
+ set { }
+}
+
+

Triggering Examples

+
var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    ↓set {
+        Persister.shared.aValue = aValue
+    }
+}
+
+
var aValue: String {
+    ↓set {
+        Persister.shared.aValue = aValue
+    }
+    get {
+        return Persister.shared.aValue
+    }
+}
+
+
var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    ↓set {
+        Persister.shared.aValue = aValue
+    }
+}
+
+
var aValue: String {
+    get {
+        let newValue = Persister.shared.aValue
+        return newValue
+    }
+    ↓set {
+        Persister.shared.aValue = aValue
+    }
+}
+
+
var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    ↓set(value) {
+        Persister.shared.aValue = aValue
+    }
+}
+
+
override var aValue: String {
+    get {
+        return Persister.shared.aValue
+    }
+    ↓set {
+        Persister.shared.aValue = aValue
+    }
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/valid_ibinspectable.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/valid_ibinspectable.html new file mode 100644 index 000000000..6760cca26 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/valid_ibinspectable.html @@ -0,0 +1,420 @@ + + + + valid_ibinspectable Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Valid IBInspectable

+ +

@IBInspectable should be applied to variables only, have its type explicit and be of a supported type

+ +
    +
  • Identifier: valid_ibinspectable
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+  @IBInspectable private var x: Int
+}
+
+
class Foo {
+  @IBInspectable private var x: String?
+}
+
+
class Foo {
+  @IBInspectable private var x: String!
+}
+
+
class Foo {
+  @IBInspectable private var count: Int = 0
+}
+
+
class Foo {
+  private var notInspectable = 0
+}
+
+
class Foo {
+  private let notInspectable: Int
+}
+
+
class Foo {
+  private let notInspectable: UInt8
+}
+
+
extension Foo {
+    @IBInspectable var color: UIColor {
+        set {
+            self.bar.textColor = newValue
+        }
+
+        get {
+            return self.bar.textColor
+        }
+    }
+}
+
+
class Foo {
+    @IBInspectable var borderColor: UIColor? = nil {
+        didSet {
+            updateAppearance()
+        }
+    }
+}
+
+

Triggering Examples

+
class Foo {
+  @IBInspectable private ↓let count: Int
+}
+
+
class Foo {
+  @IBInspectable private ↓var insets: UIEdgeInsets
+}
+
+
class Foo {
+  @IBInspectable private ↓var count = 0
+}
+
+
class Foo {
+  @IBInspectable private ↓var count: Int?
+}
+
+
class Foo {
+  @IBInspectable private ↓var count: Int!
+}
+
+
class Foo {
+  @IBInspectable private ↓var count: Optional<Int>
+}
+
+
class Foo {
+  @IBInspectable private ↓var x: Optional<String>
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment.html new file mode 100644 index 000000000..6028bf299 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment.html @@ -0,0 +1,409 @@ + + + + vertical_parameter_alignment Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Parameter Alignment

+ +

Function parameters should be aligned vertically if they’re in multiple lines in a declaration.

+ +
    +
  • Identifier: vertical_parameter_alignment
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
+                      dictionary: SourceKittenDictionary) { }
+
+
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
+                      dictionary: SourceKittenDictionary) -> [StyleViolation]
+
+
func foo(bar: Int)
+
+
func foo(bar: Int) -> String
+
+
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
+                      dictionary: SourceKittenDictionary)
+                      -> [StyleViolation]
+
+
func validateFunction(
+   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
+   dictionary: SourceKittenDictionary) -> [StyleViolation]
+
+
func validateFunction(
+   _ file: SwiftLintFile, kind: SwiftDeclarationKind,
+   dictionary: SourceKittenDictionary
+) -> [StyleViolation]
+
+
func regex(_ pattern: String,
+           options: NSRegularExpression.Options = [.anchorsMatchLines,
+                                                   .dotMatchesLineSeparators]) -> NSRegularExpression
+
+
func foo(a: Void,
+         b: [String: String] =
+         [:]) {
+}
+
+
func foo(data: (size: CGSize,
+                identifier: String)) {}
+
+
func foo(data: Data,
+         @ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
+
+
class A {
+    init(bar: Int)
+}
+
+
class A {
+    init(foo: Int,
+         bar: String)
+}
+
+

Triggering Examples

+
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
+                  ↓dictionary: SourceKittenDictionary) { }
+
+
func validateFunction(_ file: SwiftLintFile, kind: SwiftDeclarationKind,
+                       ↓dictionary: SourceKittenDictionary) { }
+
+
func validateFunction(_ file: SwiftLintFile,
+                  ↓kind: SwiftDeclarationKind,
+                  ↓dictionary: SourceKittenDictionary) { }
+
+
func foo(data: Data,
+            ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
+
+
class A {
+    init(data: Data,
+                ↓@ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {}
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html new file mode 100644 index 000000000..7058a03f9 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_parameter_alignment_on_call.html @@ -0,0 +1,413 @@ + + + + vertical_parameter_alignment_on_call Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Parameter Alignment On Call

+ +

Function parameters should be aligned vertically if they’re in multiple lines in a method call.

+ +
    +
  • Identifier: vertical_parameter_alignment_on_call
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
foo(param1: 1, param2: bar
+    param3: false, param4: true)
+
+
foo(param1: 1, param2: bar)
+
+
foo(param1: 1, param2: bar
+    param3: false,
+    param4: true)
+
+
foo(
+   param1: 1
+) { _ in }
+
+
UIView.animate(withDuration: 0.4, animations: {
+    blurredImageView.alpha = 1
+}, completion: { _ in
+    self.hideLoading()
+})
+
+
UIView.animate(withDuration: 0.4, animations: {
+    blurredImageView.alpha = 1
+},
+completion: { _ in
+    self.hideLoading()
+})
+
+
foo(param1: 1, param2: { _ in },
+    param3: false, param4: true)
+
+
foo({ _ in
+       bar()
+   },
+   completion: { _ in
+       baz()
+   }
+)
+
+
foo(param1: 1, param2: [
+   0,
+   1
+], param3: 0)
+
+
myFunc(foo: 0,
+       bar: baz == 0)
+
+

Triggering Examples

+
foo(param1: 1, param2: bar
+                ↓param3: false, param4: true)
+
+
foo(param1: 1, param2: bar
+ ↓param3: false, param4: true)
+
+
foo(param1: 1, param2: bar
+       ↓param3: false,
+       ↓param4: true)
+
+
foo(param1: 1,
+       ↓param2: { _ in })
+
+
foo(param1: 1,
+    param2: { _ in
+}, param3: 2,
+ ↓param4: 0)
+
+
foo(param1: 1, param2: { _ in },
+       ↓param3: false, param4: true)
+
+
myFunc(foo: 0,
+        ↓bar: baz == 0)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace.html new file mode 100644 index 000000000..5d9a58f14 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace.html @@ -0,0 +1,377 @@ + + + + vertical_whitespace Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Whitespace

+ +

Limit vertical whitespace to a single empty line.

+ +
    +
  • Identifier: vertical_whitespace
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, max_empty_lines: 1
  • +
+

Non Triggering Examples

+
let abc = 0
+
+
+
let abc = 0
+
+
+
+
/* bcs 
+
+
+
+*/
+
+
// bca 
+
+
+
+

Triggering Examples

+
let aaaa = 0
+
+
+
+
+
struct AAAA {}
+
+
+
+
+
+
class BBBB {}
+
+
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html new file mode 100644 index 000000000..42634e063 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_between_cases.html @@ -0,0 +1,431 @@ + + + + vertical_whitespace_between_cases Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Whitespace Between Cases

+ +

Include a single empty line between switch cases.

+ +
    +
  • Identifier: vertical_whitespace_between_cases
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
    switch x {
+    case .valid:
+        print("multiple ...")
+        print("... lines")
+
+    case .invalid:
+        print("multiple ...")
+        print("... lines")
+    }
+
+
    switch x {
+    case .valid:
+        print("x is valid")
+
+    case .invalid:
+        print("x is invalid")
+    }
+
+
    switch x {
+    case 0..<5:
+        print("x is valid")
+
+    default:
+        print("x is invalid")
+    }
+
+
switch x {
+
+case 0..<5:
+    print("x is low")
+
+case 5..<10:
+    print("x is high")
+
+default:
+    print("x is invalid")
+
+}
+
+
switch x {
+case 0..<5:
+    print("x is low")
+
+case 5..<10:
+    print("x is high")
+
+default:
+    print("x is invalid")
+}
+
+
switch x {
+case 0..<5: print("x is low")
+case 5..<10: print("x is high")
+default: print("x is invalid")
+}
+
+
switch x {    
+case 1:    
+    print("one")    
+
+default:    
+    print("not one")    
+}    
+
+

Triggering Examples

+
    switch x {
+    case .valid:
+        print("multiple ...")
+        print("... lines")
+↓    case .invalid:
+        print("multiple ...")
+        print("... lines")
+    }
+
+
    switch x {
+    case .valid:
+        print("x is valid")
+↓    case .invalid:
+        print("x is invalid")
+    }
+
+
    switch x {
+    case 0..<5:
+        print("x is valid")
+↓    default:
+        print("x is invalid")
+    }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html new file mode 100644 index 000000000..d1a644eb0 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_closing_braces.html @@ -0,0 +1,468 @@ + + + + vertical_whitespace_closing_braces Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Whitespace before Closing Braces

+ +

Don’t include vertical whitespace (empty line) before closing braces.

+ +
    +
  • Identifier: vertical_whitespace_closing_braces
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning, only_enforce_before_trivial_lines: false
  • +
+

Non Triggering Examples

+
print([
+  1
+])
+
+
do {
+  print("x is 5")
+}
+
+
func foo() {
+  run(5) { x in
+    print(x)
+  }
+}
+
+
foo(
+    x: 5,
+    y:6
+)
+
+
do {
+  print("x is 5")
+}
+
+
do {
+  print("x is 5")
+}
+
+
print([foo {
+  var sum = 0
+  for i in 1...5 { sum += i }
+  return sum
+
+}, foo {
+  var mul = 1
+  for i in 1...5 { mul *= i }
+  return mul
+}])
+
+
[
+1,
+2,
+3
+]
+
+
[1, 2].map { $0 }.filter { true }
+
+
[1, 2].map { $0 }.filter { num in true }
+
+
/*
+    class X {
+
+        let x = 5
+
+    }
+*/
+
+
if bool1 {
+  // do something
+  // do something
+
+} else if bool2 {
+  // do something
+  // do something
+  // do something
+
+} else {
+  // do something
+  // do something
+}
+
+

Triggering Examples

+
print([
+  1
+↓
+])
+
+
do {
+  print("x is 5")
+↓
+
+}
+
+
func foo() {
+  run(5) { x in
+    print(x)
+  }
+↓
+}
+
+
foo(
+    x: 5,
+    y:6
+↓
+)
+
+
do {
+  print("x is 5")
+↓
+
+}
+
+
do {
+  print("x is 5")
+↓
+}
+
+
print([foo {
+  var sum = 0
+  for i in 1...5 { sum += i }
+  return sum
+
+}, foo {
+  var mul = 1
+  for i in 1...5 { mul *= i }
+  return mul
+↓
+}])
+
+
[
+1,
+2,
+3
+↓
+]
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html new file mode 100644 index 000000000..d64253837 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/vertical_whitespace_opening_braces.html @@ -0,0 +1,458 @@ + + + + vertical_whitespace_opening_braces Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Vertical Whitespace after Opening Braces

+ +

Don’t include vertical whitespace (empty line) after opening braces.

+ +
    +
  • Identifier: vertical_whitespace_opening_braces
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
/*
+    class X {
+
+        let x = 5
+
+    }
+*/
+
+
// [1, 2].map { $0 }.filter { num in true }
+
+
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
+    guard let img = image else { return }
+}
+
+
[
+1,
+2,
+3
+]
+
+
[1, 2].map { $0 }.filter { num in true }
+
+
[1, 2].map { $0 }.foo()
+
+
class X {
+  struct Y {
+    class Z {
+    }
+  }
+}
+
+
foo(
+  x: 5,
+  y:6
+)
+
+
foo({ }) { _ in
+  self.dismiss(animated: false, completion: {
+  })
+}
+
+
func foo() {
+  run(5) { x in
+    print(x)
+  }
+}
+
+
if x == 5 {
+  print("x is 5")
+}
+
+
if x == 5 {
+  print("x is 5")
+}
+
+
struct MyStruct {
+  let x = 5
+}
+
+

Triggering Examples

+
KingfisherManager.shared.retrieveImage(with: url, options: nil, progressBlock: nil) { image, _, _, _ in
+↓
+    guard let img = image else { return }
+}
+
+
[
+↓
+1,
+2,
+3
+]
+
+
class X {
+  struct Y {
+↓
+    class Z {
+    }
+  }
+}
+
+
foo(
+↓
+  x: 5,
+  y:6
+)
+
+
foo({ }) { _ in
+↓
+  self.dismiss(animated: false, completion: {
+  })
+}
+
+
func foo() {
+↓
+  run(5) { x in
+    print(x)
+  }
+}
+
+
if x == 5 {
+↓
+
+  print("x is 5")
+}
+
+
if x == 5 {
+↓
+  print("x is 5")
+}
+
+
struct MyStruct {
+↓
+  let x = 5
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_function_in_ternary.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_function_in_ternary.html new file mode 100644 index 000000000..2a46d9601 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_function_in_ternary.html @@ -0,0 +1,423 @@ + + + + void_function_in_ternary Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Void Function in Ternary

+ +

Using ternary to call Void functions should be avoided.

+ +
    +
  • Identifier: void_function_in_ternary
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.1.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let result = success ? foo() : bar()
+
+
if success {
+    askQuestion()
+} else {
+    exit()
+}
+
+
var price: Double {
+    return hasDiscount ? calculatePriceWithDiscount() : calculateRegularPrice()
+}
+
+
foo(x == 2 ? a() : b())
+
+
chevronView.image = collapsed ? .icon(.mediumChevronDown) : .icon(.mediumChevronUp)
+
+
array.map { elem in
+    elem.isEmpty() ? .emptyValue() : .number(elem)
+}
+
+
func compute(data: [Int]) -> Int {
+    data.isEmpty ? 0 : expensiveComputation(data)
+}
+
+
var value: Int {
+    mode == .fast ? fastComputation() : expensiveComputation()
+}
+
+
var value: Int {
+    get {
+        mode == .fast ? fastComputation() : expensiveComputation()
+    }
+}
+
+
subscript(index: Int) -> Int {
+    get {
+        index == 0 ? defaultValue() : compute(index)
+    }
+
+
subscript(index: Int) -> Int {
+    index == 0 ? defaultValue() : compute(index)
+
+

Triggering Examples

+
success ↓? askQuestion() : exit()
+
+
perform { elem in
+    elem.isEmpty() ↓? .emptyValue() : .number(elem)
+    return 1
+}
+
+
DispatchQueue.main.async {
+    self.sectionViewModels[section].collapsed.toggle()
+    self.sectionViewModels[section].collapsed
+        ↓? self.tableView.deleteRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
+        : self.tableView.insertRows(at: [IndexPath(row: 0, section: section)], with: .automatic)
+    self.tableView.scrollToRow(at: IndexPath(row: NSNotFound, section: section), at: .top, animated: true)
+}
+
+
subscript(index: Int) -> Int {
+    index == 0 ↓? something() : somethingElse(index)
+    return index
+
+
var value: Int {
+    mode == .fast ↓? something() : somethingElse()
+    return 0
+}
+
+
var value: Int {
+    get {
+        mode == .fast ↓? something() : somethingElse()
+        return 0
+    }
+}
+
+
subscript(index: Int) -> Int {
+    get {
+        index == 0 ↓? something() : somethingElse(index)
+        return index
+    }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_return.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_return.html new file mode 100644 index 000000000..e0851924d --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/void_return.html @@ -0,0 +1,386 @@ + + + + void_return Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Void Return

+ +

Prefer -> Void over -> ().

+ +
    +
  • Identifier: void_return
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: Yes
  • +
  • Kind: style
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
let abc: () -> Void = {}
+
+
+
let abc: () -> (VoidVoid) = {}
+
+
+
func foo(completion: () -> Void)
+
+
+
let foo: (ConfigurationTests) -> () throws -> Void
+
+
+
let foo: (ConfigurationTests) ->   () throws -> Void
+
+
+
let foo: (ConfigurationTests) ->() throws -> Void
+
+
+
let foo: (ConfigurationTests) -> () -> Void
+
+
+

Triggering Examples

+
let abc: () -> ↓() = {}
+
+
+
let abc: () -> ↓(Void) = {}
+
+
+
let abc: () -> ↓(   Void ) = {}
+
+
+
func foo(completion: () -> ↓())
+
+
+
func foo(completion: () -> ↓(   ))
+
+
+
func foo(completion: () -> ↓(Void))
+
+
+
let foo: (ConfigurationTests) -> () throws -> ↓()
+
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/weak_delegate.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/weak_delegate.html new file mode 100644 index 000000000..946c7003a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/weak_delegate.html @@ -0,0 +1,435 @@ + + + + weak_delegate Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Weak Delegate

+ +

Delegates should be weak to avoid reference cycles.

+ +
    +
  • Identifier: weak_delegate
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
class Foo {
+  weak var delegate: SomeProtocol?
+}
+
+
+
class Foo {
+  weak var someDelegate: SomeDelegateProtocol?
+}
+
+
+
class Foo {
+  weak var delegateScroll: ScrollDelegate?
+}
+
+
+
class Foo {
+  var scrollHandler: ScrollDelegate?
+}
+
+
+
func foo() {
+  var delegate: SomeDelegate
+}
+
+
+
class Foo {
+  var delegateNotified: Bool?
+}
+
+
+
protocol P {
+ var delegate: AnyObject? { get set }
+}
+
+
+
class Foo {
+ protocol P {
+ var delegate: AnyObject? { get set }
+}
+}
+
+
+
class Foo {
+ var computedDelegate: ComputedDelegate {
+ return bar() 
+} 
+}
+
+
class Foo {
+    var computedDelegate: ComputedDelegate {
+        get {
+            return bar()
+        }
+   }
+
+
struct Foo {
+ @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
+}
+
+
struct Foo {
+ @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 
+}
+
+
struct Foo {
+ @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var extensionDelegate 
+}
+
+
class Foo {
+    func makeDelegate() -> SomeDelegate {
+        let delegate = SomeDelegate()
+        return delegate
+    }
+}
+
+

Triggering Examples

+
class Foo {
+  ↓var delegate: SomeProtocol?
+}
+
+
+
class Foo {
+  ↓var scrollDelegate: ScrollDelegate?
+}
+
+
+
class Foo {
+    ↓var delegate: SomeProtocol? {
+        didSet {
+            print("Updated delegate")
+        }
+   }
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xct_specific_matcher.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xct_specific_matcher.html new file mode 100644 index 000000000..6b5c5337a --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xct_specific_matcher.html @@ -0,0 +1,488 @@ + + + + xct_specific_matcher Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

XCTest Specific Matcher

+ +

Prefer specific XCTest matchers over XCTAssertEqual and XCTAssertNotEqual

+ +
    +
  • Identifier: xct_specific_matcher
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
XCTAssertFalse(foo)
+
+
XCTAssertTrue(foo)
+
+
XCTAssertNil(foo)
+
+
XCTAssertNotNil(foo)
+
+
XCTAssertEqual(foo, 2)
+
+
XCTAssertNotEqual(foo, "false")
+
+
XCTAssertEqual(foo, [1, 2, 3, true])
+
+
XCTAssertEqual(foo, [1, 2, 3, false])
+
+
XCTAssertEqual(foo, [1, 2, 3, nil])
+
+
XCTAssertEqual(foo, [true, nil, true, nil])
+
+
XCTAssertEqual([1, 2, 3, true], foo)
+
+
XCTAssertEqual([1, 2, 3, false], foo)
+
+
XCTAssertEqual([1, 2, 3, nil], foo)
+
+
XCTAssertEqual([true, nil, true, nil], foo)
+
+
XCTAssertEqual(2, foo)
+
+
XCTAssertNotEqual("false"), foo)
+
+
XCTAssertEqual(false, foo?.bar)
+
+
XCTAssertEqual(true, foo?.bar)
+
+
XCTAssertFalse(  foo  )
+
+
XCTAssertTrue(  foo  )
+
+
XCTAssertNil(  foo  )
+
+
XCTAssertNotNil(  foo  )
+
+
XCTAssertEqual(  foo  , 2  )
+
+
XCTAssertNotEqual(  foo, "false")
+
+
XCTAssertEqual(foo?.bar, false)
+
+
XCTAssertEqual(foo?.bar, true)
+
+
XCTAssertNil(foo?.bar)
+
+
XCTAssertNotNil(foo?.bar)
+
+
XCTAssertEqual(foo?.bar, 2)
+
+
XCTAssertNotEqual(foo?.bar, "false")
+
+
XCTAssertEqual(foo?.bar, toto())
+
+
XCTAssertEqual(foo?.bar, .toto(.zoo))
+
+
XCTAssertEqual(toto(), foo?.bar)
+
+
XCTAssertEqual(.toto(.zoo), foo?.bar)
+
+

Triggering Examples

+
↓XCTAssertEqual(foo, true)
+
+
↓XCTAssertEqual(foo, false)
+
+
↓XCTAssertEqual(foo, nil)
+
+
↓XCTAssertNotEqual(foo, true)
+
+
↓XCTAssertNotEqual(foo, false)
+
+
↓XCTAssertNotEqual(foo, nil)
+
+
↓XCTAssertEqual(true, foo)
+
+
↓XCTAssertEqual(false, foo)
+
+
↓XCTAssertEqual(nil, foo)
+
+
↓XCTAssertNotEqual(true, foo)
+
+
↓XCTAssertNotEqual(false, foo)
+
+
↓XCTAssertNotEqual(nil, foo)
+
+
↓XCTAssertEqual(foo, true, "toto")
+
+
↓XCTAssertEqual(foo, false, "toto")
+
+
↓XCTAssertEqual(foo, nil, "toto")
+
+
↓XCTAssertNotEqual(foo, true, "toto")
+
+
↓XCTAssertNotEqual(foo, false, "toto")
+
+
↓XCTAssertNotEqual(foo, nil, "toto")
+
+
↓XCTAssertEqual(true, foo, "toto")
+
+
↓XCTAssertEqual(false, foo, "toto")
+
+
↓XCTAssertEqual(nil, foo, "toto")
+
+
↓XCTAssertNotEqual(true, foo, "toto")
+
+
↓XCTAssertNotEqual(false, foo, "toto")
+
+
↓XCTAssertNotEqual(nil, foo, "toto")
+
+
↓XCTAssertEqual(foo,true)
+
+
↓XCTAssertEqual( foo , false )
+
+
↓XCTAssertEqual(  foo  ,  nil  )
+
+
↓XCTAssertEqual(true, [1, 2, 3, true].hasNumbers())
+
+
↓XCTAssertEqual([1, 2, 3, true].hasNumbers(), true)
+
+
↓XCTAssertEqual(foo?.bar, nil)
+
+
↓XCTAssertNotEqual(foo?.bar, nil)
+
+
↓XCTAssertEqual(nil, true)
+
+
↓XCTAssertEqual(nil, false)
+
+
↓XCTAssertEqual(true, nil)
+
+
↓XCTAssertEqual(false, nil)
+
+
↓XCTAssertEqual(nil, nil)
+
+
↓XCTAssertEqual(true, true)
+
+
↓XCTAssertEqual(false, false)
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xctfail_message.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xctfail_message.html new file mode 100644 index 000000000..69ca46ef6 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/xctfail_message.html @@ -0,0 +1,360 @@ + + + + xctfail_message Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

XCTFail Message

+ +

An XCTFail call should include a description of the assertion.

+ +
    +
  • Identifier: xctfail_message
  • +
  • Enabled by default: Yes
  • +
  • Supports autocorrection: No
  • +
  • Kind: idiomatic
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
func testFoo() {
+  XCTFail("bar")
+}
+
+
func testFoo() {
+  XCTFail(bar)
+}
+
+

Triggering Examples

+
func testFoo() {
+  ↓XCTFail()
+}
+
+
func testFoo() {
+  ↓XCTFail("")
+}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/yoda_condition.html b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/yoda_condition.html new file mode 100644 index 000000000..0947f3317 --- /dev/null +++ b/docsets/SwiftLintFramework.docset/Contents/Resources/Documents/yoda_condition.html @@ -0,0 +1,390 @@ + + + + yoda_condition Reference + + + + + + + + + + + + + + + +
+

+ + SwiftLintFramework 0.50.3 Docs + + (100% documented) +

+ +
+
+ +
+
+ +

+ + GitHub + View on GitHub + +

+ +

+ + Dash + Install in Dash + +

+
+ + + +
+ +
+ +
+
+ +

Yoda condition rule

+ +

The constant literal should be placed on the right-hand side of the comparison operator.

+ +
    +
  • Identifier: yoda_condition
  • +
  • Enabled by default: No
  • +
  • Supports autocorrection: No
  • +
  • Kind: lint
  • +
  • Analyzer rule: No
  • +
  • Minimum Swift compiler version: 5.0.0
  • +
  • Default configuration: warning
  • +
+

Non Triggering Examples

+
if foo == 42 {}
+
+
+
if foo <= 42.42 {}
+
+
+
guard foo >= 42 else { return }
+
+
+
guard foo != "str str" else { return }
+
+
while foo < 10 { }
+
+
+
while foo > 1 { }
+
+
+
while foo + 1 == 2 {}
+
+
if optionalValue?.property ?? 0 == 2 {}
+
+
if foo == nil {}
+
+
if flags & 1 == 1 {}
+
+

Triggering Examples

+
if ↓42 == foo {}
+
+
+
if ↓42.42 >= foo {}
+
+
+
guard ↓42 <= foo else { return }
+
+
+
guard ↓"str str" != foo else { return }
+
+
while ↓10 > foo { }
+
+
while ↓1 < foo { }
+
+
if ↓nil == foo {}
+
+
while ↓1 > i + 5 {}
+
+
if ↓200 <= i && i <= 299 || ↓600 <= i {}
+
+ +
+
+ + +
+
+ + + diff --git a/docsets/SwiftLintFramework.docset/Contents/Resources/docSet.dsidx b/docsets/SwiftLintFramework.docset/Contents/Resources/docSet.dsidx new file mode 100644 index 0000000000000000000000000000000000000000..54c725d63c3bee32558c49c36d7d342420ad7c89 GIT binary patch literal 135168 zcmeFa34C1FRWSbMN$-uek>aGzWU45(>o~UKIGWKeIgT^dX2pwak1fYeoat!hNg8W3 zGnqw;o5X#i7U%|DpwN}jLTUT`X=#B%ffic$|ADX2vb3e83zQb<0(4<%>H3{>?z?Y) zqivj|-{1cI5=rmgd(PeO*-z}uiF8TXIg=|aBuYEGg_{JQPk3PGPC*ba2!gN+{^S2d z_@$oz0Y81F-#vZ>822WH0F;Vt_X=$wBqBOU^Y9EP zH3a9PM^B8J;q6PO0NuIK@zJw8PoJGQ89jS(=kd{t_v}P8JI{?ibdKTDeno`z>wXF5 zJka)AIP*K&zSs8OZQpGBTH8Oh{e9b~+y18QFWUa3?L%$9*Y;ZtW*Z& zP*Ad^sYD@-d(<-iDWy}_`SP{YYtt}z| z$kym~%Nm`VD=4)Y5?>>N$kwRcvPS2Yay1zeUn79W&^*_IW-?ow@o+Q%kI+06qMIXx zD_4tg^dKODeE)5d&>m9m+ZP{-yIzX+GZ{M($>h>2vFYXba%t>REGP*FLf7bKEhLtv zJTF%VoQngz{&H+K+dBjA;drQWhBi|^S4?B=p#s4eD#C?c zNS9XZW2%nAZArQ!u5G3UILbbTa)6_RM?Kod-ug&ibh?BV!qfa3!x76I2+UT>w-3EI2nt1 zwJktHzs9HZ`r*}At=bwvk6Kz}Arey4vr1MeBudIzC7&yl;GEbf!SQtIL}L2E^FS)H zDr+2;0bc8Lq{j*y4ofVt5{*WBVx<++{+}8jyOeIGC--1VDJBc)JZ^OR6jkd;v8#Ky zTrA}l;4VvNXNPlH*m^9NQVo;a0Wu9aY(R}o z0~I#ks3A)MjhCKDD-KFxOUQJnIIv4q{-|Ar*|&p!(PlkXH8M}#*2pTqCM9gQyx zyfo0(__@Y+xAgn}yy1Nfhnl|9lxj}5-PQVwf$z4gw2rp41pcn=^$o|Q9|*tH{ELBH zTeok&|0kPnkGFJhGw>0*hAxVWH;f2Fw+-U-#4_e*<%ouaakFRjFj#6ymkVZF^CsJ0Jj z!(FNmyEExaDfxl|6QHE%ASp%r$wW*e21{FYaU#98+EbB!2ZGofaM9z7`C;hB&S`mf zyV@aw-h@m|vq@z%qbvZUIhrjm6gv?d>N=`o9pJSlBM}pzm1x)S!kDkV`4hq&svnQ~ zWgl@Oh*$prf86>4`9Oy{?psJ_&DUCOCnDSp;B`6&5BxZ)P(}d%ZL>0nln#gm5??3< zJ7N$8%%o?_AmK1e+T3<&q}x(=YJh{plPSEkOAI0UN*%X%T5D$UtX;BYRJQQ&~4P+PYKCm-px)t>5O zi25}|k%$Qs$h6~d8pq<$u_Nkz^5sw^B*K-B=q9o=xqZ+UdREE}C36dTxPJ@L!fYA$ zUy*l`jwLj2T$CdnYQHZD7go-4B<$;DI|EhsuJgo%`!x)sVO+H_KrPM7J37>em`o(+ zl+&Q2wPUobdUbrZ9WtoHWKuriWq|K?b%(qoROt{G@l`ZrFT(R$N2}pp!m<)hjE2L?SfmREQ%YycbnYjkqriNOm9z9vj3~(rC?3arcS9$i3pdz- zka}JO)+e2U3(Vu~#?`3WvmUH*dVqtW``tsxXM3mr1iJAY^_(0FRnGg07J* zC^1VU$fHfd2ZbZT8wJqvFSXs*Cba%`>r!iX;Ol|+1{MOH0kP#zTHer-YH4Wx+vZ;o z-q?Jh`HrS9HvMkXi<=&7{GY~B;}P+rjkh*@QG8p&;|-(Y3;o~nzeoHJUz7hyf4{$8 z{+PTZcgfAtXQW@3%F<~4_ry!}AE;lhKU4oa-`#cJ6Fyt_yLD>ask*(w2Yp}my~1}I z=GpXbm(6@H9qs!?PP_0b`roY9NpOp3nt-?8CbVRG zf$s=MF*O!`^O7{tF)MOa#L+~NX++wh4XgH* zdx4)jr0;uPh5v-A8a2bJfB7yc6auKqEX=-b81#)*d;5sgA36ioTy%`~RxVW-koRtl zL7b3wbmYXzJP-&t!+b>iC)+MwHbjF)JK?LHusg%@j=Eba3;mtgnwnT^Q)cG?%-jOky^t@QP82~C)f0y z>ih0zE62Xu02}0*@GB!ycgGn5i#9;W%brYR;W!!kQc#lMZfAiW5ZY(nUjRLhH(#i1|)?O*Rd$VVIAdJ9)w#v$=#}9)CdU4xJQT zG;!8(x>R5|f8(q)8j2$TPrlp%$+ITw(^#Lhd&jV7+6wx`tp8H%G!?U+e0K&nK_|6C z8r`-DG_nch1#9hvNRPGh=>bHBFkw&p4ZD;_mz89hb|Zc_E@kU?>Y4A3eIQuth4&`0 zkmqJ@Y*LDy+DA5oUuOGlbRl;o?Y@GRA~s#4YMtB}R4<5@OWEZZSjypaECQEbSaUME zfN?TyJ#)L$;gKH11GDnc)6$WS%hoPfsyYs{CsZ~S|1u;+wvSr@jur~Jf-%(=2vo+V zdncPkOR;qiT8bFHUt()CoTCfYUY$O&if>5e!6%6Sto|xS`kerTf9jL=bPS8pY$CIAm2F@SjsGlm znoHT_|LXxMw0+peM2FU!mA$E~gesTW=8Gni3ecv&R~B-a6F?ScjLqjPqn5rM_ekv> zgCc)T9NXUf771ShiX#;F9X<@avcviWPbLcR2rfQbu`^wYVzRe8Gy<&`s<-96PSI3Y+de!5Z69`T>sSbD)7&sLofj>d8{DcUkqhVQym~JD za0Fm1xWVw)>Mld@J*UaHOSo596zV@y|IYey{b>E(x__^GP2H6EUHJF`@e{&V+dka( z;u<4(xl(4R60zX{rYypqw$KFG8_gP~ydWA_=ock`7oH^EVoh@ARk?4Ialu zqcX541uqH^-p09kprxs^m_eC5A{`2j>QIzyDh{MSh+m0#wt%pevG%9>rEXwmcrT`N zsg-y}$J0r~ zB?an`f*@GI&B-T|ey7C|PcTl?ymi+pBLX3}wwPh>q=%b_EZJi4t7e(_o}sq(;V{tk$?zt58U+z!j1%v0D0{tkzgs4z{cP zVgkQgbYDcEj4p#Nw1|?#HFb_*Fafq!pX?>5n%42QoZQi_9tKQIom6XN101l1FQ_)l z{h;9#6Zw2*Wna?F>T$(`K~>|i*uaYSJL;eAB|MRC3!;^kd>q^dgg@w&BEdsqBD<2C zz5?>~cwQr)*`hc;v&9*WOAiMXXqC&ZEab|?I3FUcXMCXyX3m*(R*7qOy#{Jsbs78- zH6)L=t7$Q@Fb(Qdz;H5AO3vX@>vxJ(A!?Z-gE93y83WD+lU)PV&}pmJtk%ne9qNRb z$YgR$my|*d=>jeytKnho>T<_Gr}gD8koQ9;d{D&@M>~+?UT|YbT(38$JwT5YI_aXo z7+_o#Ce#su|I`IdHd z4|TzAgkVevZ6;5Iq)ap_Pj&+qZIPvu(nK&OCWskLPs45oLyb})kuJqS3mu2Mt(42M zZC$kr+s(trrSaey8?;PfTFDSJ5H8HJ>(z?SR)fJhsy!wxuSl_hXpaudMYq4AomTVEfLI=7D+;5f@^2u<|%yomMV zP9}TP%=oOsH{13Jzs>~QW@{U3ZF33h)VuGK4s-zRjCO)1^E!uI##Vtf{>D+MH#Er_ z zYeTlu8pcXcGixCs^mQDT27|!Y;(YC76-4gdce{{J`p|5=m?BaDP@ z@~1kyW#&&&z+gnAOi4)|Ns0A z|9>(my5axt#tV6cAh_ZGf5ZR(hX231KV`VTIE5lMi(Z|+*@*A>4gdce{{JAB&{>Eo zPHxrw|CuMBQ_$o^Zd=gkhRNi`hy4F8;j+;7c4=j5}fi4Pm9CQQh7kItIdiwK+-~APFkHS+Ec$GYzt-thKgb zz=?spV)XuCZ?-)k3;i8x8Wd0Gu5*XFBCbdreM%pp;BbfLQ8{I^@7UUzppcSaVWP#5 zT+HY1r`>R<$|JWmjE?9vWsp$qtu-oee`aV>geE>fOT0G&y>XlQ4UDA+VNjSl+_h{daAITEUyqI64n8)GNm_`ycO)J_M;jYa_ z=mh|R!835(mildvUY870_`(D3;S0BdN*7ox<{#^%qcY4F#C}w^f<~Wj^K3#`#(N3n zINwAyMah9$mvb>cdytTJ;*EdG_~R@4-2j}EDrd4&>F>-N%U=b81cV|h_mZOk=w zcdgmB#&YjtfF1Y;kFJ!!7Oo88%VE{)?qa>jQKXpb&q&@VP0r^Nn0TBXdu+`ffl9t@0#yy`e4)9#xFIVYWPmWTN;k~ z|K7hW|A%~0`eSLR{)hFiuKTCDHu0*s%lC)ESE2Fx{ymX|10GUi&yXp-8k?4dT&OZg zCw&G)5fBT+s#Ua7RTn`Qf)S1ns z4T<7j=EfVFg#!(tb?{A(Cnzj?Fb!@`+`-Mhoj1_qNS7H9%1|ympD6qwPS_Rz(^SA1 z_z2+)-W-<&3?TDtiXWrK9+d?Q^HH?;iTs#H`B3k^EDMK1m3G^xu1CC*NUse^)fgqP z&+RTRS014aci3&i>E1Hy*wW5WD$YGP^f1Ohzijct($Bd)T$n9-p6b6O3mAdSbe}vk z0mxK{*(CIG9+_@7?wn)ioH(mh^-VPxGMX_xO1I^Psur>vFD5nkkSq*_)Foqjrr`yy zVQ99n0ngeqdlnbd(@#AUFUSJenvNPh%Yec8kRIu+7Lx|jjI1)Kg9H%`Fkuj)3c}4F z!%iqubZ_r2C>U6Ok>V&gu2=gGbQ5J5ixufI17nUQiSxwrbyQ*bHn=4mQocve$pS>J zYS+iQ#bFqehO@PpKNq9>U>i>87D3aZXi(2GsBX8+24{p037c;9mNT+28B#Agg#MuP z0AqI$fbT;d#Jgw}`P5ccDyBCd;U?2{T8e^H$6rOuOL}^5xj(P$H z)lLUyBS4FnG>7*h(qjb%@z>yS9|Nh~*p*4pdxTVsj}6!~8~?2#!}#|GEEBHODPrFC z03laOq_f2>p&8&%2!U~~#?$Wavl@rL>vEz8M^=Q>MHAX@$2F zfJ45HR9CkLbhzq_uEnFrV7X!Dk43^p4^ zgcpM$7Sspi_TogG&ORnBNe_<9@<_1cW|pv+9_lfOmurmeR5)T*FS-O6jku_N@u7`F zdK+YySoSnzI*x~@Y^t~DIn-A|8XR_A#-{O6zB*1Ks0pjrGZZd-WYgc zAQcFMb-;&PUf9yr{HErK!ogl>m%CnE_94jL1iBm^Mv!O+C(FDJ;ms5Mn1BPDCOYRaEQ5u`v0Z zJ$^{)2WK60QO-e-o^&#f8#1FTgU24*aBd}RPd%T7VNRBdkjf`sfIERXESo>DnsFA1 z+$(#6-HO@m%5~2~_MGdTmLZR>#(Uuag4A>}$+AB{gq?l48UB83*c&g>2hhNW87M@> z5ujI7qQQly#bY;QT1aD6Ka%zsVEB5FL=5A7b%T&8Oo7+OAyFMZ3DXl{ioyPgCuI~$ z-U#sV;}qZn1Anl?b#ejYTp!|*L2B)O->-S0Yp%WR2f(`z;xofs0V@}uhH&%D`PTA< z_3Q)>c>>{5<0&Ph%t9D2tA{+?M{Z@T{qZ;kgKqa-H@-R|9SrtEtm!<)NQp0MNnP2! zXZy%{^x&+#yKIlRgRG|lfYO{PRxc!Ram?yB#FW!5=}K5kO39VFahIig?(p zRe}DjFKpqudh^$+BzI#haLY7MaCe&lhNTl#r@^jhvBkQ;m%}1ngvI#z8E~UlcVUQl zV@_bCn-9-qL%IU%zL-}a!am?xv5uDGF;?0#)^$&KwK$Qs?(ndYSK&~6j72wqp{FRv zXCf0XC~$*hfv(TSv&s_6=`?D+S`~JsJhXKtf%!ip;Ra+qgr(Am2O~I)dlADwrA5O6 z76VxcOEfI&H&*|Ax6~ONgarYX1Tf5D&QJ__qYc>hm9;tN%Eqv=7%$6cAt8Wf(UNHU z&JIew!6Sf+>GfcCAprht7CWk;a~3eDXVfmtfFSXIKjkkWhwb*(~;6p9QC4GPTlR|s_64QA$%JExc^h11Ho>E{q5>C zJX*jy5HGO?<2zwQh9j#c+SFb<(Q$qE*_%)HG2F-or@?9!8DLd}I5YxKGdYO9!-E02 zKIQJAo43%L9>fTg4)#KT+!g|c!$FGbnTdvTO%=eftX)myvJg)SbOP5`Ceedvbb$n0 zi(9YB0*XnVZBi07^dzL^hIl!a7&iR<<-4V(!i#l>%Tc#KL4AXCB*0eSn{eF)E8P}U zOsp~(pm#V{uPf0rHWV`yB#VExnMNXg z$0>6+xQfAs#^7M_Ja(ydSr*Q4OAE;G#!^cF2R?+vrnlmL7|FCXl8W_fm8K$HX2?$c zJu+gDO$YS^6?w@osKHRBOllq0ZU|+7h7zu5@7scw9s<-i35;+DnZJqXbTX0~=yV^$ z%?xTy$Zg#p;K(DrHtdi)tuIP5IvFSJU4)1u1JvX=3>vH!h6i{K3lN=hi}HIHK}oiK zoR?s@B7QAu(`wCpad%k~AgDJ(=vJGR(1Slyk_8a$L^PSX<5{9v>NGX*+JO2B^MUqj zAlW0FDuO9!yV|MH`&&aaeGH<8r9k9HcUD<0dEnr)Se4w-2V*Qp55m;2JjSq;=F(20 zhE3R}u^>!_C6gzL;Si`97t;`4vBu*W;BXnX!5rFXJ?v_uWe1&gx!8 znBzq$6nSVnest{cTr~n(rKzqSFR;kdVdCN*nm zY*n}d`t8G^)nU2_<2H+03<7%+1A3zEHM9IG4&lcO1qdq&Gcl3nm!S14%mm)<_;G|8 zS!mY@eVWXkfV^?bLuBbjFMzU~%#>5gSRuDy3F5n@(Z+33kgl-Xc*0|me#daaGgprH zu|Yt2k97>;v3_j?WI04vbr;YG?n9uNMtM-Ice)q`ps1%h3Ht0Z(^;QRlOa6-Ii-hnA~>&qEr;5#?@WdSt58k#TL7E;ozHmKN9u}SH!<5}rY=#pL;SY*0r6$xfu_$ky|F1D_=&)=K!clbpoDQ?hsBg0_+NWQkSu`E z{pbi{(8$Q#RDBm+R0@%>0UMqY%n=)!MQu^UcfDzfl6n_t4l3JVbZGVmdIPcnD|)1^ zq`@+up*3Y!Fi>;a>1cEmj1R0>m_cF!GHs544GrT@nZE}(wHk6b5M;l<@%6&p>&qpa zOR=!cEX{B}Q2+{k4(Rk^9N!j-ZwnX5tR-yoI_uKH`W|EYD7_6BXn>yuQ>xoPvKDzJ zAZ3LLY#Tk2w7HeFfVIr+h1_TdwH(SMk|K#JgG7I`dRZo(=HGRBD}?lg1cMn%BYPo( zu)vZ~rdGf#3hWEgS-fSbo%Iu|ow+ET55~n*IiE>WuIBi>f?>|%#!iNy>IUxhRAi9n znc!M)5Kk}UbA=L{D92aU<_eo%qm-sH3Bl>@&5Q!pGCe6Bhk&=RFJUq<*JvsZ7B9fI zfwll-o|u&v{$SHky$*vnHzAD%C*9#q=O9aOq6#pr0)sTm(pgw~#$uOS=GELOOEH5o z!wg5vP{34AiKFeCV^n$xYpXE5u(>TuMQUg)Jjz)66brg;u7lZn3z`L#spsr7Yn8k# zT?{5^1|cpitVcFif^3D%y*r+S!wkBU+%&*h)NHd5!P-?B^y#d;yF={;dm`PlnA;S= zgR2>Hta-I@vAhWi>I%?u#{i3VRUb|vx?Nyaq<^=+>+ZpEHWI6;E{90^t05ujv`)>_ zRCqC=4mWsBwNZ(V>g?tc}ExpmoDY_5p{oYg7b5JrG`ysG$T|GT}XjM{!0o@$z0|K2%e-#Z7G_ z@d3KS&??vSS@THvxZ&~MH&54PRa77?vL&zF+^_~pi0eo-T-CDCZVqV}Qe7Nx2OCqJ zdQDj_<)U_6EKDaJQ;b-&jubEyKuE7U+12BPX9bOiSU4lpJp&gi{77w-(J_a!p((^` zNZcJEAg-fl&Iz>tKj@nk8Xok2$^UZyfc!D}A^9Fzls+uIR=OhHQ~$5^XWM?i?PuE_ zY5hj)D_i>mUkJQE@T$NQXdv)l`JM^*Rr8Hy|r9#3pb*}6w$E93KSgU$<@O_aE*^$ z5)Xp&z-z$r*k^6y>`2U$(%NKi$kq}}$&yOEoL$nypTsKIKhl2py=1qvBe-8=g{1;B zN7w&ib$*KF!eU>6En^&j@h7YGlRBjM5{R=Ie*%@*U#!kgFrH)vd{Gw?`FIX^fH?kA zP*P>hxXGi8wSV!9ysJaq>%-9GBe~MKr5q>!`Q=C=j`f(jn?u9%sQLhp917a6$a_Gp zr=yuGC=Mr%O(E*y9Y=_S>UQghAg+H+N5u04?68g~2Jy|ZH9^EjL=b62JFO#{%+_Y= z_!107PCl56SnI3IbX;#;R5CMk{w-fv-4$D1RIXU-;ultT*)}Q?#S{`tV9=c@v%{`q zu$Hm*OU#c&uj3dCd|)*f^I}&fYIhkb$l+7|9S~16C?{i zh)I*di=r;~iUXaWOQzvzORy5hS>CIhKUT5Ld(gjGaX?o0!zuBC=NWEP?8G;OmpnwAw zX4HHLkFK09C^PA0P>9>LqnkgEUHw%sb)~cHfJVn4Xy};mT6IW1AF6b?^^O!IClgr^ z85f3X*~7@7OAjNkNivFt&gff@O31$964SiQFH9-CbHaPUuKSHH6)?{0^bwm8CkA-xE9GYgN%GabC>GfBqM%qw*sT zAWR9a2^0I9)qA0--kg%)4%JkT{mtrKJCB#qHn@yj!gp;fzKki($=QbxYS10(2IHfd zRFaGN=f@H79#_D%usxWYNBDrQV4KT)o=zF@}({h2}NAOWjQsHB%pJMeQT? zdPIGm1fiv3?mUFGoqHVu)1~f`guS7t<=L~gwiHpLqv}ox;!&UBq9TjAk+rdF6#}CA z)g55>A5wFaxN~1A$Da!Z!H5HH0Z(ncNMy+Eqe-tUZKiq&MOP`e5(xuw1^HA__1b;@ z>7LJu&WhJ=0Ub0uNN_VYNgl%N=O5q#Axz-+0H z)domwjRDmlorBq1^qKHRRY!oy7iL41-Lz}aIDxF6Q637Bk&teRW->IyAqsa%^pS0A zSq7^wuM#o_vs&x>c zLqLa8KBsgzo^F3q^||V;vVa6TywcA)dR-k*x61+&>@K}~mecF%Nzj`K#ZYB`#zfB- zImJ$*QjI$r(j*F;KeFG*o8PXHZVPfwws)DaM|y4ONrtW4YK@cc!E|YCM7>244sK7{ zecZfn5qnKKY2cQ3GX<)97>&1pAxvsfdMLoGN%L^-s^%P}Bfi{94@xW?uRn9~7lS)$q0@LW2hseFn<3%TUHk~*c7mU4ypvq}+cl8Zy- zBG@=kfE+fe$?O<7WZ=%4BQM^d$DYDCGH^10}I?U*BnCwG}W8q22L8G>joov5_Wvv}v zJ1-1oHCNPD3KDmSx>P$jS}$ii_*IW-O9zSLxPn8E{DCXzNm?fMap zbX#zZ^b!IzN(Lv_79bfQ0T-|ixur`=f#eljtWiUGY*&{%2JA%|qWxfi(1`vn*KY8} zTaRx#Moeg;ED4Zu0<9aBLhVpNtT_e}ZMBv`gDV{DP@_wULKbA;@qkvpt;C*$cl^)v*JOR4qX{|4Gl4X<62y!oAFiP6^7 z@-M<};dMgGueDrk2{yknFwypyPxkNgzqi@fwA}dhMy26X4aenQl=n&hDZN!XD>c-A zxc=q!x7Yo4;ID+&)lGxsP_6ELSF=PB0s zS?y$2Jzpk^0aLU}Jj|EGA$TJqC@){jEMT~bO^h4oVnVtRGlfA?)$XY>_{|tfIEH;U z&2hKSdycD_Os+9rJGRC}T+q=fV_KIH&<3%J_s)`KLKU>`riL5E)3tzjx~t&X!rrmZ zrP!B3Y`a{r!BfD^t+#k8gpcG9$)IU_*x#A6KslP2g{tQ-;xrSs4eLH8RA;*p!hwOy z02m8pQ_R`G`I*r9euf$Jr>7zOa~^arNZp{vgf12(F{pPjgYwf85;%(bJjFa_IVH)7 zJOw=2(*WrS(G!yUy&dy}C%nM}Ah#_ggBKK8LG8*nz5?ALHZ9D-PkEaiMHKx)9ne0fcKEq8PO zH4gCxuH<^4y09Z_z7U(bO*YUGu@^*E(32Oe*^^paryJ>51n7L|*fU^T*JJg=m;y_` z2G*J6nzQ6-)?T~4Bko%7=5e>=uVGL2u=BLGA*QQEbqzbRf4v>q4571;U3(B1cG$J) zHE)LB4*}%$)Q3Z*%-7b`&u4LMH z2W*7eCGq|%h~;1vEStSo9jNYDlYrmUt?9t?yft~Q&D@C&Gi_Q&-XOGny6vg9a@(o4?X6#J{jJs~TaN_3ANaGtQ-Q|<_q2Sin?hU-6G|49AKb#D{DBQA=!`lbO`ZT_jlD&+TgI8-?ZrmShu zTPw_czKpS#z4P>$Zb)EH==^)>%$dXK00&P7E-YP{OBh8G^*X%@Oy(=@kuBA*Izj1U zB+c{r#~>Q#W%U@y+Cu7f2qW}ZIgvS+Gh8G#JimiF5KOF-I0`v}uBnh|1F}q?=Tq+y z7y%i~4X@xj77Efl->pKzjmZ$jIWui8RD=N^Rj3lLb5ot#+=gO8NZ{<$QOfYPgY@l5 zvrdV>TN_>$TXdV{6-X6@O7U@Z1cG#hRtS~$C~g?|@(MsItHTi35k#1l4x0o90G2`~ zZy0>_pw$`mD2d3sP39$BdbnX!7EfbWcXY7kiPCOX*4WKa2!F70RVi$01FdUUFRKsG zxjn8QIj?hT;lHaMv4~5^beAKoHmXNtu#8eKLue<6Bx+f6_f5LBKJ*eE+b&+AT|B1N ztM^kn9W?B)g?4w}bX)6-R|t8q>^O`HsmgYq*4v4lJ0u)MjUjH0^>?K^T)pvWhz_GC zkB7ZGsCz+-pf*;$17a=<{ot&_duKuY^ma9@cXT`qT}^?d4)pM#dI$`3Ix2gN1Xrga z_W~-tboHfir1jwywO~358NU^(?(eQ1uV$wsgDz;{Achm8;YeR}8g>?>HsT$^wAyMD z7`NlgHowMQKvKJPhWv3OQ`U7IsCTM^XfsyX2EjZ~F#0TwL!`E=1DK#zeFB`@^MxD) ziZ1Reu7GxP`5ZXpId6}R%$_Y^QY38Ph=dI!7%U0$k1=~u6s3-UsTd^d1dj!^U+tHL ziBM(lLSkOgcMGFg7SlP*;F;6CDU9v7m0osRP!VN1sH1}O(MvKfI3)19IkGxvoDxL{ zMUzsX47z?R1SS`NF@1u;gQJrxco17#>2AaXo;nNNiiGv4D#CFdHutnN)}{86^{qv6 z%Xn1IsalHY3=gS25+s+LaJc7M8#;=q@%?JI1jc?RT_icy<}MWoz)`h}+5T!%jF+`O zL@Nls3YIDa7 z4_gJewx*U$+|;Z~JwSU0XBXy>iKeWrEJf64pL#c%0~0lahN{l`_?4>msrx0k#77Z` ziClHIFcnh6JJo$iJ9jgWeOrAa4d_1b^1!a}pf}cv{HxZLyQnKR=LBmDTcOsKJ=7Ik zSNk4g->6zs(>~$3!iR*$4>!KLv8S=V;o}WI)v(R~8UI86JLT`oZ!kwWw~sf)A>2!|Ah$ufNWx2$m|s0Mw0h<_TVqU?C%W3@AlCmC7$^J z-pdugpW=6$d-VUu0NzWhK0n3pWfO5DfG_$PflA!RTn&TbZ$^7gf9%rEh3HoNVxQC{{Y3#n& zGJ6S=VI+h+1&t9iEHSJw*;m%)=OD2Q1U4!G`b}meY&F($bSzT5I1}{a4%SLo#8Yn5^~LH&*{um*pMpY7j`9G|L)m zaZ<)Dxn{KD0bXlzP=}&9Bm1=8=m*dUDr(SD^o{lAm89_7+h`PWQ72z5CmZEO?U>9J z?Sz&fi2EUigf|v7O|53nSsUHrnkvlASX0<{f>_;b6g&gLNpXqM z6G(v%P3yt`xgdw{Obe&uxm9?rDH1G1!UjAHt)>eX?lu(0N#t{?Os_>XMF>i8_WIs3G7RBp1dQpi$ET6YQ29?JIat(iR!*n$q6$eDIy+QfG`nIg z=FRxeV%5_e>30ISTTOx3tz$46JLldXt$+X@Rg)lC>^Os>0`6R;$sKqP_|IaeOC