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

unused_closure_parameter: fails to detect escaped identifiers. #3706

Closed
2 tasks done
lhunath opened this issue Sep 1, 2021 · 1 comment
Closed
2 tasks done

unused_closure_parameter: fails to detect escaped identifiers. #3706

lhunath opened this issue Sep 1, 2021 · 1 comment

Comments

@lhunath
Copy link

lhunath commented Sep 1, 2021

New Issue Checklist

Describe the bug

Swiftlint's unused closure parameter rule fails to detect uses of the identifier in contexts where it is quoted with single-ticks. This is particularly crucial for identifiers that have the same name as keywords. The result is false-positives.

Complete output when running SwiftLint, including the stack trace and command used
$ cat test.swift
let _: (String) -> String = { `break` in `break` }
$ swiftlint lint test.swift
Linting Swift files at paths test.swift
Linting 'test.swift' (1/1)
test.swift:1:31: warning: Unused Closure Parameter Violation: Unused parameter "break" in a closure should be replaced with _. (unused_closure_parameter)
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)? homebrew
  • Which Xcode version are you using (check xcodebuild -version)? Xcode 12.5.1, Build version 12E507
@lhunath
Copy link
Author

lhunath commented Sep 1, 2021

Didn't do a good job searching.
#3628

@lhunath lhunath closed this as completed Sep 1, 2021
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

No branches or pull requests

1 participant