From f774ba47ef7a06643390be072ac28a8b22e9f690 Mon Sep 17 00:00:00 2001 From: Ivan Gromakovskii Date: Wed, 27 Sep 2023 22:55:47 +0200 Subject: [PATCH] [Chore] Do not use deprecated things from Universum Problem: some lens-related things that we use got deprecated in Universum. Solution: do not use them, import them from Control.Lens instead. --- ftp-tests/Test/Xrefcheck/FtpLinks.hs | 3 ++- package.yaml | 2 ++ src/Xrefcheck/Config.hs | 4 ++-- src/Xrefcheck/Core.hs | 4 ++-- src/Xrefcheck/Scan.hs | 4 ++-- src/Xrefcheck/Scanners/Markdown.hs | 4 ++-- src/Xrefcheck/Util.hs | 4 ++-- tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs | 3 ++- tests/Test/Xrefcheck/AnchorsSpec.hs | 3 ++- tests/Test/Xrefcheck/ConfigSpec.hs | 3 ++- tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs | 3 ++- tests/Test/Xrefcheck/IgnoreRegexSpec.hs | 3 ++- tests/Test/Xrefcheck/RedirectChainSpec.hs | 3 ++- tests/Test/Xrefcheck/RedirectConfigSpec.hs | 3 ++- tests/Test/Xrefcheck/TimeoutSpec.hs | 3 ++- tests/Test/Xrefcheck/TrailingSlashSpec.hs | 3 ++- tests/Test/Xrefcheck/UtilRequests.hs | 3 ++- 17 files changed, 34 insertions(+), 21 deletions(-) diff --git a/ftp-tests/Test/Xrefcheck/FtpLinks.hs b/ftp-tests/Test/Xrefcheck/FtpLinks.hs index 3429325a..9655f92b 100644 --- a/ftp-tests/Test/Xrefcheck/FtpLinks.hs +++ b/ftp-tests/Test/Xrefcheck/FtpLinks.hs @@ -7,8 +7,9 @@ module Test.Xrefcheck.FtpLinks , test_FtpLinks ) where -import Universum +import Universum hiding ((.~)) +import Control.Lens ((.~)) import Data.Tagged (untag) import Options.Applicative (help, long, strOption) import Test.Tasty (TestTree, askOption, testGroup) diff --git a/package.yaml b/package.yaml index 63328c3e..15989a85 100644 --- a/package.yaml +++ b/package.yaml @@ -151,6 +151,7 @@ tests: - directory - firefly - http-types + - lens - modern-uri - nyan-interpolation - o-clock @@ -172,6 +173,7 @@ tests: generated-other-modules: - Paths_xrefcheck dependencies: + - lens - optparse-applicative - tagged - tasty diff --git a/src/Xrefcheck/Config.hs b/src/Xrefcheck/Config.hs index 263b4306..0c130196 100644 --- a/src/Xrefcheck/Config.hs +++ b/src/Xrefcheck/Config.hs @@ -11,9 +11,9 @@ module Xrefcheck.Config , defConfigText ) where -import Universum +import Universum hiding ((.~)) -import Control.Lens (makeLensesWith) +import Control.Lens (makeLensesWith, (.~)) import Data.Aeson (genericParseJSON) import Data.Yaml (FromJSON (..), decodeEither', prettyPrintParseException, withText) import Text.Regex.TDFA.Text () diff --git a/src/Xrefcheck/Core.hs b/src/Xrefcheck/Core.hs index 2379cb9c..9519e1ac 100644 --- a/src/Xrefcheck/Core.hs +++ b/src/Xrefcheck/Core.hs @@ -9,9 +9,9 @@ module Xrefcheck.Core where -import Universum +import Universum hiding ((^..)) -import Control.Lens (folded, makeLenses, makePrisms, to, united) +import Control.Lens (folded, makeLenses, makePrisms, to, united, (^..)) import Data.Aeson (FromJSON (..), withText) import Data.Char (isAlphaNum) import Data.Char qualified as C diff --git a/src/Xrefcheck/Scan.hs b/src/Xrefcheck/Scan.hs index 54ff7f59..f6a910b7 100644 --- a/src/Xrefcheck/Scan.hs +++ b/src/Xrefcheck/Scan.hs @@ -31,9 +31,9 @@ module Xrefcheck.Scan , scanRepo ) where -import Universum +import Universum hiding (_1, (%~)) -import Control.Lens (makeLensesWith) +import Control.Lens (_1, makeLensesWith, (%~)) import Data.Aeson (FromJSON (..), genericParseJSON, withText) import Data.Map qualified as M import Data.Reflection (Given) diff --git a/src/Xrefcheck/Scanners/Markdown.hs b/src/Xrefcheck/Scanners/Markdown.hs index 0c3480e9..d3cc6962 100644 --- a/src/Xrefcheck/Scanners/Markdown.hs +++ b/src/Xrefcheck/Scanners/Markdown.hs @@ -16,11 +16,11 @@ module Xrefcheck.Scanners.Markdown , makeError ) where -import Universum +import Universum hiding (use) import CMarkGFM (Node (..), NodeType (..), PosInfo (..), commonmarkToNode, extAutolink, optFootnotes) -import Control.Lens (_Just, makeLenses, makeLensesFor, (.=)) +import Control.Lens (_Just, makeLenses, makeLensesFor, use, (.=)) import Control.Monad.Trans.Writer.CPS (Writer, runWriter, tell) import Data.Aeson (FromJSON (..), genericParseJSON) import Data.ByteString.Lazy qualified as BSL diff --git a/src/Xrefcheck/Util.hs b/src/Xrefcheck/Util.hs index 47d8fc12..022532e8 100644 --- a/src/Xrefcheck/Util.hs +++ b/src/Xrefcheck/Util.hs @@ -17,9 +17,9 @@ module Xrefcheck.Util , module Xrefcheck.Util.Interpolate ) where -import Universum +import Universum hiding ((.~)) -import Control.Lens (LensRules, lensField, lensRules, mappingNamer) +import Control.Lens (LensRules, lensField, lensRules, mappingNamer, (.~)) import Data.Aeson qualified as Aeson import Data.Aeson.Casing (aesonPrefix, camelCase) import Data.Fixed (Fixed (MkFixed), HasResolution (resolution)) diff --git a/tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs b/tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs index bd53245e..7b4bf057 100644 --- a/tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs +++ b/tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.AnchorsInHeadersSpec where -import Universum +import Universum hiding ((^.)) +import Control.Lens ((^.)) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase, (@?=)) diff --git a/tests/Test/Xrefcheck/AnchorsSpec.hs b/tests/Test/Xrefcheck/AnchorsSpec.hs index 4f87dadf..e5f14496 100644 --- a/tests/Test/Xrefcheck/AnchorsSpec.hs +++ b/tests/Test/Xrefcheck/AnchorsSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.AnchorsSpec where -import Universum +import Universum hiding ((^.)) +import Control.Lens ((^.)) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase, (@?=)) diff --git a/tests/Test/Xrefcheck/ConfigSpec.hs b/tests/Test/Xrefcheck/ConfigSpec.hs index 06855d1f..6158d613 100644 --- a/tests/Test/Xrefcheck/ConfigSpec.hs +++ b/tests/Test/Xrefcheck/ConfigSpec.hs @@ -5,10 +5,11 @@ module Test.Xrefcheck.ConfigSpec where -import Universum +import Universum hiding ((.~)) import Control.Concurrent (forkIO, killThread) import Control.Exception qualified as E +import Control.Lens ((.~)) import Data.List (isInfixOf) import Data.Yaml (ParseException (..), decodeEither') diff --git a/tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs b/tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs index 8091d912..c390f2c6 100644 --- a/tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs +++ b/tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs @@ -5,9 +5,10 @@ module Test.Xrefcheck.IgnoreAnnotationsSpec where -import Universum +import Universum hiding ((^.)) import CMarkGFM (PosInfo (..)) +import Control.Lens ((^.)) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase, (@?=)) diff --git a/tests/Test/Xrefcheck/IgnoreRegexSpec.hs b/tests/Test/Xrefcheck/IgnoreRegexSpec.hs index c6af37e9..a6755647 100644 --- a/tests/Test/Xrefcheck/IgnoreRegexSpec.hs +++ b/tests/Test/Xrefcheck/IgnoreRegexSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.IgnoreRegexSpec where -import Universum +import Universum hiding ((.~), (^.)) +import Control.Lens ((.~), (^.)) import Data.Reflection (give) import Data.Yaml (decodeEither') import Test.Tasty (TestTree, testGroup) diff --git a/tests/Test/Xrefcheck/RedirectChainSpec.hs b/tests/Test/Xrefcheck/RedirectChainSpec.hs index 4b7a4752..dff1b0f7 100644 --- a/tests/Test/Xrefcheck/RedirectChainSpec.hs +++ b/tests/Test/Xrefcheck/RedirectChainSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.RedirectChainSpec where -import Universum +import Universum hiding ((.~)) +import Control.Lens ((.~)) import Data.CaseInsensitive qualified as CI import Data.Map qualified as M import Network.HTTP.Types (mkStatus) diff --git a/tests/Test/Xrefcheck/RedirectConfigSpec.hs b/tests/Test/Xrefcheck/RedirectConfigSpec.hs index 01f1f52f..c54683cf 100644 --- a/tests/Test/Xrefcheck/RedirectConfigSpec.hs +++ b/tests/Test/Xrefcheck/RedirectConfigSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.RedirectConfigSpec where -import Universum +import Universum hiding ((%~), (.~)) +import Control.Lens ((%~), (.~)) import Data.CaseInsensitive qualified as CI import Data.Map qualified as M import Network.HTTP.Types (mkStatus) diff --git a/tests/Test/Xrefcheck/TimeoutSpec.hs b/tests/Test/Xrefcheck/TimeoutSpec.hs index 496b6b4b..b6774a6b 100644 --- a/tests/Test/Xrefcheck/TimeoutSpec.hs +++ b/tests/Test/Xrefcheck/TimeoutSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.TimeoutSpec where -import Universum +import Universum hiding ((.~)) +import Control.Lens ((.~)) import Data.CaseInsensitive qualified as CI import Data.Map qualified as M import Data.Set qualified as S diff --git a/tests/Test/Xrefcheck/TrailingSlashSpec.hs b/tests/Test/Xrefcheck/TrailingSlashSpec.hs index 7e7ec1d5..213488a7 100644 --- a/tests/Test/Xrefcheck/TrailingSlashSpec.hs +++ b/tests/Test/Xrefcheck/TrailingSlashSpec.hs @@ -5,8 +5,9 @@ module Test.Xrefcheck.TrailingSlashSpec where -import Universum +import Universum hiding ((.~)) +import Control.Lens ((.~)) import System.Directory (doesFileExist) import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (assertFailure, testCase) diff --git a/tests/Test/Xrefcheck/UtilRequests.hs b/tests/Test/Xrefcheck/UtilRequests.hs index 2587b9ff..f1a8d1a5 100644 --- a/tests/Test/Xrefcheck/UtilRequests.hs +++ b/tests/Test/Xrefcheck/UtilRequests.hs @@ -15,10 +15,11 @@ module Test.Xrefcheck.UtilRequests , VerifyLinkTestEntry (..) ) where -import Universum +import Universum hiding ((.~)) import Control.Concurrent (forkIO, killThread) import Control.Exception qualified as E +import Control.Lens ((.~)) import Data.Map qualified as M import Data.Set qualified as S import Test.Tasty.HUnit (assertBool)