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

prefer_zero_over_explicit_init Not working for UIEdgeInsets #3986

Closed
1 task
skatolyk opened this issue Jun 1, 2022 · 1 comment · Fixed by #4008
Closed
1 task

prefer_zero_over_explicit_init Not working for UIEdgeInsets #3986

skatolyk opened this issue Jun 1, 2022 · 1 comment · Fixed by #4008
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.

Comments

@skatolyk
Copy link

skatolyk commented Jun 1, 2022

New Issue Checklist

  • Handle new UIEdgeInsets.zero case

Describe the bug

The use of prefer_zero_over_explicit_init doesn't cover UIEdgeInsets.zero case.

For example we have next code

extension UIApplication {
    static var safeAreaInsets: UIEdgeInsets {
        UIWindow.key?.safeAreaInsets ?? UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) // Here should be swiftlint prefer_zero_over_explicit_init  warning 
    }
}
@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Jun 8, 2022
@marcelofabri
Copy link
Collaborator

PRs are welcome!

@SimplyDanny SimplyDanny added the good first issue Issue to be taken up by new contributors yet unfamiliar with the project. label Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules. good first issue Issue to be taken up by new contributors yet unfamiliar with the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants