Skip to content

Commit

Permalink
Merge pull request #801 from wbagdon/patch-1
Browse files Browse the repository at this point in the history
Remove whitespace from TODO message
  • Loading branch information
jpsim authored Sep 2, 2016
2 parents 38a7cc5 + fddc848 commit ed73db3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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.
[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

0 comments on commit ed73db3

Please sign in to comment.