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

More organizeDeclarations improvements #724

Conversation

calda
Copy link
Collaborator

@calda calda commented Aug 29, 2020

This PR makes a few improvements to the organizeDeclarations rule (#701) based on discussions from airbnb/swift#102:

  • Correct misspelled mark comments (instead of duplicating them) by comparing the edit distance
  • Group typealias declarations with types instead of with properties
    • Previously they were being treated as instanceProperty declarations, but they are actually more type-like)
  • Stop inserting blank lines at the top and bottom of type bodies
    • This resolves linting conflicts with the blankLinesAtEndOfScope rule

@calda calda force-pushed the cal--organize-decls-improvements-0.46.1 branch 2 times, most recently from 1dc86c0 to 768a7b6 Compare August 29, 2020 20:56
@coveralls
Copy link

coveralls commented Aug 29, 2020

Coverage Status

Coverage increased (+0.2%) to 93.541% when pulling 0fd3811 on calda:cal--organize-decls-improvements-0.46.1 into fb4787c on nicklockwood:develop.

@nicklockwood nicklockwood force-pushed the cal--organize-decls-improvements-0.46.1 branch from 0fd3811 to 1943906 Compare August 29, 2020 21:50
@nicklockwood nicklockwood merged commit ccbb0f3 into nicklockwood:develop Aug 29, 2020
// we'll want to replace the existing comment with the correct comment.
let existingComment = sourceCode(for: Array(parser.tokens[potentialSeparatorRange]))

guard editDistance(existingComment.lowercased(), potentialSeparatorComment.lowercased()) <= 3 else {
Copy link

Choose a reason for hiding this comment

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

👌

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.

4 participants