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

vertical_parameter_alignment is triggered for @ViewBuilder #2792

Closed
Igor-Palaguta opened this issue Jul 4, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@Igor-Palaguta
Copy link

commented Jul 4, 2019

New Issue Checklist

Describe the bug

vertical_parameter_alignment rule is triggered for this case:

    init(data: Data,
         numberOfColumns: Int,
         spacing: Length,
         @ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {
        self.grid = Grid(items: data, numberOfColumns: numberOfColumns)
        self.spacing = spacing
        self.content = content
    }

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    0.33.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    downloaded package file from github
// This triggers a violation:
    init(data: Data,
         numberOfColumns: Int,
         spacing: Length,
         @ViewBuilder content: @escaping (Data.Element.IdentifiedValue) -> Content) {
        self.grid = Grid(items: data, numberOfColumns: numberOfColumns)
        self.spacing = spacing
        self.content = content
    }

Can perform PR if agreed

@Igor-Palaguta

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

@marcelofabri Thank you for fixing this, but now warning is not triggered in Xcode 11, but is triggered in Xcode 10,
This code under conditional compilation using #if canImport(SwiftUI)

@marcelofabri

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

@Igor-Palaguta unfortunately, SourceKit from Xcode 10.2 doesn’t understand attributes in function parameters, so the information is not available

@Igor-Palaguta

This comment has been minimized.

Copy link
Author

commented Jul 9, 2019

Is there way to disable swiftlint for specific xcode?

@jpsim

This comment has been minimized.

Copy link
Collaborator

commented Jul 9, 2019

The "Disabling rules in code" section of the readme might be helpful: https://github.com/realm/SwiftLint#disable-rules-in-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.