Statistics
| Branch: | Tag: | Revision:

## root / htools / lint-hints.hs @ f127e585

1 2 3 5b11f8db Iustin Pop ```{-| Custom hint lints for Ganeti. ``` 2cdaf225 Iustin Pop 5b11f8db Iustin Pop ```Since passing --hint to hlint will override, not extend the built-in ``` 5b11f8db Iustin Pop ```hints, we need to import the existing hints so that we get full ``` 5b11f8db Iustin Pop ```coverage. ``` 2cdaf225 Iustin Pop 2cdaf225 Iustin Pop ```-} ``` 2cdaf225 Iustin Pop 5b11f8db Iustin Pop ```import "hint" HLint.HLint ``` 2cdaf225 Iustin Pop ```import "hint" HLint.Dollar ``` 2cdaf225 Iustin Pop 5a1e31b4 Iustin Pop ```-- The following two hints warn to simplify e.g. "map (\v -> (v, ``` 5a1e31b4 Iustin Pop ```-- True)) lst" to "zip lst (repeat True)", which is more abstract ``` 5a1e31b4 Iustin Pop ```warn = map (\v -> (v, x)) y ==> zip y (repeat x) ``` 5a1e31b4 Iustin Pop ``` where _ = notIn v x ``` 5a1e31b4 Iustin Pop ```warn = map (\v -> (x, v)) ==> zip (repeat x) ``` 5a1e31b4 Iustin Pop ``` where _ = notIn v x ``` 0c76f280 Iustin Pop 0c76f280 Iustin Pop ```-- The following warn on use of length instead of null ``` 0c76f280 Iustin Pop ```warn = length x > 0 ==> not (null x) ``` 0c76f280 Iustin Pop ```warn = length x /= 0 ==> not (null x) ``` 0c76f280 Iustin Pop `warn = length x == 0 ==> null x`