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

closure_spacing false positive when using Swift Regex literals involving brackets #4090

Closed
2 tasks done
JonathanDowning opened this issue Aug 14, 2022 · 1 comment · Fixed by #4092
Closed
2 tasks done

Comments

@JonathanDowning
Copy link

JonathanDowning commented Aug 14, 2022

New Issue Checklist

Describe the bug

SwiftLint erroneously raises a closure_spacing warning when using the new Swift Regex literal syntax which includes an opening and closing bracket.

let r = /\{\}/ // ⚠️ Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint
main.swift:1:10: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace. (closure_spacing)

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.47.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:
only_rules
  - closure_spacing
  • Are you using nested configurations? No
  • Which Xcode version are you using (check xcodebuild -version)? Build version 14A5294e
  • Do you have a sample that shows the issue?
echo "let r = /\{\}/" | swiftlint lint --no-cache --use-stdin --enable-all-rules
@jpsim
Copy link
Collaborator

jpsim commented Aug 15, 2022

Fixed in #4092.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants