introduce GHC version checks for unsupported features (#9)

This commit is contained in:
Alex 2023-01-12 15:29:50 +01:00 committed by GitHub
parent 6fcfc118d4
commit 456dc8161d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,61 @@ maintainer: marco.perone@tweag.io
copyright: 2022 Tweag I/O
license: OtherLicense
# language: GHC2021 # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/control.html?highlight=ghc2021#extension-GHC2021
when:
- condition: impl(ghc >= 9.2)
then:
# https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/control.html?highlight=ghc2021#extension-GHC2021
language: GHC2021
ghc-options:
# https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-kind-signatures
- -Wno-missing-kind-signatures
else:
default-extensions:
- BangPatterns
- BinaryLiterals
- ConstrainedClassMethods
- ConstraintKinds
- DeriveDataTypeable
- DeriveFoldable
- DeriveFunctor
- DeriveGeneric
- DeriveLift
- DeriveTraversable
- DoAndIfThenElse
- EmptyCase
- EmptyDataDecls
- EmptyDataDeriving
- ExistentialQuantification
- ExplicitForAll
- FlexibleContexts
- FlexibleInstances
- ForeignFunctionInterface
- GADTSyntax
- GeneralisedNewtypeDeriving
- HexFloatLiterals
- ImplicitPrelude
- ImportQualifiedPost
- InstanceSigs
- KindSignatures
- MonomorphismRestriction
- MultiParamTypeClasses
- NamedFieldPuns
- NamedWildCards
- NumericUnderscores
- PatternGuards
- PolyKinds
- PostfixOperators
- RankNTypes
- RelaxedPolyRec
- ScopedTypeVariables
- StandaloneDeriving
- StandaloneKindSignatures
- StarIsType
- TraditionalRecordSyntax
- TupleSections
- TypeApplications
- TypeOperators
- TypeSynonymInstances
default-extensions:
- DerivingStrategies # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/deriving_strategies.html#extension-DerivingStrategies
@ -13,54 +67,6 @@ default-extensions:
- OverloadedStrings # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/overloaded_strings.html#extension-OverloadedStrings
- PackageImports # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/package_qualified_imports.html#extension-PackageImports
# Enabled by GHC2021, which we don't use because it's only supported by GHC >= 9.2
- BangPatterns
- BinaryLiterals
- ConstrainedClassMethods
- ConstraintKinds
- DeriveDataTypeable
- DeriveFoldable
- DeriveFunctor
- DeriveGeneric
- DeriveLift
- DeriveTraversable
- DoAndIfThenElse
- EmptyCase
- EmptyDataDecls
- EmptyDataDeriving
- ExistentialQuantification
- ExplicitForAll
#- FieldSelectors # Not supported by GHC 9.0
- FlexibleContexts
- FlexibleInstances
- ForeignFunctionInterface
- GADTSyntax
- GeneralisedNewtypeDeriving
- HexFloatLiterals
- ImplicitPrelude
- ImportQualifiedPost
- InstanceSigs
- KindSignatures
- MonomorphismRestriction
- MultiParamTypeClasses
- NamedFieldPuns
- NamedWildCards
- NumericUnderscores
- PatternGuards
- PolyKinds
- PostfixOperators
- RankNTypes
- RelaxedPolyRec
- ScopedTypeVariables
- StandaloneDeriving
- StandaloneKindSignatures
- StarIsType
- TraditionalRecordSyntax
- TupleSections
- TypeApplications
- TypeOperators
- TypeSynonymInstances
# Options inspired by: https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3
ghc-options:
# Enable every warning GHC supports
@ -74,8 +80,6 @@ ghc-options:
- -Wno-unsafe # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/safe_haskell.html#ghc-flag--Wunsafe
- -Wno-missing-safe-haskell-mode # https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/safe_haskell.html#ghc-flag--Wmissing-safe-haskell-mode
- -Wno-implicit-prelude # https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wimplicit-prelude
# Not supported by GHC 9.0
#- -Wno-missing-kind-signatures # https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-kind-signatures
- -Wno-missing-export-lists # https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-export-lists
- -Wno-missing-home-modules # https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-home-modules
- -Wno-missing-import-lists # https://downloads.haskell.org/ghc/latest/docs/users_guide/using-warnings.html#ghc-flag--Wmissing-import-lists