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

Fix issue that prevented the inclusion of a configuration file from a parent folder #3491

Merged
merged 4 commits into from
Feb 23, 2021

Conversation

fredpi
Copy link
Collaborator

@fredpi fredpi commented Jan 15, 2021

Closes #3485.

@fredpi
Copy link
Collaborator Author

fredpi commented Jan 15, 2021

The issue has been that, when only one single configuration file was provided, the relative path management for the included & excluded paths, as implemented here, was never called. That only happens for more than one configuration...

To fix this, I added relative path handling for the first configuration file, so that even without more configuration files, the included / excluded paths are put in proper relation to the root directory.

@SwiftLintBot
Copy link

SwiftLintBot commented Jan 15, 2021

546 Warnings
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Settings/AppSettingsTableViewController.swift:27:13: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Settings/SettingsTableViewController.swift:644:13: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoHashable.generated.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:5:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:6:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:17:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:18:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:5:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:11:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:14:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:17:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:20:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:13:1: warning: Variable Declaration Whitespace Violation: Let and var should be separated from other statements by a blank line. (let_var_whitespace)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:16:1: warning: Variable Declaration Whitespace Violation: Let and var should be separated from other statements by a blank line. (let_var_whitespace)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:14:3: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:4:1: error: No Extension Access Modifier Violation: Prefer not to use extension access modifiers (no_extension_access_modifier)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:13:1: error: No Extension Access Modifier Violation: Prefer not to use extension access modifiers (no_extension_access_modifier)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoCases.generated.swift:16:1: error: No Extension Access Modifier Violation: Prefer not to use extension access modifiers (no_extension_access_modifier)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:6:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:12:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:6:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:9:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:12:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:15:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:20:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/LinuxMain.generated.swift:24:1: warning: Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:8:5: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:9:5: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:7:1: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:12:1: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:19:1: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:23:1: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:27:1: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:32:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:38:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:44:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:52:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:60:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:66:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:74:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:80:3: warning: Explicit ACL Violation: All declarations should specify Access Control Level keywords explicitly. (explicit_acl)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:7: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 Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:12: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 Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:19: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 Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:23: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 Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:27: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 Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:32:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:38:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:44:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:52:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:60:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:66:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:74:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:80:3: warning: Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:13:5: warning: Implicit Return Violation: Prefer implicit returns in closures, functions and getters. (implicit_return)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:20:5: warning: Implicit Return Violation: Prefer implicit returns in closures, functions and getters. (implicit_return)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:24:5: warning: Implicit Return Violation: Prefer implicit returns in closures, functions and getters. (implicit_return)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:28:5: warning: Implicit Return Violation: Prefer implicit returns in closures, functions and getters. (implicit_return)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:32:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:35:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:37:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:41:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:43:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:47:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:49:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:52:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:55:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:57:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:60:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:63:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:65:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:69:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:71:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:74:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:77:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:79:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:83:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:85:1: warning: Indentation Width Violation: Code should be unindented by multiples of one tab or multiples of 4 spaces. (indentation_width)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:12:1: warning: Static Operator Violation: Operators should be declared as static functions, not free functions. (static_operator)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:19:1: warning: Static Operator Violation: Operators should be declared as static functions, not free functions. (static_operator)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:23:1: warning: Static Operator Violation: Operators should be declared as static functions, not free functions. (static_operator)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:27:1: warning: Static Operator Violation: Operators should be declared as static functions, not free functions. (static_operator)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:15:16: warning: Unneeded Parentheses in Closure Argument Violation: Parentheses are not needed when declaring closure arguments. (unneeded_parentheses_in_closure_argument)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoLenses.generated.swift:54:18: warning: Unused Closure Parameter Violation: Unused parameter "person" in a closure should be replaced with _. (unused_closure_parameter)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:16:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:18:9: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:29:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:36:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:42:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:43:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:44:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:45:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:46:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:47:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:54:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:59:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:64:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:65:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:66:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:72:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:73:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:74:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:75:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:76:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:77:5: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:89:9: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:90:9: warning: Conditional Returns on Newline Violation: Conditional statements should always return on the next line (conditional_returns_on_newline)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:3:33: warning: Superfluous Disable Command Violation: SwiftLint rule 'file_length' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:1:1: warning: File Name Violation: File name should match a type or extension declared in the file (if any). (file_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:34:52: error: Identifier Name Violation: Variable name should start with a lowercase character: 'AutoEquatable' (identifier_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:52:52: error: Identifier Name Violation: Variable name should start with a lowercase character: 'AutoEquatable' (identifier_name)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:35:1: warning: Line Length Violation: Line should be 120 characters or less: currently 129 characters (line_length)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:28:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:35:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:41:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:53:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:58:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:63:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:71:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:84:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:99:8: warning: Missing Docs Violation: public declarations should be documented. (missing_docs)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:4:1: warning: Private over fileprivate Violation: Prefer private over fileprivate declarations. (private_over_fileprivate)
⚠️ This PR introduced a violation in Sourcery: /Templates/Tests/Generated/AutoEquatable.generated.swift:15:1: warning: Private over fileprivate Violation: Prefer private over fileprivate declarations. (private_over_fileprivate)
⚠️ Danger found 546 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 126.
25 Messages
📖 Linting Aerial with this PR took 2.05s vs 2.01s on master (1% slower)
📖 Linting Alamofire with this PR took 2.88s vs 2.82s on master (2% slower)
📖 Linting Firefox with this PR took 9.99s vs 9.84s on master (1% slower)
📖 Linting Kickstarter with this PR took 15.65s vs 15.26s on master (2% slower)
📖 Linting Moya with this PR took 1.42s vs 1.47s on master (3% faster)
📖 Linting Nimble with this PR took 1.31s vs 1.29s on master (1% slower)
📖 Linting Quick with this PR took 0.61s vs 0.59s on master (3% slower)
📖 Linting Realm with this PR took 4.24s vs 4.24s on master (0% slower)
📖 Linting SourceKitten with this PR took 1.06s vs 1.02s on master (3% slower)
📖 Linting Sourcery with this PR took 8.66s vs 8.44s on master (2% slower)
📖 Linting Swift with this PR took 11.46s vs 11.33s on master (1% slower)
📖 Linting WordPress with this PR took 18.69s vs 18.63s on master (0% slower)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:1:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:2:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:3:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:4:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:5:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:10:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:29:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:33:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:56:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:62:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:80:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:88:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
📖 This PR fixed a violation in Realm: /examples/ios/swift/GettingStarted.playground/Contents.swift:95:3: warning: Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)

Generated by 🚫 Danger

@fredpi fredpi mentioned this pull request Jan 15, 2021
@fredpi
Copy link
Collaborator Author

fredpi commented Jan 17, 2021

Seeing very weird SwiftLintBot reports here...

All new violations reported by the SwiftLintBot are from files that are excluded in Sourcery's .swiftlint.yml. However, if I understand the osscheck script and in particular this line correctly, the .swiftlint.yml configuration of a repo doesn't matter: it gets wiped and the repo is then linted using the --enable-all-rules option (unless only rules are changed but that's not the case here).

So to me it seems like the new violations are in fact intended behavior! But then, why are they new and why does this PR change the behavior? As a reference: This test PR that basically does nothing except for renaming a variable doesn't cause new warnings.

Primarily, I'd like to understand what the intended behavior is (meaning whether the new violations should not be there or should have always been there). Any ideas, @jpsim, @marcelofabri, @norio-nomura?

@jpsim
Copy link
Collaborator

jpsim commented Feb 23, 2021

Seeing very weird SwiftLintBot reports here...

Yeah it's not working correctly, see #3533

@jpsim jpsim force-pushed the feature/3485-fix-relative-paths branch from 6691119 to 129bd52 Compare February 23, 2021 22:51
@jpsim
Copy link
Collaborator

jpsim commented Feb 23, 2021

PR looks great! I hope you don't mind @fredpi I rebased and force-pushed to this branch and will merge when CI passes.

@jpsim jpsim merged commit 2f6fd1e into master Feb 23, 2021
@jpsim jpsim deleted the feature/3485-fix-relative-paths branch February 23, 2021 23:19
sethfri pushed a commit that referenced this pull request Feb 24, 2021
… parent folder (#3491)

* Add (currently failing) test for #3485

* [#3485] Add missing rootDir adjustment for included / excluded paths

* Add changelog entry

* Adjust tests for relative included / excluded paths
@jpsim
Copy link
Collaborator

jpsim commented Feb 25, 2021

This is actually a breaking change, and in fact broke a SwiftLint integration with a closed source project of mine.

I believe this covers the scenario where the breakage is happening:

- /tmp/A/B/C/.swiftlint.yml <- config file generated by a script for `swiftlint analyze` purposes
- /src/MyProject/swiftlint.yml <- lint file checked in to the repo used for `swiftlint lint` purposes

The custom config looks like this:

included:
  - Dir1/Dir2/Sources/MyFile.swift
analyzer_rules:
  - unused_import

And I'm running SwiftLint from the /src/MyProject working directory with the temporary config file specified: swiftlint --config /tmp/A/B/C/.swiftlint.yml.

Before this PR, it worked well:

$ swiftlint analyze --config \
  /tmp/A/B/C/.swiftlint.yml \
  --compile-commands \
  /tmp/A/B/C/compile_commands.json
Analyzing Swift files in current working directory
Analyzing 'MyFile.swift' (1/1)
/src/MyProject/Dir1/Dir2/Sources/MyFile.swift:1:2: warning: Unused Import Violation: Missing import for referenced module 'MyModule'. (unused_import)
Done analyzing! Found 1 violation, 0 serious in 1 file.

With this PR, it's failing to find files to lint:

$ swiftlint analyze --config \
  /tmp/A/B/C/.swiftlint.yml \
  --compile-commands \
  /tmp/A/B/C/compile_commands.json
Analyzing Swift files in current working directory
Error: No lintable files found at paths: ''

So unfortunately I'll be reverting this to avoid this breaking change until we can think through a possible solution.

jpsim added a commit that referenced this pull request Feb 25, 2021
@jpsim
Copy link
Collaborator

jpsim commented Feb 25, 2021

Reverted in b66f7c7

@fredpi
Copy link
Collaborator Author

fredpi commented Feb 25, 2021

@jpsim I'm sorry for breaking things again – it seems like there were good reasons that nobody really touched the whole configuration system for some time... 🥲

If I understand your example correctly, we have different ideas of where the included / excluded paths should relate to: It seems like in previous SwiftLint versions (before 0.41.0) they related to the current working directory, right? In #3058 however I changed it so that the included / excluded paths are relative to the path their containing configuration file resides in.

I documented that behavior in the README.md (via #3058):

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.

This PR only fixed an inconsistency with the design I chose, so if we decide that the included / excluded paths should instead be relative to the cwd, more changes than just reverting this PR are needed.

However, I still think that it is better if the paths are relative to the location of the config file:

  • I don't know anymore how nested configurations worked previously, but with nested configurations it should definitely be the case that the paths specified in them relate to the location of the config file, not the cwd.
  • It would be irritating if the behavior was different for other configuration files.
  • Changing the location from which SwiftLint is run should only change the lintable paths IMHO. I don't think it should change the absolute location of the included / excluded paths, because that should solely be up to the configuration and not depend on the cwd.

Of course, this change of concept is a breaking change and I should have better explained it in #3058 for us to be able to discuss its consequences before releasing it – also without the bug / inconsistency this PR fixed, we would have noticed the breaking character of this change earlier...

But now, that it is released, I think the best way to move forward is to leave it with the current state, remerge this PR and maybe drop a breaking notice in the next release notes (although parts of the breaking change already happened in 0.41.0).

But maybe it's just that I misunderstood the example you provided, so please tell me, if that's the case!

@jpsim
Copy link
Collaborator

jpsim commented Feb 26, 2021

it seems like there were good reasons that nobody really touched the whole configuration system for some time

This is why I really appreciate your work in this area, especially the added tests, documentation and perhaps most importantly consideration about how this should all work, which I'll admit I still find pretty difficult to reason about.

After reading through your last comment and thinking it through, I completely agree that we should remerge this PR and that the behavior is what makes most sense.

However, I think there's still value in allowing out-of-tree configuration files. In my case, I don't want to dirty the git state in the repo being linted and the configuration files that I'm generating in /tmp/ are exactly that, meant to be temporary.

I'd still like to find a way to support that. Do you agree we should find a way to support this?

Do you think it would make sense for configuration files that are loaded from locations that aren't descendant of the current working directory to have their in included / excluded paths be applied in relation to the current working directory?

@jpsim
Copy link
Collaborator

jpsim commented Feb 26, 2021

However, I think there's still value in allowing out-of-tree configuration files. In my case, I don't want to dirty the git state in the repo being linted and the configuration files that I'm generating in /tmp/ are exactly that, meant to be temporary.

Actually I found a simple solution, at least for my use cases. Out-of-tree configuration files can use absolute paths, which works well today.

included:
  # Before
  - Dir1/Dir2/Sources/MyFile.swift
  # After
  - /src/MyProject/Dir1/Dir2/Sources/MyFile.swift
analyzer_rules:
  - unused_import

jpsim added a commit that referenced this pull request Feb 26, 2021
…tion file from a parent folder (#3491)""

This reverts commit b66f7c7.
@jpsim
Copy link
Collaborator

jpsim commented Feb 26, 2021

Re-merging in #3542

@fredpi
Copy link
Collaborator Author

fredpi commented Feb 26, 2021

@jpsim

which I'll admit I still find pretty difficult to reason about.

Yes, me too! There are so many use cases that need to be considered and when adding a fix for one use case, it's hard not to break another use case 😅

I'd still like to find a way to support that. Do you agree we should find a way to support this?

Yes, definitely!

Do you think it would make sense for configuration files that are loaded from locations that aren't descendant of the current working directory to have their in included / excluded paths be applied in relation to the current working directory?

I think such an approach would be rather irritating, e. g.: What behavior to expect for the use case where a configuration file from one directory above is used? Actually the issue this PR addressed (#3485) is an example for that: Their command is swiftlint --config ../.swiftlint.yml.

The absolute path approach

But I think the solution you discovered for your use case (specifying an absolute path starting with /) is great! The reason why this works is because "/foo".bridge().absolutePathRepresentation(rootDirectory: somePath) always returns "/foo".

Now, without having it tested yet, I'd claim that this does not only work for your use case (some distant path), but also when specifying an absolute path to a file that lives in a directory below the configuration file. Internally, the absolute path may get transformed to a relative path, but that wouldn't break the functionality.

So I suggest the following:

  • Test whether specifying absolute paths always works with the current implementation. Add test for that to SwiftLint.
  • If it works without a change, I'd still put an explanation into the relevant method where the included / excluded path management is done.
  • If it doesn't work without a change, that change might be a simple one: not applying the path management in the method mentioned above for paths starting with /.
  • Document the absolute path functionality in the README.

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.

Since 0.41: False positive errors, seems to ignore my .swiftlint.yml
3 participants