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 rule for single space after period on comments #4624

Merged
merged 7 commits into from
Dec 15, 2022

Conversation

Julioacarrettoni
Copy link
Contributor

@Julioacarrettoni Julioacarrettoni commented Dec 6, 2022

Because even prose needs a style guide, and according to owl.purdue.edu we should be using a single space after punctuation, I'm introducing period_spacing.

Punctuation
Use a single space after a period.

The rule simply checks and removes extra spaces after the first space following a period in .blockComment, .docBlockComment, .lineComment, and .docLineComment.

Per the contributing guidelines :

SwiftLint supports building via Xcode and Swift Package Manager on macOS, and with Swift Package Manager on Linux. When contributing code changes, please ensure that all three supported build methods continue to work and pass tests.

  • $ xcodebuild -scheme swiftlint test -destination platform=macOS,arch=arm64,id=00006001-000411983E09801E
  • $ swift test
  • $ make docker_test (passes when applying the change from Update docker_test to swift 5.7 #4625)

This rule opt-in because it triggers in a lot of the linked repositories and it fits the definition of opt-in-rules nevertheless the rule does not trigger in this repository right now.

A rule that is not general consensus or is only useful in some cases (e.g. force_unwrapping)

triggers

@SwiftLintBot
Copy link

SwiftLintBot commented Dec 6, 2022

531 Warnings
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Browser/Search/SearchEngines.swift:41:36: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Browser/Search/SearchEngines.swift:41:92: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Browser/Search/SearchEngines.swift:43:14: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Browser/Search/SearchEngines.swift:55:89: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Settings/SettingsContentViewController.swift:11:52: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Widgets/TwoLineCell.swift:150:12: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Client/Frontend/Widgets/TwoLineCell.swift:152:19: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Brave: /Sources/BraveNews/FeedItemView.swift:473:19: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /AtbUITests/AtbIntegrationTests.swift:103:86: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /Core/URLExtension.swift:87:81: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/DirectoryMonitor.swift:107:33: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Favicons.swift:54:126: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/Favicons.swift:55:51: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/TabViewController.swift:117:39: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGo/UIImageViewExtension.swift:32:58: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Application/AppDelegate.swift:197:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/SearchEngines/SearchEngines.swift:16:15: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Browser/SearchEngines/SearchEngines.swift:26:90: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Settings/SettingsContentViewController.swift:10:51: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Strings.swift:25:73: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Client/Frontend/Widgets/ChevronView.swift:91:105: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:245:105: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:252:48: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:254:58: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/State.swift:267:48: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/StorageClient.swift:500:73: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/StorageClient.swift:589:37: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/StorageClient.swift:616:97: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/StorageClient.swift:629:42: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:25:43: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:32:34: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:440:81: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:441:108: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:60:88: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:666:45: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:672:45: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:833:52: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:869:30: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:870:57: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Sync/SyncStateMachine.swift:930:57: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/AccountTests/TokenServerClientTests.swift:12:73: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/AccountTests/TokenServerClientTests.swift:14:80: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/SyncTests/MetaGlobalTests.swift:296:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/SyncTests/MetaGlobalTests.swift:374:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/SyncTests/MetaGlobalTests.swift:560:85: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/SyncTests/MetaGlobalTests.swift:599:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Firefox: /Tests/SyncTests/MockSyncServerTests.swift:164:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Kickstarter: /Library/Strings.swift:26546:30: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:12:74: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:14:41: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitArticleStatusUpdate.swift:32:40: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitSendStatusOperation.swift:131:56: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/FeedProvider/Twitter/TwitterFeedProvider.swift:438:27: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/FeedProvider/Twitter/TwitterStatus.swift:104:73: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAPICaller.swift:10:62: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAPICaller.swift:280:46: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAPICaller.swift:491:80: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAPICaller.swift:494:61: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAPICaller.swift:9:64: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift:759:57: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift:760:57: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/LocalAccount/LocalAccountDelegate.swift:307:53: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift:181:38: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/MainWindowController.swift:185:19: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/MainWindow/Sidebar/SidebarViewController.swift:86:41: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/AppDelegate+Scriptability.swift:111:76: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/AppDelegate+Scriptability.swift:13:42: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/AppDelegate+Scriptability.swift:15:62: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/AppDelegate+Scriptability.swift:173:35: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/AppDelegate+Scriptability.swift:178:24: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/NSScriptCommand+NetNewsWire.swift:37:75: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Mac/Scriptability/NSScriptCommand+NetNewsWire.swift:38:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Shared/Favicons/FaviconDownloader.swift:242:72: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/AppleScriptXCTestCase.swift:25:61: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/NSAppleEventDescriptor+UserRecordFields.swift:16:41: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift:82:70: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /Tests/NetNewsWireTests/ScriptingTests/ScriptingTests.swift:89:29: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/ArticleViewController.swift:123:71: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/ContextMenuPreviewViewController.swift:46:18: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/ContextMenuPreviewViewController.swift:46:82: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:422:88: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:423:66: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:425:14: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:425:83: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:535:35: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Article/WebViewController.swift:536:51: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/MasterFeed/Cell/MasterFeedTableViewCellLayout.swift:92:107: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/MasterFeed/MasterFeedViewController+Drop.swift:112:74: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/SceneCoordinator.swift:1400:106: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/SceneCoordinator.swift:1401:83: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in NetNewsWire: /iOS/Settings/SettingsViewController.swift:37:78: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Nimble: /Sources/Nimble/Expectation.swift:121:76: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Quick: /Sources/Quick/QuickSpec.swift:69:28: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Quick: /Sources/Quick/StopTest.swift:9:48: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Realm: /RealmSwift/Realm.swift:867:52: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Realm: /RealmSwift/RealmConfiguration.swift:160:66: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Exec.swift:34:70: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Exec.swift:36:73: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Exec.swift:51:71: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Exec.swift:53:74: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Module.swift:34:40: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/Module.swift:88:40: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/SwiftDocKey.swift:258:52: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in SourceKitten: /Source/SourceKittenFramework/SwiftVersion.swift:21:64: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/OSLog/OSLogIntegerTypes.swift:22:8: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/OSLog/OSLogIntegerTypes.swift:23:8: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/OSLog/OSLogStringAlignment.swift:26:54: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/OSLog/OSLogStringTypes.swift:22:8: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/OSLog/OSLogStringTypes.swift:23:8: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1190:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1194:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1415:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1419:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1677:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:1681:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:422:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:426:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:647:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:651:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:909:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift:913:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/CheckCollectionType.swift:965:59: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:1018:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:1188:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:1459:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:1622:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:1886:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:2057:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:2329:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:2494:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:2658:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:2924:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:3189:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:3362:16: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ This PR introduced a violation in Swift: /stdlib/private/StdlibCollectionUnittest/MinimalCollections.swift:388:53: warning: Period Spacing Violation: Periods should not be followed by more than one space. (period_spacing)
⚠️ Danger found 531 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 135.
18 Messages
📖 Linting Aerial with this PR took 1.2s vs 1.2s on main (0% slower)
📖 Linting Alamofire with this PR took 1.56s vs 1.56s on main (0% slower)
📖 Linting Brave with this PR took 8.28s vs 8.27s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 3.23s vs 3.21s on main (0% slower)
📖 Linting Firefox with this PR took 10.29s vs 10.25s on main (0% slower)
📖 Linting Kickstarter with this PR took 11.24s vs 11.24s on main (0% slower)
📖 Linting Moya with this PR took 0.64s vs 0.63s on main (1% slower)
📖 Linting NetNewsWire with this PR took 3.55s vs 3.53s on main (0% slower)
📖 Linting Nimble with this PR took 0.71s vs 0.69s on main (2% slower)
📖 Linting PocketCasts with this PR took 8.27s vs 8.3s on main (0% faster)
📖 Linting Quick with this PR took 0.25s vs 0.26s on main (3% faster)
📖 Linting Realm with this PR took 12.48s vs 12.47s on main (0% slower)
📖 Linting SourceKitten with this PR took 0.5s vs 0.52s on main (3% faster)
📖 Linting Sourcery with this PR took 2.58s vs 2.59s on main (0% faster)
📖 Linting Swift with this PR took 4.97s vs 4.93s on main (0% slower)
📖 Linting VLC with this PR took 1.43s vs 1.42s on main (0% slower)
📖 Linting Wire with this PR took 9.72s vs 9.73s on main (0% faster)
📖 Linting WordPress with this PR took 12.31s vs 12.3s on main (0% slower)

Generated by 🚫 Danger

@Julioacarrettoni
Copy link
Contributor Author

/retest

@Julioacarrettoni Julioacarrettoni marked this pull request as ready for review December 6, 2022 22:59
@Julioacarrettoni
Copy link
Contributor Author

&retest

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
)

