Skip to content

Add SwiftLint rule to prevent multiple variable declarations on one line #5990

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 14 commits into
base: main
Choose a base branch
from

Conversation

AhmedZaghloul19
Copy link

for the issue:
Rule Request: Avoid multiple statements on a single line separated with semicolons #5829

@SwiftLintBot
Copy link

SwiftLintBot commented Feb 5, 2025

438 Warnings
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Protected.swift:39:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Protected.swift:47:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:499:68: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:934:49: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:122:90: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:123:45: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:136:34: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:140:77: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:143:33: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/RequestTaskMap.swift:146:29: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:1279:94: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/SessionDelegate.swift:240:91: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:47:72: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/RequestInterceptor.swift:271:79: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/RequestInterceptor.swift:296:79: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/RequestInterceptor.swift:325:70: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/AuthenticationInterceptorTests.swift:108:24: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/AuthenticationInterceptorTests.swift:116:24: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/AuthenticationInterceptorTests.swift:73:24: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1018:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1041:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1063:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1085:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1107:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1129:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1151:81: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1154:61: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:115:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1178:50: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1233:57: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1353:48: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:137:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:1380:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:159:81: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:162:61: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:186:50: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:209:49: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:264:57: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:384:48: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:411:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:46:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:69:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:902:63: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:928:67: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:92:52: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/CombineTests.swift:992:60: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/DownloadTests.swift:1048:89: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/DownloadTests.swift:934:80: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestInterceptorTests.swift:520:78: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestInterceptorTests.swift:541:78: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestInterceptorTests.swift:563:78: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:104:71: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:105:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:125:70: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:126:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:145:81: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:146:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:165:64: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:190:69: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:39:58: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:40:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:59:63: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:60:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:81:66: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestModifierTests.swift:82:38: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:1282:49: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:1300:50: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:860:74: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:864:74: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:868:74: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/ResponseTests.swift:566:80: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:1662:62: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/PrivacyDashboard/PrivacyDashboardViewController.swift:300:132: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/TabViewController.swift:1507:95: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/MenuBookmarksViewModelTests.swift:60:73: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/MenuBookmarksViewModelTests.swift:68:73: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /BrowserKit/Sources/Shared/Deferred/Deferred.swift:84:32: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Application/RemoteSettings/Application Services/ASSearchEngineIconDataFetcher.swift:42:82: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Application/RemoteSettings/Application Services/ASSearchEngineProvider.swift:83:86: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift:593:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Bookmarks/Legacy/LegacyBookmarksPanel.swift:484:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Downloads/DownloadsPanel.swift:375:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Downloads/DownloadsPanel.swift:401:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Reader/ReaderPanel.swift:380:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Library/Reader/ReaderPanel.swift:391:65: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/ClientTests/Utils/ThrottlerTests.swift:81:112: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/Blockzilla/BrowserViewController.swift:919:67: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/Blockzilla/BrowserViewController.swift:948:51: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/Blockzilla/Settings/Controller/AddSearchEngineViewController.swift:268:89: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/Deferred/Deferred.swift:80:32: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/OpenInFocus/ActionViewController.swift:76:129: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/OpenInFocus/ActionViewController.swift:84:78: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Firefox: /focus-ios/OpenInFocus/ActionViewController.swift:85:87: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Kickstarter: /Library/Tracking/KSRAnalytics.swift:1750:34: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Kickstarter: /Library/Tracking/KSRAnalytics.swift:1755:28: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Kickstarter: /Library/Tracking/KSRAnalytics.swift:1760:45: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Moya: /Sources/Moya/Atomic.swift:18:24: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Moya: /Sources/Moya/Atomic.swift:23:24: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/AsyncAwaitTest+Require.swift:110:71: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/AsyncAwaitTest.swift:88:66: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/Matchers/ThrowErrorTest.swift:50:81: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/Matchers/ThrowErrorTest.swift:55:67: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/Matchers/ThrowErrorTest.swift:60:67: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/SynchronousTest.swift:41:74: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Nimble: /Tests/NimbleTests/SynchronousTest.swift:80:77: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/End of Year/EndOfYearStoriesBuilderTests.swift:232:112: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/End of Year/EndOfYearStoriesBuilderTests.swift:246:112: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/End of Year/EndOfYearStoriesBuilderTests.swift:264:115: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in PocketCasts: /PocketCastsTests/Tests/End of Year/EndOfYearStoriesBuilderTests.swift:281:115: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in PocketCasts: /podcasts/LeftAlignedFlowLayout.swift:6:74: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Attribute.swift:198:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Attribute.swift:204:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Attribute.swift:210:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Import.swift:80:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Modifier.swift:67:19: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Protocol.swift:129:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/ProtocolComposition.swift:109:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Array.swift:84:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Array.swift:90:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Dictionary.swift:104:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Dictionary.swift:111:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Dictionary.swift:98:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Generic.swift:68:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Generic.swift:74:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Set.swift:84:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/TypeName/Set.swift:90:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:127:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:133:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:141:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:147:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:153:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/AST/Typealias.swift:160:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:134:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:140:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:146:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:152:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:158:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:164:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ This PR introduced a violation in Sourcery: /SourceryRuntime/Sources/Common/FileParserResult.swift:170:15: warning: Multiple Statements Violation: Every statement should be on its own line (multiple_statements)
⚠️ Danger found 438 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 139.
18 Messages
📖 Building this branch resulted in a binary size of 29551.43 KiB vs 29537.85 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.95 s vs 0.93 s on main (2% slower).
📖 Linting Alamofire with this PR took 1.27 s vs 1.27 s on main (0% slower).
📖 Linting Brave with this PR took 8.62 s vs 8.61 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 5.78 s vs 5.78 s on main (0% slower).
📖 Linting Firefox with this PR took 12.08 s vs 12.04 s on main (0% slower).
📖 Linting Kickstarter with this PR took 10.46 s vs 10.42 s on main (0% slower).
📖 Linting Moya with this PR took 0.52 s vs 0.54 s on main (3% faster).
📖 Linting NetNewsWire with this PR took 2.91 s vs 2.88 s on main (1% slower).
📖 Linting Nimble with this PR took 0.79 s vs 0.78 s on main (1% slower).
📖 Linting PocketCasts with this PR took 8.81 s vs 8.9 s on main (1% faster).
📖 Linting Quick with this PR took 0.43 s vs 0.43 s on main (0% slower).
📖 Linting Realm with this PR took 4.54 s vs 4.54 s on main (0% slower).
📖 Linting Sourcery with this PR took 2.34 s vs 2.34 s on main (0% slower).
📖 Linting Swift with this PR took 4.79 s vs 4.78 s on main (0% slower).
📖 Linting VLC with this PR took 1.32 s vs 1.31 s on main (0% slower).
📖 Linting Wire with this PR took 19.09 s vs 19.06 s on main (0% slower).
📖 Linting WordPress with this PR took 11.35 s vs 11.29 s on main (0% slower).

