jfmengels / elm-review-reporter / Reporter

Formats the result of elm-review in a nice human-readable way.

Types


type alias Error =
{ moduleName : Maybe String
, ruleName : String
, message : String
, details : List String
, range : Range
, hasFix : Basics.Bool 
}

Contents of an error. Convert the errors from Review to this type.


type alias File =
{ path : String
, source : String 
}

Represents a file.


type alias TextContent =
{ str : String
, color : Maybe ( Basics.Int
, Basics.Int
, Basics.Int )
, backgroundColor : Maybe ( Basics.Int
, Basics.Int
, Basics.Int ) 
}

Represents styled text.

Formatter functions return a list of these, that should be styled in the viewing medium according to the associated colors and joined together without spaces.

Report


type Mode
    = Reviewing
    | Fixing

Mode in which elm-review is running.

formatReport : Mode -> List ( File, List Error ) -> List TextContent

Reports the errors reported by elm-review in a nice human-readable way.

Fix

formatFixProposal : File -> Error -> String -> List TextContent

Reports a fix proposal for a single error reported by elm-review in a nice human-readable way.