Skip to content

Commit

Permalink
[Chore] Do not use deprecated things from Universum
Browse files Browse the repository at this point in the history
Problem: some lens-related things that we use got deprecated in
Universum.
Solution: do not use them, import them from Control.Lens instead.
  • Loading branch information
gromakovsky authored and int-index committed Sep 12, 2024
1 parent aebb334 commit b284b0d
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 21 deletions.
3 changes: 2 additions & 1 deletion ftp-tests/Test/Xrefcheck/FtpLinks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ module Test.Xrefcheck.FtpLinks
, test_FtpLinks
) where

import Universum
import Universum hiding ((.~))

import Control.Lens ((.~))
import Data.Tagged (Tagged, untag)
import Options.Applicative (help, long, strOption)
import Test.Tasty (TestTree, askOption, testGroup)
Expand Down
2 changes: 2 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ tests:
- directory
- firefly
- http-types
- lens
- modern-uri
- nyan-interpolation
- o-clock
Expand All @@ -172,6 +173,7 @@ tests:
generated-other-modules:
- Paths_xrefcheck
dependencies:
- lens
- optparse-applicative
- tagged
- tasty
Expand Down
4 changes: 2 additions & 2 deletions src/Xrefcheck/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down
4 changes: 2 additions & 2 deletions src/Xrefcheck/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Xrefcheck/Scan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/Xrefcheck/Scanners/Markdown.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Xrefcheck/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/AnchorsInHeadersSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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, (@?=))

Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/AnchorsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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, (@?=))

Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/ConfigSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/IgnoreAnnotationsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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, (@?=))

Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/IgnoreRegexSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/RedirectChainSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/RedirectConfigSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/TimeoutSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/TrailingSlashSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/Test/Xrefcheck/UtilRequests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b284b0d

Please sign in to comment.