         for line in file.lines {
             let correctedLine = (line.content as NSString)
                 .stringByTrimmingTrailingCharactersInSet(whitespaceCharacterSet)
+
+            if configuration.ignoresEmptyLines && correctedLine.characters.isEmpty {
+                correctedLines.append(line.content)
+                continue
+            }
+
             let region = fileRegions.filter {
                 $0.contains(Location(file: file.path, line: line.index, character: 0))
             }.first

import Foundation
import SourceKittenFramework

public struct TrailingWhitespaceRule: CorrectableRule, ConfigurationProviderRule,
SourceKitFreeRule {

    public var configuration = SeverityConfiguration(.Warning)

    public init() {}


    )

    public func validateFile(file: File) -> [StyleViolation] {
        var filteredLines: [Line]
        if configuration.ignoresEmptyLines {
            filteredLines = file.lines.filter {
                // Ignores lines that contain nothing but whitespace = empty lines
                $0.content.hasTrailingWhitespace() && !$0.content.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()).isEmpty
            }
        } else {
            filteredLines = file.lines.filter {
                $0.content.hasTrailingWhitespace()
            }
        }

        return filteredLines.map {
            StyleViolation(ruleDescription: self.dynamicType.description,
                severity: configuration.severityConfiguration.severity,
                location: Location(file: file.path, line: $0.index))
        }
    }
