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

Add emptyExtension rule #283

Merged
merged 4 commits into from
Aug 7, 2024
Merged

Add emptyExtension rule #283

merged 4 commits into from
Aug 7, 2024

Conversation

mannylopez
Copy link
Contributor

@mannylopez mannylopez commented Aug 1, 2024

Summary

This PR adds rule emptyExtension to remove empty extensions that define no properties, functions, or conformances.

// WRONG: The first extension is empty and redundant.
extension Planet {}

extension Planet: Equatable {}

// RIGHT: Empty extensions that add a protocol conformance aren't redundant.
extension Planet: Equatable {}

Reasoning

Improves readability since the code has no effect and should be removed for clarity.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Member

@calda calda left a comment

Choose a reason for hiding this comment

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

Good internal support for this change, thanks @mannylopez!

@calda calda merged commit 1d7fa19 into master Aug 7, 2024
5 checks passed
@calda calda deleted the manny-lopez--empty-extension branch August 7, 2024 16:47
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