Skip to content

Commit b7afc97

Browse files
ffaf1mergify[bot]
andauthored
cabal check: add typed errors (#8269)
* (cabal check) Add typed errors * hlint Distribution.PackageDescription.Check Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 180b671 commit b7afc97

File tree

37 files changed

+929
-613
lines changed

37 files changed

+929
-613
lines changed

Cabal-syntax/src/Distribution/Compiler.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defaultCompilerFlavor = case buildCompilerFlavor of
125125
-- Cabal parses only @ghc-options@ and @ghcjs-options@, others are omitted.
126126
--
127127
data PerCompilerFlavor v = PerCompilerFlavor v v
128-
deriving (Generic, Show, Read, Eq, Typeable, Data, Functor, Foldable
128+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data, Functor, Foldable
129129
, Traversable)
130130

131131
instance Binary a => Binary (PerCompilerFlavor a)

Cabal-syntax/src/Distribution/License.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ data License =
125125

126126
-- | Indicates an erroneous license name.
127127
| UnknownLicense String
128-
deriving (Generic, Read, Show, Eq, Typeable, Data)
128+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
129129

130130
instance Binary License
131131
instance Structured License

Cabal-syntax/src/Distribution/Parsec/Warning.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ instance NFData PWarnType where rnf = genericRnf
5151

5252
-- | Parser warning.
5353
data PWarning = PWarning !PWarnType !Position String
54-
deriving (Show, Generic)
54+
deriving (Eq, Ord, Show, Generic)
5555

5656
instance Binary PWarning
5757
instance NFData PWarning where rnf = genericRnf

Cabal-syntax/src/Distribution/Types/Benchmark.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data Benchmark = Benchmark {
2828
benchmarkInterface :: BenchmarkInterface,
2929
benchmarkBuildInfo :: BuildInfo
3030
}
31-
deriving (Generic, Show, Read, Eq, Typeable, Data)
31+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
3232

3333
instance Binary Benchmark
3434
instance Structured Benchmark

Cabal-syntax/src/Distribution/Types/BenchmarkInterface.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ data BenchmarkInterface =
3030
-- interfaces for the given reason (e.g. unknown benchmark type).
3131
--
3232
| BenchmarkUnsupported BenchmarkType
33-
deriving (Eq, Generic, Read, Show, Typeable, Data)
33+
deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)
3434

3535
instance Binary BenchmarkInterface
3636
instance Structured BenchmarkInterface

Cabal-syntax/src/Distribution/Types/BenchmarkType.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data BenchmarkType = BenchmarkTypeExe Version
2222
-- ^ \"type: exitcode-stdio-x.y\"
2323
| BenchmarkTypeUnknown String Version
2424
-- ^ Some unknown benchmark type e.g. \"type: foo\"
25-
deriving (Generic, Show, Read, Eq, Typeable, Data)
25+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2626

2727
instance Binary BenchmarkType
2828
instance Structured BenchmarkType

Cabal-syntax/src/Distribution/Types/BuildInfo.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ data BuildInfo = BuildInfo {
110110
targetBuildDepends :: [Dependency], -- ^ Dependencies specific to a library or executable target
111111
mixins :: [Mixin]
112112
}
113-
deriving (Generic, Show, Read, Eq, Typeable, Data)
113+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
114114

115115
instance Binary BuildInfo
116116
instance Structured BuildInfo

Cabal-syntax/src/Distribution/Types/BuildType.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data BuildType
2525
-- information used by later phases.
2626
| Make -- ^ calls @Distribution.Make.defaultMain@
2727
| Custom -- ^ uses user-supplied @Setup.hs@ or @Setup.lhs@ (default)
28-
deriving (Generic, Show, Read, Eq, Typeable, Data)
28+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2929

3030
instance Binary BuildType
3131
instance Structured BuildType

Cabal-syntax/src/Distribution/Types/Dependency.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ data Dependency = Dependency
4444
-- ^ The set of libraries required from the package.
4545
-- Only the selected libraries will be built.
4646
-- It does not affect the cabal-install solver yet.
47-
deriving (Generic, Read, Show, Eq, Typeable, Data)
47+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
4848

4949
depPkgName :: Dependency -> PackageName
5050
depPkgName (Dependency pn _ _) = pn

