mirror of
https://github.com/serokell/xrefcheck.git
synced 2024-08-16 17:10:26 +03:00
Add explicit strategies to deriving clauses
Problem: The `deriving ($classes...)` is becoming obsolete. Solution: Replace with `deriving $strat ($classes...)`; make old deriving a warning.
This commit is contained in:
parent
7e954c20a4
commit
9ecf668fbc
@ -29,7 +29,7 @@ ftpOptions =
|
||||
|
||||
-- | Option specifying FTP host.
|
||||
newtype FtpHostOpt = FtpHostOpt Text
|
||||
deriving (Show, Eq)
|
||||
deriving stock (Show, Eq)
|
||||
|
||||
instance IsOption FtpHostOpt where
|
||||
defaultValue = FtpHostOpt "ftp://localhost"
|
||||
|
@ -55,6 +55,7 @@ ghc-options:
|
||||
- -Wall
|
||||
- -Wincomplete-record-updates
|
||||
- -Wincomplete-uni-patterns
|
||||
- -Wmissing-deriving-strategies
|
||||
|
||||
dependencies:
|
||||
- aeson
|
||||
|
@ -40,7 +40,7 @@ import Data.DList qualified as DList
|
||||
data Flavor
|
||||
= GitHub
|
||||
| GitLab
|
||||
deriving (Show)
|
||||
deriving stock (Show)
|
||||
|
||||
allFlavors :: [Flavor]
|
||||
allFlavors = [GitHub, GitLab]
|
||||
@ -61,7 +61,7 @@ instance FromJSON Flavor where
|
||||
-- We keep this in text because scanners for different formats use different
|
||||
-- representation of this thing, and it actually appears in reports only.
|
||||
newtype Position = Position (Maybe Text)
|
||||
deriving (Show, Eq, Generic)
|
||||
deriving stock (Show, Eq, Generic)
|
||||
|
||||
instance Buildable Position where
|
||||
build (Position pos) = case pos of
|
||||
@ -77,7 +77,7 @@ data Reference = Reference
|
||||
, rAnchor :: Maybe Text
|
||||
-- ^ Section or custom anchor tag.
|
||||
, rPos :: Position
|
||||
} deriving (Show, Generic)
|
||||
} deriving stock (Show, Generic)
|
||||
|
||||
-- | Context of anchor.
|
||||
data AnchorType
|
||||
@ -87,14 +87,14 @@ data AnchorType
|
||||
-- ^ They can be set up manually
|
||||
| BiblioAnchor
|
||||
-- ^ Id of entry in bibliography
|
||||
deriving (Show, Eq, Generic)
|
||||
deriving stock (Show, Eq, Generic)
|
||||
|
||||
-- | A referable anchor.
|
||||
data Anchor = Anchor
|
||||
{ aType :: AnchorType
|
||||
, aName :: Text
|
||||
, aPos :: Position
|
||||
} deriving (Show, Eq, Generic)
|
||||
} deriving stock (Show, Eq, Generic)
|
||||
|
||||
data FileInfoDiff = FileInfoDiff
|
||||
{ _fidReferences :: DList Reference
|
||||
@ -116,14 +116,14 @@ instance Monoid FileInfoDiff where
|
||||
data FileInfo = FileInfo
|
||||
{ _fiReferences :: [Reference]
|
||||
, _fiAnchors :: [Anchor]
|
||||
} deriving (Show, Generic)
|
||||
} deriving stock (Show, Generic)
|
||||
makeLenses ''FileInfo
|
||||
|
||||
instance Default FileInfo where
|
||||
def = diffToFileInfo mempty
|
||||
|
||||
newtype RepoInfo = RepoInfo (Map FilePath FileInfo)
|
||||
deriving (Show)
|
||||
deriving stock (Show)
|
||||
|
||||
-----------------------------------------------------------
|
||||
-- Instances
|
||||
@ -189,7 +189,7 @@ data LocationType
|
||||
-- ^ Reference to a file at outer site
|
||||
| OtherLoc
|
||||
-- ^ Entry not to be processed (e.g. "mailto:e-mail")
|
||||
deriving (Show)
|
||||
deriving stock (Show)
|
||||
|
||||
instance Buildable LocationType where
|
||||
build = \case
|
||||
@ -303,7 +303,7 @@ canonizeLocalRef ref =
|
||||
data VerifyProgress = VerifyProgress
|
||||
{ vrLocal :: !(Progress Int)
|
||||
, vrExternal :: !(Progress Int)
|
||||
} deriving (Show)
|
||||
} deriving stock (Show)
|
||||
|
||||
initVerifyProgress :: [Reference] -> VerifyProgress
|
||||
initVerifyProgress references = VerifyProgress
|
||||
|
@ -44,4 +44,4 @@ instance Buildable FTPException where
|
||||
build (UnsuccessfulException e) = build e
|
||||
build (BogusResponseFormatException e) = build e
|
||||
|
||||
deriving instance Eq FTPException
|
||||
deriving stock instance Eq FTPException
|
||||
|
@ -36,7 +36,7 @@ data Progress a = Progress
|
||||
-- ^ Overall amount of work.
|
||||
, pErrors :: !a
|
||||
-- ^ How many of the completed work finished with an error.
|
||||
} deriving (Show)
|
||||
} deriving stock (Show)
|
||||
|
||||
-- | Initialise null progress.
|
||||
initProgress :: Num a => a -> Progress a
|
||||
|
@ -73,7 +73,7 @@ data IgnoreMode
|
||||
| Paragraph
|
||||
| File
|
||||
| None
|
||||
deriving Eq
|
||||
deriving stock (Eq)
|
||||
|
||||
-- | A fold over a `Node`.
|
||||
cataNode :: (Maybe PosInfo -> NodeType -> [c] -> c) -> Node -> c
|
||||
|
@ -64,10 +64,10 @@ import Xrefcheck.System
|
||||
-----------------------------------------------------------
|
||||
|
||||
newtype VerifyResult e = VerifyResult [e]
|
||||
deriving (Show, Eq, Functor)
|
||||
deriving newtype (Show, Eq, Functor)
|
||||
|
||||
deriving instance Semigroup (VerifyResult e)
|
||||
deriving instance Monoid (VerifyResult e)
|
||||
deriving newtype instance Semigroup (VerifyResult e)
|
||||
deriving newtype instance Monoid (VerifyResult e)
|
||||
|
||||
instance Buildable e => Buildable (VerifyResult e) where
|
||||
build vr = case verifyErrors vr of
|
||||
@ -114,7 +114,7 @@ data VerifyError
|
||||
| ExternalFtpException FTPException
|
||||
| FtpEntryDoesNotExist FilePath
|
||||
| ExternalResourceSomeError Text
|
||||
deriving (Show, Eq)
|
||||
deriving stock (Show, Eq)
|
||||
|
||||
instance Buildable VerifyError where
|
||||
build = \case
|
||||
|
Loading…
Reference in New Issue
Block a user