Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hlint warnings #4837

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .hlint.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


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

# Specify additional command line arguments
#
Expand Down
4 changes: 1 addition & 3 deletions bench/locli/app/locli.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{-# LANGUAGE OverloadedStrings #-}

import Cardano.Prelude hiding (option)

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

import Cardano.TopHandler
import Cardano.Command (opts, pref, renderCommandError, runCommand)
import Cardano.TopHandler


main :: IO ()
Expand Down
2 changes: 1 addition & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ runQueryStakePools (AnyConsensusModeParams cModeParams)

sbe <- getSbe $ cardanoEraStyle era

lift (queryExpr (QueryInEra eInMode $ QueryInShelleyBasedEra sbe $ QueryStakePools))
lift (queryExpr (QueryInEra eInMode $ QueryInShelleyBasedEra sbe QueryStakePools))
& onLeft (left . ShelleyQueryCmdUnsupportedNtcVersion)
& onLeft (left . ShelleyQueryCmdEraMismatch)
) & onLeft (left . ShelleyQueryCmdAcquireFailure)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}

module Cardano.Tracer.Handlers.RTView.State.EraSettings
( EraSettings (..)
, ErasSettings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}

module Cardano.Tracer.Handlers.RTView.Update.Reload
Expand Down
1 change: 0 additions & 1 deletion cardano-tracer/src/Cardano/Tracer/Run.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}

-- | This top-level module is used by 'cardano-tracer' app.
module Cardano.Tracer.Run
Expand Down
2 changes: 1 addition & 1 deletion trace-dispatcher/src/Cardano/Logging/FrequencyLimiter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ limitFrequency thresholdFrequency limiterName vtracer ltracer = do
then 10.0
else thresholdPeriod / elapsedTime
let spendReward = if rawSpendReward < 1.0 && rawSpendReward > 0.0
then - ((1.0 / rawSpendReward) - 1.0)
then 1.0 - (1.0 / rawSpendReward)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this change @kosyrevSerge

else rawSpendReward - 1.0
-- Normalize so that (0.0-10.0) means message
-- arrive quicker then threshold
Expand Down
11 changes: 5 additions & 6 deletions trace-forward/src/Trace/Forward/Run/DataPoint/Acceptor.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}

module Trace.Forward.Run.DataPoint.Acceptor
Expand All @@ -8,21 +7,21 @@ module Trace.Forward.Run.DataPoint.Acceptor
) where

import qualified Codec.Serialise as CBOR
import Control.Concurrent.STM.TMVar (putTMVar)
import Control.Concurrent.STM.TVar (modifyTVar', readTVar, readTVarIO)
import Control.Exception (finally)
import Control.Monad (unless)
import Control.Monad.Extra (ifM)
import Control.Monad.STM (atomically, check)
import Control.Concurrent.STM.TVar (modifyTVar', readTVar, readTVarIO)
import Control.Concurrent.STM.TMVar (putTMVar)
import qualified Data.ByteString.Lazy as LBS
import Data.Void (Void)
import Ouroboros.Network.Mux (MuxMode (..), MuxPeer (..), RunMiniProtocol (..))
import Ouroboros.Network.Driver.Simple (runPeer)
import Ouroboros.Network.Mux (MuxMode (..), MuxPeer (..), RunMiniProtocol (..))

import Trace.Forward.Configuration.DataPoint (AcceptorConfiguration (..))
import qualified Trace.Forward.Protocol.DataPoint.Acceptor as Acceptor
import qualified Trace.Forward.Protocol.DataPoint.Codec as Acceptor
import Trace.Forward.Protocol.DataPoint.Type (DataPointName)
import Trace.Forward.Configuration.DataPoint (AcceptorConfiguration (..))
import Trace.Forward.Utils.DataPoint (DataPointRequestor (..))

acceptDataPointsInit
Expand All @@ -46,7 +45,7 @@ runPeerWithRequestor
-> IO DataPointRequestor
-> IO ()
-> MuxPeer LBS.ByteString IO ()
runPeerWithRequestor config mkDPRequestor peerErrorHandler =
runPeerWithRequestor config mkDPRequestor peerErrorHandler =
MuxPeerRaw $ \channel -> do
dpRequestor <- mkDPRequestor
runPeer
Expand Down