Skip to content

Commit cd5e753

Browse files
committed
Warn on use of unsafe decodeUtf8
1 parent 02966a1 commit cd5e753

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

data/hlint.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
- import Data.Attoparsec.Text
5252
- import Data.Attoparsec.ByteString
5353

54+
- package:
55+
name: text
56+
modules:
57+
- import Data.Text
58+
- import Data.Text.Encoding
59+
5460
- package:
5561
name: codeworld-api
5662
modules:
@@ -869,6 +875,14 @@
869875
- warn: {lhs: Data.Attoparsec.Text.option Nothing (Just <$> p), rhs: optional p}
870876
- warn: {lhs: Data.Attoparsec.ByteString.option Nothing (Just <$> p), rhs: optional p}
871877

878+
- group:
879+
name: text
880+
enabled: true
881+
imports:
882+
- package text
883+
rules:
884+
- warn: {lhs: decodeUtf8, rhs: decodeUtf8', name: Avoid decodeUtf8}
885+
872886
- group:
873887
name: generalise
874888
enabled: false
@@ -1235,6 +1249,10 @@
12351249
# issue1183 = (a >= 'a') && (a <= 'z') -- isAsciiLower a
12361250
# issue1218 = uncurry (zipWith g) $ (a, b) -- zipWith g a b
12371251

1252+
# import Data.Text
1253+
# import Data.Text.Encoding
1254+
# yes = decodeUtf8 -- decodeUtf8'
1255+
12381256
# import Language.Haskell.TH\
12391257
# yes = varE 'foo -- [|foo|]
12401258
# import Prelude \

0 commit comments

Comments
 (0)