Skip to content

Commit

Permalink
Merge pull request #17 from serokell/martoon/int139-project-rename
Browse files Browse the repository at this point in the history
[INT-139] Project rename
  • Loading branch information
Martoon-00 authored Jan 14, 2020
2 parents 38bd3b7 + 0c1d453 commit 0c0ccb3
Show file tree
Hide file tree
Showing 21 changed files with 87 additions and 87 deletions.
8 changes: 4 additions & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<img src="https://user-images.githubusercontent.com/5394217/70820564-06b06e00-1dea-11ea-9680-27f661ca2a58.png" alt="Output sample" width="600"/>

### 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.
Expand Down Expand Up @@ -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.

Expand All @@ -66,63 +66,63 @@ 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).

</details>

## 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

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!
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#
# SPDX-License-Identifier: MPL-2.0

(import ./crossref-verifier.nix {}).components.exes.crossref-verify
(import ./xrefcheck.nix {}).components.exes.xrefcheck
12 changes: 6 additions & 6 deletions exec/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -15,7 +15,7 @@ extra-source-files:
- README.md
- src-files/*

description: Please see the README on GitHub at <https://github.com/serokell/crossref-verifier#readme>
description: Please see the README on GitHub at <https://github.com/serokell/xrefcheck#readme>

default-extensions:
- AllowAmbiguousTypes
Expand Down Expand Up @@ -90,7 +90,7 @@ library:
source-dirs: src

executables:
crossref-verify:
xrefcheck:
main: Main.hs
source-dirs: exec
ghc-options:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions release/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/Crv/CLI.hs → src/Xrefcheck/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{-# LANGUAGE ApplicativeDo #-}

module Crv.CLI
module Xrefcheck.CLI
( VerifyMode (..)
, shouldCheckLocal
, shouldCheckExternal
Expand All @@ -19,9 +19,9 @@ 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
import Xrefcheck.Core

modeReadM :: ReadM VerifyMode
modeReadM = eitherReader $ \s ->
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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."

Expand Down
4 changes: 2 additions & 2 deletions src/Crv/Config.hs → src/Xrefcheck/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Crv/Core.hs → src/Xrefcheck/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

-- | Various primitives.

module Crv.Core where
module Xrefcheck.Core where

import Control.DeepSeq (NFData)
import Control.Lens (makeLenses, (%=))
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Crv/Progress.hs → src/Xrefcheck/Progress.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-}

-- | Printing progress bars.
module Crv.Progress
module Xrefcheck.Progress
( -- * Progress
Progress (..)
, initProgress
Expand All @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions src/Crv/Scan.hs → src/Xrefcheck/Scan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

-- | Generalised repo scanner and analyser.

module Crv.Scan
module Xrefcheck.Scan
( Extension
, ScanAction
, FormatsSupport
Expand All @@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

-- | Markdown documents markdownScanner.

module Crv.Scanners.Markdown
module Xrefcheck.Scanners.Markdown
( markdownScanner
, markdownSupport
) where
Expand All @@ -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
Expand Down
Loading

0 comments on commit 0c0ccb3

Please sign in to comment.