1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 16:37:50 +03:00
semantic/.hlint.yaml
2018-06-19 09:27:58 -04:00

46 lines
1.8 KiB
YAML

# HLint configuration file
# https://github.com/ndmitchell/hlint
- arguments: [--color=auto, -XDataKinds, -XDeriveFoldable, -XDeriveFunctor, -XDeriveGeneric, -XDeriveTraversable, -XFlexibleContexts, -XFlexibleInstances, -XMultiParamTypeClasses, -XOverloadedStrings, -XRecordWildCards, -XStandaloneDeriving, -XStrictData, -XTypeApplications]
# Blacklist some functions by default.
- functions:
- {name: unsafePerformIO, within: [Data.Scientific.Exts]} # unsafePerformIO has to be explicitly whitelisted
- {name: unsafeCoerce, within: []} # unsafeCoerce has to be explicitly whitelisted
- {name: head, within: []}
- {name: tail, within: []}
- {name: init, within: []}
- {name: last, within: []}
- {name: fromJust, within: []}
# Replace a $ b $ c with a . b $ c
- group: {name: dollar, enabled: true}
# Generalise map to fmap, ++ to <>
- group: {name: generalise, enabled: true}
# Ignore some builtin hints
- ignore: {name: Use mappend}
- ignore: {name: Redundant do}
# TODO: investigate whether cost-center analysis is better with lambda-case than it was
- ignore: {name: Use lambda-case}
- ignore: {name: Use fmap}
# Our customized warnings
# AMP fallout
- warning: {lhs: mapM, rhs: traverse, name: Generalize mapM}
- warning: {lhs: mapM_, rhs: traverse_, name: Generalize mapM_}
- warning: {lhs: forM, rhs: for, name: Generalize forM}
- warning: {lhs: forM_, rhs: for_, name: Generalize forM_}
- warning: {lhs: sequence, rhs: sequenceA, name: Generalize sequence}
- warning: {lhs: sequence_, rhs: sequenceA_, name: Generalize sequence_}
- warning: {lhs: return, rhs: pure, name: Avoid return}
# Terms
- warning: {lhs: termFAnnotation . unTerm, rhs: termAnnotation, name: "Use termAnnotation"}
- warning: {lhs: termFOut . unTerm, rhs: termOut, name: "Use termOut"}
# Conveniences
- warning: {lhs: maybe a pure, rhs: maybeM a}