Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data CheckResult
- checkFile :: TabSize -> Verbose -> FilePath -> IO CheckResult
- data LineError = LineError Int Text
- displayLineError :: FilePath -> LineError -> Text
- transform :: TabSize -> Text -> Text
- transformWithLog :: TabSize -> Text -> (Text, [LineError])
- type TabSize = Int
- type Verbose = Bool
- defaultTabSize :: TabSize
Documentation
data CheckResult Source #
Result of checking a file against the whitespace policy.
CheckOK | The file satifies the policy. |
CheckViolation Text [LineError] | The file violates the policy, a fix and a list of violating lines are returned. |
CheckIOError IOException | An I/O error occurred while accessing the file. (E.g., the file is not UTF8 encoded.) |
checkFile :: TabSize -> Verbose -> FilePath -> IO CheckResult Source #
Check a file against the whitespace policy, returning a fix if violations occurred.
Represents a line of input violating whitespace rules. Stores the index of the line and the line itself.
displayLineError :: FilePath -> LineError -> Text Source #
Print a erroneous line with visibleSpaces
.
:: TabSize | Expand tab characters to so many spaces. Keep tabs if |
-> Text | Text before transformation. |
-> (Text, [LineError]) | Text after transformation and violating lines if any. |
Transforms the contents of a file.
defaultTabSize :: TabSize Source #
Default tab size.