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

Add new opt-in non_final_class rule #6025

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

JaviSoto
Copy link
Contributor

No description provided.

@JaviSoto JaviSoto force-pushed the dev/javi/non-final-class branch from 8fb103d to fc16f25 Compare March 17, 2025 21:51
@SwiftLintBot
Copy link

SwiftLintBot commented Mar 17, 2025

7497 Warnings
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/WelcomeViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/RecapViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/FirstSetupWindowController.swift:15:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/NextViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/VideoFormatViewController.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/CacheSetupViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/First time setup/TimeSetupViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Infos panels/HelpViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/PanelWindowController.swift:11:7: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Infos panels/InfoViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Infos panels/CreditsViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/CompanionCacheViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/Collection View/PlayingCollectionViewItem.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/DisplaysViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/SidebarViewController.swift:15:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/NowPlayingViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/FiltersViewController.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/BrightnessViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/App/AppDelegate.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/SourcesViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/CacheViewController.swift:19:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/AdvancedViewController.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/OverlaysViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/TimeViewController.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:22:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Locations.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Hardware/DisplayDetection.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/ManifestLoader.swift:18:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/CustomVideoFolders.swift:9:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/CustomVideoFolders.swift:58:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/CustomVideoFolders.swift:117:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/SeededGenerator.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Aerial.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Sidebar.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Downloads/AsynchronousOperation.swift:25:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoBatteryView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoLocationView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/VideoList.swift:22:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/VideoHeaderView.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoMusicView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoTableSource.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoContainerView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoMessageView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/VideoViewItem.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoTimerView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoDateView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoSettingsView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoCommonView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoSettingsTableSource.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Music/ArtworkLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoCountdownView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoClockView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Controllers/CustomVideoController.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Music/MusicLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/InfoWeatherView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/ClockLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/DisplayView.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/DisplayView.swift:43:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/DownloadIndicatorLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LocationLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LayerManager.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/YahooLogoLayer.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/DateLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WindDirectionLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/AnimationTextLayer.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/BatteryIconLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/CountdownLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/TimerLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/MainUI/ShadowTextFieldCell.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LayerOffsets.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/MainUI/NowPlayingCollectionView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/MainUI/SidebarOutlineView.swift:15:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/AnimationLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/MainUI/VideoCellView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Sources/SourceOutlineView.swift:15:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/MessageLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ConditionLayer.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ConditionLayer.swift:30:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Sources/DescriptionCellView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ConditionSymbolLayer.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Sources/CheckboxCellView.swift:17:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Sources/ActionCellView.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/ForecastLayer.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/AppDelegate.swift:28:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/MasterViewController.swift:28:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/DetailViewController.swift:28:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/DataRequest.swift:28:8: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/MultipartFormData.swift:78:5: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:29:8: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/BaseTestCase.swift:29:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/URLProtocolTests.swift:29:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/URLProtocolTests.swift:112:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1460:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:29:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/HTTPHeadersTests.swift:28:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/RetryPolicyTests.swift:29:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncoderTests.swift:1146:9: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:143:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:167:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:226:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:352:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:515:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:677:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:1044:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:1306:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:1336:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /watchOS Example/watchOS Example WatchKit Extension/ExtensionDelegate.swift:27:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /watchOS Example/watchOS Example WatchKit Extension/HostingController.swift:29:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/MultipartFormDataTests.swift:59:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/MultipartFormDataTests.swift:90:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Alamofire: /Tests/MultipartFormDataTests.swift:820:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/BraveWidgets/WidgetStrings.swift:9:9: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/ShareExtension/ShareToBraveViewController.swift:27:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/ActionExtension/ActionToBraveViewController.swift:10:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/WebShell/ContentView.swift:16:9: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/WebShell/ContentView.swift:27:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/AutoFillProvider/CredentialProviderViewController.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/BraveWireGuard/PacketTunnelProvider.swift:9:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/CPTemplateApplicationSceneDelegate.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/BrowserIntents/IntentHandler.swift:10:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppState.swift:29:8: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/WalletUserAssetGroupTests.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/DataSavedTests.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppDelegate.swift:39:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/DataControllerTests.swift:11:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/WalletUserAssetBalanceTests.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/FeedSourceOverrideTests.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/FavoriteTests.swift:12:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/DomainTests.swift:14:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/WalletUserAssetTests.swift:13:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/BraveNewsTests/OPMLParsingTests.swift:10:1: Warning: Classes should be marked as final unless they are explicitly open (non_final_class)
⚠️ Danger found 7497 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 133.
18 Messages
📖 Building this branch resulted in a binary size of 29613.98 KiB vs 29603.41 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 1.76 s vs 1.04 s on main (69% slower).
📖 Linting Alamofire with this PR took 1.4 s vs 1.39 s on main (0% slower).
📖 Linting Brave with this PR took 9.71 s vs 9.68 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 6.45 s vs 6.45 s on main (0% slower).
📖 Linting Firefox with this PR took 12.97 s vs 12.95 s on main (0% slower).
📖 Linting Kickstarter with this PR took 11.18 s vs 11.1 s on main (0% slower).
📖 Linting Moya with this PR took 0.58 s vs 0.56 s on main (3% slower).
📖 Linting NetNewsWire with this PR took 3.21 s vs 3.2 s on main (0% slower).
📖 Linting Nimble with this PR took 0.84 s vs 0.83 s on main (1% slower).
📖 Linting PocketCasts with this PR took 9.52 s vs 9.4 s on main (1% slower).
📖 Linting Quick with this PR took 0.47 s vs 0.47 s on main (0% slower).
📖 Linting Realm with this PR took 5.07 s vs 5.06 s on main (0% slower).
📖 Linting Sourcery with this PR took 2.55 s vs 2.54 s on main (0% slower).
📖 Linting Swift with this PR took 5.46 s vs 5.46 s on main (0% slower).
📖 Linting VLC with this PR took 1.45 s vs 1.45 s on main (0% slower).
📖 Linting Wire with this PR took 20.63 s vs 20.57 s on main (0% slower).
📖 Linting WordPress with this PR took 12.55 s vs 12.47 s on main (0% slower).

