1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00
semantic/.hlint.yaml

77 lines
3.0 KiB
YAML
Raw Normal View History

2018-06-19 16:14:46 +03:00
# HLint configuration file
# https://github.com/ndmitchell/hlint
- arguments: [--color=auto, -XDataKinds, -XDeriveFoldable, -XDeriveFunctor, -XDeriveGeneric, -XDeriveTraversable, -XFlexibleContexts, -XFlexibleInstances, -XMultiParamTypeClasses, -XOverloadedStrings, -XRecordWildCards, -XStandaloneDeriving, -XStrictData, -XTypeApplications, -XDerivingVia]
# Blacklist some functions by default.
- functions:
- {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: []}
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
# 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
- ignore: {name: Use module export list}
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
# Change the severity of hints we dont want to fail CI for
- suggest: {name: Eta reduce}
# Ignore eta reduce in the assignment modules
- ignore:
name: Eta reduce
within:
- Language.Go.Assignment
- Language.MiniPython.Assignment
- Language.MiniRuby.Assignment
- Language.PHP.Assignment
- Language.Python.Assignment
- Language.Ruby.Assignment
- ignore: {name: Use ., within: [Analysis.Abstract.Graph.graphingModules]}
- ignore: {name: Reduce duplication, within: [Semantic.Util]}
2019-02-12 18:58:03 +03:00
- ignore: {name: Use newtype instead of data, within: [Semantic.Api.V1.CodeAnalysisPB]}
2018-06-19 16:15:50 +03:00
# Our customized warnings
2018-06-19 16:16:56 +03:00
# 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_}
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}
- warning: {lhs: either (const a) id, rhs: fromRight a, name: use fromRight}
- warning: {lhs: either id (const a), rhs: fromLeft a, name: use fromRight}
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}