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

Remove whitespace from TODO message #801

Merged
merged 5 commits into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

##### Bug Fixes

* Fixed whitespace being added to TODO messages
Copy link
Collaborator

Choose a reason for hiding this comment

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

missing period and two trailing spaces as defined in CONTRIBUTING.md

[W. Bagdon](https://github.com/wbagdon)
[#792](https://github.com/realm/SwiftLint/issues/792)

* Fixed regex bug in Vertical Whitespace Rule by using SourceKitten instead.
The rule now enabled by default again (no longer opt-in).
[J. Cheyo Jimenez](https://github.com/masters3d)
Expand Down
2 changes: 2 additions & 0 deletions Source/SwiftLintFramework/Rules/TodoRule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public struct TodoRule: ConfigurationProviderRule {
message = message.stringByReplacingOccurrencesOfString("TODO", withString: "")
}
message = message.stringByReplacingOccurrencesOfString("//", withString: "")
// trim whitespace
message = message.stringByTrimmingCharactersInSet(.whitespaceAndNewlineCharacterSet())

// limiting the output length of todo message
let maxLengthOfMessage = 30
Expand Down