# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

# HLint configuration file
# https://github.com/ndmitchell/hlint
##########################

  - ignore: { name: "Parse error" }
  - ignore: { name: "Reduce duplication" }
  - ignore: { name: "Redundant lambda" }
  - ignore: { name: "Redundant multi-way if" }
  - ignore: { name: "Use ||" }
  - ignore: { name: "Use &&" }
  - ignore: { name: "Use ++" }
  - ignore: { name: "Use ***" }
  - ignore: { name: "Redundant void" }
  - ignore: { name: "Too strict maybe" }
  - ignore: { name: "Use Just" }
  - ignore: { name: "Use const" }

  - arguments:
      - -XQuasiQuotes
      - -XTemplateHaskell
      - -j

  - fixity: "infix 4 `isInfixOf`"
  - fixity: "infix 4 `hasInfix`"
  - fixity: "infixl 6 `strConcat`"
  - fixity: "infix 4 `ciEq`"
  - fixity: "infix 4 `maybeEq`"
  - fixity: "infixl 8 ->."
  - fixity: "infixl 8 #>>."
  - fixity: "infixl 6 `diffDays`"
  - fixity: "infixr 3 `predDNFAnd`"
  - fixity: "infixr 2 `predDNFOr`"
  - fixity: "infixl 6 |-"
  - fixity: "infixr 5 <|"
  - fixity: "infixr 5 `cons`"
  - fixity: "infixl 5 |>"
  - fixity: "infixl 5 `snoc`"
  - fixity: "infixl 8 ^.."
  - fixity: "infixl 8 ^?"
  - fixity: "infixl 8 ^?!"
  - fixity: "infixl 8 ^@.."
  - fixity: "infixl 8 ^@?"
  - fixity: "infixl 8 ^@?!"
  - fixity: "infixl 8 ^."
  - fixity: "infixl 8 ^@."
  - fixity: "infixr 9 <.>"
  - fixity: "infixr 9 <."
  - fixity: "infixr 9 .>"
  - fixity: "infixl 8 ^#"
  - fixity: "infixr 4 %%@~"
  - fixity: "infixr 4 <%@~"
  - fixity: "infixr 4 <<%@~"
  - fixity: "infixr 4 %%~"
  - fixity: "infixr 4 <+~"
  - fixity: "infixr 4 <*~"
  - fixity: "infixr 4 <-~"
  - fixity: "infixr 4 <//~"
  - fixity: "infixr 4 <^~"
  - fixity: "infixr 4 <^^~"
  - fixity: "infixr 4 <**~"
  - fixity: "infixr 4 <&&~"
  - fixity: "infixr 4 <||~"
  - fixity: "infixr 4 <<>~"
  - fixity: "infixr 4 <%~"
  - fixity: "infixr 4 <<%~"
  - fixity: "infixr 4 <<.~"
  - fixity: "infixr 4 <<?~"
  - fixity: "infixr 4 <#~"
  - fixity: "infixr 4 #~"
  - fixity: "infixr 4 #%~"
  - fixity: "infixr 4 <#%~"
  - fixity: "infixr 4 #%%~"
  - fixity: "infixr 4 <<+~"
  - fixity: "infixr 4 <<-~"
  - fixity: "infixr 4 <<*~"
  - fixity: "infixr 4 <<//~"
  - fixity: "infixr 4 <<^~"
  - fixity: "infixr 4 <<^^~"
  - fixity: "infixr 4 <<**~"
  - fixity: "infixr 4 <<||~"
  - fixity: "infixr 4 <<&&~"
  - fixity: "infixr 4 <<<>~"
  - fixity: "infix 4 %%@="
  - fixity: "infix 4 <%@="
  - fixity: "infix 4 <<%@="
  - fixity: "infix 4 %%="
  - fixity: "infix 4 <+="
  - fixity: "infix 4 <*="
  - fixity: "infix 4 <-="
  - fixity: "infix 4 <//="
  - fixity: "infix 4 <^="
  - fixity: "infix 4 <^^="
  - fixity: "infix 4 <**="
  - fixity: "infix 4 <&&="
  - fixity: "infix 4 <||="
  - fixity: "infix 4 <<>="
  - fixity: "infix 4 <%="
  - fixity: "infix 4 <<%="
  - fixity: "infix 4 <<.="
  - fixity: "infix 4 <<?="
  - fixity: "infix 4 <#="
  - fixity: "infix 4 #="
  - fixity: "infix 4 #%="
  - fixity: "infix 4 <#%="
  - fixity: "infix 4 #%%="
  - fixity: "infix 4 <<+="
  - fixity: "infix 4 <<-="
  - fixity: "infix 4 <<*="
  - fixity: "infix 4 <<//="
  - fixity: "infix 4 <<^="
  - fixity: "infix 4 <<^^="
  - fixity: "infix 4 <<**="
  - fixity: "infix 4 <<||="
  - fixity: "infix 4 <<&&="
  - fixity: "infix 4 <<<>="
  - fixity: "infixr 2 <<~"
  - fixity: "infixl 1 ??"
  - fixity: "infixl 1 &~"
  - fixity: "infixr 9 ..."
  - fixity: "infixr 8 #"
  - fixity: "infixr 4 %@~"
  - fixity: "infixr 4 .@~"
  - fixity: "infixr 4 .~"
  - fixity: "infixr 4 +~"
  - fixity: "infixr 4 *~"
  - fixity: "infixr 4 -~"
  - fixity: "infixr 4 //~"
  - fixity: "infixr 4 ^~"
  - fixity: "infixr 4 ^^~"
  - fixity: "infixr 4 **~"
  - fixity: "infixr 4 &&~"
  - fixity: "infixr 4 <>~"
  - fixity: "infixr 4 ||~"
  - fixity: "infixr 4 %~"
  - fixity: "infixr 4 <.~"
  - fixity: "infixr 4 ?~"
  - fixity: "infixr 4 <?~"
  - fixity: "infix 4 %@="
  - fixity: "infix 4 .@="
  - fixity: "infix 4 .="
  - fixity: "infix 4 +="
  - fixity: "infix 4 *="
  - fixity: "infix 4 -="
  - fixity: "infix 4 //="
  - fixity: "infix 4 ^="
  - fixity: "infix 4 ^^="
  - fixity: "infix 4 **="
  - fixity: "infix 4 &&="
  - fixity: "infix 4 <>="
  - fixity: "infix 4 ||="
  - fixity: "infix 4 %="
  - fixity: "infix 4 <.="
  - fixity: "infix 4 ?="
  - fixity: "infix 4 <?="
  - fixity: "infixr 2 <~"
  - fixity: "infixl 5 `failing`"
  - fixity: "infixr 2 `zoom`"
  - fixity: "infixr 2 `magnify`"
  - fixity: "infixl 1 &"
  - fixity: "infixl 1 <&>"
  - fixity: "infixr 4 .|.~"
  - fixity: "infixr 4 .&.~"
  - fixity: "infixr 4 <.|.~"
  - fixity: "infixr 4 <.&.~"
  - fixity: "infixr 4 <<.|.~"
  - fixity: "infixr 4 <<.&.~"
  - fixity: "infix 4 .|.="
  - fixity: "infix 4 .&.="
  - fixity: "infix 4 <.|.="
  - fixity: "infix 4 <.&.="
  - fixity: "infix 4 <<.|.="
  - fixity: "infix 4 <<.&.="
  - fixity: "infixr 4 </>~"
  - fixity: "infixr 4 <</>~"
  - fixity: "infixr 4 <<</>~"
  - fixity: "infixr 4 <.>~"
  - fixity: "infixr 4 <<.>~"
  - fixity: "infixr 4 <<<.>~"
  - fixity: "infix 4 </>="
  - fixity: "infix 4 <</>="
  - fixity: "infix 4 <<</>="
  - fixity: "infix 4 <.>="
  - fixity: "infix 4 <<.>="
  - fixity: "infix 4 <<<.>="

  - suggest: { lhs: maybeT (return ()), rhs: maybeT_ }
  - suggest: { lhs: fromMaybe (return ()), rhs: maybeVoid }
  - suggest: { lhs: maybe (return ()) void, rhs: maybeVoid }

  - warn: { lhs: length xs >= n, rhs: minLength n xs, note: IncreasesLaziness }
  - warn: { lhs: n <= length xs, rhs: minLength n xs, note: IncreasesLaziness }
  - warn: { lhs: length xs > n, rhs: minLength (n + 1) xs, note: IncreasesLaziness }
  - warn: { lhs: n < length xs, rhs: minLength (n + 1) xs, note: IncreasesLaziness }
  - warn: { lhs: length xs <= n, rhs: maxLength n xs, note: IncreasesLaziness }
  - warn: { lhs: n >= length xs, rhs: maxLength n xs, note: IncreasesLaziness }
  - warn: { lhs: length xs < n, rhs: maxLength (n - 1) xs, note: IncreasesLaziness }
  - warn: { lhs: n > length xs, rhs: maxLength (n - 1) xs, note: IncreasesLaziness }

  - error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
  - error: {lhs: v Database.Esqueleto.==. Database.Esqueleto.val Nothing, rhs: Database.Esqueleto.isNothing v, name: Use Esqueleto's isNothing}
  - error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.nothing, rhs: Database.Esqueleto.Utils.isJust v, name: Use Esqueleto's not isNothing}
  - error: {lhs: v Database.Esqueleto.!=. Database.Esqueleto.val Nothing, rhs: Database.Esqueleto.Utils.isJust v, name: Use Esqueleto's not isNothing}
