.hlint.yaml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # HLint configuration file
  2. # https://github.com/ndmitchell/hlint
  3. ##########################
  4. # This file contains a template configuration file, which is typically
  5. # placed as .hlint.yaml in the root of your project
  6. # Warnings currently triggered by your code
  7. - ignore: {name: "Avoid lambda using `infix`"}
  8. - ignore: {name: "Avoid lambda"}
  9. - ignore: {name: "Eta reduce"}
  10. - ignore: {name: "Evaluate"}
  11. - ignore: {name: "Fuse foldr/map"}
  12. - ignore: {name: "Fuse mapM/map"}
  13. - ignore: {name: "Hoist not"}
  14. - ignore: {name: "Move brackets to avoid $"}
  15. - ignore: {name: "Reduce duplication"}
  16. - ignore: {name: "Redundant $"}
  17. - ignore: {name: "Redundant <$>"}
  18. - ignore: {name: "Redundant bracket"}
  19. - ignore: {name: "Redundant case"}
  20. - ignore: {name: "Redundant guard"}
  21. - ignore: {name: "Redundant if"}
  22. - ignore: {name: "Redundant lambda"}
  23. - ignore: {name: "Redundant multi-way if"}
  24. - ignore: {name: "Redundant return"}
  25. - ignore: {name: "Redundant section"}
  26. - ignore: {name: "Redundant variable capture"}
  27. - ignore: {name: "Replace case with fromMaybe"}
  28. - ignore: {name: "Replace case with maybe"}
  29. - ignore: {name: "Use &&"}
  30. - ignore: {name: "Use ++"}
  31. - ignore: {name: "Use :"}
  32. - ignore: {name: "Use <$"}
  33. - ignore: {name: "Use <$>"}
  34. - ignore: {name: "Use <=<"}
  35. - ignore: {name: "Use >"}
  36. - ignore: {name: "Use Just"}
  37. - ignore: {name: "Use camelCase"}
  38. - ignore: {name: "Use const"}
  39. # Andreas, 2021-02-15
  40. # Silence specific hlint warnings, e.g.
  41. # https://github.com/agda/agda/pull/5214/checks?check_run_id=1909201141
  42. - ignore: {name: "Use curry", within: Agda.TypeChecking.Reduce.reduceWithBlocker }
  43. - ignore: {name: "Use empty"}
  44. # Andreas, 2021-03-03
  45. # "Use fewer imports" is quite silly if one has imports under #if.
  46. - ignore: {name: "Use fewer imports"}
  47. - ignore:
  48. name: "Use fmap"
  49. within:
  50. - Agda.TypeChecking.Rules.Application.checkPrimTrans
  51. - Agda.TypeChecking.Primitive.Cubical.primTrans'
  52. - Agda.TypeChecking.Primitive.Cubical.primComp
  53. - Agda.Syntax.Concrete.Operators.parsePat
  54. - ignore: {name: "Use fromMaybe"}
  55. - ignore: {name: "Use id"}
  56. - ignore: {name: "Use infix"}
  57. - ignore: {name: "Use intercalate"}
  58. - ignore: {name: "Use lambda-case"}
  59. - ignore: {name: "Use list comprehension"}
  60. - ignore: {name: "Use list literal pattern"}
  61. - ignore: {name: "Use list literal"}
  62. - ignore: {name: "Use mapMaybe"}
  63. - ignore: {name: "Use maximum"}
  64. - ignore: {name: "Use maybe"}
  65. - ignore: {name: "Use mconcat"}
  66. - ignore: {name: "Use newtype instead of data"}
  67. - ignore: {name: "Use notElem"}
  68. - ignore: {name: "Use null"}
  69. - ignore: {name: "Use record patterns"}
  70. - ignore: {name: "Use second"}
  71. - ignore: {name: "Use section"}
  72. - ignore: {name: "Use sequenceA"}
  73. - ignore: {name: "Use ||"}
  74. # Specify additional command line arguments
  75. #
  76. # - arguments: [--color, --cpp-simple, -XQuasiQuotes]
  77. - arguments: [
  78. -XBangPatterns,
  79. -XConstraintKinds,
  80. -XDefaultSignatures,
  81. -XDeriveDataTypeable,
  82. -XDeriveFoldable,
  83. -XDeriveFunctor,
  84. -XDeriveGeneric,
  85. -XDeriveTraversable,
  86. -XExistentialQuantification,
  87. -XFlexibleContexts,
  88. -XFlexibleInstances,
  89. -XFunctionalDependencies,
  90. -XGeneralizedNewtypeDeriving,
  91. -XInstanceSigs,
  92. -XLambdaCase,
  93. -XMultiParamTypeClasses,
  94. -XMultiWayIf,
  95. -XNamedFieldPuns,
  96. -XOverloadedStrings,
  97. -XPatternSynonyms,
  98. -XRankNTypes,
  99. -XRecordWildCards,
  100. -XScopedTypeVariables,
  101. -XStandaloneDeriving,
  102. -XTupleSections,
  103. -XTypeFamilies,
  104. -XTypeSynonymInstances,
  105. # hlint (3.1.6, anyway), seems to assume -XTypeApplications,
  106. # which causes a parsing error in some cases.
  107. # (At the time of this note, a parse error in Agda.TypeChecking.Generalize)
  108. -XNoTypeApplications,
  109. ]
  110. # Control which extensions/flags/modules/functions can be used
  111. #
  112. # - extensions:
  113. # - default: false # all extension are banned by default
  114. # - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
  115. # - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
  116. #
  117. # - flags:
  118. # - {name: -w, within: []} # -w is allowed nowhere
  119. #
  120. # - modules:
  121. # - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
  122. # - {name: Control.Arrow, within: []} # Certain modules are banned entirely
  123. #
  124. # - functions:
  125. # - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
  126. # Add custom hints for this project
  127. #
  128. # Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
  129. # - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
  130. # Turn on hints that are off by default
  131. #
  132. # Ban "module X(module X) where", to require a real export list
  133. # - warn: {name: Use explicit module export list}
  134. #
  135. # Replace a $ b $ c with a . b $ c
  136. # - group: {name: dollar, enabled: true}
  137. #
  138. # Generalise map to fmap, ++ to <>
  139. # - group: {name: generalise, enabled: true}
  140. # Ignore some builtin hints
  141. # - ignore: {name: Use let}
  142. # - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
  143. # Define some custom infix operators
  144. # - fixity: infixr 3 ~^#^~
  145. # To generate a suitable file for HLint do:
  146. # $ hlint --default > .hlint.yaml