|
| 1 | +# HLint configuration file |
| 2 | +# https://github.com/ndmitchell/hlint |
| 3 | +########################## |
| 4 | + |
| 5 | +# To run HLint do: |
| 6 | +# $ hlint --git -j4 |
| 7 | + |
| 8 | +# Warnings currently triggered by our code |
| 9 | +- ignore: {name: "Use <$>"} |
| 10 | +- ignore: {name: "Use :"} |
| 11 | +- ignore: {name: "Redundant do"} |
| 12 | +- ignore: {name: "Avoid lambda"} |
| 13 | +- ignore: {name: "Use newtype instead of data"} |
| 14 | +- ignore: {name: "Use fromMaybe"} |
| 15 | +- ignore: {name: "Use unless"} |
| 16 | +- ignore: {name: "Move brackets to avoid $"} |
| 17 | +- ignore: {name: "Eta reduce"} |
| 18 | +- ignore: {name: "Parse error"} |
| 19 | +- ignore: {name: "Reduce duplication"} |
| 20 | +- ignore: {name: "Use ++"} |
| 21 | +- ignore: {name: "Use $>"} |
| 22 | +- ignore: {name: "Use section"} |
| 23 | +- ignore: {name: "Use record patterns"} |
| 24 | +- ignore: {name: "Use camelCase"} |
| 25 | +- ignore: {name: "Use uncurry"} |
| 26 | +- ignore: {name: "Avoid lambda using `infix`"} |
| 27 | + |
| 28 | +# Off by default hints we like |
| 29 | +- warn: {name: Use module export list} |
| 30 | + |
| 31 | +# Condemn nub and friends |
| 32 | +- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x} |
| 33 | +- warn: {lhs: nub, rhs: Data.List.Extra.nubOrd} |
| 34 | +- warn: {lhs: nubBy, rhs: Data.List.Extra.nubOrdBy} |
| 35 | +- warn: {lhs: Data.List.Extra.nubOn, rhs: Data.List.Extra.nubOrdOn} |
| 36 | + |
| 37 | +# DA specific hints |
| 38 | +- warn: {lhs: Data.Text.pack (DA.Pretty.renderPlain x), rhs: DA.Pretty.renderPlain x} |
| 39 | +- warn: {lhs: Data.Text.Extended.pack (DA.Pretty.renderPlain x), rhs: DA.Pretty.renderPlain x} |
| 40 | +- warn: {lhs: DA.Pretty.renderPlain (DA.Pretty.pretty x), rhs: DA.Pretty.renderPretty x} |
| 41 | +- warn: {lhs: Data.Text.readFile, rhs: Data.Text.Extended.readFileUtf8} |
| 42 | +- warn: {lhs: Data.Text.writeFile, rhs: Data.Text.Extended.writeFileUtf8} |
| 43 | +- warn: {lhs: Data.Text.Lazy.readFile, rhs: Data.Text.Extended.readFileUtf8} |
| 44 | +- warn: {lhs: Data.Text.Lazy.writeFile, rhs: Data.Text.Extended.writeFileUtf8} |
| 45 | +- warn: {lhs: System.Environment.setEnv, rhs: System.Environment.Blank.setEnv} |
| 46 | + |
| 47 | +# Specify additional command line arguments |
| 48 | +# |
| 49 | +- arguments: ["--cpp-include=include"] |
| 50 | + |
| 51 | +- extensions: |
| 52 | + - default: true |
| 53 | + |
| 54 | + # Extensions enabled by `bazel` and `da-ghci` by default. We ban them here |
| 55 | + # to avoid useless pragmas piling up on the top of files. |
| 56 | + - {name: BangPatterns, within: []} |
| 57 | + - {name: DeriveDataTypeable, within: []} |
| 58 | + - {name: DeriveFoldable, within: []} |
| 59 | + - {name: DeriveFunctor, within: []} |
| 60 | + - {name: DeriveGeneric, within: []} |
| 61 | + - {name: DeriveTraversable, within: []} |
| 62 | + - {name: FlexibleContexts, within: []} |
| 63 | + - {name: GeneralizedNewtypeDeriving, within: []} |
| 64 | + - {name: LambdaCase, within: []} |
| 65 | + - {name: NamedFieldPuns, within: []} |
| 66 | + - {name: PackageImports, within: []} |
| 67 | + - {name: RecordWildCards, within: []} |
| 68 | + - {name: ScopedTypeVariables, within: []} |
| 69 | + - {name: StandaloneDeriving, within: []} |
| 70 | + - {name: TupleSections, within: []} |
| 71 | + - {name: TypeApplications, within: []} |
| 72 | + - {name: ViewPatterns, within: []} |
| 73 | + |
| 74 | + # Shady extensions |
| 75 | + - name: CPP |
| 76 | + within: |
| 77 | + - Development.IDE.Compat |
| 78 | + - Development.IDE.Core.FileStore |
| 79 | + - Development.IDE.Core.Compile |
| 80 | + - Development.IDE.Core.Rules |
| 81 | + - Development.IDE.GHC.Compat |
| 82 | + - Development.IDE.GHC.Orphans |
| 83 | + - Development.IDE.GHC.Util |
| 84 | + - Development.IDE.Import.FindImports |
| 85 | + - Development.IDE.LSP.Outline |
| 86 | + - Development.IDE.Spans.Calculate |
| 87 | + - Development.IDE.Spans.Documentation |
| 88 | + - Development.IDE.Spans.Common |
| 89 | + - Development.IDE.Plugin.CodeAction |
| 90 | + - Development.IDE.Plugin.Completions |
| 91 | + - Development.IDE.Plugin.Completions.Logic |
| 92 | + - Main |
| 93 | + |
| 94 | +- flags: |
| 95 | + - default: false |
| 96 | + - {name: [-Wno-missing-signatures, -Wno-orphans, -Wno-overlapping-patterns, -Wno-incomplete-patterns, -Wno-missing-fields, -Wno-unused-matches]} |
| 97 | + - {name: [-Wno-dodgy-imports,-Wno-incomplete-uni-patterns], within: [Main, Development.IDE.GHC.Compat]} |
| 98 | +# - modules: |
| 99 | +# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set' |
| 100 | +# - {name: Control.Arrow, within: []} # Certain modules are banned entirely |
| 101 | +# |
| 102 | +- functions: |
| 103 | + # Things that are unsafe in Haskell base library |
| 104 | + - {name: unsafeInterleaveIO, within: []} |
| 105 | + - {name: unsafeDupablePerformIO, within: []} |
| 106 | + - {name: unsafeCoerce, within: []} |
| 107 | + # Things that are a bit dangerous in the GHC API |
| 108 | + - {name: nameModule, within: []} |
| 109 | + |
| 110 | +# Add custom hints for this project |
| 111 | +# |
| 112 | +# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar" |
| 113 | +# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x} |
| 114 | + |
| 115 | +# Turn on hints that are off by default |
| 116 | +# |
| 117 | +# Ban "module X(module X) where", to require a real export list |
| 118 | +# - warn: {name: Use explicit module export list} |
| 119 | +# |
| 120 | +# Replace a $ b $ c with a . b $ c |
| 121 | +# - group: {name: dollar, enabled: true} |
| 122 | +# |
| 123 | +# Generalise map to fmap, ++ to <> |
| 124 | +# - group: {name: generalise, enabled: true} |
| 125 | + |
| 126 | +# Ignore some builtin hints |
| 127 | +# - ignore: {name: Use let} |
| 128 | +# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules |
| 129 | + |
| 130 | +# Define some custom infix operators |
| 131 | +# - fixity: infixr 3 ~^#^~ |
0 commit comments