Skip to content

Commit

Permalink
Use -Werror on CI (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-and-witch committed Jun 27, 2024
1 parent ed7169d commit f4f2ee4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
key: ${{ runner.os }}-v2-${{ matrix.ghc }}-${{ github.run_id }}
restore-keys: ${{ runner.os }}-v2-${{ matrix.ghc }}-
- run: |
cabal build all -fexamples
cabal build all -fexamples --ghc-options=-Werror
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ instance ToMultipart Tmp SendDocumentRequest where
= (FileData "file" (T.pack $ takeFileName path) ct path)
: maybe [] (\t -> [FileData "thumbnail" (T.pack $ takeFileName t) "image/jpeg" t]) sendDocumentThumbnail

DocumentFile path ct = sendDocumentDocument
(path, ct) = case sendDocumentDocument of
DocumentFile path' ct' -> (path', ct')
_ -> error "ToMultipart Tmp SendDocumentRequest: cannot use multipart for links or file ids"


instance ToJSON SendDocumentRequest where toJSON = gtoJSON
Expand Down
4 changes: 3 additions & 1 deletion telegram-bot-api/src/Telegram/Bot/API/Methods/SendPhoto.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ instance ToMultipart Tmp SendPhotoRequest where
= (FileData "file" (T.pack $ takeFileName path) ct path)
: maybe [] (\t -> [FileData "thumb" (T.pack $ takeFileName t) "image/jpeg" t]) sendPhotoThumb

PhotoFile path ct = sendPhotoPhoto
(path, ct) = case sendPhotoPhoto of
PhotoFile path' ct' -> (path', ct')
_ -> error "ToMultipart Tmp SendPhotoRequest: cannot use multipart for links or file ids"

instance ToJSON SendPhotoRequest where toJSON = gtoJSON

Expand Down
4 changes: 2 additions & 2 deletions telegram-bot-simple/examples/EchoBot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ updateToAction update _
Just $ InlineEcho queryId msg
| isJust $ updateMessageSticker update = do
fileId <- stickerFileId <$> updateMessageSticker update
chatId <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatId
chatOfUser <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatOfUser
| otherwise = case updateMessageText update of
Just text -> Just (Echo text)
Nothing -> Nothing
Expand Down
4 changes: 2 additions & 2 deletions telegram-bot-simple/examples/EchoBotWebhook.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ updateToAction update _
Just $ InlineEcho queryId msg
| isJust $ updateMessageSticker update = do
fileId <- stickerFileId <$> updateMessageSticker update
chatId <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatId
chatOfUser <- updateChatId update
pure $ StickerEcho (InputFileId fileId) chatOfUser
| otherwise = case updateMessageText update of
Just text -> Just (Echo text)
Nothing -> Nothing
Expand Down
1 change: 1 addition & 0 deletions telegram-bot-simple/src/Telegram/Bot/Simple/Reply.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ replyMessageToSendMessageRequest :: SomeChatId -> ReplyMessage -> SendMessageReq
replyMessageToSendMessageRequest someChatId ReplyMessage{..} = SendMessageRequest
{ sendMessageChatId = someChatId
, sendMessageBusinessConnectionId = Nothing
, sendMessageMessageEffectId = Nothing
, sendMessageMessageThreadId = replyMessageMessageThreadId
, sendMessageText = replyMessageText
, sendMessageParseMode = replyMessageParseMode
Expand Down

0 comments on commit f4f2ee4

Please sign in to comment.