Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for merging nested configuration with parent configurations #1674

Closed

Conversation

stephanecopin
Copy link
Contributor

@stephanecopin stephanecopin commented Jul 13, 2017

This is an implementation of merging nested Configuration, based on the existing codebase (#676)

When creating a merged Configuration, the rule are:
For the parameters:

  • Use the included and excluded folders of the nested configuration (with the rootPath of the nested configuration)
  • Use the minimum warning threshold between the parent and the nested configuration. If just one or the other is present, use that one, otherwise just set it to nil
  • Use the parent reporter
  • Use the parent cachePath

For the rules:

  • Nested configurations may specify rules they want to enable using opt_in_rules. Any rules specified under opt_in_rules in the nested .swiftlint.yml will be enabled.
  • Nested configurations may specifically disable rules using disable_rules, in the same manner as described above.
  • Nested configurations may also specify whitelist_rules, in which case only these rules will be enabled, and all others disabled.
  • If a rule is both present in the parent and the nested configuration, the nested configuration wins.

There is room for improvements, as I just used the existing internal func merge(with configuration: Configuration) -> Configuration method to implement the changes.
There should also be a way to override just part of a rule's configuration (rather than the whole configuration), but that requires deeper changes for a very specific use case, so it's not done in this PR.

I'll be adding some unit tests while this is being reviewed.

Let me know what you think!

@SwiftLintBot
Copy link

SwiftLintBot commented Jul 13, 2017

143 Warnings
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L8:9: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L9:9: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L10:9: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L13:9: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L14:9: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/AccessTokenPluginSpec.swift#L6:7: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/Error+MoyaSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MethodSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MethodSpec.swift#L5:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L26:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L29:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L30:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L31:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L32:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L43:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L46:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L47:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L48:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L49:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L59:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L62:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L63:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L64:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L65:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L84:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L85:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L86:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L91:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L92:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L95:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L14:86: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L5:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/EndpointSpec.swift#L107:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/ErrorTests.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/ErrorTests.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/ErrorTests.swift#L6:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/ErrorTests.swift#L4:1: warning: Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)
⚠️ This PR introduced a violation in Moya: /Tests/MultipartFormDataSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MultipartFormDataSpec.swift#L3:18: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MultipartFormDataSpec.swift#L5:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L9:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L10:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L11:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L14:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L15:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L16:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L52:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L3:18: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MultiTargetSpec.swift#L5:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/NetworkLoggerPluginSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/NetworkLoggerPluginSpec.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/NetworkLoggerPluginSpec.swift#L7:7: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L277:5: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L135:25: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L28:51: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L32:51: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L36:51: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L9:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L22:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L276:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L134:37: warning: Operator Usage Whitespace Violation: Operators should be surrounded by a single whitespace when they are being used. (operator_usage_whitespace)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderIntegrationTests.swift#L152:37: warning: Operator Usage Whitespace Violation: Operators should be surrounded by a single whitespace when they are being used. (operator_usage_whitespace)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L173:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L211:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L212:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L253:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L267:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L19:1: error: No Extension Access Modifier Violation: Prefer not to use extension access modifiers (no_extension_access_modifier)
⚠️ This PR introduced a violation in Moya: /Tests/Observable+MoyaSpec.swift#L34:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L55:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L142:21: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L121:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L5:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L213:55: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/ReactiveSwiftMoyaProviderTests.swift#L10:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L49:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L111:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L117:21: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L123:21: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L7:18: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L100:55: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L140:55: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L10:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L167:25: warning: Switch Case on Newline Violation: Cases inside a switch should always be on a newline (switch_case_on_newline)
⚠️ This PR introduced a violation in Moya: /Tests/RxSwiftMoyaProviderTests.swift#L168:25: warning: Switch Case on Newline Violation: Cases inside a switch should always be on a newline (switch_case_on_newline)
⚠️ This PR introduced a violation in Moya: /Tests/TestPlugin.swift#L8:5: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/TestPlugin.swift#L5:7: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L135:32: warning: Number Separator Violation: Underscores should be used as thousand separator in large decimal numbers. (number_separator)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L58:70: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L10:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L52:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L56:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/TestHelpers.swift#L61:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L165:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L202:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L203:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L242:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L256:17: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L4:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L19:1: error: No Extension Access Modifier Violation: Prefer not to use extension access modifiers (no_extension_access_modifier)
⚠️ This PR introduced a violation in Moya: /Tests/SignalProducer+MoyaSpec.swift#L34:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L525:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L526:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L527:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L530:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L531:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L616:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L617:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L618:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L621:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L622:17: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L26:13: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L53:13: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L62:13: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L109:13: warning: Nimble Operator Violation: Prefer Nimble operator overloads over free matcher functions. (nimble_operator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L418:73: warning: Number Separator Violation: Underscores should be used as thousand separator in large decimal numbers. (number_separator)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L2:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L3:8: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L6:18: warning: Sorted Imports Violation: Imports should be sorted. (sorted_imports)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L67:69: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L86:38: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L100:38: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L122:38: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L137:38: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L375:42: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L385:70: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L637:55: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L710:55: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaProviderSpec.swift#L8:1: warning: Explicit Top Level ACL Violation: Top-level declarations should specify Access Control Level keywords explicitly. (explicit_top_level_acl)
12 Messages
📖 Linting Aerial with this PR took 0.35s vs 0.32s on master (9% slower)
📖 Linting Alamofire with this PR took 2.33s vs 2.3s on master (1% slower)
📖 Linting Firefox with this PR took 10.14s vs 10.29s on master (1% faster)
📖 Linting Kickstarter with this PR took 14.54s vs 14.78s on master (1% faster)
📖 Linting Moya with this PR took 0.79s vs 0.69s on master (14% slower)
📖 Linting Nimble with this PR took 1.35s vs 1.35s on master (0% slower)
📖 Linting Quick with this PR took 0.43s vs 0.44s on master (2% faster)
📖 Linting Realm with this PR took 2.22s vs 2.13s on master (4% slower)
📖 Linting SourceKitten with this PR took 0.85s vs 0.88s on master (3% faster)
📖 Linting Sourcery with this PR took 2.78s vs 2.86s on master (2% faster)
📖 Linting Swift with this PR took 9.89s vs 10.06s on master (1% faster)
📖 Linting WordPress with this PR took 9.59s vs 9.67s on master (0% faster)

Generated by 🚫 Danger

@stephanecopin stephanecopin force-pushed the nested-configurations branch from 52730ce to d2e6ae2 Compare July 13, 2017 17:56
@stephanecopin stephanecopin force-pushed the nested-configurations branch from d2e6ae2 to 26be12b Compare July 13, 2017 18:14
@stephanecopin stephanecopin changed the title Add basic support for nested configuration Add support for merging nested configuration with parent configurations Jul 13, 2017
@SDGGiesbrecht
Copy link
Contributor

Thanks for starting work on this! It has been on my to‐do list for months now, but I’ve been to busy with other things. I’m excited to see it.

@jpsim
Copy link
Collaborator

jpsim commented Jul 13, 2017

Same here! Note that we're having some major issues with OSSCheck at the moment, which I'm debugging in #1675, so there's no need to pay attention to its (wildly inaccurate) report.

@codecov-io
Copy link

codecov-io commented Jul 13, 2017

Codecov Report

Merging #1674 into master will increase coverage by 0.14%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1674      +/-   ##
==========================================
+ Coverage   87.35%   87.49%   +0.14%     
==========================================
  Files         201      201              
  Lines       10000    10102     +102     
==========================================
+ Hits         8735     8839     +104     
+ Misses       1265     1263       -2
Impacted Files Coverage Δ
...urce/SwiftLintFramework/Models/Configuration.swift 90.2% <100%> (+3.22%) ⬆️
...s/SwiftLintFrameworkTests/ConfigurationTests.swift 95.41% <100%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93b130f...26be12b. Read the comment docs.

@jpsim
Copy link
Collaborator

jpsim commented Jul 13, 2017

I should've looked at the OSSCheck report more closely, as it looks like it was already accurate. The only OSS repo which reports newly added violations is Moya, which uses nested SwiftLint configurations (one at the top level and one under Tests), which would explain why this PR suddenly changes the violations reported under Tests/*.

@jpsim
Copy link
Collaborator

jpsim commented Jul 14, 2017

I've been playing around with this branch, splitting out different parts of Configuration.swift into dedicated extensions. You can see my edits in the jp-nested-configurations branch, or more usefully as a comparison with this PR's branch: stephanecopin/SwiftLint@nested-configurations...realm:jp-nested-configurations

@stephanecopin I'd love to hear your rough thoughts on that. I haven't had the time to clean it up much, but if you like some of the directions, we can iterate on it.

@stephanecopin
Copy link
Contributor Author

@jpsim I very much like that, that makes the whole thing less cluttered. I think this is the right direction 👍

@jpsim
Copy link
Collaborator

jpsim commented Jul 17, 2017

Continued in #1687.

@jpsim jpsim closed this Jul 17, 2017
@AnthonyMDev
Copy link

The README seems to be outdated about Nested Configurations. It looks like this PR says we CAN use excluded and included in nested configs. And the docs in general for nested configs are basically missing. Would really appreciate docs on this. I'm trying to use it, but don't know what the behavior is and am just doing a bunch of trial and error now.

@jpsim
Copy link
Collaborator

jpsim commented Sep 3, 2019

It looks like this PR says we CAN use excluded and included in nested configs

That's right! Since August 2017, any nested configuration's excluded and included settings are used instead of anything defined in parent configurations. This is documented in the comments for Configuration.merge(with:):

return Configuration(
    rulesMode: configuration.rulesMode, // Use the rulesMode used to build the merged configuration
    included: configuration.included, // Always use the nested included directories
    excluded: configuration.excluded, // Always use the nested excluded directories
    // The minimum warning threshold if both exist, otherwise the nested,
    // and if it doesn't exist try to use the parent one
    warningThreshold: warningThreshold.map { warningThreshold in
        return min(configuration.warningThreshold ?? .max, warningThreshold)
    } ?? configuration.warningThreshold,
    reporter: reporter, // Always use the parent reporter
    rules: mergingRules(with: configuration),
    cachePath: cachePath, // Always use the parent cache path
    rootPath: configuration.rootPath,
    indentation: configuration.indentation
)

The README seems to be outdated about Nested Configurations.
And the docs in general for nested configs are basically missing. Would really appreciate docs on this. I'm trying to use it, but don't know what the behavior is and am just doing a bunch of trial and error now.

I couldn't agree more 😄. I filed #2856 to track writing comprehensive docs on configuration merging rules. As you familiarize yourself more with SwiftLint's behavior, this would be a great first ticket to contribute, if you're so inclined to help the next people going down the same path you did. No pressure of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants