Skip to content

Commit 1a99018

Browse files
committed
Fix (some) HLint issues in wire-api
There are a lot left, but these ones should be safe to not change the application's behavior.
1 parent 3af4fe2 commit 1a99018

File tree

21 files changed

+33
-44
lines changed

21 files changed

+33
-44
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix some HLint issues in libs/wire-api.

libs/wire-api/src/Wire/API/Arbitrary.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
1+
{-# LANGUAGE DisambiguateRecordFields #-}
22
{-# LANGUAGE KindSignatures #-}
3-
{-# LANGUAGE RecordWildCards #-}
43
{-# LANGUAGE ScopedTypeVariables #-}
54
{-# OPTIONS_GHC -fno-warn-orphans #-}
65

libs/wire-api/src/Wire/API/Conversation/Member.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,12 @@ instance Arbitrary MemberUpdate where
252252

253253
validateMemberUpdate :: MemberUpdate -> Either String MemberUpdate
254254
validateMemberUpdate u =
255-
if ( isJust (mupOtrMuteStatus u)
256-
|| isJust (mupOtrMuteRef u)
257-
|| isJust (mupOtrArchive u)
258-
|| isJust (mupOtrArchiveRef u)
259-
|| isJust (mupHidden u)
260-
|| isJust (mupHiddenRef u)
261-
)
255+
if isJust (mupOtrMuteStatus u)
256+
|| isJust (mupOtrMuteRef u)
257+
|| isJust (mupOtrArchive u)
258+
|| isJust (mupOtrArchiveRef u)
259+
|| isJust (mupHidden u)
260+
|| isJust (mupHiddenRef u)
262261
then Right u
263262
else
264263
Left

libs/wire-api/src/Wire/API/Conversation/Role.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ instance FromJSON ConversationRole where
137137
parseJSON = A.withObject "conversationRole" $ \o -> do
138138
role <- o A..: "conversation_role"
139139
actions <- o A..: "actions"
140-
case (toConvRole role (Just $ Actions actions)) of
140+
case toConvRole role (Just $ Actions actions) of
141141
Just cr -> return cr
142142
Nothing -> fail ("Failed to parse: " ++ show o)
143143

libs/wire-api/src/Wire/API/CustomBackend.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
21
{-# LANGUAGE StrictData #-}
32

43
-- This file is part of the Wire Server implementation.

libs/wire-api/src/Wire/API/Push/V2/Token.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ data PushToken = PushToken
8383
deriving (Arbitrary) via (GenericUniform PushToken)
8484

8585
pushToken :: Transport -> AppName -> Token -> ClientId -> PushToken
86-
pushToken tp an tk cl = PushToken tp an tk cl
86+
pushToken = PushToken
8787

8888
modelPushToken :: Doc.Model
8989
modelPushToken = Doc.defineModel "PushToken" $ do

libs/wire-api/src/Wire/API/Routes/Internal/Brig/Connection.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE RecordWildCards #-}
1+
{-# LANGUAGE DisambiguateRecordFields #-}
22

33
-- This file is part of the Wire Server implementation.
44
--

libs/wire-api/src/Wire/API/Routes/MultiVerb.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ instance
325325
type ResponseStatus (WithHeaders hs a r) = ResponseStatus r
326326
type ResponseBody (WithHeaders hs a r) = ResponseBody r
327327

328-
responseRender acc x = fmap addHeaders $ responseRender @cs @r acc y
328+
responseRender acc x = addHeaders <$> responseRender @cs @r acc y
329329
where
330330
(hs, y) = toHeaders @xs x
331331
addHeaders r =

libs/wire-api/src/Wire/API/Routes/Public/Galley.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE DerivingVia #-}
2-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
32
{-# OPTIONS_GHC -Wno-orphans #-}
43

54
-- This file is part of the Wire Server implementation.

libs/wire-api/src/Wire/API/Team/Invitation.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ modelTeamInvitationRequest = Doc.defineModel "TeamInvitationRequest" $ do
7474

7575
instance ToJSON InvitationRequest where
7676
toJSON i =
77-
object $
77+
object
7878
[ "locale" .= irLocale i,
7979
"role" .= irRole i,
8080
"name" .= irInviteeName i,
@@ -137,7 +137,7 @@ modelTeamInvitation = Doc.defineModel "TeamInvitation" $ do
137137

138138
instance ToJSON Invitation where
139139
toJSON i =
140-
object $
140+
object
141141
[ "team" .= inTeam i,
142142
"role" .= inRole i,
143143
"id" .= inInvitation i,

0 commit comments

Comments
 (0)