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

Treat conditional code as if it was always active #5581

Merged
merged 2 commits into from
May 16, 2024

Conversation

SimplyDanny
Copy link
Collaborator

Fixes #5574.

@SwiftLintBot
Copy link

SwiftLintBot commented May 15, 2024

1 Warning
⚠️ This PR may need tests.
17 Messages
📖 Linting Aerial with this PR took 0.79s vs 0.8s on main (1% faster)
📖 Linting Alamofire with this PR took 1.13s vs 1.14s on main (0% faster)
📖 Linting Brave with this PR took 6.65s vs 6.61s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 3.54s vs 3.51s on main (0% slower)
📖 Linting Firefox with this PR took 9.46s vs 9.47s on main (0% faster)
📖 Linting Kickstarter with this PR took 8.35s vs 8.12s on main (2% slower)
📖 Linting Moya with this PR took 0.48s vs 0.48s on main (0% slower)
📖 Linting NetNewsWire with this PR took 2.34s vs 2.4s on main (2% faster)
📖 Linting Nimble with this PR took 0.66s vs 0.67s on main (1% faster)
📖 Linting PocketCasts with this PR took 6.88s vs 7.05s on main (2% faster)
📖 Linting Quick with this PR took 0.37s vs 0.38s on main (2% faster)
📖 Linting Realm with this PR took 4.15s vs 4.13s on main (0% slower)
📖 Linting Sourcery with this PR took 2.11s vs 2.05s on main (2% slower)
📖 Linting Swift with this PR took 3.94s vs 3.85s on main (2% slower)
📖 Linting VLC with this PR took 1.1s vs 1.1s on main (0% slower)
📖 Linting Wire with this PR took 14.82s vs 14.76s on main (0% slower)
📖 Linting WordPress with this PR took 9.65s vs 9.83s on main (1% faster)

Generated by 🚫 Danger

@SimplyDanny
Copy link
Collaborator Author

I'd appreciate your feedback on this @mildm8nnered as you have provided the initial implementation of this rule. This is the last issue reported after the 0.55.0 release. Once it's merged, I may cut 0.55.1.

var varDecls = [VariableDeclSyntax]()

override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
if node.isProtocol((any NamedDeclSyntax).self) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ternary operator and save on the returns here potentially

Copy link
Collaborator

@mildm8nnered mildm8nnered left a comment

Choose a reason for hiding this comment

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

lgtm

@SimplyDanny SimplyDanny enabled auto-merge (squash) May 16, 2024 16:32
@SimplyDanny SimplyDanny merged commit 161391d into realm:main May 16, 2024
12 checks passed
@SimplyDanny SimplyDanny deleted the ignore-conditional-clauses branch May 16, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants