1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Check.Src.LineLength where

import Curry.Position
import Curry.Span
import Text.Pretty

import Types
import State

checkLineLength :: SrcLine -> CSM ()
checkLineLength (n,l) = do
  c <- getConfig
  whenM (length l > (maxLineLength c))
        (report (Message
                  (Span
                    (Position n 1)
                    (Position n (length l)))
                  (text "line too long")
                  (text "line should be under"
                  <+> colorizeKey (show (maxLineLength c))
                  <+> text "character(s)")
                )
        )