----------------------------------------------------------------------------- -- | -- Module : Lentil.Types -- Copyright : © 2015 Francesco Ariis -- License : GPLv3 (see the LICENSE file) -- -- Types descriptions ----------------------------------------------------------------------------- module Lentil.Types where import qualified Data.List as L data Issue = Issue { iFile :: FilePath, iRow :: Row, iDesc :: Description, iTags :: [Tag] } deriving (Eq, Show) data Tag = Tag { tagString :: String } deriving (Show, Eq, Ord) type Description = String type Row = Int -- output format data Format = TagPop | Pretty | Csv | Comp deriving (Show, Eq, Enum, Bounded) -- comp: as gcc/ghc would output warnings -- tag delimiters openDel, closeDel :: Char openDel = '[' closeDel = ']' -- eliminate "./" at the beginning of fp if present prettyFP :: String -> String prettyFP fp | L.isPrefixOf "./" fp = drop 2 fp | otherwise = fp