Generated by 🚫 Danger

@SimplyDanny
Copy link
Collaborator

Thank you for the contribution! Here are some general remarks:

  • The rule is supposed to trigger on multiple statements on a single line. That is, it is not only about variable declarations, but all kinds of statements like let a = 1; return a or if b { return }; let a = 1.
  • Refer to TrailingSemicolonRule to get an idea of how this could be implemented.
  • Run make sourcery to get the order of tests and the rule list in the right order.
  • 19980 warnings are surely too many. I expect a handful or warnings or even none.
  • The explicit test MultipleVariableDeclarationRuleTests isn't required. Rather add more triggering and non-triggering examples to the rule's description.

@AhmedZaghloul19
Copy link
Author

Thank you @SimplyDanny, yes it was unnecessary to have unit tests for it, I think now it'll work properly.
and about this pipeline error, I really don't know why!, if you can help me fixing it it would be great.
it was successful before solving the merge conflict

@SimplyDanny
Copy link
Collaborator

and about this pipeline error, I really don't know why!, if you can help me fixing it it would be great.

Danger doesn't like merge commits, that's all. You need to rebase your branch onto main instead.

@AhmedZaghloul19
Copy link
Author

@SimplyDanny I'm trying to rebase on main but I'm afraid of messing everything up actually, as there is conflicts while rebasing and I'm afraid of not including your changes 😬