Generated by 🚫 Danger

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.

Nice little rule that may have its use cases!

There are a few violations in SwiftLint's code base itself. They can likely be auto-fixed. However, if there is inheritance involved we shouldn't put an open but rather disable the rule locally or globally in the configuration (in case there are too many "false" positives).

Other than that, I've added a few remarks inline.

struct NonFinalClassRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Copy link
Collaborator

Choose a reason for hiding this comment

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

We now support adding rationals to rule descriptions. This feels like a very good candidate for some more explanation, as it seems highly opinionated and project-specific considering that open implies public which is often not what libraries want instead.

}

private final class Visitor: ViolationsSyntaxVisitor<ConfigurationType> {
override func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefer visitPost instead.

let modifiers = node.modifiers
if !modifiers.contains(keyword: .final),
!modifiers.contains(keyword: .open) {
let classToken = node.classKeyword
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
let classToken = node.classKeyword
let classTokenPosition = node.classKeyword.positionAfterSkippingLeadingTrivia

let classToken = node.classKeyword
violations.append(.init(
position: classToken.positionAfterSkippingLeadingTrivia,
reason: "Classes should be marked as `final` unless they are explicitly `open`",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be more succinct and targeted to the single class being checked:

Suggested change
reason: "Classes should be marked as `final` unless they are explicitly `open`",
reason: "Class should be marked as `final` or explicitly `open`",

Copy link
Collaborator

Choose a reason for hiding this comment

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

This test isn't needed. All examples in the description are test cases by design.

Example("public final class MyClass {}"),
],
triggeringExamples: [
Example("class MyClass {}"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add violation markers to indicate the exact positions where the violations are expected to appear.

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