2018-06-19 16:14:46 +03:00
|
|
|
|
# HLint configuration file
|
|
|
|
|
# https://github.com/ndmitchell/hlint
|
2018-06-19 16:14:55 +03:00
|
|
|
|
|
2019-10-30 20:42:53 +03:00
|
|
|
|
- arguments: [--color=auto, -XStrictData]
|
2018-06-19 16:15:07 +03:00
|
|
|
|
|
|
|
|
|
# Blacklist some functions by default.
|
|
|
|
|
- functions:
|
2018-11-05 17:41:39 +03:00
|
|
|
|
- {name: unsafePerformIO, within: [Data.Scientific.Exts.attemptUnsafeArithmetic]}
|
2018-06-19 16:56:05 +03:00
|
|
|
|
- {name: unsafeCoerce, within: []}
|
2018-06-19 16:26:36 +03:00
|
|
|
|
- {name: head, within: []}
|
|
|
|
|
- {name: tail, within: []}
|
|
|
|
|
- {name: init, within: []}
|
|
|
|
|
- {name: last, within: []}
|
2018-06-19 16:27:05 +03:00
|
|
|
|
- {name: fromJust, within: []}
|
2020-01-17 05:58:21 +03:00
|
|
|
|
- {name: decodeUtf8, within: [], message: "Use decodeUtf8' or decodeUtf8With lenientDecode"}
|
2018-06-19 16:15:14 +03:00
|
|
|
|
|
|
|
|
|
# Replace a $ b $ c with a . b $ c
|
|
|
|
|
- group: {name: dollar, enabled: true}
|
2018-06-19 16:15:26 +03:00
|
|
|
|
|
|
|
|
|
# Generalise map to fmap, ++ to <>
|
|
|
|
|
- group: {name: generalise, enabled: true}
|
2018-06-19 16:15:36 +03:00
|
|
|
|
|
2018-07-16 16:20:26 +03:00
|
|
|
|
# Change the severity of the default group to warning
|
|
|
|
|
- warn: {group: {name: default}}
|
|
|
|
|
|
2018-07-16 16:20:34 +03:00
|
|
|
|
# Ignore the highly noisy module export list hint
|
2019-10-30 21:45:36 +03:00
|
|
|
|
- ignore: {name: Use explicit module export list}
|
2018-07-16 16:20:34 +03:00
|
|
|
|
|
2018-06-19 16:15:36 +03:00
|
|
|
|
# Ignore some builtin hints
|
|
|
|
|
- ignore: {name: Use mappend}
|
|
|
|
|
- ignore: {name: Redundant do}
|
2018-06-19 16:30:25 +03:00
|
|
|
|
- ignore: {name: Use lambda-case} # TODO: investigate whether cost-center analysis is better with lambda-case than it was
|
2018-06-19 16:30:46 +03:00
|
|
|
|
- ignore: {name: Use fmap} # Ignored because map has better type inference.
|
2018-06-19 16:15:50 +03:00
|
|
|
|
|
2018-06-19 16:40:35 +03:00
|
|
|
|
# Change the severity of hints we don’t want to fail CI for
|
|
|
|
|
- suggest: {name: Eta reduce}
|
|
|
|
|
|
2019-10-21 21:05:21 +03:00
|
|
|
|
# While I think DerivingStrategies is good, it's too noisy to suggest by default
|
|
|
|
|
- ignore:
|
|
|
|
|
name: Use DerivingStrategies
|
|
|
|
|
|
2018-11-05 17:36:40 +03:00
|
|
|
|
# Ignore eta reduce in the assignment modules
|
|
|
|
|
- ignore:
|
2018-11-05 17:46:46 +03:00
|
|
|
|
name: Eta reduce
|
|
|
|
|
within:
|
|
|
|
|
- Language.Go.Assignment
|
|
|
|
|
- Language.PHP.Assignment
|
|
|
|
|
- Language.Python.Assignment
|
|
|
|
|
- Language.Ruby.Assignment
|
2018-11-05 17:36:40 +03:00
|
|
|
|
|
2019-05-16 01:44:43 +03:00
|
|
|
|
- ignore: {name: Use ., within: [Analysis.Abstract.Graph.graphingModules, Semantic.Distribute]}
|
2018-11-05 17:38:39 +03:00
|
|
|
|
|
2019-10-21 21:05:21 +03:00
|
|
|
|
- ignore:
|
|
|
|
|
within:
|
|
|
|
|
- Proto.Semantic
|
|
|
|
|
- Proto.Semantic_Fields
|
|
|
|
|
- Proto.Semantic_JSON
|
|
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
|
name: Reduce duplication
|
|
|
|
|
within:
|
|
|
|
|
- Semantic.Util
|
|
|
|
|
|
|
|
|
|
# hlint has issues with QuantifiedConstraints (see https://github.com/ndmitchell/hlint/issues/759)
|
|
|
|
|
# Once the above is fixed, we can drop this error.
|
|
|
|
|
|
|
|
|
|
- ignore: { name: Parse error }
|
|
|
|
|
|
|
|
|
|
# hlint is too paranoid about NonEmpty functions (https://github.com/ndmitchell/hlint/issues/787)
|
|
|
|
|
|
|
|
|
|
- ignore:
|
|
|
|
|
name: Avoid restricted function
|
|
|
|
|
within:
|
|
|
|
|
- Language.Python.Syntax
|
|
|
|
|
- Data.Syntax.Expression
|
2018-11-05 17:39:23 +03:00
|
|
|
|
|
2018-06-19 16:15:50 +03:00
|
|
|
|
# Our customized warnings
|
2018-06-19 16:16:56 +03:00
|
|
|
|
|
|
|
|
|
# AMP fallout
|
2018-06-19 16:18:49 +03:00
|
|
|
|
- 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_}
|
2018-06-19 16:15:50 +03:00
|
|
|
|
- warning: {lhs: return, rhs: pure, name: Avoid return}
|
2018-06-19 16:16:56 +03:00
|
|
|
|
|
|
|
|
|
# Terms
|
2018-06-19 16:29:13 +03:00
|
|
|
|
- warning: {lhs: termFAnnotation . unTerm, rhs: termAnnotation, name: Use termAnnotation}
|
|
|
|
|
- warning: {lhs: termFOut . unTerm, rhs: termOut, name: Use termOut}
|
2018-08-28 00:51:18 +03:00
|
|
|
|
- warning: {lhs: project . termOut, rhs: projectTerm, name: Use projectTerm}
|
2018-06-19 16:27:58 +03:00
|
|
|
|
|
|
|
|
|
# Conveniences
|
2018-06-19 16:29:18 +03:00
|
|
|
|
- warning: {lhs: maybe a pure, rhs: maybeM a, name: Use maybeM}
|
2019-01-11 20:49:56 +03:00
|
|
|
|
- warning: {lhs: either (const a) id, rhs: fromRight a, name: use fromRight}
|
2019-06-16 14:00:47 +03:00
|
|
|
|
- warning: {lhs: either id (const a), rhs: fromLeft a, name: use fromLeft}
|
2018-06-19 16:30:05 +03:00
|
|
|
|
|
|
|
|
|
# Applicative style
|
|
|
|
|
- warning: {lhs: f <$> pure a <*> b, rhs: f a <$> b, name: Avoid redundant pure}
|
|
|
|
|
- warning: {lhs: f <$> pure a <* b, rhs: f a <$ b, name: Avoid redundant pure}
|