on v0.1.0 help sign in
ghcide/.hlint.yaml
128 lines 4.6 kB history raw
1# HLint configuration file
2# https://github.com/ndmitchell/hlint
3##########################
5# To run HLint do:
6# $ hlint --git -j4
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`"}
28# Off by default hints we like
29- warn: {name: Use module export list}
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}
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}
47# Specify additional command line arguments
49- arguments: ["--cpp-include=include"]
51- extensions:
52 - default: true
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: OverloadedStrings, within: []}
67 - {name: PackageImports, within: []}
68 - {name: RecordWildCards, within: []}
69 - {name: ScopedTypeVariables, within: []}
70 - {name: StandaloneDeriving, within: []}
71 - {name: TupleSections, within: []}
72 - {name: TypeApplications, within: []}
73 - {name: ViewPatterns, within: []}
75 # Shady extensions
76 - {name: ImplicitParams, within: []}
77 - name: CPP
78 within:
79 - Development.IDE.Core.FileStore
80 - Development.IDE.Core.Compile
81 - Development.IDE.GHC.Compat
82 - Development.IDE.GHC.Util
83 - Development.IDE.Import.FindImports
84 - Development.IDE.Spans.Calculate
85 - Development.IDE.Spans.Documentation
86 - Development.IDE.Spans.Common
87 - Development.IDE.Plugin.CodeAction
88 - Development.IDE.Plugin.Completions.Logic
89 - Main
91- flags:
92 - default: false
93 - {name: [-Wno-missing-signatures, -Wno-orphans, -Wno-overlapping-patterns, -Wno-incomplete-patterns, -Wno-missing-fields, -Wno-unused-matches]}
94 - {name: [-Wno-dodgy-imports], within: Main}
95# - modules:
96# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
97# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
99- functions:
100 # Things that are unsafe in Haskell base library
101 - {name: unsafeInterleaveIO, within: []}
102 - {name: unsafeDupablePerformIO, within: []}
103 - {name: unsafeCoerce, within: []}
104 # Things that are a bit dangerous in the GHC API
105 - {name: nameModule, within: []}
107# Add custom hints for this project
109# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
110# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
112# Turn on hints that are off by default
114# Ban "module X(module X) where", to require a real export list
115# - warn: {name: Use explicit module export list}
117# Replace a $ b $ c with a . b $ c
118# - group: {name: dollar, enabled: true}
120# Generalise map to fmap, ++ to <>
121# - group: {name: generalise, enabled: true}
123# Ignore some builtin hints
124# - ignore: {name: Use let}
125# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
127# Define some custom infix operators
128# - fixity: infixr 3 ~^#^~