Cabal-syntax/src/Distribution/Types/ExeDependency.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data ExeDependency = ExeDependency
2424
PackageName
2525
UnqualComponentName -- name of executable component of package
2626
VersionRange
27-
deriving (Generic, Read, Show, Eq, Typeable, Data)
27+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
2828

2929
instance Binary ExeDependency
3030
instance Structured ExeDependency

Cabal-syntax/src/Distribution/Types/Executable.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data Executable = Executable {
2424
exeScope :: ExecutableScope,
2525
buildInfo :: BuildInfo
2626
}
27-
deriving (Generic, Show, Read, Eq, Typeable, Data)
27+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2828

2929
instance L.HasBuildInfo Executable where
3030
buildInfo f l = (\x -> l { buildInfo = x }) <$> f (buildInfo l)

Cabal-syntax/src/Distribution/Types/ExecutableScope.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import qualified Text.PrettyPrint as Disp
1717

1818
data ExecutableScope = ExecutablePublic
1919
| ExecutablePrivate
20-
deriving (Generic, Show, Read, Eq, Typeable, Data)
20+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2121

2222
instance Pretty ExecutableScope where
2323
pretty ExecutablePublic = Disp.text "public"

Cabal-syntax/src/Distribution/Types/ForeignLib.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ data ForeignLib = ForeignLib {
6060
-- the condition trees (for instance, when creating an sdist)
6161
, foreignLibModDefFile :: [FilePath]
6262
}
63-
deriving (Generic, Show, Read, Eq, Typeable, Data)
63+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
6464

6565
data LibVersionInfo = LibVersionInfo Int Int Int deriving (Data, Eq, Generic, Typeable)
6666

Cabal-syntax/src/Distribution/Types/ForeignLibOption.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ data ForeignLibOption =
2222
-- This option is compulsory on Windows and unsupported
2323
-- on other platforms.
2424
ForeignLibStandalone
25-
deriving (Generic, Show, Read, Eq, Typeable, Data)
25+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2626

2727
instance Pretty ForeignLibOption where
2828
pretty ForeignLibStandalone = Disp.text "standalone"

Cabal-syntax/src/Distribution/Types/ForeignLibType.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ data ForeignLibType =
2727
| ForeignLibNativeStatic
2828
-- TODO: Maybe this should record a string?
2929
| ForeignLibTypeUnknown
30-
deriving (Generic, Show, Read, Eq, Typeable, Data)
30+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
3131

3232
instance Pretty ForeignLibType where
3333
pretty ForeignLibNativeShared = Disp.text "native-shared"

Cabal-syntax/src/Distribution/Types/LegacyExeDependency.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import qualified Text.PrettyPrint as Disp
2424
data LegacyExeDependency = LegacyExeDependency
2525
String
2626
VersionRange
27-
deriving (Generic, Read, Show, Eq, Typeable, Data)
27+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
2828

2929
instance Binary LegacyExeDependency
3030
instance Structured LegacyExeDependency

Cabal-syntax/src/Distribution/Types/Library.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ data Library = Library
2828
, libVisibility :: LibraryVisibility -- ^ Whether this multilib can be dependent from outside.
2929
, libBuildInfo :: BuildInfo
3030
}
31-
deriving (Generic, Show, Eq, Read, Typeable, Data)
31+
deriving (Generic, Show, Eq, Ord, Read, Typeable, Data)
3232

3333
instance L.HasBuildInfo Library where
3434
buildInfo f l = (\x -> l { libBuildInfo = x }) <$> f (libBuildInfo l)

Cabal-syntax/src/Distribution/Types/LibraryVisibility.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data LibraryVisibility
2424
= LibraryVisibilityPublic
2525
-- | Internal library, default
2626
| LibraryVisibilityPrivate
27-
deriving (Generic, Show, Read, Eq, Typeable, Data)
27+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2828

2929
instance Pretty LibraryVisibility where
3030
pretty LibraryVisibilityPublic = Disp.text "public"

Cabal-syntax/src/Distribution/Types/ModuleReexport.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ data ModuleReexport = ModuleReexport {
2424
moduleReexportOriginalName :: ModuleName,
2525
moduleReexportName :: ModuleName
2626
}
27-
deriving (Eq, Generic, Read, Show, Typeable, Data)
27+
deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)
2828

2929
instance Binary ModuleReexport
3030
instance Structured ModuleReexport

