Fix linting errors. (yay hlint!)

[?]
Oct 6, 2015, 9:12 PM
7HPY3QPFPN35PSPUBVNW2GTFB3CBQZBST4J2BAVJ7QMXLIUN52JAC

Dependencies

  • [2] 2XQD6KKK Add invitation logic and clean up DBProg error handling.
  • [3] 2OIPAQCB Merge branch 'master' of github.com:nuttycom/ananke
  • [4] 7XN3I3QJ Add 'loggedIntervals' endpoint.
  • [5] 7KZP4RHZ Switch from Data.Time to Data.Thyme
  • [6] Z7KS5XHH Very WIP. Wow.
  • [7] EMVTF2IW WIP moving back to snap.
  • [8] 5DRIWGLU Improving TimeLog specs
  • [9] A6HKMINB Attempting to improve JSON handling.
  • [10] LD4GLVSF More database stuff.
  • [11] 75N3UJ4J More progression toward lenses.
  • [12] N4NDAZYT Initial implementation of payouts.
  • [13] SLL7262C Make depreciation functions more flexible.
  • [14] SCXG6TJW Make log reduction safer in presence of overlapping events.
  • [15] W35DDBFY Factor common JSON conversions up into client lib module.
  • [16] GCVQD44V Create amends endpoint, switch to UUID primary keys
  • [17] KNSI575V Cleanup of EventLog types.
  • [18] QMRKFEPG Refactor QDB to use a free monad algebra instead.
  • [19] 4QX5E5AC Initial compilation of payouts function succeeds.
  • [20] WO2MINIF Auctions now compile!
  • [21] 2G3GNDDU Event logging is now functioning in postgres.
  • [22] TLQ72DSJ Lenses, sqlite-simple
  • [23] PBD7LZYQ Postgres & auth are beginning to function.
  • [24] XTBSG4C7 Adding serveJSON combinator to eliminate some boilerplate from handlers.
  • [25] 7DBNV3GV Initial, stack-based impl of time log event reduction.
  • [26] 4U7F3CPI THE GREAT RENAMING OF THINGS!
  • [27] Y35QCWYW Minor improvement in WorkIndex type to eliminate duplicated information.
  • [28] ZITLSTYX Fix problems with SQL queries & depreciation function parsing.
  • [29] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [30] TNR3TEHK Switch to Postgres + snaplet arch compiles.
  • [31] O5FVTOM6 Undo JSON silliness, enable a couple more routes.
  • [32] EQXRXRZD Changed to use tasty instead of test-framework
  • [33] RPAJLHMT Change to use UUIDs instead of ints for primary keys.
  • [*] LAROLAYU WIP
  • [*] NVOCQVAS Initial failing tests.

