Skip to content

Commit b19401f

Browse files
authored
Merge pull request #4837 from input-output-hk/newhoggy/fix-hlint-warnings
Fix hlint warnings
2 parents cf7c3f7 + 254caba commit b19401f

File tree

8 files changed

+9
-16
lines changed

8 files changed

+9
-16
lines changed

.hlint.template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
# Warnings currently triggered by your code
10-
# - ignore: {name: "Move brackets to avoid $"}
10+
- ignore: {name: "Move brackets to avoid $"}
1111

1212
# Specify additional command line arguments
1313
#

bench/locli/app/locli.hs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
{-# LANGUAGE OverloadedStrings #-}
2-
31
import Cardano.Prelude hiding (option)
42

53
import Control.Monad.Trans.Except.Exit (orDie)
64
import qualified Options.Applicative as Opt
75

8-
import Cardano.TopHandler
96
import Cardano.Command (opts, pref, renderCommandError, runCommand)
7+
import Cardano.TopHandler
108

119

1210
main :: IO ()

cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ runQueryStakePools (AnyConsensusModeParams cModeParams)
10361036

10371037
sbe <- getSbe $ cardanoEraStyle era
10381038

1039-
lift (queryExpr (QueryInEra eInMode $ QueryInShelleyBasedEra sbe $ QueryStakePools))
1039+
lift (queryExpr (QueryInEra eInMode $ QueryInShelleyBasedEra sbe QueryStakePools))
10401040
& onLeft (left . ShelleyQueryCmdUnsupportedNtcVersion)
10411041
& onLeft (left . ShelleyQueryCmdEraMismatch)
10421042
) & onLeft (left . ShelleyQueryCmdAcquireFailure)

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/State/EraSettings.hs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE OverloadedStrings #-}
2-
31
module Cardano.Tracer.Handlers.RTView.State.EraSettings
42
( EraSettings (..)
53
, ErasSettings

cardano-tracer/src/Cardano/Tracer/Handlers/RTView/Update/Reload.hs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE OverloadedStrings #-}
21
{-# LANGUAGE ScopedTypeVariables #-}
32

43
module Cardano.Tracer.Handlers.RTView.Update.Reload

cardano-tracer/src/Cardano/Tracer/Run.hs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE NamedFieldPuns #-}
2-
{-# LANGUAGE OverloadedStrings #-}
32

43
-- | This top-level module is used by 'cardano-tracer' app.
54
module Cardano.Tracer.Run

trace-dispatcher/src/Cardano/Logging/FrequencyLimiter.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ limitFrequency thresholdFrequency limiterName vtracer ltracer = do
138138
then 10.0
139139
else thresholdPeriod / elapsedTime
140140
let spendReward = if rawSpendReward < 1.0 && rawSpendReward > 0.0
141-
then - ((1.0 / rawSpendReward) - 1.0)
141+
then 1.0 - (1.0 / rawSpendReward)
142142
else rawSpendReward - 1.0
143143
-- Normalize so that (0.0-10.0) means message
144144
-- arrive quicker then threshold

trace-forward/src/Trace/Forward/Run/DataPoint/Acceptor.hs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE DataKinds #-}
2-
{-# LANGUAGE OverloadedStrings #-}
32
{-# LANGUAGE NamedFieldPuns #-}
43

54
module Trace.Forward.Run.DataPoint.Acceptor
@@ -8,21 +7,21 @@ module Trace.Forward.Run.DataPoint.Acceptor
87
) where
98

109
import qualified Codec.Serialise as CBOR
10+
import Control.Concurrent.STM.TMVar (putTMVar)
11+
import Control.Concurrent.STM.TVar (modifyTVar', readTVar, readTVarIO)
1112
import Control.Exception (finally)
1213
import Control.Monad (unless)
1314
import Control.Monad.Extra (ifM)
1415
import Control.Monad.STM (atomically, check)
15-
import Control.Concurrent.STM.TVar (modifyTVar', readTVar, readTVarIO)
16-
import Control.Concurrent.STM.TMVar (putTMVar)
1716
import qualified Data.ByteString.Lazy as LBS
1817
import Data.Void (Void)
19-
import Ouroboros.Network.Mux (MuxMode (..), MuxPeer (..), RunMiniProtocol (..))
2018
import Ouroboros.Network.Driver.Simple (runPeer)
19+
import Ouroboros.Network.Mux (MuxMode (..), MuxPeer (..), RunMiniProtocol (..))
2120

21+
import Trace.Forward.Configuration.DataPoint (AcceptorConfiguration (..))
2222
import qualified Trace.Forward.Protocol.DataPoint.Acceptor as Acceptor
2323
import qualified Trace.Forward.Protocol.DataPoint.Codec as Acceptor
2424
import Trace.Forward.Protocol.DataPoint.Type (DataPointName)
25-
import Trace.Forward.Configuration.DataPoint (AcceptorConfiguration (..))
2625
import Trace.Forward.Utils.DataPoint (DataPointRequestor (..))
2726

2827
acceptDataPointsInit
@@ -46,7 +45,7 @@ runPeerWithRequestor
4645
-> IO DataPointRequestor
4746
-> IO ()
4847
-> MuxPeer LBS.ByteString IO ()
49-
runPeerWithRequestor config mkDPRequestor peerErrorHandler =
48+
runPeerWithRequestor config mkDPRequestor peerErrorHandler =
5049
MuxPeerRaw $ \channel -> do
5150
dpRequestor <- mkDPRequestor
5251
runPeer

0 commit comments

Comments
 (0)