Fix false positives for 'multiple_closures_with_trailing_closure'#3353
Conversation
Generated by 🚫 Danger |
Codecov Report
@@ Coverage Diff @@
## master #3353 +/- ##
==========================================
- Coverage 90.52% 90.52% -0.01%
==========================================
Files 417 417
Lines 20434 20471 +37
==========================================
+ Hits 18498 18531 +33
- Misses 1936 1940 +4
Continue to review full report at Codecov.
|
|
This is likely a good candidate to be written in SwiftSyntax—what’s the current support status for that? I see an old PR got merged, reverted, and then re-opened, but it looks like that last PR has gone stale... |
|
@jpsim Is there further work this needs to be mergeable? |
SwiftSyntax needs to be properly linked to handle the issues discussed in #3105 before we can use it in a release. |
|
Thanks for the PR! I suspect there are ways to improve this to avoid using regular expressions, but given this is giving false positives on Swift 5.3, I'll merge this now. |
|
@jpsim Yeah I'm not thrilled with the implementation, but I couldn't come up with a great alternative off the top of my head given the info available in a |
* master-upstream: (98 commits) Fix some false positives in rule `explicit_self` (realm#3368) Update SourceKitten to 0.30.1 (realm#3367) Fix issues with analyzer rules, Xcode 12 & SwiftUI (realm#3366) Add empty changelog section release 0.40.3 Fix false positives for 'multiple_closures_with_trailing_closure' (realm#3353) [UnusedDeclarationRule] Work around SR-11985 (realm#3363) Revert "Fix finding the nested config when a single file path is passed (realm#3342)" (realm#3362) [CONTRIBUTING] Add building & running tips (realm#3360) Fix finding the nested config when a single file path is passed (realm#3342) Include Linux zip in list of GitHub release binaries (realm#3350) [UnusedDeclarationRule] Add more tests (realm#3359) Test CI with official Swift 5.3 release (realm#3356) Don't mark `@NSApplicationMain` or `@UIApplicationMain` classes as unused (realm#3355) [Fix] `UnusedCaptureListRule`: implicit self in @escaping closures (realm#3352) Skip correcting files with parser diagnostics (realm#3349) [SwiftLintFile] Remove lock in favor of UUID (realm#3347) [UnusedDeclarationRule] Speed up and detect more dead code (realm#3340) Add empty changelog section release 0.40.2 ... # Conflicts: # Source/swiftlint/Helpers/LintableFilesVisitor.swift
* master: (98 commits) Fix some false positives in rule `explicit_self` (realm#3368) Update SourceKitten to 0.30.1 (realm#3367) Fix issues with analyzer rules, Xcode 12 & SwiftUI (realm#3366) Add empty changelog section release 0.40.3 Fix false positives for 'multiple_closures_with_trailing_closure' (realm#3353) [UnusedDeclarationRule] Work around SR-11985 (realm#3363) Revert "Fix finding the nested config when a single file path is passed (realm#3342)" (realm#3362) [CONTRIBUTING] Add building & running tips (realm#3360) Fix finding the nested config when a single file path is passed (realm#3342) Include Linux zip in list of GitHub release binaries (realm#3350) [UnusedDeclarationRule] Add more tests (realm#3359) Test CI with official Swift 5.3 release (realm#3356) Don't mark `@NSApplicationMain` or `@UIApplicationMain` classes as unused (realm#3355) [Fix] `UnusedCaptureListRule`: implicit self in @escaping closures (realm#3352) Skip correcting files with parser diagnostics (realm#3349) [SwiftLintFile] Remove lock in favor of UUID (realm#3347) [UnusedDeclarationRule] Speed up and detect more dead code (realm#3340) Add empty changelog section release 0.40.2 ...
Resolves #3295