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

operator_usage_whitespace does not work for the ternary operator #3965

Closed
2 tasks done
ghost opened this issue Apr 30, 2022 · 1 comment
Closed
2 tasks done

operator_usage_whitespace does not work for the ternary operator #3965

ghost opened this issue Apr 30, 2022 · 1 comment
Labels
bug Unexpected and reproducible misbehavior.

Comments

@ghost
Copy link

ghost commented Apr 30, 2022

New Issue Checklist

Describe the bug

The operator_usage_whitespace rule fails to identify missing spaces around the ternary operator (? :).

Environment

  • SwiftLint version: 0.47.1
  • Installation method : cloned this repo and added tests
  • Paste your configuration file:
opt_in_rules:
  - operator_usage_whitespace
  • Do you have a sample that shows the issue?

Example that should trigger the rule:

  let foo = bar ? 0:1

Expected fix:

  let foo = bar ? 0 : 1
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Apr 30, 2022
marcelofabri added a commit that referenced this issue May 1, 2022
marcelofabri added a commit that referenced this issue May 1, 2022
@marcelofabri
Copy link
Collaborator

Fixed in #3962

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

No branches or pull requests

2 participants