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 violation report with @testable #2211

Closed
2 tasks done
BenStaveleyTaylor opened this issue May 18, 2018 · 0 comments
Closed
2 tasks done

attributes rule gives violation report with @testable #2211

BenStaveleyTaylor opened this issue May 18, 2018 · 0 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@BenStaveleyTaylor
Copy link
Contributor

New Issue Checklist

Bug Report

The attributes rule seems to give wrong results with @testable. In the sample code to reproduce below, if you remove the blank line between @testable and @available the violation warning goes away, but that is wrong. @testable is not an attribute of the class and is correctly separated by vertical white space.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint --config swiftlint.yml
Loading configuration from 'swiftlint.yml'
Linting Swift files in current working directory
Linting 'DeleteMeTests.swift' (1/1)
/Users/bestave/Desktop/DeleteMe/DeleteMeFP/AttributeTest/DeleteMeTests.swift:13: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)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version: 0.25.1 (release and latest source)
  • Installation method used: SwiftLint.pkg installer and also cloned/built from master source
  • Paste your configuration file:
opt_in_rules:
  - attributes
  • Are you using [nested configurations]? No
  • Which Xcode version are you using? 9.3.1
  • Do you have a sample that shows the issue? Yes:
import XCTest
@testable import DeleteMe

@available (iOS 11.0, *)
class DeleteMeTests: XCTestCase {
}
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

2 participants