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

Update sortTypealiases rule to support any keyword #1938

Merged

Conversation

calda
Copy link
Collaborator

@calda calda commented Dec 7, 2024

As a follow-up to the fix for #1929 this PR updates the sortTypealaises rule to support the any keyword.

Comment on lines 2217 to 2219
let andTokenIndices = type.range.filter { index in
tokens[index] == .operator("&", .infix)
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the problem with the previous approach. We can't just assume that every & in a type is separating elements of a protocol composition.

Copy link

codecov bot commented Dec 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.11%. Comparing base (f36187b) to head (bf72c9c).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1938      +/-   ##
===========================================
- Coverage    95.18%   95.11%   -0.07%     
===========================================
  Files          137      137              
  Lines        25094    25125      +31     
===========================================
+ Hits         23885    23898      +13     
- Misses        1209     1227      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nicklockwood nicklockwood merged commit 5c77fde into nicklockwood:develop Dec 10, 2024
10 of 12 checks passed
@nicklockwood
Copy link
Owner

Thanks!

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 this pull request may close these issues.

2 participants