Repository navigation
Add allow_compact_empty_blocks option to no_empty_block rule - #6840
Merged
SimplyDanny merged 1 commit intoJul 27, 2026
Merged
SimplyDanny merged 1 commit into
SimplyDanny merged 1 commit into
Conversation
Generated by 🚫 Danger |
Allow empty blocks written compactly as `{}` while still flagging empty
blocks with whitespace or newlines between the braces.
Fixes realm#6839
arimu1
force-pushed
the
feat/no-empty-block-allow-compact-empty-blocks
branch
from
July 25, 2026 02:25
b2c7ef9 to
60a5be6
Compare
SimplyDanny
approved these changes
Jul 27, 2026
SimplyDanny
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! Thanks @arimu1!
SimplyDanny
enabled auto-merge (squash)
July 27, 2026 16:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
allow_compact_empty_blocksboolean configuration option tono_empty_block(defaults tofalse).{}are allowed, while empty blocks with whitespace or newlines between the braces are still flagged.Fixes #6839
Test plan
swift build --target SwiftLintBuiltInRulespasses locallyswift test --filter NoEmptyBlock— blocked locally (no full Xcode;swift testfails on missing XCTest module)xcodebuild -scheme swiftlint test -destination 'platform=macOS'— blocked locally (only Command Line Tools installed)