Improve pattern_matching_keywords SwiftSyntax rule#6534
Open
GandaLF2006 wants to merge 3 commits intorealm:mainfrom
Open
Improve pattern_matching_keywords SwiftSyntax rule#6534GandaLF2006 wants to merge 3 commits intorealm:mainfrom
GandaLF2006 wants to merge 3 commits intorealm:mainfrom
Conversation
a42f3d1 to
992cd9e
Compare
Generated by 🚫 Danger |
1a809bf to
b14f17b
Compare
Contributor
Author
|
@SimplyDanny It would be great if you can review it |
b14f17b to
ec4ab2e
Compare
ec4ab2e to
64d1527
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the existing opt-in SwiftLint rule
pattern_matching_keywords.Compared to the original implementation, the rule now covers more pattern-matching contexts and handles nested tuple/enum associated value patterns more reliably.
What changed
The original implementation only analyzed
switchcase items and relied on a narrower syntax-based approach.This update expands the rule to also check:
if caseguard casewhile casefor casecatchIt also improves handling of:
caseclauses