Skip to content

Migrate VerticalWhitespaceOpeningBracesRule to SwiftSyntax #6119

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jpsim
Copy link
Collaborator

@jpsim jpsim commented Jun 20, 2025

Summary

Convert VerticalWhitespaceOpeningBracesRule to use SwiftSyntax instead
of SourceKit for improved performance and better detection of empty
lines after opening braces.

Key Technical Improvements

  • Enhanced trivia analysis for accurate empty line detection after
    opening braces
  • Proper handling of closure "in" keywords with context-aware
    detection
  • Improved correction logic handling all newline types (LF, CR,
    CRLF) consistently
  • SwiftSyntax visitor pattern replacing regex-based detection for
    better accuracy
  • Comprehensive token analysis supporting all opening brace types
    ({, [, ()
  • Accurate position tracking for violation start and end positions

Migration Details

  • Replaced CorrectableRule, OptInRule with
    @SwiftSyntaxRule(correctable: true, optIn: true)
  • Implemented ViolationsSyntaxVisitor for detecting violations in
    token trailing trivia
  • Implemented ViolationsSyntaxRewriter for correcting violations
    across different syntax contexts
  • Added proper handling of closures, code blocks, arrays, and tuples
  • Maintained exact position reporting for violation locations
  • Preserved all existing test cases and rule behavior

@jpsim jpsim force-pushed the migrate-verticalwhitespaceopeningbracesrule-to-swiftsyntax branch from 27e3c77 to b690c0c Compare June 20, 2025 18:25
@SwiftLintBot
Copy link

SwiftLintBot commented Jun 20, 2025

1311 Warnings
⚠️ This PR may need tests.
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:65:17: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView+Brightness.swift:15:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/Brave/Frontend/Browser/Playlist/Controllers/PlaylistLegacyCarplayController.swift:428:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Sources/DataImporter/Utilities/BookmarksImportExportUtility.swift:29:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptySearchView.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:26:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:28:13: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/CredentialProviderListItemTableViewCell.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/UnderflowContainer.swift:118:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/BackButtonModifier.swift:47:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/CameraView.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/PasteCodeView.swift:140:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/ContentBlocking.swift:27:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/URLExtension.swift:27:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelFiringAsync.swift:32:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/AutofillInterfaceEmailTruncator.swift:32:17: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:29:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:1283:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2498:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2539:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2550:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2559:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/Pixel.swift:232:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/Pixel.swift:323:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/TextMasker.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/Core/HistoryManager.swift:29:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AboutView.swift:98:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/EmptyCollectionReusableView.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/CrashCollectionOnboarding.swift:39:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/BulkGeneratorView.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/BulkGeneratorView.swift:145:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogsSettings.swift:55:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListSectioningHelper.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListSectioningHelper.swift:51:13: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TextZoomLevel.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsModel.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/UITableViewCellExtension.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SyncSettingsViewController+PlatformLinks.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SpeechRecognizer.swift:105:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FireproofingAlert.swift:28:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FireproofingAlert.swift:71:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/WebProgressWorker.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/CreditCardRow/CreditCardRow.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/Configuration/ConfigurationManager.swift:43:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/CreditCardRow/CreditCardRowViewModel.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/UIImageViewExtension.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:76:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:102:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:127:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:136:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FileSizeDebugViewController.swift:35:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FileSizeDebugViewController.swift:234:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/Theme+DesignSystem.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/Configuration/ConfigurationStore.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarNotificationViewModel.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SyncSettingsViewController.swift:436:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/ToggleExpandButtonStyle.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/Favicons.swift:85:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/Favicons.swift:99:17: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsState.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:26:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:130:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:175:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AddOrEditBookmarkViewController.swift:54:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillEditableMaskedCell.swift:68:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:28:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:69:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:77:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:79:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:618:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:93:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:95:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:99:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:107:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:115:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:119:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:127:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:131:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:135:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:139:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SwiftUICollectionViewCell.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/UIHostingControllerExtension.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:69:17: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:112:25: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:120:29: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadActionMessageViewHelper.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:26:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:144:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:165:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:179:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:221:17: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:599:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillContentScopeFeatureToggles.swift:25:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SaveToDownloadsAlert.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SaveToDownloadsAlert.swift:27:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:269:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:291:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillBreakageReportTableViewCell.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabSwitcherViewController+MultiSelect.swift:253:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabSwitcherViewController+MultiSelect.swift:626:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/ProgressView.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/ProgressView.swift:206:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListDataSource.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:49:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:51:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:59:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:89:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackViewController.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackViewController.swift:79:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/PrivacyIconView.swift:187:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/HomePageConfiguration.swift:29:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/DesktopDownloadViewModel.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:560:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:745:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:872:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:874:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:876:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:926:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OnboardingExperiment/AddressBarPositionPicker/OnboardingAddressBarPositionPicker.swift:63:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/OnboardingExperiment/ProgressBarView.swift:24:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/FavoritesFaviconLoader.swift:23:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:69:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:952:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:1321:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:1401:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2595:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2615:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2636:9: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ This PR introduced a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2784:5: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ Danger found 1311 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 133.
1305 Messages
📖 Building this branch resulted in a binary size of 25269.46 KiB vs 25245.04 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.17 s vs 0.3 s on main (43% faster).
📖 Linting Alamofire with this PR took 0.17 s vs 0.36 s on main (52% faster).
📖 Linting Brave with this PR took 0.77 s vs 2.2 s on main (65% faster).
📖 Linting DuckDuckGo with this PR took 2.44 s vs 6.22 s on main (60% faster).
📖 Linting Firefox with this PR took 1.01 s vs 2.97 s on main (65% faster).
📖 Linting Kickstarter with this PR took 0.75 s vs 2.22 s on main (66% faster).
📖 Linting Moya with this PR took 0.14 s vs 0.21 s on main (33% faster).
📖 Linting NetNewsWire with this PR took 0.31 s vs 0.79 s on main (60% faster).
📖 Linting Nimble with this PR took 0.15 s vs 0.28 s on main (46% faster).
📖 Linting PocketCasts with this PR took 0.71 s vs 2.05 s on main (65% faster).
📖 Linting Quick with this PR took 0.13 s vs 0.19 s on main (31% faster).
📖 Linting Realm with this PR took 0.43 s vs 1.06 s on main (59% faster).
📖 Linting Sourcery with this PR took 0.29 s vs 0.62 s on main (53% faster).
📖 Linting Swift with this PR took 0.45 s vs 1.25 s on main (64% faster).
📖 Linting VLC with this PR took 0.21 s vs 0.41 s on main (48% faster).
📖 Linting Wire with this PR took 1.93 s vs 5.67 s on main (65% faster).
📖 Linting WordPress with this PR took 1.04 s vs 3.06 s on main (66% faster).
📖 This PR fixed a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:65:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in Aerial: /Aerial/Source/Views/AerialView+Brightness.swift:15:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptySearchView.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:26:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/EmptyView.swift:28:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/AutofillCredentialProvider/CredentialProvider/CredentialProviderList/CredentialProviderListItemTableViewCell.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/CameraView.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/UnderflowContainer.swift:118:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/Internal/BackButtonModifier.swift:47:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/LocalPackages/SyncUI-iOS/Sources/SyncUI-iOS/Views/PasteCodeView.swift:140:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/ContentBlocking.swift:27:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/URLExtension.swift:27:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:29:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:1283:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2498:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2539:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2550:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelEvent.swift:2559:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/PixelFiringAsync.swift:32:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/AutofillInterfaceEmailTruncator.swift:32:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/Pixel.swift:232:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/Pixel.swift:323:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/TextMasker.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/Core/HistoryManager.swift:29:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/EmptyCollectionReusableView.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AboutView.swift:98:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/CrashCollectionOnboarding.swift:39:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/BulkGeneratorView.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/BulkGeneratorView.swift:145:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListSectioningHelper.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListSectioningHelper.swift:51:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogsSettings.swift:55:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TextZoomLevel.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsModel.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SyncSettingsViewController+PlatformLinks.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SpeechRecognizer.swift:105:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/UITableViewCellExtension.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FireproofingAlert.swift:28:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FireproofingAlert.swift:71:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/WebProgressWorker.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/Configuration/ConfigurationManager.swift:43:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/CreditCardRow/CreditCardRow.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/Configuration/ConfigurationStore.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/CreditCardRow/CreditCardRowViewModel.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FileSizeDebugViewController.swift:35:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FileSizeDebugViewController.swift:234:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/UIImageViewExtension.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:76:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:102:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:127:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabsBarCell.swift:136:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarNotificationViewModel.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SyncSettingsViewController.swift:436:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/Theme+DesignSystem.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/ToggleExpandButtonStyle.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/Favicons.swift:85:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/Favicons.swift:99:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:28:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:69:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:77:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:79:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DaxDialogs.swift:618:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:26:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:130:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutoClearSettingsViewController.swift:175:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsState.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AddOrEditBookmarkViewController.swift:54:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillEditableMaskedCell.swift:68:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SwiftUICollectionViewCell.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:93:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:95:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:99:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:107:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:115:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:119:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:127:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:131:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:135:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/OmniBarDelegate.swift:139:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/UIHostingControllerExtension.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillContentScopeFeatureToggles.swift:25:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:69:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:112:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AlertPlaygroundView.swift:120:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:26:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:144:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:165:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:179:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:221:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppUserDefaults.swift:599:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadActionMessageViewHelper.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:269:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackFormViewController.swift:291:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SaveToDownloadsAlert.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SaveToDownloadsAlert.swift:27:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabSwitcherViewController+MultiSelect.swift:253:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabSwitcherViewController+MultiSelect.swift:626:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/ProgressView.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/ProgressView.swift:206:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AutofillBreakageReportTableViewCell.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/DownloadsListDataSource.swift:24:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:49:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:51:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:59:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/AppConfigurationFetch.swift:89:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackViewController.swift:23:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/FeedbackViewController.swift:79:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/PrivacyIconView.swift:187:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:560:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:745:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:872:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:874:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:876:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/SettingsViewModel.swift:926:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/HomePageConfiguration.swift:29:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:69:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:952:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:1321:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:1401:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2595:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2615:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2636:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2784:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:2859:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
📖 This PR fixed a violation in DuckDuckGo: /iOS/DuckDuckGo/TabViewController.swift:3021:1: Warning: Don't include vertical whitespace (empty line) after opening braces (vertical_whitespace_opening_braces)
⚠️ Danger found 1305 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 146.

Generated by 🚫 Danger

@jpsim jpsim force-pushed the migrate-verticalwhitespaceopeningbracesrule-to-swiftsyntax branch from 78d1b0c to ea4a254 Compare June 24, 2025 14:13
## Summary

Convert VerticalWhitespaceOpeningBracesRule to use SwiftSyntax instead
of SourceKit for improved performance and better detection of empty
lines after opening braces.

## Key Technical Improvements

- **Enhanced trivia analysis** for accurate empty line detection after
  opening braces
- **Proper handling of closure "in" keywords** with context-aware
  detection
- **Improved correction logic** handling all newline types (LF, CR,
  CRLF) consistently
- **SwiftSyntax visitor pattern** replacing regex-based detection for
  better accuracy
- **Comprehensive token analysis** supporting all opening brace types
  (`{`, `[`, `(`)
- **Accurate position tracking** for violation start and end positions

## Migration Details

- Replaced `CorrectableRule, OptInRule` with
  `@SwiftSyntaxRule(correctable: true, optIn: true)`
- Implemented `ViolationsSyntaxVisitor` for detecting violations in
  token trailing trivia
- Implemented `ViolationsSyntaxRewriter` for correcting violations
  across different syntax contexts
- Added proper handling of closures, code blocks, arrays, and tuples
- Maintained exact position reporting for violation locations
- Preserved all existing test cases and rule behavior
@SimplyDanny SimplyDanny force-pushed the migrate-verticalwhitespaceopeningbracesrule-to-swiftsyntax branch from ea4a254 to af63388 Compare June 29, 2025 17:56
@SimplyDanny
Copy link
Collaborator

Rebased to get the better summary.

@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Jun 29, 2025

The difference to the previous implementation are examples like

func f() { // comment

}

with comments after the opening brace. They trigger now.

Another difference is when the in keyword separating a closure's arguments from its body is on a line after the opening brace, like in:

f { foo,
    bar in

}

The previous implementation didn't trigger on the empty line, the new implementation does.

I think that both cases are acceptable without introducing an option since there are only ~20 examples of either nature in the scanned repositories.

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.

It's a bit irritating that the rule triggers on the opening brace in all cases except for closures where it triggers on the empty line. We should harmonize that (probably in a separate change afterwards).

}
}

private extension TriviaPiece {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should move this to SwiftSyntax+SwiftLint.swift and reused it in other rules.

}

private extension VerticalWhitespaceOpeningBracesRule {
final class Visitor: ViolationsSyntaxVisitor<SeverityConfiguration<VerticalWhitespaceOpeningBracesRule>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
final class Visitor: ViolationsSyntaxVisitor<SeverityConfiguration<VerticalWhitespaceOpeningBracesRule>> {
final class Visitor: ViolationsSyntaxVisitor<ConfigurationType> {

}
}

final class Rewriter: ViolationsSyntaxRewriter<SeverityConfiguration<VerticalWhitespaceOpeningBracesRule>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
final class Rewriter: ViolationsSyntaxRewriter<SeverityConfiguration<VerticalWhitespaceOpeningBracesRule>> {
final class Rewriter: ViolationsSyntaxRewriter<ConfigurationType> {

Comment on lines +411 to +422
if let firstStatement = node.statements.first {
let leadingTrivia = firstStatement.leadingTrivia
let correctedTrivia = correctTrivia(trivia: leadingTrivia)
if correctedTrivia.hasCorrections {
numberOfCorrections += correctedTrivia.correctionCount
var newStatements = node.statements
newStatements[newStatements.startIndex] = firstStatement
.with(\.leadingTrivia, correctedTrivia.trivia)
return node.with(\.statements, newStatements)
}
}
return super.visit(node)
Copy link
Collaborator

Choose a reason for hiding this comment

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

These blocks look all very similar. Common parts could be extracted into a method.

// Comment explaining the logic
performAction()
}
"""),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I tried with another example:

if x == 5 { // comment
    
    print("x is 5")
}

The violation triggers at the comment and the correction removes on of the leading slashes //.

}
}

final class Rewriter: ViolationsSyntaxRewriter<SeverityConfiguration<VerticalWhitespaceOpeningBracesRule>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The rewriter is currently not used at all since the visitor does the replacement already and the rule doesn't specify explicitRewriter: true.

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.

3 participants