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_on_call doesn't recognize multiple trailing closures #3581

Closed
2 tasks done
commscheck opened this issue Mar 24, 2021 · 4 comments · Fixed by #5334
Closed
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@commscheck
Copy link

New Issue Checklist

Describe the bug

vertical_parameter_alignment_on_call fails when a method call:

  • lists its parameters vertically
  • has multiple trailing closures
  • has the closing parenthesis and the first opening brace ) { on a new line
Complete output when running SwiftLint, including the stack trace and command used
$ ./Pods/SwiftLint/swiftlint

Linting Swift files in current working directory
Linting 'TestArea.swift' (1/1)
/Users/commscheck/src/commscheck/SwiftLintTrailingClosures/Shared/TestArea.swift:11:11: warning: Vertical Parameter Alignment On Call Violation: Function parameters should be aligned vertically if they're in multiple lines in a method call. (vertical_parameter_alignment_on_call)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.43.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? CocoaPods
  • Paste your configuration file:
opt_in_rules:
  - vertical_parameter_alignment_on_call
  • Are you using nested configurations? No
  • Which Xcode version are you using (check xcodebuild -version)? 12.4.0
  • 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.
// Passes as expected
UIViewPropertyAnimator.runningPropertyAnimator(
    withDuration: 2.0,
    delay: 0.0,
    options: [.curveEaseIn]
) {
    // animations
}

// Passes as expected
UIViewPropertyAnimator.runningPropertyAnimator(
    withDuration: 2.0,
    delay: 0.0,
    options: [.curveEaseIn]) {
        // animations
    } completion: { _ in
        // completion
    }

// Triggers a violation
UIViewPropertyAnimator.runningPropertyAnimator(
    withDuration: 2.0,
    delay: 0.0,
    options: [.curveEaseIn]
) {
    // animations
} completion: { _ in
    // completion
}
@Fab1n
Copy link

Fab1n commented Oct 12, 2022

What about this issue? This is a problem!

@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Oct 12, 2022
@SimplyDanny
Copy link
Collaborator

Related to #3399.

@417-72KI
Copy link
Contributor

417-72KI commented Mar 8, 2023

Any updates?
We have no choice but to disable vertical_parameter_alignment_on_call. 😔

@yildirimatcioglu
Copy link

yildirimatcioglu commented May 2, 2023

You can try to use it like this.

UIViewPropertyAnimator.runningPropertyAnimator(
    withDuration: 2.0,
    delay: 0.0,
    options: [.curveEaseIn]
    animations:  {
        // animations
    }, 
    completion: { _ in
        // completion
    })

marcelofabri added a commit that referenced this issue Nov 7, 2023
marcelofabri added a commit that referenced this issue Nov 7, 2023
u-abyss pushed a commit to u-abyss/SwiftLint that referenced this issue Dec 16, 2023
MartijnAmbagtsheer pushed a commit to MartijnAmbagtsheer/SwiftLint that referenced this issue Dec 20, 2023
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

Successfully merging a pull request may close this issue.

5 participants