mirror of
https://github.com/serokell/xrefcheck.git
synced 2024-08-16 17:10:26 +03:00
Improve readability of imports
Problem: In ``` import qualified Foo.Bar as Bar import Foo.Bar (Bar) ``` names of the imported modules are on different vertical lines, which disables autosorting, and makes it harder to read. Solution: Use `ImportQualifiedPost`
This commit is contained in:
parent
2f9a9d8599
commit
92c3de5587
@ -7,7 +7,7 @@ module Main where
|
||||
|
||||
import Universum
|
||||
|
||||
import qualified Data.ByteString as BS
|
||||
import Data.ByteString qualified as BS
|
||||
import Main.Utf8 (withUtf8)
|
||||
|
||||
import Xrefcheck.CLI (Command (..), getCommand)
|
||||
|
@ -31,6 +31,7 @@ default-extensions:
|
||||
- FlexibleInstances
|
||||
- FunctionalDependencies
|
||||
- GeneralizedNewtypeDeriving
|
||||
- ImportQualifiedPost
|
||||
- LambdaCase
|
||||
- MultiParamTypeClasses
|
||||
- MultiWayIf
|
||||
|
@ -21,9 +21,9 @@ module Xrefcheck.CLI
|
||||
|
||||
import Universum
|
||||
|
||||
import qualified Data.Char as C
|
||||
import qualified Data.List as L
|
||||
import qualified Data.Text as T
|
||||
import Data.Char qualified as C
|
||||
import Data.List qualified as L
|
||||
import Data.Text qualified as T
|
||||
import Data.Version (showVersion)
|
||||
import Options.Applicative
|
||||
(Parser, ReadM, command, eitherReader, execParser, flag, flag', footerDoc, fullDesc, help, helper,
|
||||
|
@ -14,14 +14,14 @@ import Universum
|
||||
import Control.Exception (assert)
|
||||
import Control.Lens (makeLensesWith)
|
||||
import Data.Aeson.TH (deriveFromJSON)
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.Map as Map
|
||||
import Data.ByteString qualified as BS
|
||||
import Data.Map qualified as Map
|
||||
import Data.Yaml (FromJSON (..), decodeEither', prettyPrintParseException, withText)
|
||||
import Instances.TH.Lift ()
|
||||
import Text.Regex.TDFA (CompOption (..), ExecOption (..), Regex)
|
||||
import qualified Text.Regex.TDFA as R
|
||||
import Text.Regex.TDFA qualified as R
|
||||
import Text.Regex.TDFA.ByteString ()
|
||||
import qualified Text.Regex.TDFA.Text as R
|
||||
import Text.Regex.TDFA.Text qualified as R
|
||||
|
||||
-- FIXME: Use </> from System.FilePath
|
||||
-- </> from Posix is used only because we cross-compile to Windows and \ doesn't work on Linux
|
||||
|
@ -14,11 +14,11 @@ import Universum
|
||||
import Control.Lens (makeLenses, (%=))
|
||||
import Data.Aeson (FromJSON (..), withText)
|
||||
import Data.Char (isAlphaNum)
|
||||
import qualified Data.Char as C
|
||||
import Data.Char qualified as C
|
||||
import Data.Default (Default (..))
|
||||
import qualified Data.List as L
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Text as T
|
||||
import Data.List qualified as L
|
||||
import Data.Map qualified as M
|
||||
import Data.Text qualified as T
|
||||
import Fmt (Buildable (..), blockListF, blockListF', nameF, (+|), (|+))
|
||||
import System.Console.Pretty (Color (..), Style (..), color, style)
|
||||
import System.FilePath (isPathSeparator, pathSeparator)
|
||||
|
@ -19,10 +19,10 @@ module Xrefcheck.Scan
|
||||
import Universum
|
||||
|
||||
import Data.Aeson.TH (deriveFromJSON)
|
||||
import qualified Data.Foldable as F
|
||||
import qualified Data.Map as M
|
||||
import Data.Foldable qualified as F
|
||||
import Data.Map qualified as M
|
||||
import GHC.Err (errorWithoutStackTrace)
|
||||
import qualified System.Directory.Tree as Tree
|
||||
import System.Directory.Tree qualified as Tree
|
||||
import System.FilePath (dropTrailingPathSeparator, takeDirectory, takeExtension, (</>))
|
||||
|
||||
import Xrefcheck.Core
|
||||
|
@ -21,11 +21,11 @@ import CMarkGFM (Node (..), NodeType (..), PosInfo (..), commonmarkToNode)
|
||||
import Control.Lens ((%=))
|
||||
import Control.Monad.Trans.Except (Except, runExcept, throwE)
|
||||
import Data.Aeson.TH (deriveFromJSON)
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import Data.ByteString.Lazy qualified as BSL
|
||||
import Data.Char (isSpace)
|
||||
import Data.Default (Default (..))
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.Lazy as LT
|
||||
import Data.Text qualified as T
|
||||
import Data.Text.Lazy qualified as LT
|
||||
import Fmt (Buildable (..), blockListF, nameF, (+|), (|+))
|
||||
|
||||
import Xrefcheck.Core
|
||||
|
@ -13,12 +13,12 @@ module Xrefcheck.System
|
||||
import Universum
|
||||
|
||||
import Data.Aeson (FromJSON (..), withText)
|
||||
import qualified Data.Char as C
|
||||
import Data.Char qualified as C
|
||||
import GHC.IO.Unsafe (unsafePerformIO)
|
||||
import System.Directory (canonicalizePath)
|
||||
import System.Environment (lookupEnv)
|
||||
import System.FilePath ((</>))
|
||||
import qualified System.FilePath.Glob as Glob
|
||||
import System.FilePath.Glob qualified as Glob
|
||||
|
||||
-- | We can quite safely treat surrounding filesystem as frozen,
|
||||
-- so IO reading operations can be turned into pure values.
|
||||
|
@ -16,7 +16,7 @@ module Xrefcheck.Util
|
||||
import Universum
|
||||
|
||||
import Control.Lens (LensRules, lensField, lensRules, mappingNamer)
|
||||
import qualified Data.Aeson as Aeson
|
||||
import Data.Aeson qualified as Aeson
|
||||
import Data.Aeson.Casing (aesonPrefix, camelCase)
|
||||
import Fmt (Builder, build, fmt, nameF)
|
||||
import System.Console.Pretty (Pretty (..), Style (Faint))
|
||||
|
@ -27,13 +27,13 @@ import Universum
|
||||
import Control.Concurrent.Async (wait, withAsync)
|
||||
import Control.Exception (throwIO)
|
||||
import Control.Monad.Except (MonadError (..))
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Text as T
|
||||
import Data.ByteString qualified as BS
|
||||
import Data.Map qualified as M
|
||||
import Data.Text qualified as T
|
||||
import Data.Text.Metrics (damerauLevenshteinNorm)
|
||||
import Data.Traversable (for)
|
||||
import Fmt (Buildable (..), blockListF', listF, (+|), (|+))
|
||||
import qualified GHC.Exts as Exts
|
||||
import GHC.Exts qualified as Exts
|
||||
import Network.FTP.Client
|
||||
(FTPException (..), FTPResponse (..), ResponseStatus (..), login, nlst, size, withFTP, withFTPS)
|
||||
import Network.HTTP.Client (HttpException (..), HttpExceptionContent (..), responseStatus)
|
||||
@ -44,7 +44,7 @@ import Network.HTTP.Types.Status (Status, statusCode, statusMessage)
|
||||
import System.Console.Pretty (Style (..), style)
|
||||
import System.Directory (canonicalizePath, doesDirectoryExist, doesFileExist)
|
||||
import System.FilePath (takeDirectory, (</>))
|
||||
import qualified System.FilePath.Glob as Glob
|
||||
import System.FilePath.Glob qualified as Glob
|
||||
import Text.Regex.TDFA.Text (Regex, regexec)
|
||||
import Text.URI (Authority (..), URI (..), mkURI)
|
||||
import Time (RatioNat, Second, Time (..), ms, threadDelay, timeout)
|
||||
|
@ -7,7 +7,7 @@ module Test.Xrefcheck.AnchorsInHeadersSpec where
|
||||
|
||||
import Universum
|
||||
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import Data.ByteString.Lazy qualified as BSL
|
||||
import Test.Hspec (Spec, describe, it, shouldBe)
|
||||
|
||||
import Xrefcheck.Core
|
||||
|
@ -8,9 +8,9 @@ module Test.Xrefcheck.ConfigSpec where
|
||||
import Universum
|
||||
|
||||
import Control.Concurrent (forkIO, killThread)
|
||||
import qualified Control.Exception as E
|
||||
import Control.Exception qualified as E
|
||||
|
||||
import qualified Data.ByteString as BS
|
||||
import Data.ByteString qualified as BS
|
||||
import Network.HTTP.Types (Status (..))
|
||||
import Test.Hspec (Spec, before, describe, it, shouldBe)
|
||||
import Test.QuickCheck (counterexample, ioProperty, once)
|
||||
|
@ -7,7 +7,7 @@ module Test.Xrefcheck.Util where
|
||||
|
||||
import Universum
|
||||
|
||||
import qualified Data.ByteString.Lazy as BSL
|
||||
import Data.ByteString.Lazy qualified as BSL
|
||||
import Network.HTTP.Types (forbidden403, unauthorized401)
|
||||
import Web.Firefly (ToResponse (..), route, run)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user