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

Skip defer statements in #if blocks if it is not itself the last statement #4617

Merged
merged 2 commits into from
Dec 6, 2022

Conversation

SimplyDanny
Copy link
Collaborator

Fixes #4615.

@SwiftLintBot
Copy link

SwiftLintBot commented Dec 4, 2022

1 Warning
⚠️ This PR may need tests.
19 Messages
📖 Linting Aerial with this PR took 0.14s vs 0.14s on main (0% slower)
📖 Linting Alamofire with this PR took 0.09s vs 0.09s on main (0% slower)
📖 Linting Brave with this PR took 0.42s vs 0.43s on main (2% faster)
📖 Linting DuckDuckGo with this PR took 0.23s vs 0.23s on main (0% slower)
📖 Linting Firefox with this PR took 0.39s vs 0.39s on main (0% slower)
📖 Linting Kickstarter with this PR took 0.5s vs 0.51s on main (1% faster)
📖 Linting Moya with this PR took 0.13s vs 0.13s on main (0% slower)
📖 Linting NetNewsWire with this PR took 0.18s vs 0.19s on main (5% faster)
📖 Linting Nimble with this PR took 0.08s vs 0.09s on main (11% faster)
📖 Linting PocketCasts with this PR took 0.39s vs 0.39s on main (0% slower)
📖 Linting Quick with this PR took 0.06s vs 0.06s on main (0% slower)
📖 Linting Realm with this PR took 0.45s vs 0.45s on main (0% slower)
📖 Linting SourceKitten with this PR took 0.08s vs 0.08s on main (0% slower)
📖 Linting Sourcery with this PR took 0.19s vs 0.19s on main (0% slower)
📖 Linting Swift with this PR took 0.66s vs 0.66s on main (0% slower)
📖 Linting VLC with this PR took 0.11s vs 0.11s on main (0% slower)
📖 Linting Wire with this PR took 0.45s vs 0.46s on main (2% faster)
📖 Linting WordPress with this PR took 0.59s vs 0.6s on main (1% faster)
📖 This PR fixed a violation in NetNewsWire: /ArticlesDatabase/Sources/ArticlesDatabase/StatusesTable.swift:35:3: warning: Inert Defer Violation: If defer is at the end of its parent scope, it will be executed right where it is anyway. (inert_defer)

Generated by 🚫 Danger

@SimplyDanny SimplyDanny force-pushed the defer-in-if-config-clause branch from 87e4c6c to 9b55b33 Compare December 5, 2022 23:18
@SimplyDanny SimplyDanny enabled auto-merge (squash) December 5, 2022 23:18
@SimplyDanny SimplyDanny disabled auto-merge December 5, 2022 23:18
@SimplyDanny SimplyDanny enabled auto-merge (squash) December 5, 2022 23:19
@SimplyDanny SimplyDanny merged commit 609418f into realm:main Dec 6, 2022
@SimplyDanny SimplyDanny deleted the defer-in-if-config-clause branch December 6, 2022 20:49
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.

False positive inert_defer with condition compilation
3 participants