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

implements FunctionArgumentsSpacingRule #5337

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

Conversation

u-abyss
Copy link
Contributor

@u-abyss u-abyss commented Nov 8, 2023

closed #5224

implements functions_arguments_spacing rule to detects unnecessary spaces before the first argument of a function and unnecessary spaces in the last argument.

nonTriggeringExamples:

makeGenerator()
makeGenerator(style)
makeGenerator(true, false)

triggeringExamples

makeGenerator(↓ style)
makeGenerator(style ↓)
makeGenerator(↓ style ↓)
makeGenerator(↓ offset: 0, limit: 0)
makeGenerator(offset: 0, limit: 0 ↓)
makeGenerator(↓ 1, 2, 3 ↓)

@SwiftLintBot
Copy link

SwiftLintBot commented Nov 8, 2023

280 Warnings
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:253:56: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:254:40: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:256:40: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/AnimatableLayer.swift:221:32: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/FiltersViewController.swift:76:130: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/Brave/Frontend/Browser/Helpers/ErrorPageHelper.swift:72:66: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/Brave/WebFilters/ShieldStats/Adblock/AdBlockStats.swift:260:60: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/BraveWallet/Crypto/AssetIconView.swift:162:18: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/BraveWallet/Crypto/Onboarding/BiometricView.swift:121:40: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/BraveWallet/Crypto/Portfolio/PortfolioView.swift:236:60: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/BraveWallet/Crypto/Stores/PortfolioStore.swift:606:25: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/BraveWallet/Crypto/Stores/SwapTokenStore.swift:391:22: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/Playlist/PlaylistDownloadManager.swift:715:164: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/Playlist/PlaylistMediaStreamer.swift:122:60: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Sources/Playlist/PlaylistMediaStreamer.swift:129:56: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Tests/BraveWalletTests/AccountActivityStoreTests.swift:91:18: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Tests/BraveWalletTests/TransactionsActivityStoreTests.swift:76:18: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Tests/GrowthTests/AppReviewManagerLegacyTests.swift:49:86: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Brave: /Tests/GrowthTests/P3ATimedStorageTests.swift:370:54: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /Core/Pixel.swift:212:103: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/AutofillLoginPromptViewController.swift:132:87: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/SettingsAppeareanceView.swift:36:76: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/SettingsLegacyViewProvider.swift:71:51: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/SettingsSubscriptionView.swift:60:46: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/Subscription/PurchaseManager.swift:137:131: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/UserScripts/IdentityTheftRestorationPagesUserScript.swift:38:143: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/UserScripts/SubscriptionPagesUseSubscriptionFeature.swift:258:127: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/UserScripts/SubscriptionPagesUserScript.swift:38:131: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/ViewModel/SubscriptionEmailViewModel.swift:84:68: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/ViewModel/SubscriptionFlowViewModel.swift:149:71: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Subscription/ViewModel/SubscriptionITPViewModel.swift:108:72: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/UserAuthenticator.swift:70:87: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/UserText.swift:259:325: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/BlockerListRequestTests.swift:112:81: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/BlockerListRequestTests.swift:46:81: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/BlockerListRequestTests.swift:63:101: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/BlockerListRequestTests.swift:80:94: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/BlockerListRequestTests.swift:98:94: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in DuckDuckGo: /Widgets/Widgets.swift:83:77: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+WebViewDelegates.swift:435:91: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/SearchLoader.swift:77:57: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/Tabs/Legacy/LegacyGridTabViewController.swift:289:105: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/Tabs/Legacy/LegacyTabTrayViewController.swift:593:106: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Browser/Tabs/Views/EmptyPrivateTabsView.swift:55:25: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/PasswordManagement/PasswordManagerDataSourceHelper.swift:61:24: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/PasswordManagement/PasswordManagerDataSourceHelper.swift:61:70: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/PasswordManagement/PasswordManagerDataSourceHelper.swift:81:20: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/PasswordManagement/PasswordManagerDataSourceHelper.swift:81:57: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift:115:115: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Settings/Main/General/SearchBarSetting.swift:20:67: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/Client/Frontend/Widgets/PhotonActionSheet/PhotonActionSheetView.swift:335:55: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/ThirdParty/Deferred/Deferred/Deferred.swift:63:40: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/ThirdParty/Deferred/Deferred/Deferred.swift:63:55: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/TrackingProtectionTests.swift:170:54: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Package.swift:67:21: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Package.swift:68:31: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:115:65: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:115:74: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:122:68: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:122:77: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:128:56: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:128:64: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:129:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:129:85: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:130:68: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:130:77: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:135:70: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProvider+ReactiveSpec.swift:135:79: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:217:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:217:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:235:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:235:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:261:42: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:261:50: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:276:47: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:276:57: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:321:42: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:321:50: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:342:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:342:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:343:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:343:54: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:366:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:366:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:367:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:367:54: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:386:45: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:386:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:692:65: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:692:74: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:698:64: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:698:73: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:701:52: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:701:60: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:703:53: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:703:85: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:705:64: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:705:73: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:709:70: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/MoyaProviderSpec.swift:709:79: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:74:28: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:74:49: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:75:28: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:75:75: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:76:28: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:76:54: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:85:197: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in Moya: /Tests/MoyaTests/NetworkLoggerPluginSpec.swift:85:28: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift:1056:93: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift:1061:92: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift:1348:87: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift:1377:80: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/FeedbinAccountDelegate.swift:1408:81: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/NewsBlurAccountDelegate+Internal.swift:342:75: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/NewsBlurAccountDelegate+Internal.swift:373:76: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/ReaderAPIAccountDelegate.swift:1101:87: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/ReaderAPIAccountDelegate.swift:954:85: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountDelegates/ReaderAPIAccountDelegate.swift:958:84: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitArticlesZoneDelegate.swift:149:88: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/Sidebar/SidebarOutlineDataSource.swift:385:78: warning: no Unnecessary Spaces Violation: No space before the first and after the last argument and exactly one space after every comma (no_unnecessary_spaces)
⚠️ Danger found 280 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 120.
17 Messages
📖 Linting Aerial with this PR took 0.72s vs 0.72s on main (0% slower)
📖 Linting Alamofire with this PR took 1.03s vs 1.02s on main (0% slower)
📖 Linting Brave with this PR took 5.87s vs 5.86s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 3.07s vs 3.1s on main (0% faster)
📖 Linting Firefox with this PR took 7.9s vs 8.04s on main (1% faster)
📖 Linting Kickstarter with this PR took 7.19s vs 7.05s on main (1% slower)
📖 Linting Moya with this PR took 0.43s vs 0.44s on main (2% faster)
📖 Linting NetNewsWire with this PR took 2.05s vs 2.07s on main (0% faster)
📖 Linting Nimble with this PR took 0.61s vs 0.61s on main (0% slower)
📖 Linting PocketCasts with this PR took 5.83s vs 5.87s on main (0% faster)
📖 Linting Quick with this PR took 0.29s vs 0.29s on main (0% slower)
📖 Linting Realm with this PR took 3.71s vs 3.64s on main (1% slower)
📖 Linting Sourcery with this PR took 1.78s vs 1.74s on main (2% slower)
📖 Linting Swift with this PR took 3.48s vs 3.44s on main (1% slower)
📖 Linting VLC with this PR took 0.98s vs 0.96s on main (2% slower)
📖 Linting Wire with this PR took 12.38s vs 12.31s on main (0% slower)
📖 Linting WordPress with this PR took 8.3s vs 8.24s on main (0% slower)

