     }
 
     public func correctFile(file: File) -> [Correction] {
-        guard let newLineCount = file.contents.leadingNewlineCount() where newLineCount != 0  else {
+        guard let spaceCount = file.contents.leadingNewlineAndWhiteSpaceCount()
+            where spaceCount != 0  else {
             return []
         }
         let region = file.regions().filter {

            return []
        }
        file.write(file.contents.substringFromIndex(
                file.contents.startIndex.advancedBy(newLineCount)))

        let location = Location(file: file.path, line: max(file.lines.count, 1))
        return [Correction(ruleDescription: self.dynamicType.description, location: location)]

        name: "Leading Whitespace",
        description: "Files should not contain leading whitespace.",
        nonTriggeringExamples: [ "//\n" ],
        triggeringExamples: [ "\n", " //\n" ],
        corrections: ["\n": ""]
    )

    public func validateFile(file: File) -> [StyleViolation] {
