Skip to content

Commit 05b68e4

Browse files
committed
fixup! fixup! Gardening code with hlint
1 parent 12764c6 commit 05b68e4

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

inline-c-cpp/test/tests.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ C.include "<stdexcept>"
1515

1616
main :: IO ()
1717
main = Hspec.hspec $ do
18-
Hspec.describe "Basic C++" $
18+
Hspec.describe "Basic C++" $ do
1919
Hspec.it "Hello World" $ do
2020
let x = 3
2121
[C.block| void {
@@ -128,3 +128,5 @@ main = Hspec.hspec $ do
128128
|]
129129

130130
result `Hspec.shouldBe` Right 0xDEADBEEF
131+
132+
{- HLINT ignore main "Redundant do" -}

inline-c/test/Language/C/Inline/ContextSpec.hs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,52 +26,52 @@ import Language.C.Inline.Context
2626

2727
spec :: Hspec.SpecWith ()
2828
spec = do
29-
Hspec.it "converts simple type correctly (1)" $
29+
Hspec.it "converts simple type correctly (1)" $ do
3030
shouldBeType (cty "int") [t| CInt |]
31-
Hspec.it "converts simple type correctly (2)" $
31+
Hspec.it "converts simple type correctly (2)" $ do
3232
shouldBeType (cty "char") [t| CChar |]
33-
Hspec.it "converts void" $
33+
Hspec.it "converts void" $ do
3434
shouldBeType (cty "void") [t| () |]
35-
Hspec.it "converts standard library types (1)" $
35+
Hspec.it "converts standard library types (1)" $ do
3636
shouldBeType (cty "FILE") [t| CFile |]
37-
Hspec.it "converts standard library types (2)" $
37+
Hspec.it "converts standard library types (2)" $ do
3838
shouldBeType (cty "uint16_t") [t| Word16 |]
39-
Hspec.it "converts standard library types (3)" $
39+
Hspec.it "converts standard library types (3)" $ do
4040
shouldBeType (cty "jmp_buf") [t| CJmpBuf |]
41-
Hspec.it "converts single ptr type" $
41+
Hspec.it "converts single ptr type" $ do
4242
shouldBeType (cty "long*") [t| Ptr CLong |]
43-
Hspec.it "converts double ptr type" $
43+
Hspec.it "converts double ptr type" $ do
4444
shouldBeType (cty "unsigned long**") [t| Ptr (Ptr CULong) |]
45-
Hspec.it "converts arrays" $
45+
Hspec.it "converts arrays" $ do
4646
shouldBeType (cty "double[]") [t| CArray CDouble |]
47-
Hspec.it "converts named things" $
47+
Hspec.it "converts named things" $ do
4848
shouldBeType (cty "unsigned int foo[]") [t| CArray CUInt |]
49-
Hspec.it "converts arrays of pointers" $
49+
Hspec.it "converts arrays of pointers" $ do
5050
shouldBeType
5151
(cty "unsigned short *foo[]") [t| CArray (Ptr CUShort) |]
52-
Hspec.it "ignores qualifiers" $
52+
Hspec.it "ignores qualifiers" $ do
5353
shouldBeType (cty "const short*") [t| Ptr CShort |]
54-
Hspec.it "ignores storage information" $
54+
Hspec.it "ignores storage information" $ do
5555
shouldBeType (cty "extern unsigned long") [t| CULong |]
56-
Hspec.it "converts sized arrays" $
56+
Hspec.it "converts sized arrays" $ do
5757
shouldBeType (cty "float[4]") [t| CArray CFloat |]
58-
Hspec.it "converts variably sized arrays" $
58+
Hspec.it "converts variably sized arrays" $ do
5959
shouldBeType (cty "float[*]") [t| CArray CFloat |]
60-
Hspec.it "converts function pointers" $
60+
Hspec.it "converts function pointers" $ do
6161
shouldBeType
6262
(cty "int (*f)(unsigned char, float)")
6363
[t| FunPtr (CUChar -> CFloat -> IO CInt) |]
64-
Hspec.it "converts complicated function pointers (1)" $
64+
Hspec.it "converts complicated function pointers (1)" $ do
6565
-- pointer to function returning pointer to function returning int
6666
shouldBeType
6767
(cty "int (*(*)())()") [t| FunPtr (IO (FunPtr (IO CInt))) |]
68-
Hspec.it "converts complicated function pointerst (2)" $
68+
Hspec.it "converts complicated function pointerst (2)" $ do
6969
-- foo is an array of pointer to pointer to function returning
7070
-- pointer to array of pointer to char
7171
shouldBeType
7272
(cty "char *(*(**foo [])())[]")
7373
[t| CArray (Ptr (FunPtr (IO (Ptr (CArray (Ptr CChar)))))) |]
74-
Hspec.it "converts complicated function pointers (3)" $
74+
Hspec.it "converts complicated function pointers (3)" $ do
7575
-- foo is an array of pointer to pointer to function taking int
7676
-- returning pointer to array of pointer to char
7777
shouldBeType
@@ -97,3 +97,5 @@ spec = do
9797
cty s = C.parameterDeclarationType $ assertParse C.parseParameterDeclaration s
9898

9999
baseTypes = ctxTypesTable baseCtx
100+
101+
{- HLINT ignore spec "Redundant do" -}

0 commit comments

Comments
 (0)