You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is a bug report, please ignore this section.
If this is a new rule request, please ignore all sections below this one, format
this issue's title as Rule Request: [Rule Name] and describe:
Why should this rule be added? Share links to existing discussion about what
the community thinks about this.
Provide several examples of what would and wouldn't trigger violations.
Should the rule be configurable, if so what parameters should be configurable?
Should the rule be opt-in or enabled by default? Why?
See README.md for guidelines on when to mark a
rule as opt-in.
Bug Report
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
...TagView.swift:13:25: warning: Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)
...TagListView.swift:12:20: warning: Attributes Violation: Attributes should be on their own lines in functions and types, but on the same line as variables and imports. (attributes)
...TagListView.swift:19:33: 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.26.0
Installation method used (Homebrew, CocoaPods, building from source, etc)?
CocoaPods
Are you using nested configurations?
No
If so, paste their relative paths and respective contents.
Which Xcode version are you using (check xcode-select -p)?
Version 9.4.1
Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
// This triggers a violation:
@objcpublicprotocolTagListViewDelegate{@objcoptionalfunc tagDidSelect(_ title:String, index:Int, tagView:TagView, sender:TagListView) //here
@objcoptionalfunc tagDidDeselect(_ title:String, index:Int, tagView:TagView, sender:TagListView)@objcoptionalfunc tagRemoveButtonPressed(_ title:String, tagView:TagView, sender:TagListView)}@IBDesignableopenclassTagListView:UIView{@IBInspectableopendynamicvartextColor:UIColor=UIColor.white { // and here
didSet {
for tagView in tagViews {
tagView.textColor = textColor
}}}@IBInspectableopendynamicvarselectedTextColor:UIColor=UIColor.white {
didSet {
for tagView in tagViews {
tagView.selectedTextColor = selectedTextColor
}}}
It seems like problem in two lines one after the other with attribute.
If i change code like this, there are no errors:
@IBDesignableopenclassTagListView:UIView{lettmp=5 // insert this line
@IBInspectableopendynamicvartextColor:UIColor=UIColor.white {
didSet {
for tagView in tagViews {
tagView.textColor = textColor
}}}
The text was updated successfully, but these errors were encountered:
Also, i can't disable it with // swiftlint:disable:next attributes, because it shows me Superfluous Disable Command Violation error.
So, the only way to deal with it - disabling for whole file
New Issue Checklist
Rule Request
If this is a bug report, please ignore this section.
If this is a new rule request, please ignore all sections below this one, format
this issue's title as
Rule Request: [Rule Name]
and describe:the community thinks about this.
See README.md for guidelines on when to mark a
rule as opt-in.
Bug Report
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)?0.26.0
CocoaPods
No
If so, paste their relative paths and respective contents.
xcode-select -p
)?Version 9.4.1
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.It seems like problem in two lines one after the other with attribute.
If i change code like this, there are no errors:
The text was updated successfully, but these errors were encountered: