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

Unable to disable annotation rule for annotations with arguments #3316

Closed
2 tasks done
theoriginalbit opened this issue Aug 22, 2020 · 2 comments · Fixed by #3405
Closed
2 tasks done

Unable to disable annotation rule for annotations with arguments #3316

theoriginalbit opened this issue Aug 22, 2020 · 2 comments · Fixed by #3405

Comments

@theoriginalbit
Copy link

New Issue Checklist

Describe the bug

Given the following in the config

attributes:
  always_on_same_line: ["@IBAction", "@NSManaged", "@objc", "@objcMembers"]

The code below has a warning stating it should be on its own line

@objc(EMGridMetrics) class GridMetrics: NSObject {
  // …
}
$ swiftlint lint

…/GridMetrics.swift:1:22: warning: Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.40.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:
included:
  - Sources
opt_in_rules:
  - attributes

attributes:
  always_on_same_line: ["@IBAction", "@NSManaged", "@objc", "@objcMembers"]
  • Are you using nested configurations? No
  • Which Xcode version are you using (check xcodebuild -version)? Xcode 11, and Xcode 12
  • Do you have a sample that shows the issue? See above
@theoriginalbit
Copy link
Author

Also with the same config, I have the following causing strange behaviour

@objc(startCyclingEvery:) func startCycling(every duration: TimeInterval) {
  // …
}

The above will provide the attribute warning . But then putting it on the new line gives the same warning

@jpsim
Copy link
Collaborator

jpsim commented Nov 7, 2020

Fixing in #3405

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 a pull request may close this issue.

2 participants