git.iko.soy/typeable/minio-hs
on master help sign in
Enable partial fields warning (#179)

- Updates exported type `EventMessage` - so avoid exporting partial functions.

commite06bb4c949c88283d2f3acc79e9375c7579ca8fe authorAditya Manthramurthy <donatello@users.noreply.github.com> dateTue 4 Oct 2022, 09:25 (4 years ago) parentd82b093
4 files changed+15−29
CHANGELOG.md+4 Setup.hs−19 minio-hs.cabal+4−4 src/Network/Minio/Data.hs+7−6
CHANGELOG.md+4
@@ -1,6 +1,10 @@
11Changelog
22==========
33
4+## Version 1.7.0 -- Unreleased
5+
6+* Fix data type `EventMessage` to not export partial fields
7+
48## Version 1.6.0
59
610* HLint fixes - some types were changed to newtype (#173)
Setup.hsdeleted−19
@@ -1,19 +0,0 @@
1−--
2−-- MinIO Haskell SDK, (C) 2017 MinIO, Inc.
3−--
4−-- Licensed under the Apache License, Version 2.0 (the "License");
5−-- you may not use this file except in compliance with the License.
6−-- You may obtain a copy of the License at
7−--
8−-- http://www.apache.org/licenses/LICENSE-2.0
9−--
10−-- Unless required by applicable law or agreed to in writing, software
11−-- distributed under the License is distributed on an "AS IS" BASIS,
12−-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13−-- See the License for the specific language governing permissions and
14−-- limitations under the License.
15−--
16−
17−import Distribution.Simple
18−
19−main = defaultMain
minio-hs.cabal+4−4
@@ -1,4 +1,4 @@
1−cabal-version: 2.2
1+cabal-version: 2.4
22name: minio-hs
33version: 1.6.0
44synopsis: A MinIO Haskell Library for Amazon S3 compatible cloud
@@ -44,9 +44,9 @@ common base-settings
4444
4545 -- Add this when we have time. Fixing partial-fields requires major version
4646 -- bump at this time.
47− -- if impl(ghc >= 8.4)
48− -- ghc-options: -Wpartial-fields
49− -- -Wmissing-export-lists
47+ if impl(ghc >= 8.4)
48+ ghc-options: -Wpartial-fields
49+ -- -Wmissing-export-lists
5050
5151 if impl(ghc >= 8.8)
5252 ghc-options: -Wmissing-deriving-strategies
src/Network/Minio/Data.hs+7−6
@@ -963,13 +963,14 @@ outputJSONFromRecordDelimiter t =
963963
964964-- | An EventMessage represents each kind of message received from the server.
965965data EventMessage
966− = ProgressEventMessage {emProgress :: Progress}
967− | StatsEventMessage {emStats :: Stats}
966+ = ProgressEventMessage Progress
967+ | StatsEventMessage Stats
968968 | RequestLevelErrorMessage
969− { emErrorCode :: Text,
970− emErrorMessage :: Text
971− }
972− | RecordPayloadEventMessage {emPayloadBytes :: ByteString}
969+ Text
970+ -- ^ Error code
971+ Text
972+ -- ^ Error message
973+ | RecordPayloadEventMessage ByteString
973974 deriving stock (Show, Eq)
974975
975976data MsgHeaderName