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

attributes rule gives false error in protocol implementation after @testable #2125

Closed
2 tasks done
ldiqual opened this issue Mar 30, 2018 · 2 comments
Closed
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@ldiqual
Copy link

ldiqual commented Mar 30, 2018

New Issue Checklist

Bug Report

attributes rules gives a false error on Xcode 9.3:

File.swift:15:15: warning: Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)

Code:

import SomeFramework

@testable import SomeApp

private final class SomeClass: SomeProtocol { // error here
    ...
}

Environment

  • SwiftLint version: 0.25.0
  • Installation method used: cocoapods
  • Paste your configuration file:
attributes:
  always_on_line_above:
    - "@objc"
    - "@nonobjc"
    - "@available"
    - "@discardableResult"
  always_on_same_line:
    - "@IBOutlet"
    - "@IBAction"
    - "@NSManaged"
    - "@testable"
  • Are you using nested configurations? Yes, one at the root folder and one in AppTests.

  • Which Xcode version are you using (check xcode-select -p)? Xcode 9.3 9E145

  • Do you have a sample that shows the issue? Yes, see above

@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Mar 30, 2018
@marcelofabri
Copy link
Collaborator

@ldiqual Was this introduced on Xcode 9.3/Swift 4.1?

@keith
Copy link
Collaborator

keith commented Apr 2, 2018

Another repro case:

@testable import foo

private let bar = ""

I can confirm this only happens for this case with Xcode 9.3/Swift 4.1.

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

No branches or pull requests

3 participants