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

Support UIEdgeInsets type in prefer_zero_over_explicit_init rule #4008

Merged
merged 3 commits into from
Jun 29, 2022

Conversation

KokiHirokawa
Copy link
Contributor

@KokiHirokawa KokiHirokawa commented Jun 26, 2022

See Also

Problem

"prefer_zero_over_explicit_init" rule is not working for UIEdgeInsets.

Detail

Fix regex pattern of PreferZeroOverExplicitInitRule.

Screenshot

Before After
スクリーンショット 2022-06-26 15 31 38 スクリーンショット 2022-06-28 23 24 41

@SwiftLintBot
Copy link

SwiftLintBot commented Jun 26, 2022

2 Warnings
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Widgets/CellWithRoundedButton.swift:58:26: warning: Prefer Zero Over Explicit Init Violation: Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0)) (prefer_zero_over_explicit_init)
⚠️ This PR introduced a violation in WordPress: /WordPress/Classes/ViewRelated/Cells/BorderedButtonTableViewCell.swift:138:35: warning: Prefer Zero Over Explicit Init Violation: Prefer .zero over explicit init with zero parameters (e.g. CGPoint(x: 0, y: 0)) (prefer_zero_over_explicit_init)
12 Messages
📖 Linting Aerial with this PR took 0.32s vs 0.32s on master (0% slower)
📖 Linting Alamofire with this PR took 0.31s vs 0.31s on master (0% slower)
📖 Linting Firefox with this PR took 1.46s vs 1.46s on master (0% slower)
📖 Linting Kickstarter with this PR took 2.23s vs 2.24s on master (0% faster)
📖 Linting Moya with this PR took 0.14s vs 0.14s on master (0% slower)
📖 Linting Nimble with this PR took 0.15s vs 0.15s on master (0% slower)
📖 Linting Quick with this PR took 0.08s vs 0.08s on master (0% slower)
📖 Linting Realm with this PR took 1.09s vs 1.08s on master (0% slower)
📖 Linting SourceKitten with this PR took 0.13s vs 0.14s on master (7% faster)
📖 Linting Sourcery with this PR took 0.45s vs 0.45s on master (0% slower)
📖 Linting Swift with this PR took 0.94s vs 0.92s on master (2% slower)
📖 Linting WordPress with this PR took 2.53s vs 2.52s on master (0% slower)

Generated by 🚫 Danger

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2022

Codecov Report

Merging #4008 (de859dc) into master (1faea36) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4008   +/-   ##
=======================================
  Coverage   92.41%   92.41%           
=======================================
  Files         446      446           
  Lines       22530    22534    +4     
=======================================
+ Hits        20821    20825    +4     
  Misses       1709     1709           
Impacted Files Coverage Δ
...les/Idiomatic/PreferZeroOverExplicitInitRule.swift 100.00% <100.00%> (ø)

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@KokiHirokawa KokiHirokawa changed the title [WIP] prefer_zero_over_explicit_init Not working for UIEdgeInsets Fix regix pattern of PreferZeroOverExplicitInitRule to support for UIEdgeInsets Jun 28, 2022
@KokiHirokawa KokiHirokawa changed the title Fix regix pattern of PreferZeroOverExplicitInitRule to support for UIEdgeInsets Fix regex pattern of PreferZeroOverExplicitInitRule to support for UIEdgeInsets Jun 28, 2022
@KokiHirokawa KokiHirokawa marked this pull request as ready for review June 28, 2022 14:36
Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

CHANGELOG.md Outdated Show resolved Hide resolved
@SimplyDanny SimplyDanny linked an issue Jun 28, 2022 that may be closed by this pull request
1 task
Co-authored-by: Danny Mösch <[email protected]>
@KokiHirokawa KokiHirokawa changed the title Fix regex pattern of PreferZeroOverExplicitInitRule to support for UIEdgeInsets Support UIEdgeInsets type in prefer_zero_over_explicit_init rule. Jun 28, 2022
@KokiHirokawa KokiHirokawa changed the title Support UIEdgeInsets type in prefer_zero_over_explicit_init rule. Support UIEdgeInsets type in prefer_zero_over_explicit_init rule Jun 28, 2022
@KokiHirokawa
Copy link
Contributor Author

KokiHirokawa commented Jun 28, 2022

@SimplyDanny Thank you for the review!

@SimplyDanny SimplyDanny self-requested a review June 29, 2022 11:01
@SimplyDanny SimplyDanny merged commit 25ed3d2 into realm:master Jun 29, 2022
@KokiHirokawa KokiHirokawa deleted the issue-3986 branch July 3, 2022 07:39
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.

prefer_zero_over_explicit_init Not working for UIEdgeInsets
4 participants