Generated by 🚫 Danger

@u-abyss
Copy link
Contributor Author

u-abyss commented Nov 24, 2023

@SimplyDanny Could you review this PR? I'm pretty new to SwiftSyntax, so any suggestions are welcome.

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.

Thanks for taking this up!

Please add a changelog entry to let folks now about the new rule and to credit yourself.

We should also carefully review the reported OSS findings. Often, they disclose cases that we haven't thought of just yet.

}

let leftParanTrailingTrivia = node.leftParen?.trailingTrivia
if leftParanTrailingTrivia == Trivia.space {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if there are multiple spaces? I don't think f( a ) would trigger the rule. Also comments are interesting, e.g. f( /* comment */ a /* other comment */ ). Will it trigger?

return
}

let leftParanTrailingTrivia = node.leftParen?.trailingTrivia
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's sometimes a bit surprising to which node SwiftSyntax attaches the whitespace. Therefore, you should also check the leading trivia of the first argument and the trailing trivia of the last argument.

@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch from e61b058 to 620741f Compare December 3, 2023 03:32
@u-abyss
Copy link
Contributor Author

u-abyss commented Dec 13, 2023

@SimplyDanny
Thank you for your kind reviews.
The CI is currently failing and I would like to know why it is failing as I cannot find the cause on my end.
I have confirmed success by running the swift test locally.

@SimplyDanny
Copy link
Collaborator

@SimplyDanny Thank you for your kind reviews. The CI is currently failing and I would like to know why it is failing as I cannot find the cause on my end. I have confirmed success by running the swift test locally.

Please rebase your branch onto the current main. That should resolve the test failures.

@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch from a6be49b to f884b3a Compare December 16, 2023 10:00
@u-abyss
Copy link
Contributor Author

u-abyss commented Dec 16, 2023

@SimplyDanny
I rebased my branch onto current main branch, but CI still fail...

@SimplyDanny
Copy link
Collaborator

@SimplyDanny

I rebased my branch onto current main branch, but CI still fail...

Merge is not the same as rebase. 😉

Danger fails because of merge commits which are undesirable.

@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch 3 times, most recently from 7083432 to 04e7abe Compare December 17, 2023 11:59
@u-abyss
Copy link
Contributor Author

u-abyss commented Dec 17, 2023

@SimplyDanny
It was not rebased correctly; rebasing my branch onto the current main branch, and the CI passed.
thanks.
I fixed the parts that were reviewed.
I've added some test cases, but I'm not sure I've covered all of them, so if there are any missing, please point them out!

@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch 2 times, most recently from ab5ebba to aa032f5 Compare February 11, 2024 14:28
@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch from aa032f5 to 2f86326 Compare February 11, 2024 14:29
@u-abyss u-abyss force-pushed the feature/Spaces-in-function-arguments branch 2 times, most recently from f6688ee to dfbec83 Compare February 11, 2024 16:06
@u-abyss
Copy link
Contributor Author

u-abyss commented Feb 11, 2024

@SimplyDanny
The implementation has been changed to ensure that there is not only no space before the first argument and after the last argument, but that there is only one space after the comma in all arguments.
For comments, the implementation has been changed to allow one space before the comment when a comment is written after an argument or a comma.

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.

Spaces in function arguments
3 participants