Add Query support for Nodes (no filtering, no RPC)
[ganeti-local] / htools / lint-hints.hs
1 {- Custom hint lints for Ganeti.
2
3 Since passing --hint to hlint will override, not extend the built-in hints, we need to import the existing hints so that we get full coverage.
4
5 -}
6
7 import "hint" HLint.Default
8 import "hint" HLint.Dollar
9
10 -- The following two hints warn to simplify e.g. "map (\v -> (v,
11 -- True)) lst" to "zip lst (repeat True)", which is more abstract
12 warn = map (\v -> (v, x)) y ==> zip y (repeat x)
13   where _ = notIn v x
14 warn = map (\v -> (x, v)) ==> zip (repeat x)
15   where _ = notIn v x
16
17 -- The following warn on use of length instead of null
18 warn = length x > 0 ==> not (null x)
19 warn = length x /= 0 ==> not (null x)
20 warn = length x == 0 ==> null x