func violationRanges(in file: SwiftLintFile) -> [NSRange] {
// Find all comment tokens in the file and regex search them for violations
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd love to see a rule enforcing periods to finalize comments. 😉 Can we have a period after each sentence to be consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhhhh! I like that!
Should it be a separate rule though?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, I don't think such a rule would be feasible. It's hard to recognize full sentences. A comment can also be a link, a code snippet or a few words which don't result into a sentence.

My comment was rather meant as a joke referring to your comments in the new rule ... 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm glad that's the case, I had a mini crisis trying to figure out the rule for that 😅

1. Moved changelog to the top.
2. Extracted "isComment" logic to a SyntaxClassification extension.
3. Added a double space on the changelog for proper rendering.
4. Added violation markers to the triggering examples.
}

let range = classifiedRange.range.toSourceKittenByteRange()
.map { $0.range.toSourceKittenByteRange() }
Copy link
Collaborator

Choose a reason for hiding this comment

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

The isComment seems to be missing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I get for doing manual copy&paste.
Thank you so much for the thorough review!

I'm kinda surprised by the lack of false positives with this mistake. I mean, the list of examples is not exhaustive but the rule was also run on all those other repos right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, the rule is run on all the repositories listed above. The violations are truncated to 135 while there is a total of 531, though. So I guess we either just don't see the violations in comment_spacing or the regex used in the rule is already precise enough.

If you have an idea for a test case that would exactly trigger in such a case, do not hesitate to add it. 😉

)

func violationRanges(in file: SwiftLintFile) -> [NSRange] {
// Find all comment tokens in the file and regex search them for violations
Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, I don't think such a rule would be feasible. It's hard to recognize full sentences. A comment can also be a link, a code snippet or a few words which don't result into a sentence.

My comment was rather meant as a joke referring to your comments in the new rule ... 😄

return true
case .none, .keyword, .identifier, .typeIdentifier, .operatorIdentifier, .dollarIdentifier, .integerLiteral,
.floatingLiteral, .stringLiteral, .stringInterpolationAnchor, .poundDirectiveKeyword, .buildConfigId,
.attribute, .objectLiteral, .editorPlaceholder:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the full set of cases here? To make sure the compiler warns if there are new kinds?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly 💯

@Julioacarrettoni
Copy link
Contributor Author

So… what happens next? 🙃

@SimplyDanny SimplyDanny merged commit 3745704 into realm:main Dec 15, 2022
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