@SimplyDanny
Copy link
Collaborator

@SimplyDanny I'm trying to rebase on main but I'm afraid of messing everything up actually, as there is conflicts while rebasing and I'm afraid of not including your changes 😬

You definitely messed something up. You can try to rebase again and throw away all commits that are not yours or duplicates of commits you have created previously. There shouldn't be any conflicts apart from maybe CHANGELOG.md, which would be easy to resolve.

@AhmedZaghloul19 AhmedZaghloul19 force-pushed the multiple-variable-declaration-rule branch 3 times, most recently from 25b3805 to 7f6556e Compare February 19, 2025 22:18
@AhmedZaghloul19 AhmedZaghloul19 force-pushed the multiple-variable-declaration-rule branch from 7f6556e to 92b6a81 Compare February 19, 2025 22:23
@AhmedZaghloul19
Copy link
Author

@SimplyDanny I'm trying to rebase on main but I'm afraid of messing everything up actually, as there is conflicts while rebasing and I'm afraid of not including your changes 😬

You definitely messed something up. You can try to rebase again and throw away all commits that are not yours or duplicates of commits you have created previously. There shouldn't be any conflicts apart from maybe CHANGELOG.md, which would be easy to resolve.

@SimplyDanny the git now is fixed and everything is ready 👍🏼

@SimplyDanny
Copy link
Collaborator

@SimplyDanny the git now is fixed and everything is ready 👍🏼

Commits look okay now. But there's still a few things to consider. Did you read my other comment carefully?

@AhmedZaghloul19
Copy link
Author

@SimplyDanny Now it's ready, but I think it's not good to merge with the 436 warnings which is the violations of the new rule in the project.
do you think we have to fix it in this PR or create another issue for creating that and I'll do it also ?

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.

This looks much better! However, there are a few more remarks from my side ...

Now it's ready, but I think it's not good to merge with the 436 warnings which is the violations of the new rule in the project.
do you think we have to fix it in this PR or create another issue for creating that and I'll do it also ?

These warnings are from other project, we scan to get an impression on the rule's behavior in the real world. It's fine to have many warnings as long as they are valid. It shows that the rule does a good job in finding violations. Important is that all of these findings are actually valid and (if possible) no false positives. This is what you should ensure.

private extension TokenSyntax {
var isThereStatementAfterSemicolon: Bool {
guard tokenKind == .semicolon,
!trailingTrivia.isEmpty else { return false }
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't comprehend this condition. Why is no trivia after the semicolon allowed? I think an example like let a = 0;let b = 0 should trigger as well.

Comment on lines 68 to 69
isFollowedOnlyByWhitespaceOrNewline {
return nextToken.leadingTrivia.containsNewlines() == false
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think what you actually want to know is whether the next token is on the same line as the semicolon. You can use locationConverter in every visitor and rewriter. It can tell you on which line a certain token is located. If you compare the line of the semicolon with the line of the next token, you know whether to trigger a violation or not.

if Date().timeIntervalSince(startDate) > timeout {
task.cancel()
break
}
Copy link
Collaborator

@SimplyDanny SimplyDanny Mar 9, 2025

Choose a reason for hiding this comment

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

This doesn't look like it got auto-fixed by the rule. The only cases that can be fixed automatically are the ones where the statements are on their own line without leading tokens. We should probably restrict the rewriter to these cases.

let newNode = TokenSyntax(
.unknown(""),
leadingTrivia: node.leadingTrivia,
trailingTrivia: .newlines(1),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesn't indent the following statement. Consider the example

{
    let a = 0; let b = 0
}

which should be corrected to

{
    let a = 0;
    let b = 0
}

Copy link
Author

@AhmedZaghloul19 AhmedZaghloul19 Mar 27, 2025

Choose a reason for hiding this comment

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

The autocorrect version is

{
    let a = 0
    let b = 0
}

as we're removing the semicolon, as it's swift code styling
We can keep the semicolon as well

Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct. My bad. Except this example wouldn't be formatted like that with the current implementation.

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.

4 participants