packages feed

hydra-build-0.17.5: src/main/haskell/Hydra/Build/Comparereport.hs

-- Note: this is an automatically generated file. Do not edit.

-- | Type-level model for the JSON snapshot compare-report: the per-module comparison record and the whole-report summary shared by the native generator drivers. See https://github.com/CategoricalData/hydra/issues/416

module Hydra.Build.Comparereport where

import qualified Hydra.Core as Core
import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)
import qualified Data.Scientific as Sci

-- | The whole compare-report: per-module records plus the byte-identical tally
data CompareReport =
  CompareReport {
    -- | One record per compared module
    compareReportRows :: [ModuleCompare],
    -- | How many modules were byte-identical
    compareReportByteEqCount :: Int,
    -- | How many modules were compared
    compareReportTotal :: Int}
  deriving (Eq, Ord, Read, Show)

_CompareReport = Core.Name "hydra.build.comparereport.CompareReport"

_CompareReport_rows = Core.Name "rows"

_CompareReport_byteEqCount = Core.Name "byteEqCount"

_CompareReport_total = Core.Name "total"

-- | The result of comparing one module's JSON on the two sides
data CompareStatus =
  -- | The two sides are byte-identical
  CompareStatusByteEq |
  -- | Both sides exist but differ
  CompareStatusDiffer |
  -- | Our side is absent (the canonical side has the module, ours does not)
  CompareStatusMissing
  deriving (Eq, Ord, Read, Show)

_CompareStatus = Core.Name "hydra.build.comparereport.CompareStatus"

_CompareStatus_byteEq = Core.Name "byteEq"

_CompareStatus_differ = Core.Name "differ"

_CompareStatus_missing = Core.Name "missing"

-- | One module's comparison record
data ModuleCompare =
  ModuleCompare {
    -- | The module name (the JSON file's base name, without the .json suffix)
    moduleCompareModule :: String,
    -- | The comparison status
    moduleCompareStatus :: CompareStatus,
    -- | The byte size of our (freshly generated) side, or 0 if missing
    moduleCompareOurSize :: Int,
    -- | The byte size of the canonical side
    moduleCompareCanonSize :: Int,
    -- | The number of differing lines (0 when byte-identical)
    moduleCompareDiffLines :: Int}
  deriving (Eq, Ord, Read, Show)

_ModuleCompare = Core.Name "hydra.build.comparereport.ModuleCompare"

_ModuleCompare_module = Core.Name "module"

_ModuleCompare_status = Core.Name "status"

_ModuleCompare_ourSize = Core.Name "ourSize"

_ModuleCompare_canonSize = Core.Name "canonSize"

_ModuleCompare_diffLines = Core.Name "diffLines"