Cabal-syntax/src/Distribution/Types/PackageDescription.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ data PackageDescription
146146
extraTmpFiles :: [FilePath],
147147
extraDocFiles :: [FilePath]
148148
}
149-
deriving (Generic, Show, Read, Eq, Typeable, Data)
149+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
150150

151151
instance Binary PackageDescription
152152
instance Structured PackageDescription

Cabal-syntax/src/Distribution/Types/PkgconfigDependency.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import qualified Distribution.Compat.CharParsing as P
2121
data PkgconfigDependency = PkgconfigDependency
2222
PkgconfigName
2323
PkgconfigVersionRange
24-
deriving (Generic, Read, Show, Eq, Typeable, Data)
24+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
2525

2626
instance Binary PkgconfigDependency
2727
instance Structured PkgconfigDependency

Cabal-syntax/src/Distribution/Types/PkgconfigVersionRange.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ data PkgconfigVersionRange
3535
| PcOrEarlierVersion PkgconfigVersion -- =< version
3636
| PcUnionVersionRanges PkgconfigVersionRange PkgconfigVersionRange
3737
| PcIntersectVersionRanges PkgconfigVersionRange PkgconfigVersionRange
38-
deriving (Generic, Read, Show, Eq, Typeable, Data)
38+
deriving (Generic, Read, Show, Eq, Ord, Typeable, Data)
3939

4040
instance Binary PkgconfigVersionRange
4141
instance Structured PkgconfigVersionRange

Cabal-syntax/src/Distribution/Types/SetupBuildInfo.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data SetupBuildInfo = SetupBuildInfo
2525
-- internally, and doesn't correspond to anything in the .cabal
2626
-- file. See #3199.
2727
}
28-
deriving (Generic, Show, Eq, Read, Typeable, Data)
28+
deriving (Generic, Show, Eq, Ord, Read, Typeable, Data)
2929

3030
instance Binary SetupBuildInfo
3131
instance Structured SetupBuildInfo

Cabal-syntax/src/Distribution/Types/TestSuite.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ data TestSuite = TestSuite {
2929
testBuildInfo :: BuildInfo,
3030
testCodeGenerators :: [String]
3131
}
32-
deriving (Generic, Show, Read, Eq, Typeable, Data)
32+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
3333

3434
instance L.HasBuildInfo TestSuite where
3535
buildInfo f l = (\x -> l { testBuildInfo = x }) <$> f (testBuildInfo l)

Cabal-syntax/src/Distribution/Types/TestSuiteInterface.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ data TestSuiteInterface =
3535
-- the given reason (e.g. unknown test type).
3636
--
3737
| TestSuiteUnsupported TestType
38-
deriving (Eq, Generic, Read, Show, Typeable, Data)
38+
deriving (Eq, Ord, Generic, Read, Show, Typeable, Data)
3939

4040
instance Binary TestSuiteInterface
4141
instance Structured TestSuiteInterface

Cabal-syntax/src/Distribution/Types/TestType.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Text.PrettyPrint (char, text)
2222
data TestType = TestTypeExe Version -- ^ \"type: exitcode-stdio-x.y\"
2323
| TestTypeLib Version -- ^ \"type: detailed-x.y\"
2424
| TestTypeUnknown String Version -- ^ Some unknown test type e.g. \"type: foo\"
25-
deriving (Generic, Show, Read, Eq, Typeable, Data)
25+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
2626

2727
instance Binary TestType
2828
instance Structured TestType

Cabal-syntax/src/Distribution/Types/VersionRange/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ data VersionRange
5656
| MajorBoundVersion Version -- @^>= ver@ (same as >= ver && < MAJ(ver)+1)
5757
| UnionVersionRanges VersionRange VersionRange
5858
| IntersectVersionRanges VersionRange VersionRange
59-
deriving ( Data, Eq, Generic, Read, Show, Typeable )
59+
deriving ( Data, Eq, Ord, Generic, Read, Show, Typeable )
6060

6161
instance Binary VersionRange
6262
instance Structured VersionRange

Cabal-syntax/src/Language/Haskell/Extension.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ data Language =
6161

6262
-- | An unknown language, identified by its name.
6363
| UnknownLanguage String
64-
deriving (Generic, Show, Read, Eq, Typeable, Data)
64+
deriving (Generic, Show, Read, Eq, Ord, Typeable, Data)
6565

6666
instance Binary Language
6767
instance Structured Language

0 commit comments

Comments
 (0)