Enable partial fields warning (#179)

- Updates exported type `EventMessage` - so avoid exporting partial
functions.
This commit is contained in:
Aditya Manthramurthy 2022-10-04 09:25:39 -07:00 committed by GitHub
parent d82b093b6b
commit e06bb4c949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 29 deletions

View File

@ -1,6 +1,10 @@
Changelog
==========
## Version 1.7.0 -- Unreleased
* Fix data type `EventMessage` to not export partial fields
## Version 1.6.0
* HLint fixes - some types were changed to newtype (#173)

View File

@ -1,19 +0,0 @@
--
-- MinIO Haskell SDK, (C) 2017 MinIO, Inc.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
import Distribution.Simple
main = defaultMain

View File

@ -1,4 +1,4 @@
cabal-version: 2.2
cabal-version: 2.4
name: minio-hs
version: 1.6.0
synopsis: A MinIO Haskell Library for Amazon S3 compatible cloud
@ -44,9 +44,9 @@ common base-settings
-- Add this when we have time. Fixing partial-fields requires major version
-- bump at this time.
-- if impl(ghc >= 8.4)
-- ghc-options: -Wpartial-fields
-- -Wmissing-export-lists
if impl(ghc >= 8.4)
ghc-options: -Wpartial-fields
-- -Wmissing-export-lists
if impl(ghc >= 8.8)
ghc-options: -Wmissing-deriving-strategies

View File

@ -963,13 +963,14 @@ outputJSONFromRecordDelimiter t =
-- | An EventMessage represents each kind of message received from the server.
data EventMessage
= ProgressEventMessage {emProgress :: Progress}
| StatsEventMessage {emStats :: Stats}
= ProgressEventMessage Progress
| StatsEventMessage Stats
| RequestLevelErrorMessage
{ emErrorCode :: Text,
emErrorMessage :: Text
}
| RecordPayloadEventMessage {emPayloadBytes :: ByteString}
Text
-- ^ Error code
Text
-- ^ Error message
| RecordPayloadEventMessage ByteString
deriving stock (Show, Eq)
data MsgHeaderName