ghcide/.hlint.yaml
Alejandro Serrano a0aa013e33 Better docs for completions (#288)
* Remove JSON instances for completions, since we are not implementing "resolve"

* Remove completion resolve data from tests

* Better docs

* Fix tests

* Fix for 8.4

* Turn Haddock markup into Markdown

* Add types to completion items

* Make it work on 8.8 and 8.4

* Revert "Remove completion resolve data from tests"

This reverts commit 625d710f11.

* Revert "Remove JSON instances for completions, since we are not implementing "resolve""

This reverts commit 12ff27dce7.

* Fix tests

* Require higher version of regex-pcre-builtin

* Replace Pandoc with direct conversion from Haddock to Markdown

* Show kinds of type constructors too

* A few fixed to Markdown conversion

* Check optNewColonConvention

* Fix build on 8.4 and 8.8

* More fixes for 8.4 and 8.8

* Check only the common part of the completion text

* Make icons consistent with Outline

* Test docs for completions

* Make constructors return the corresponding CompletionItem + tests for that behavior

* Make test work on 8.4
2020-01-09 09:44:32 +01:00

124 lines
4.3 KiB
YAML

# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################
# To run HLint do:
# $ hlint --git -j4
# Warnings currently triggered by our code
- ignore: {name: "Use <$>"}
- ignore: {name: "Use :"}
- ignore: {name: "Redundant do"}
- ignore: {name: "Avoid lambda"}
- ignore: {name: "Use newtype instead of data"}
- ignore: {name: "Use fromMaybe"}
- ignore: {name: "Use unless"}
- ignore: {name: "Move brackets to avoid $"}
- ignore: {name: "Eta reduce"}
- ignore: {name: "Parse error"}
- ignore: {name: "Reduce duplication"}
- ignore: {name: "Use ++"}
- ignore: {name: "Use $>"}
- ignore: {name: "Use section"}
- ignore: {name: "Use record patterns"}
- ignore: {name: "Use camelCase"}
- ignore: {name: "Use uncurry"}
- ignore: {name: "Avoid lambda using `infix`"}
# Off by default hints we like
- warn: {name: Use module export list}
# Condemn nub and friends
- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x}
- warn: {lhs: nub, rhs: Data.List.Extra.nubOrd}
- warn: {lhs: nubBy, rhs: Data.List.Extra.nubOrdBy}
- warn: {lhs: Data.List.Extra.nubOn, rhs: Data.List.Extra.nubOrdOn}
# DA specific hints
- warn: {lhs: Data.Text.pack (DA.Pretty.renderPlain x), rhs: DA.Pretty.renderPlain x}
- warn: {lhs: Data.Text.Extended.pack (DA.Pretty.renderPlain x), rhs: DA.Pretty.renderPlain x}
- warn: {lhs: DA.Pretty.renderPlain (DA.Pretty.pretty x), rhs: DA.Pretty.renderPretty x}
- warn: {lhs: Data.Text.readFile, rhs: Data.Text.Extended.readFileUtf8}
- warn: {lhs: Data.Text.writeFile, rhs: Data.Text.Extended.writeFileUtf8}
- warn: {lhs: Data.Text.Lazy.readFile, rhs: Data.Text.Extended.readFileUtf8}
- warn: {lhs: Data.Text.Lazy.writeFile, rhs: Data.Text.Extended.writeFileUtf8}
- warn: {lhs: System.Environment.setEnv, rhs: System.Environment.Blank.setEnv}
# Specify additional command line arguments
#
- arguments: ["--cpp-include=include"]
- extensions:
- default: true
# Extensions enabled by `bazel` and `da-ghci` by default. We ban them here
# to avoid useless pragmas piling up on the top of files.
- {name: BangPatterns, within: []}
- {name: DeriveDataTypeable, within: []}
- {name: DeriveFoldable, within: []}
- {name: DeriveFunctor, within: []}
- {name: DeriveGeneric, within: []}
- {name: DeriveTraversable, within: []}
- {name: FlexibleContexts, within: []}
- {name: GeneralizedNewtypeDeriving, within: []}
- {name: LambdaCase, within: []}
- {name: NamedFieldPuns, within: []}
- {name: OverloadedStrings, within: []}
- {name: PackageImports, within: []}
- {name: RecordWildCards, within: []}
- {name: ScopedTypeVariables, within: []}
- {name: StandaloneDeriving, within: []}
- {name: TupleSections, within: []}
- {name: TypeApplications, within: []}
- {name: ViewPatterns, within: []}
# Shady extensions
- {name: ImplicitParams, within: []}
- name: CPP
within:
- Development.IDE.Core.FileStore
- Development.IDE.Core.Compile
- Development.IDE.GHC.Compat
- Development.IDE.GHC.Util
- Development.IDE.Import.FindImports
- Development.IDE.LSP.CodeAction
- Development.IDE.Spans.Calculate
- Development.IDE.Spans.Documentation
- Main
- flags:
- default: false
- {name: [-Wno-missing-signatures, -Wno-orphans, -Wno-overlapping-patterns, -Wno-incomplete-patterns, -Wno-missing-fields, -Wno-unused-matches]}
- {name: [-Wno-dodgy-imports], within: Main}
# - modules:
# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
#
- functions:
- {name: unsafeInterleaveIO, within: []}
- {name: unsafeDupablePerformIO, within: []}
- {name: unsafeCoerce, within: []}
# Add custom hints for this project
#
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
# Turn on hints that are off by default
#
# Ban "module X(module X) where", to require a real export list
# - warn: {name: Use explicit module export list}
#
# 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 let}
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
# Define some custom infix operators
# - fixity: infixr 3 ~^#^~