nixfmt-0.3.0: An opinionated formatter for Nix

Safe HaskellNone
LanguageHaskell2010

Nixfmt

Synopsis

Documentation

errorBundlePretty #

Arguments

:: (Stream s, ShowErrorComponent e) 
=> ParseErrorBundle s e

Parse error bundle to display

-> String

Textual rendition of the bundle

Pretty-print a ParseErrorBundle. All ParseErrors in the bundle will be pretty-printed in order together with the corresponding offending lines by doing a single efficient pass over the input stream. The rendered String always ends with a newline.

Since: megaparsec-7.0.0

type ParseErrorBundle = ParseErrorBundle Text Void Source #

A megaparsec ParseErrorBundle specified for use with nixfmt.

format :: Int -> FilePath -> Text -> Either ParseErrorBundle Text Source #

format w filename source returns either a parsing error specifying a failure in filename or a formatted version of source with a maximum width of w columns where possible.