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

ldiqual opened this Issue Mar 30, 2018 · 2 comments


None yet
3 participants

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)


import SomeFramework

@testable import SomeApp

private final class SomeClass: SomeProtocol { // error here


  • SwiftLint version: 0.25.0
  • Installation method used: cocoapods
  • Paste your configuration file:
    - "@objc"
    - "@nonobjc"
    - "@available"
    - "@discardableResult"
    - "@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 label Mar 30, 2018


This comment has been minimized.


marcelofabri commented Apr 1, 2018

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


This comment has been minimized.


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