From fd949bc3c8820f272d25a5d7ad5e422152ba5f90 Mon Sep 17 00:00:00 2001 From: martoon Date: Mon, 13 Jan 2020 15:58:14 +0300 Subject: [PATCH 1/2] Rename the project to `xrefcheck` Problem: the previous name `crossref-verifier` was found long and boring. Solution: rename to `xrefcheck`. --- .buildkite/pipeline.yml | 8 +++--- .github/CONTRIBUTING.md | 2 +- README.md | 40 +++++++++++++------------- default.nix | 2 +- package.yaml | 14 ++++----- release/default.nix | 6 ++-- src/Crv/CLI.hs | 8 +++--- crossref-verifier.nix => xrefcheck.nix | 6 ++-- 8 files changed, 43 insertions(+), 43 deletions(-) rename crossref-verifier.nix => xrefcheck.nix (92%) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b41a0996..f24ab285 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -3,14 +3,14 @@ # SPDX-License-Identifier: MPL-2.0 steps: - - command: nix-build crossref-verifier.nix + - command: nix-build xrefcheck.nix label: Library and tests - command: nix-build label: Executable artifact_paths: - - "result/bin/crossref-verify" - - command: nix run -f. -c crossref-verify - label: Crossref-verify itself + - "result/bin/xrefcheck" + - command: nix run -f. -c xrefcheck + label: Xrefcheck itself - command: nix run -f $(nix eval -f nix/sources.nix --raw nixpkgs) reuse -c reuse lint label: REUSE lint - command: diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 80994beb..f93d0107 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -8,7 +8,7 @@ ## Reporting issues -Please [open an issue](https://github.com/serokell/crossref-verifier/issues/new/choose) if you find a bug or have a feature request. +Please [open an issue](https://github.com/serokell/xrefcheck/issues/new/choose) if you find a bug or have a feature request. Note: you need to login (e. g. using your GitHub account) first. Before submitting a bug report or feature request, check to make sure it hasn't already been submitted diff --git a/README.md b/README.md index 80be9ef6..9c647c81 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@ - SPDX-License-Identifier: MPL-2.0 --> -# Crossref-verifier +# Xrefcheck -[![Build status](https://badge.buildkite.com/75461331a6058b334383cdfca1071dc1f908b70cf069d857b7.svg?branch=master)](https://buildkite.com/serokell/crossref-verifier) +[![Build status](https://badge.buildkite.com/75461331a6058b334383cdfca1071dc1f908b70cf069d857b7.svg?branch=master)](https://buildkite.com/serokell/xrefcheck) -Crossref-verifier is a tool for verifying local and external references in repository documentation that is quick, easy to setup, and suitable to be added to CI. +Xrefcheck is a tool for verifying local and external references in repository documentation that is quick, easy to setup, and suitable to be added to CI. Output sample ### Motivation -As the project evolves, links in documentation have a tendency to get broken. This is usually because of: +As the project evolves, links in documentation have a tendency to get broken. This is usually because of: 1. File movements; 2. Markdown header renames; 3. Outer sites ceasing their existence. @@ -45,18 +45,18 @@ Both relative and absolute local links are supported out of the box. * [url-checker](https://github.com/paramt/url-checker) - GitHub action which checks links in specified files. * [broken-link-checker](https://github.com/stevenvachon/broken-link-checker) - advanced checker for `HTML` files. -## Build instructions [↑](#crossref-verifier) +## Build instructions [↑](#xrefcheck) Run `stack install` to build everything and install the executable. -### CI and nix [↑](#crossref-verifier) +### CI and nix [↑](#xrefcheck) -To build only the executables, run `nix-build`. You can use this line on your CI to use crossref-verifier: +To build only the executables, run `nix-build`. You can use this line on your CI to use xrefcheck: ``` -nix run -f https://github.com/serokell/crossref-verifier/archive/master.tar.gz -c crossref-verify +nix run -f https://github.com/serokell/xrefcheck/archive/master.tar.gz -c xrefcheck ``` -Our CI uses `nix-build crossref-verifier.nix` to build the whole project, including tests and Haddock. +Our CI uses `nix-build xrefcheck.nix` to build the whole project, including tests and Haddock. It is based on the [`haskell.nix`](https://input-output-hk.github.io/haskell.nix/) project. You can do that too if you wish. @@ -66,31 +66,31 @@ You can do that too if you wish. There is a [bug](https://github.com/input-output-hk/haskell.nix/issues/335) which causes us to put some redundancy into Nix files: 1. [`nix/sources.json`](nix/sources.json) lists all such dependencies that we obtain using `git`. It specifies concrete git revisions and SHA256 checksums. -2. [`crossref-verifier.nix`](crossref-verifier.nix) lists all such dependencies as well, but without revisions. +2. [`xrefcheck.nix`](xrefcheck.nix) lists all such dependencies as well, but without revisions. As a consequence, you may have to update these files when you update [`stack.yaml`](stack.yaml). You can use [`niv update`](https://github.com/nmattia/niv#update) to update [`nix/sources.json`](nix/sources.json). -## Usage [↑](#crossref-verifier) +## Usage [↑](#xrefcheck) To find all broken links in a repository, run from within its folder: ```sh -crossref-verify +xrefcheck ``` To also display all found links and anchors: ```sh -crossref-verify -v +xrefcheck -v ``` For description of other options: ```sh -crossref-verify --help +xrefcheck --help ``` ## Configuring @@ -98,31 +98,31 @@ crossref-verify --help Configuration template (with all options explained) can be dumped with: ```sh -crossref-verify dump-config +xrefcheck dump-config ``` Currently supported options include: * Timeout for checking external references; * List of ignored folders. -## For further work [↑](#crossref-verifier) +## For further work [↑](#xrefcheck) - [ ] Support for non-Unix systems. - [ ] Support link detection in different languages, not only Markdown. - [ ] Haskell Haddock is first in turn. -## Issue tracker [↑](#crossref-verifier) +## Issue tracker [↑](#xrefcheck) We use GitHub issues as our issue tracker. You can login using your GitHub account to leave a comment or create a new issue. -## For Contributors [↑](#crossref-verifier) +## For Contributors [↑](#xrefcheck) Please see [CONTRIBUTING.md](/.github/CONTRIBUTING.md) for more information. -## About Serokell [↑](#crossref-verifier) +## About Serokell [↑](#xrefcheck) -Crossref-verifier is maintained and funded with ❤️ by [Serokell](https://serokell.io/). +Xrefcheck is maintained and funded with ❤️ by [Serokell](https://serokell.io/). The names and logo for Serokell are trademark of Serokell OÜ. We love open source software! See [our other projects](https://serokell.io/community?utm_source=github) or [hire us](https://serokell.io/hire-us?utm_source=github) to design, develop and grow your idea! diff --git a/default.nix b/default.nix index fa420cc3..8abb21fd 100644 --- a/default.nix +++ b/default.nix @@ -2,4 +2,4 @@ # # SPDX-License-Identifier: MPL-2.0 -(import ./crossref-verifier.nix {}).components.exes.crossref-verify +(import ./xrefcheck.nix {}).components.exes.xrefcheck diff --git a/package.yaml b/package.yaml index 8d63518b..704f719e 100644 --- a/package.yaml +++ b/package.yaml @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: MPL-2.0 -name: crossref-verifier +name: xrefcheck version: 0.1.0.0 -github: serokell/crossref-verifier +github: serokell/xrefcheck license: MPL-2.0 license-file: LICENSE author: Kostya Ivanov, Serokell @@ -15,7 +15,7 @@ extra-source-files: - README.md - src-files/* -description: Please see the README on GitHub at +description: Please see the README on GitHub at default-extensions: - AllowAmbiguousTypes @@ -90,7 +90,7 @@ library: source-dirs: src executables: - crossref-verify: + xrefcheck: main: Main.hs source-dirs: exec ghc-options: @@ -99,14 +99,14 @@ executables: - -with-rtsopts=-N - -O2 dependencies: - - crossref-verifier + - xrefcheck tests: - crossref-verifier-tests: + xrefcheck-tests: main: Main.hs source-dirs: tests dependencies: - - crossref-verifier + - xrefcheck - hspec - QuickCheck build-tools: diff --git a/release/default.nix b/release/default.nix index e0c661f2..32388e2e 100644 --- a/release/default.nix +++ b/release/default.nix @@ -4,16 +4,16 @@ { pkgs ? import (import ../nix/sources.nix).nixpkgs { } }: let - executable = (import ../crossref-verifier.nix { + executable = (import ../xrefcheck.nix { static = true; - }).components.exes.crossref-verify; + }).components.exes.xrefcheck; joinByBasename = name: paths: pkgs.runCommandNoCC name { } ('' mkdir $out '' + pkgs.lib.concatMapStrings (path: '' ln -s ${path} $out/${builtins.baseNameOf path} '') paths); -in joinByBasename "crossref-verifier-release" [ +in joinByBasename "xrefcheck-release" [ "${executable}/bin" ../LICENSES ../README.md diff --git a/src/Crv/CLI.hs b/src/Crv/CLI.hs index 0f789313..a3b77b02 100644 --- a/src/Crv/CLI.hs +++ b/src/Crv/CLI.hs @@ -19,7 +19,7 @@ import Data.Version (showVersion) import Options.Applicative (Parser, ReadM, command, eitherReader, execParser, fullDesc, help, helper, hsubparser, info, infoOption, long, metavar, option, progDesc, short, strOption, switch, value) -import Paths_crossref_verifier (version) +import Paths_xrefcheck (version) import Crv.Core @@ -52,7 +52,7 @@ data Options = Options -- | Where to try to seek configuration if specific path is not set. defaultConfigPaths :: [FilePath] -defaultConfigPaths = ["./crossref-verifier.yaml", "./.crossref-verifier.yaml"] +defaultConfigPaths = ["./xrefcheck.yaml", "./.xrefcheck.yaml"] optionsParser :: Parser Options optionsParser = do @@ -99,7 +99,7 @@ dumpConfigOptions = hsubparser $ short 'o' <> long "output" <> metavar "FILEPATH" <> - value ".crossref-verifier.yaml" <> + value ".xrefcheck.yaml" <> help "Name of created config file." totalParser :: Parser Command @@ -109,7 +109,7 @@ totalParser = asum ] versionOption :: Parser (a -> a) -versionOption = infoOption ("crossref-verify-" <> (showVersion version)) $ +versionOption = infoOption ("xrefcheck-" <> (showVersion version)) $ long "version" <> help "Show version." diff --git a/crossref-verifier.nix b/xrefcheck.nix similarity index 92% rename from crossref-verifier.nix rename to xrefcheck.nix index aeae92a3..5d28146d 100644 --- a/crossref-verifier.nix +++ b/xrefcheck.nix @@ -13,12 +13,12 @@ let project = hn.stackProject { src = hn.haskellLib.cleanGit { src = ./.; }; modules = [{ - packages.crossref-verifier = { + packages.xrefcheck = { # More failures during CI == Less failures in runtime! postHaddock = '' [[ -z "$(ls -A dist/doc/html)" ]] && exit 1 || echo "haddock successfully generated documentation"''; package.ghcOptions = "-Werror"; - components.exes.crossref-verify.configureFlags = + components.exes.xrefcheck.configureFlags = with nixpkgs.pkgsStatic; lib.optionals static [ "--disable-executable-dynamic" @@ -42,4 +42,4 @@ let subdir = "code/prelude"; }]; }; -in project.crossref-verifier +in project.xrefcheck From 0c1d453e8740563b79879109659f189b63ddda08 Mon Sep 17 00:00:00 2001 From: martoon Date: Mon, 13 Jan 2020 16:06:19 +0300 Subject: [PATCH 2/2] Rename module names Problem: module names are prefixed with `Crv` which does not suit the new project naming. Solution: following the new `xrefcheck` name, rename modules so that they start from `Xrefcheck`. --- exec/Main.hs | 12 +++++----- src/{Crv => Xrefcheck}/CLI.hs | 6 ++--- src/{Crv => Xrefcheck}/Config.hs | 4 ++-- src/{Crv => Xrefcheck}/Core.hs | 6 ++--- src/{Crv => Xrefcheck}/Progress.hs | 6 ++--- src/{Crv => Xrefcheck}/Scan.hs | 10 ++++---- src/{Crv => Xrefcheck}/Scanners.hs | 0 src/{Crv => Xrefcheck}/Scanners/Markdown.hs | 6 ++--- src/{Crv => Xrefcheck}/System.hs | 2 +- src/{Crv => Xrefcheck}/Util.hs | 2 +- src/{Crv => Xrefcheck}/Verify.hs | 24 ++++++++++---------- tests/Test/{Crv => Xrefcheck}/AnchorsSpec.hs | 4 ++-- tests/Test/{Crv => Xrefcheck}/ConfigSpec.hs | 4 ++-- tests/Test/{Crv => Xrefcheck}/LocalSpec.hs | 4 ++-- 14 files changed, 45 insertions(+), 45 deletions(-) rename src/{Crv => Xrefcheck}/CLI.hs (97%) rename src/{Crv => Xrefcheck}/Config.hs (96%) rename src/{Crv => Xrefcheck}/Core.hs (99%) rename src/{Crv => Xrefcheck}/Progress.hs (98%) rename src/{Crv => Xrefcheck}/Scan.hs (95%) rename src/{Crv => Xrefcheck}/Scanners.hs (100%) rename src/{Crv => Xrefcheck}/Scanners/Markdown.hs (97%) rename src/{Crv => Xrefcheck}/System.hs (97%) rename src/{Crv => Xrefcheck}/Util.hs (96%) rename src/{Crv => Xrefcheck}/Verify.hs (96%) rename tests/Test/{Crv => Xrefcheck}/AnchorsSpec.hs (93%) rename tests/Test/{Crv => Xrefcheck}/ConfigSpec.hs (82%) rename tests/Test/{Crv => Xrefcheck}/LocalSpec.hs (87%) diff --git a/exec/Main.hs b/exec/Main.hs index 32306790..a3211f63 100644 --- a/exec/Main.hs +++ b/exec/Main.hs @@ -10,12 +10,12 @@ import Data.Yaml (decodeFileEither, prettyPrintParseException) import Fmt (blockListF', build, fmt, fmtLn, indentF) import System.Directory (doesFileExist) -import Crv.CLI -import Crv.Config -import Crv.Progress -import Crv.Scan -import Crv.Scanners -import Crv.Verify +import Xrefcheck.CLI +import Xrefcheck.Config +import Xrefcheck.Progress +import Xrefcheck.Scan +import Xrefcheck.Scanners +import Xrefcheck.Verify formats :: FormatsSupport formats = specificFormatsSupport diff --git a/src/Crv/CLI.hs b/src/Xrefcheck/CLI.hs similarity index 97% rename from src/Crv/CLI.hs rename to src/Xrefcheck/CLI.hs index a3b77b02..e2ebcd80 100644 --- a/src/Crv/CLI.hs +++ b/src/Xrefcheck/CLI.hs @@ -5,7 +5,7 @@ {-# LANGUAGE ApplicativeDo #-} -module Crv.CLI +module Xrefcheck.CLI ( VerifyMode (..) , shouldCheckLocal , shouldCheckExternal @@ -21,7 +21,7 @@ import Options.Applicative (Parser, ReadM, command, eitherReader, execParser, fu short, strOption, switch, value) import Paths_xrefcheck (version) -import Crv.Core +import Xrefcheck.Core modeReadM :: ReadM VerifyMode modeReadM = eitherReader $ \s -> @@ -109,7 +109,7 @@ totalParser = asum ] versionOption :: Parser (a -> a) -versionOption = infoOption ("xrefcheck-" <> (showVersion version)) $ +versionOption = infoOption ("xrefcheck-" <> showVersion version) $ long "version" <> help "Show version." diff --git a/src/Crv/Config.hs b/src/Xrefcheck/Config.hs similarity index 96% rename from src/Crv/Config.hs rename to src/Xrefcheck/Config.hs index 38a9807b..22f783d4 100644 --- a/src/Crv/Config.hs +++ b/src/Xrefcheck/Config.hs @@ -5,7 +5,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Crv.Config where +module Xrefcheck.Config where import Data.Aeson.Options (defaultOptions) import Data.Aeson.TH (deriveFromJSON) @@ -16,7 +16,7 @@ import System.FilePath.Posix (()) import TH.RelativePaths (qReadFileBS) import Time (KnownRatName, Second, Time, unitsP) -import Crv.System (CanonicalizedGlobPattern) +import Xrefcheck.System (CanonicalizedGlobPattern) -- | Overall config. data Config = Config diff --git a/src/Crv/Core.hs b/src/Xrefcheck/Core.hs similarity index 99% rename from src/Crv/Core.hs rename to src/Xrefcheck/Core.hs index 85eba45c..328fb7e7 100644 --- a/src/Crv/Core.hs +++ b/src/Xrefcheck/Core.hs @@ -7,7 +7,7 @@ -- | Various primitives. -module Crv.Core where +module Xrefcheck.Core where import Control.DeepSeq (NFData) import Control.Lens (makeLenses, (%=)) @@ -22,8 +22,8 @@ import System.Console.Pretty (Color (..), Style (..), color, style) import System.FilePath.Posix (isPathSeparator, pathSeparator) import Text.Numeral.Roman (toRoman) -import Crv.Progress -import Crv.Util +import Xrefcheck.Progress +import Xrefcheck.Util ----------------------------------------------------------- -- Types diff --git a/src/Crv/Progress.hs b/src/Xrefcheck/Progress.hs similarity index 98% rename from src/Crv/Progress.hs rename to src/Xrefcheck/Progress.hs index b849e300..a8e12345 100644 --- a/src/Crv/Progress.hs +++ b/src/Xrefcheck/Progress.hs @@ -4,7 +4,7 @@ -} -- | Printing progress bars. -module Crv.Progress +module Xrefcheck.Progress ( -- * Progress Progress (..) , initProgress @@ -30,9 +30,9 @@ import Time (ms, threadDelay) data Progress a = Progress { pCurrent :: a -- ^ How much has been completed. - , pTotal :: a + , pTotal :: a -- ^ Overall amount of work. - , pErrors :: !a + , pErrors :: !a -- ^ How many of the completed work finished with an error. } deriving (Show) diff --git a/src/Crv/Scan.hs b/src/Xrefcheck/Scan.hs similarity index 95% rename from src/Crv/Scan.hs rename to src/Xrefcheck/Scan.hs index 53f9c68e..cd413699 100644 --- a/src/Crv/Scan.hs +++ b/src/Xrefcheck/Scan.hs @@ -5,7 +5,7 @@ -- | Generalised repo scanner and analyser. -module Crv.Scan +module Xrefcheck.Scan ( Extension , ScanAction , FormatsSupport @@ -21,10 +21,10 @@ import GHC.Err (errorWithoutStackTrace) import qualified System.Directory.Tree as Tree import System.FilePath.Posix (takeDirectory, takeExtension, ()) -import Crv.Config -import Crv.Core -import Crv.Progress -import Crv.Util () +import Xrefcheck.Config +import Xrefcheck.Core +import Xrefcheck.Progress +import Xrefcheck.Util () -- | File extension, dot included. type Extension = String diff --git a/src/Crv/Scanners.hs b/src/Xrefcheck/Scanners.hs similarity index 100% rename from src/Crv/Scanners.hs rename to src/Xrefcheck/Scanners.hs diff --git a/src/Crv/Scanners/Markdown.hs b/src/Xrefcheck/Scanners/Markdown.hs similarity index 97% rename from src/Crv/Scanners/Markdown.hs rename to src/Xrefcheck/Scanners/Markdown.hs index 854b0602..c6f0cebc 100644 --- a/src/Crv/Scanners/Markdown.hs +++ b/src/Xrefcheck/Scanners/Markdown.hs @@ -7,7 +7,7 @@ -- | Markdown documents markdownScanner. -module Crv.Scanners.Markdown +module Xrefcheck.Scanners.Markdown ( markdownScanner , markdownSupport ) where @@ -21,8 +21,8 @@ import qualified Data.Text.Lazy as LT import Fmt (Buildable (..), blockListF, nameF, (+|), (|+)) import GHC.Conc (par) -import Crv.Core -import Crv.Scan +import Xrefcheck.Core +import Xrefcheck.Scan instance Buildable Node where build (Node _mpos ty subs) = nameF (show ty) $ blockListF subs diff --git a/src/Crv/System.hs b/src/Xrefcheck/System.hs similarity index 97% rename from src/Crv/System.hs rename to src/Xrefcheck/System.hs index 91fbc62f..9be47b27 100644 --- a/src/Crv/System.hs +++ b/src/Xrefcheck/System.hs @@ -3,7 +3,7 @@ - SPDX-License-Identifier: MPL-2.0 -} -module Crv.System +module Xrefcheck.System ( readingSystem , CanonicalizedGlobPattern (..) ) where diff --git a/src/Crv/Util.hs b/src/Xrefcheck/Util.hs similarity index 96% rename from src/Crv/Util.hs rename to src/Xrefcheck/Util.hs index 3226f6f4..ed067e8f 100644 --- a/src/Crv/Util.hs +++ b/src/Xrefcheck/Util.hs @@ -5,7 +5,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} -module Crv.Util +module Xrefcheck.Util ( nameF' , paren ) where diff --git a/src/Crv/Verify.hs b/src/Xrefcheck/Verify.hs similarity index 96% rename from src/Crv/Verify.hs rename to src/Xrefcheck/Verify.hs index e55fbfa9..79a229b4 100644 --- a/src/Crv/Verify.hs +++ b/src/Xrefcheck/Verify.hs @@ -7,7 +7,7 @@ {-# LANGUAGE PartialTypeSignatures #-} {-# OPTIONS_GHC -Wno-partial-type-signatures #-} -module Crv.Verify +module Xrefcheck.Verify ( -- * General verification VerifyResult (..) , verifyOk @@ -17,7 +17,7 @@ module Crv.Verify , WithReferenceLoc (..) -- * Cross-references validation - , CrvVerifyError (..) + , VerifyError (..) , verifyRepo , checkExternalResource ) where @@ -39,10 +39,10 @@ import qualified System.FilePath.Glob as Glob import System.FilePath.Posix (takeDirectory, ()) import Time (RatioNat, Second, Time (..), ms, threadDelay, timeout) -import Crv.Config -import Crv.Core -import Crv.Progress -import Crv.System +import Xrefcheck.Config +import Xrefcheck.Core +import Xrefcheck.Progress +import Xrefcheck.System {-# ANN module ("HLint: ignore Use uncurry" :: Text) #-} {-# ANN module ("HLint: ignore Use 'runExceptT' from Universum" :: Text) #-} @@ -89,7 +89,7 @@ instance Buildable a => Buildable (WithReferenceLoc a) where "In file " +| style Faint (style Bold wrlFile) |+ "\nbad " +| wrlReference |+ "\n" +| wrlItem |+ "\n\n" -data CrvVerifyError +data VerifyError = FileDoesNotExist FilePath | AnchorDoesNotExist Text [Anchor] | AmbiguousAnchorRef FilePath Text (NonEmpty Anchor) @@ -98,7 +98,7 @@ data CrvVerifyError | ExternalResourceSomeError Text deriving (Show) -instance Buildable CrvVerifyError where +instance Buildable VerifyError where build = \case FileDoesNotExist file -> "⛀ File does not exist:\n " +| file |+ "\n" @@ -131,7 +131,7 @@ verifyRepo -> VerifyMode -> FilePath -> RepoInfo - -> IO (VerifyResult $ WithReferenceLoc CrvVerifyError) + -> IO (VerifyResult $ WithReferenceLoc VerifyError) verifyRepo rw config@VerifyConfig{..} mode root repoInfo'@(RepoInfo repoInfo) = do let toScan = do (file, fileInfo) <- M.toList repoInfo @@ -163,7 +163,7 @@ verifyReference -> FilePath -> FilePath -> Reference - -> IO (VerifyResult $ WithReferenceLoc CrvVerifyError) + -> IO (VerifyResult $ WithReferenceLoc VerifyError) verifyReference config@VerifyConfig{..} mode progressRef (RepoInfo repoInfo) root fileWithReference ref@Reference{..} = do @@ -244,7 +244,7 @@ verifyReference config@VerifyConfig{..} mode progressRef (RepoInfo repoInfo) checkExternalResource :: VerifyConfig -> Text - -> IO (VerifyResult CrvVerifyError) + -> IO (VerifyResult VerifyError) checkExternalResource VerifyConfig{..} link | doesReferLocalhost = return mempty | otherwise = fmap toVerifyRes $ do @@ -254,7 +254,7 @@ checkExternalResource VerifyConfig{..} link where doesReferLocalhost = any (`T.isInfixOf` link) ["://localhost", "://127.0.0.1"] - makeRequest :: _ => method -> RatioNat -> IO (Either CrvVerifyError ()) + makeRequest :: _ => method -> RatioNat -> IO (Either VerifyError ()) makeRequest method timeoutFrac = runExceptT $ do parsedUrl <- parseUrl (encodeUtf8 link) & maybe (throwError ExternalResourceInvalidUri) pure diff --git a/tests/Test/Crv/AnchorsSpec.hs b/tests/Test/Xrefcheck/AnchorsSpec.hs similarity index 93% rename from tests/Test/Crv/AnchorsSpec.hs rename to tests/Test/Xrefcheck/AnchorsSpec.hs index ec7b4919..cab4a497 100644 --- a/tests/Test/Crv/AnchorsSpec.hs +++ b/tests/Test/Xrefcheck/AnchorsSpec.hs @@ -3,12 +3,12 @@ - SPDX-License-Identifier: MPL-2.0 -} -module Test.Crv.AnchorsSpec where +module Test.Xrefcheck.AnchorsSpec where import Test.Hspec (Spec, describe, it) import Test.QuickCheck ((===)) -import Crv.Core (headerToAnchor) +import Xrefcheck.Core (headerToAnchor) spec :: Spec spec = do diff --git a/tests/Test/Crv/ConfigSpec.hs b/tests/Test/Xrefcheck/ConfigSpec.hs similarity index 82% rename from tests/Test/Crv/ConfigSpec.hs rename to tests/Test/Xrefcheck/ConfigSpec.hs index 724de17d..2ba50fa8 100644 --- a/tests/Test/Crv/ConfigSpec.hs +++ b/tests/Test/Xrefcheck/ConfigSpec.hs @@ -3,12 +3,12 @@ - SPDX-License-Identifier: MPL-2.0 -} -module Test.Crv.ConfigSpec where +module Test.Xrefcheck.ConfigSpec where import Test.Hspec (Spec, it) import Test.QuickCheck (ioProperty, once) -import Crv.Config +import Xrefcheck.Config spec :: Spec spec = diff --git a/tests/Test/Crv/LocalSpec.hs b/tests/Test/Xrefcheck/LocalSpec.hs similarity index 87% rename from tests/Test/Crv/LocalSpec.hs rename to tests/Test/Xrefcheck/LocalSpec.hs index 605706e8..434baf0f 100644 --- a/tests/Test/Crv/LocalSpec.hs +++ b/tests/Test/Xrefcheck/LocalSpec.hs @@ -3,12 +3,12 @@ - SPDX-License-Identifier: MPL-2.0 -} -module Test.Crv.LocalSpec where +module Test.Xrefcheck.LocalSpec where import Test.Hspec (Spec, describe, it) import Test.QuickCheck ((===)) -import Crv.Core (canonizeLocalRef) +import Xrefcheck.Core (canonizeLocalRef) spec :: Spec spec = do