mirror of
https://github.com/Mesabloo/diagnose.git
synced 2024-09-11 11:26:56 +03:00
*: fix various warnings
This commit is contained in:
parent
e2cbf2c3f5
commit
6c1516ebb2
@ -36,7 +36,7 @@ library
|
||||
OverloadedStrings
|
||||
LambdaCase
|
||||
BlockArguments
|
||||
ghc-options: -Wall -Wextra -Wmissing-local-signatures -Wmonomorphism-restriction
|
||||
ghc-options: -Wall -Wextra
|
||||
build-depends:
|
||||
aeson ==1.5.6.0
|
||||
, ansi-wl-pprint ==0.6.9
|
||||
@ -58,7 +58,7 @@ test-suite diagnose-tests
|
||||
OverloadedStrings
|
||||
LambdaCase
|
||||
BlockArguments
|
||||
ghc-options: -Wall -Wextra -Wmissing-local-signatures -Wmonomorphism-restriction -threaded -rtsopts -with-rtsopts=-N -O0 -g
|
||||
ghc-options: -Wall -Wextra -threaded -rtsopts -with-rtsopts=-N -O0 -g
|
||||
build-depends:
|
||||
aeson ==1.5.6.0
|
||||
, ansi-wl-pprint ==0.6.9
|
||||
|
@ -25,8 +25,8 @@ library:
|
||||
ghc-options:
|
||||
- -Wall
|
||||
- -Wextra
|
||||
- -Wmissing-local-signatures
|
||||
- -Wmonomorphism-restriction
|
||||
# - -Wmissing-local-signatures
|
||||
# - -Wmonomorphism-restriction
|
||||
|
||||
tests:
|
||||
diagnose-tests:
|
||||
|
@ -320,8 +320,6 @@ showAllMarkersInLine hasMultilines colorMultilinePrefix withUnicode isError left
|
||||
nubbedPipes = List.nubBy ((==) `on` (begin . fst)) filteredPipes
|
||||
-- and then remove all duplicates
|
||||
|
||||
allPreviousPipes = nubbedPipes <&> second \ marker -> markerColor isError marker (text if withUnicode then "│" else "|")
|
||||
|
||||
allColumns _ [] = (1, [])
|
||||
allColumns n ms@((Position (_, bc) _ _, col) : ms')
|
||||
| n == bc = bimap (+ 1) (col :) (allColumns (n + 1) ms')
|
||||
|
11
test/Spec.hs
11
test/Spec.hs
@ -1,3 +1,5 @@
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
|
||||
import Error.Diagnose
|
||||
( printDiagnostic,
|
||||
diagnosticToJson,
|
||||
@ -5,22 +7,21 @@ import Error.Diagnose
|
||||
err,
|
||||
warn,
|
||||
Marker(..),
|
||||
Diagnostic(..),
|
||||
Report,
|
||||
Position(..),
|
||||
addFile,
|
||||
addReport,
|
||||
def )
|
||||
|
||||
import qualified Data.ByteString.Lazy as BS
|
||||
import Data.HashMap.Lazy (HashMap)
|
||||
import qualified Data.HashMap.Lazy as HashMap
|
||||
|
||||
import System.IO (hPutStrLn, hFlush)
|
||||
import Data.List (foldl')
|
||||
import qualified Data.ByteString.Lazy as BS
|
||||
import System.IO (hPutStrLn)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let files = HashMap.fromList
|
||||
let files :: HashMap FilePath String = HashMap.fromList
|
||||
[ ("test.zc", "let id<a>(x : a) : a := x + 1\nrec fix(f) := f(fix(f))\nlet const<a, b>(x : a, y : b) : a := x")
|
||||
, ("somefile.zc", "let id<a>(x : a) : a := x\n + 1")
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user