src, nix: hlint update
This pulls in an updated hlint version from nixpkgs, and fixes some new eta-reduction warnings. (I don't particularly think this is more readable, but I suppose being consistently hlint-clean is worth it.)
This commit is contained in:
+1
-17
@@ -141,23 +141,7 @@ rec {
|
|||||||
|
|
||||||
# Linting and styling tools.
|
# Linting and styling tools.
|
||||||
style =
|
style =
|
||||||
let
|
pkgs.callPackage nix/tools/style.nix { inherit hsie; };
|
||||||
# keep old version of hlint to not deal with linter changes for now
|
|
||||||
nixpkgsVersionPrev = {
|
|
||||||
date = "2021-11-02";
|
|
||||||
rev = "7053541084bf5ce2921ef307e5585d39d7ba8b3f";
|
|
||||||
tarballHash = "1flhh5d4zy43x6060hvzjb5hi5cmc51ivc0nwmija9n8d35kcc4x";
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgsPrev =
|
|
||||||
builtins.fetchTarball {
|
|
||||||
url = "https://github.com/nixos/nixpkgs/archive/${nixpkgsVersionPrev.rev}.tar.gz";
|
|
||||||
sha256 = nixpkgsVersionPrev.tarballHash;
|
|
||||||
};
|
|
||||||
pkgsPrev = import nixpkgsPrev { };
|
|
||||||
inherit (pkgsPrev) hlint;
|
|
||||||
in
|
|
||||||
pkgs.callPackage nix/tools/style.nix { inherit hlint hsie; };
|
|
||||||
|
|
||||||
# Scripts for running tests.
|
# Scripts for running tests.
|
||||||
tests =
|
tests =
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ reachMainApp AppConfig{..} =
|
|||||||
"*6" -> ipv6Addrs xs ++ ipv4Addrs xs
|
"*6" -> ipv6Addrs xs ++ ipv4Addrs xs
|
||||||
"!6" -> ipv6Addrs xs
|
"!6" -> ipv6Addrs xs
|
||||||
_ -> xs
|
_ -> xs
|
||||||
ipv4Addrs xs = filter ((/=) AF_INET6 . addrFamily) xs
|
ipv4Addrs = filter ((/=) AF_INET6 . addrFamily)
|
||||||
ipv6Addrs xs = filter ((==) AF_INET6 . addrFamily) xs
|
ipv6Addrs = filter ((==) AF_INET6 . addrFamily)
|
||||||
|
|
||||||
addrs <- getAddrInfo (Just $ defaultHints { addrSocketType = Stream }) (T.unpack <$> host) (Just . show $ configServerPort)
|
addrs <- getAddrInfo (Just $ defaultHints { addrSocketType = Stream }) (T.unpack <$> host) (Just . show $ configServerPort)
|
||||||
tryAddr `traverse` filterAddrs addrs
|
tryAddr `traverse` filterAddrs addrs
|
||||||
|
|||||||
@@ -175,10 +175,10 @@ class JustIfMaybe a b where
|
|||||||
justIfMaybe :: a -> b
|
justIfMaybe :: a -> b
|
||||||
|
|
||||||
instance JustIfMaybe a a where
|
instance JustIfMaybe a a where
|
||||||
justIfMaybe a = a
|
justIfMaybe = identity
|
||||||
|
|
||||||
instance JustIfMaybe a (Maybe a) where
|
instance JustIfMaybe a (Maybe a) where
|
||||||
justIfMaybe a = Just a
|
justIfMaybe = Just
|
||||||
|
|
||||||
-- | Reads and parses the config and overrides its parameters from env vars,
|
-- | Reads and parses the config and overrides its parameters from env vars,
|
||||||
-- files or db settings.
|
-- files or db settings.
|
||||||
|
|||||||
@@ -455,7 +455,7 @@ findProc qi argumentsKeys paramsAsSingleObject allProcs contentType isInvPost =
|
|||||||
matchProc = overloadedProcPartition $ HM.lookupDefault mempty qi allProcs -- first find the proc by name
|
matchProc = overloadedProcPartition $ HM.lookupDefault mempty qi allProcs -- first find the proc by name
|
||||||
-- The partition obtained has the form (overloadedProcs,fallbackProcs)
|
-- The partition obtained has the form (overloadedProcs,fallbackProcs)
|
||||||
-- where fallbackProcs are functions with a single unnamed parameter
|
-- where fallbackProcs are functions with a single unnamed parameter
|
||||||
overloadedProcPartition procs = foldr select ([],[]) procs
|
overloadedProcPartition = foldr select ([],[])
|
||||||
select proc ~(ts,fs)
|
select proc ~(ts,fs)
|
||||||
| matchesParams proc = (proc:ts,fs)
|
| matchesParams proc = (proc:ts,fs)
|
||||||
| hasSingleUnnamedParam proc = (ts,proc:fs)
|
| hasSingleUnnamedParam proc = (ts,proc:fs)
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ callRequest proc apiReq readReq = FunctionCall {
|
|||||||
| ppName prm == mempty -> OnePosParam prm
|
| ppName prm == mempty -> OnePosParam prm
|
||||||
| otherwise -> KeyParams $ specifiedParams [prm]
|
| otherwise -> KeyParams $ specifiedParams [prm]
|
||||||
prms -> KeyParams $ specifiedParams prms
|
prms -> KeyParams $ specifiedParams prms
|
||||||
specifiedParams params = filter (\x -> ppName x `S.member` iColumns apiReq) params
|
specifiedParams = filter (\x -> ppName x `S.member` iColumns apiReq)
|
||||||
|
|
||||||
returningCols :: ReadRequest -> [FieldName] -> [FieldName]
|
returningCols :: ReadRequest -> [FieldName] -> [FieldName]
|
||||||
returningCols rr@(Node _ forest) pkCols
|
returningCols rr@(Node _ forest) pkCols
|
||||||
|
|||||||
Reference in New Issue
Block a user