Change contents

  • replacement in lib/Aftok/Auction.hs at line 49
    [3.165][3.165:227]()
    x : (takeWinningBids (total + (x ^. bidAmount)) xs)
    [3.165]
    [3.652]
    x : takeWinningBids (total + (x ^. bidAmount)) xs
  • replacement in lib/Aftok/Auction.hs at line 55
    [3.403][3.581:677](),[3.581][3.581:677]()
    remainderSeconds = Seconds . round $ winFraction * (toRational $ x ^. bidSeconds)
    [3.403]
    [3.925]
    remainderSeconds = Seconds . round $ winFraction * toRational (x ^. bidSeconds)
  • replacement in lib/Aftok/Auction.hs at line 62
    [3.1147][3.404:454]()
    in takeWinningBids (fromInteger 0) $ sort bids
    [3.1147]
    in takeWinningBids 0 $ sort bids
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 174
    [3.1808][3.975:1059]()
    dbEval (FindEvent (EventId eid)) = do
    logEntries <- pquery qdbLogEntryParser
    [3.1808]
    [3.1059]
    dbEval (FindEvent (EventId eid)) =
    headMay <$> pquery qdbLogEntryParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 179
    [3.1200][3.1200:1230]()
    pure $ headMay logEntries
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 181
    [3.1289][3.1289:1323]()
    let q p (Before e) = pquery p
    [3.1289]
    [3.1323]
    let q (Before e) = pquery logEntryParser
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 185
    [2.2836][3.1512:1548](),[3.1512][3.1512:1548]()
    q p (During s e) = pquery p
    [2.2836]
    [3.1548]
    q (During s e) = pquery logEntryParser
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 190
    [2.2884][3.1782:1815](),[3.1782][3.1782:1815]()
    q p (After s) = pquery p
    [2.2884]
    [3.1815]
    q (After s) = pquery logEntryParser
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 194
    [2.2919][3.2004:2034](),[3.2004][3.2004:2034]()
    in q logEntryParser ival
    [2.2919]
    [3.1083]
    in q ival
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 214
    [3.2942][2.2967:2986]()
    (Only $ pid)
    [3.2942]
    [3.2966]
    (Only pid)
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 221
    [3.3162][2.2987:3079]()
    (pid ^. (_ProjectId), auc ^. (raiseAmount.to PBTC), auc ^. (auctionEnd.to fromThyme))
    [3.3162]
    [3.5182]
    (pid ^. _ProjectId, auc ^. (raiseAmount.to PBTC), auc ^. (auctionEnd.to fromThyme))
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 223
    [3.5183][3.3240:3311]()
    dbEval (FindAuction aucId) = do
    auctions <- pquery auctionParser
    [3.5183]
    [3.3311]
    dbEval (FindAuction aucId) =
    headMay <$> pquery auctionParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 227
    [3.3412][3.3412:3440]()
    pure $ headMay auctions
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 242
    [3.3939][3.3939:3976]()
    (Only $ (aucId ^. _AuctionId))
    [3.3939]
    [3.667]
    (Only (aucId ^. _AuctionId))
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 249
    [3.705][3.4201:4270]()
    dbEval (FindUser (UserId uid)) = do
    users <- pquery userParser
    [3.705]
    [3.4270]
    dbEval (FindUser (UserId uid)) =
    headMay <$> pquery userParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 253
    [3.4350][3.4350:4375]()
    pure $ headMay users
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 254
    [3.1369][3.4376:4454]()
    dbEval (FindUserByName (UserName h)) = do
    users <- pquery qdbUserParser
    [3.1369]
    [3.4454]
    dbEval (FindUserByName (UserName h)) =
    headMay <$> pquery qdbUserParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 258
    [3.4540][3.4540:4565]()
    pure $ headMay users
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 267
    [3.3742][2.3557:3634]()
    dbEval (FindInvitation ic) = do
    invitations <- pquery invitationParser
    [3.3742]
    [2.3634]
    dbEval (FindInvitation ic) =
    headMay <$> pquery invitationParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 272
    [2.3804][2.3804:3835]()
    pure $ headMay invitations
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 290
    [3.947][3.4843:4924]()
    dbEval (FindProject (ProjectId pid)) = do
    projects <- pquery projectParser
    [3.947]
    [3.4]
    dbEval (FindProject (ProjectId pid)) =
    headMay <$> pquery projectParser
  • edit in lib/Aftok/Database/PostgreSQL.hs at line 294
    [3.5026][3.5026:5054]()
    pure $ headMay projects
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 303
    [3.1043][3.5466:5532]()
    dbEval (AddUserToProject pid current new) = do
    void $ pexec
    [3.1043]
    [3.5532]
    dbEval (AddUserToProject pid current new) = void $
    pexec
  • replacement in lib/Aftok/Interval.hs at line 41
    [3.722][3.722:755]()
    ilen i = (_end i) .-. (_start i)
    [3.722]
    [3.120]
    ilen i = _end i .-. _start i
  • edit in lib/Aftok/Json.hs at line 1
    [3.19][3.1931:1964]()
    {-# LANGUAGE TemplateHaskell #-}
  • replacement in lib/Aftok/Json.hs at line 83
    [2.6666][2.6666:6721]()
    object [ "projectId" .= (tshow $ pid ^. _ProjectId)
    [2.6666]
    [3.5274]
    object [ "projectId" .= tshow (pid ^. _ProjectId)
  • replacement in lib/Aftok/Json.hs at line 91
    [3.5417][3.1729:1797]()
    , "initiator" .= (tshow $ p ^. (initiator._UserId)) ]
    [3.5417]
    [3.2560]
    , "initiator" .= tshow (p ^. (initiator._UserId))
    ]
  • replacement in lib/Aftok/Json.hs at line 100
    [3.5449][3.1975:2061](),[3.1975][3.1975:2061]()
    toJSON $ (L.toList . fmap intervalJSON) <$> (MS.mapKeysMonotonic (^._BtcAddr) widx)
    [3.5449]
    [3.2061]
    toJSON $ (L.toList . fmap intervalJSON) <$> MS.mapKeysMonotonic (^._BtcAddr) widx
  • replacement in lib/Aftok/Json.hs at line 132
    [3.6098][3.6098:6166]()
    (fail $ (show addrText) <> "is not a valid BTC address")
    [3.6098]
    [3.6166]
    (fail $ show addrText <> "is not a valid BTC address")
  • replacement in lib/Aftok/TimeLog.hs at line 118
    [3.1012][3.1906:1977]()
    (totalTime, keyTimes) = MS.mapAccum addIntervalDiff zeroV $ widx
    [3.1012]
    [3.1977]
    (totalTime, keyTimes) = MS.mapAccum addIntervalDiff zeroV widx
  • replacement in lib/Aftok/TimeLog.hs at line 124
    [3.4420][3.490:550](),[3.550][3.778:844](),[3.778][3.778:844]()
    let sortedEntries = F.foldr H.insert H.empty $ logEntries
    rawIndex = F.foldl' appendLogEntry MS.empty $ sortedEntries
    [3.4420]
    [3.844]
    let sortedEntries = F.foldr H.insert H.empty logEntries
    rawIndex = F.foldl' appendLogEntry MS.empty sortedEntries
  • replacement in lib/Aftok/TimeLog.hs at line 160
    [3.1093][3.3119:3145]()
    _ -> Left ev : []
    [3.1093]
    [3.869]
    _ -> [Left ev]
  • replacement in lib/Aftok/TimeLog.hs at line 184
    [3.2812][3.2812:2848]()
    in depreciation *^ (ilen ival)
    [3.2812]
    in depreciation *^ ilen ival
  • replacement in lib/Aftok/Util/Http.hs at line 20
    [3.849][3.849:906]()
    (uname : pwd : []) -> pure $ (decodeUtf8 uname, pwd)
    [3.849]
    [3.906]
    [uname, pwd] -> pure (decodeUtf8 uname, pwd)
  • replacement in lib/Aftok.hs at line 86
    [3.11108][3.11108:11244]()
    , "arguments" .= (
    object [ "undep" .= up
    , "dep" .= dp
    ]
    )]
    [3.11108]
    [3.11244]
    , "arguments" .= object [ "undep" .= up
    , "dep" .= dp
    ]
    ]