chore(debugging): convert trace ghc warnings to hlint warnings

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8700
GitOrigin-RevId: 29b1ee9172bb10823420de9555c3e22f9846facd
This commit is contained in:
Gil Mizrahi 2023-04-11 12:05:14 +03:00 committed by hasura-bot
parent 6df11fbf2c
commit 4696b60ec7
2 changed files with 21 additions and 4 deletions

View File

@ -71,6 +71,19 @@
within: []
message: "undefined isn't allowed"
## Trace debugging
- name: "ltrace"
within: []
message: "ltrace left in code"
- name: "ltraceM"
within: []
message: "ltraceM left in code"
- name: "traceToFile"
within: []
message: "traceToFile left in code"
- name: "traceToFileM"
within: []
message: "traceToFileM left in code"
################################################################################
# Ignore some builtin hints

View File

@ -299,12 +299,14 @@ tshow = T.pack . show
-- | Labeled, prettified 'traceShowId'.
ltrace :: Show a => String -> a -> a
ltrace lbl x = Debug.trace (lbl <> ": " <> TL.unpack (PS.pShow x)) x
{-# WARNING ltrace "ltrace left in code" #-}
{- HLINT ignore ltrace -}
-- | Labeled, prettified 'traceShowM'.
ltraceM :: Applicative m => Show a => String -> a -> m ()
ltraceM lbl x = Debug.traceM (lbl <> ": " <> TL.unpack (PS.pShow x))
{-# WARNING ltraceM "ltraceM left in code" #-}
{- HLINT ignore ltraceM -}
-- | Trace a prettified value to a file.
traceToFile :: Show a => FilePath -> a -> a
@ -312,7 +314,8 @@ traceToFile filepath x =
Debug.trace
("tracing to " <> filepath)
(unsafePerformIO (TLIO.writeFile filepath (PS.pShowNoColor x) $> x))
{-# WARNING traceToFile "traceToFile left in code" #-}
{- HLINT ignore traceToFile -}
-- | Trace a prettified value to a file in an Applicative context.
traceToFileM :: Applicative m => Show a => FilePath -> a -> m ()
@ -323,7 +326,8 @@ traceToFileM filepath x =
filepath,
show $ unsafePerformIO $ TLIO.writeFile filepath $ PS.pShowNoColor x
]
{-# WARNING traceToFileM "traceToFileM left in code" #-}
{- HLINT ignore traceToFileM -}
--------------------------------------------------------------------------------
-- Map-related utilities