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
2 tasks done
Igor-Palaguta opened this issue Jul 4, 2019 · 4 comments · Fixed by #2794
Closed
2 tasks done

vertical_parameter_alignment is triggered for @ViewBuilder #2792

Igor-Palaguta opened this issue Jul 4, 2019 · 4 comments · Fixed by #2794
Labels

Comments

@Igor-Palaguta
Copy link

Igor-Palaguta 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
Copy link
Author

@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
Copy link
Collaborator

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

@Igor-Palaguta
Copy link
Author

Is there way to disable swiftlint for specific xcode?

@jpsim
Copy link
Collaborator

jpsim 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
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants