Browse Source

s/linkcheck/liche/g

renovate/configure
Yota Toyama 8 years ago
parent
commit
7dc638e4be
  1. 16
      README.md
  2. 4
      arguments.go
  3. 4
      examples/error.feature
  4. 26
      examples/markdown.feature
  5. 2
      rakefile.rb

16
README.md

@ -1,23 +1,23 @@
# linkcheck # liche
[![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/linkcheck.svg?style=flat-square)](https://circleci.com/gh/raviqqe/linkcheck) [![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/liche.svg?style=flat-square)](https://circleci.com/gh/raviqqe/liche)
[![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/linkcheck?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/linkcheck) [![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/liche?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/liche)
[![License](https://img.shields.io/github/license/raviqqe/linkcheck.svg?style=flat-square)](LICENSE) [![License](https://img.shields.io/github/license/raviqqe/liche.svg?style=flat-square)](LICENSE)
`linkcheck` is a command line tool to check links in Markdown and HTML files. `liche` is a command line tool to check links in Markdown and HTML files.
It checks all `a` and `img` tags in specified files. It checks all `a` and `img` tags in specified files.
## Installation ## Installation
```sh ```sh
go get -u github.com/raviqqe/linkcheck go get -u github.com/raviqqe/liche
``` ```
## Usage ## Usage
```sh ```sh
linkcheck file.md liche file.md
linkcheck file1.md file2.md liche file1.md file2.md
``` ```
## License ## License

4
arguments.go

@ -10,7 +10,7 @@ import (
const usage = `Link checker for Markdown and HTML const usage = `Link checker for Markdown and HTML
Usage: Usage:
linkcheck [-t <timeout>] [-v] <filenames>... liche [-t <timeout>] [-v] <filenames>...
Options: Options:
-v, --verbose Be verbose -v, --verbose Be verbose
@ -23,7 +23,7 @@ type arguments struct {
} }
func getArgs() (arguments, error) { func getArgs() (arguments, error) {
args, err := docopt.Parse(usage, nil, true, "linkcheck", true) args, err := docopt.Parse(usage, nil, true, "liche", true)
if err != nil { if err != nil {
return arguments{}, err return arguments{}, err

4
examples/error.feature

@ -1,11 +1,11 @@
Feature: Error Feature: Error
Scenario: Fail with no argument Scenario: Fail with no argument
Given a file named "foo.md" with "" Given a file named "foo.md" with ""
When I run `linkcheck` When I run `liche`
Then the exit status should be 1 Then the exit status should be 1
Scenario: Fail with a non-existent file Scenario: Fail with a non-existent file
Given a file named "foo.md" with "" Given a file named "foo.md" with ""
When I run `linkcheck bar.md` When I run `liche bar.md`
Then the exit status should be 1 Then the exit status should be 1
And the stderr should contain "no such file" And the stderr should contain "no such file"

26
examples/markdown.feature

@ -1,7 +1,7 @@
Feature: Markdown Feature: Markdown
Scenario: Check an empty markdown file Scenario: Check an empty markdown file
Given a file named "foo.md" with "" Given a file named "foo.md" with ""
When I successfully run `linkcheck foo.md` When I successfully run `liche foo.md`
Then the stdout should contain exactly "" Then the stdout should contain exactly ""
Scenario: Check a markdown file Scenario: Check a markdown file
@ -22,7 +22,7 @@ Feature: Markdown
echo Hello, world! echo Hello, world!
``` ```
""" """
When I successfully run `linkcheck foo.md` When I successfully run `liche foo.md`
Then the stdout should contain exactly "" Then the stdout should contain exactly ""
Scenario: Check a markdown file which contains a live link Scenario: Check a markdown file which contains a live link
@ -30,7 +30,7 @@ Feature: Markdown
""" """
[Google](https://google.com) [Google](https://google.com)
""" """
When I successfully run `linkcheck foo.md` When I successfully run `liche foo.md`
Then the stdout should contain exactly "" Then the stdout should contain exactly ""
Scenario: Check a markdown file which contains a dead link Scenario: Check a markdown file which contains a dead link
@ -38,7 +38,7 @@ Feature: Markdown
""" """
[The answer](https://some-say-the-answer-is-42.com) [The answer](https://some-say-the-answer-is-42.com)
""" """
When I run `linkcheck foo.md` When I run `liche foo.md`
Then the exit status should be 1 Then the exit status should be 1
And the stderr should contain "ERROR" And the stderr should contain "ERROR"
@ -48,7 +48,7 @@ Feature: Markdown
[Google](https://google.com) [Google](https://google.com)
[The answer](https://some-say-the-answer-is-42.com) [The answer](https://some-say-the-answer-is-42.com)
""" """
When I run `linkcheck foo.md` When I run `liche foo.md`
Then the exit status should be 1 Then the exit status should be 1
And the stderr should not contain "OK" And the stderr should not contain "OK"
And the stderr should contain "ERROR" And the stderr should contain "ERROR"
@ -58,7 +58,7 @@ Feature: Markdown
""" """
[Google](https://google.com) [Google](https://google.com)
""" """
When I successfully run `linkcheck -v foo.md` When I successfully run `liche -v foo.md`
Then the stderr should contain "OK" Then the stderr should contain "OK"
Scenario: Check a markdown file which contains a live link in verbose mode with a long option Scenario: Check a markdown file which contains a live link in verbose mode with a long option
@ -66,7 +66,7 @@ Feature: Markdown
""" """
[Google](https://google.com) [Google](https://google.com)
""" """
When I successfully run `linkcheck --verbose foo.md` When I successfully run `liche --verbose foo.md`
Then the stderr should contain "OK" Then the stderr should contain "OK"
Scenario: Check a markdown file which contains live and dead links in verbose mode Scenario: Check a markdown file which contains live and dead links in verbose mode
@ -75,7 +75,7 @@ Feature: Markdown
[Google](https://google.com) [Google](https://google.com)
[The answer](https://some-say-the-answer-is-42.com) [The answer](https://some-say-the-answer-is-42.com)
""" """
When I run `linkcheck -v foo.md` When I run `liche -v foo.md`
Then the exit status should be 1 Then the exit status should be 1
And the stderr should contain "OK" And the stderr should contain "OK"
And the stderr should contain "ERROR" And the stderr should contain "ERROR"
@ -89,18 +89,18 @@ Feature: Markdown
""" """
[Yahoo](https://yahoo.com) [Yahoo](https://yahoo.com)
""" """
When I successfully run `linkcheck foo.md bar.md` When I successfully run `liche foo.md bar.md`
Then the stdout should contain exactly "" Then the stdout should contain exactly ""
Scenario: Check 2 markdown files Scenario: Check 2 markdown files
Given a file named "foo.md" with: Given a file named "foo.md" with:
""" """
[![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/linkcheck.svg?style=flat-square)](https://circleci.com/gh/raviqqe/linkcheck) [![Circle CI](https://img.shields.io/circleci/project/github/raviqqe/liche.svg?style=flat-square)](https://circleci.com/gh/raviqqe/liche)
[![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/linkcheck?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/linkcheck) [![Go Report Card](https://goreportcard.com/badge/github.com/raviqqe/liche?style=flat-square)](https://goreportcard.com/report/github.com/raviqqe/liche)
""" """
And a file named "foo.sh" with: And a file named "foo.sh" with:
""" """
linkcheck -v foo.md 2>&1 | wc -l liche -v foo.md 2>&1 | wc -l
""" """
When I successfully run `sh foo.sh` When I successfully run `sh foo.sh`
Then the stdout should contain exactly "5" Then the stdout should contain exactly "5"
@ -110,5 +110,5 @@ Feature: Markdown
""" """
[Google](https://google.com) [Google](https://google.com)
""" """
When I successfully run `linkcheck --timeout 10 foo.md` When I successfully run `liche --timeout 10 foo.md`
Then the stdout should contain exactly "" Then the stdout should contain exactly ""

2
rakefile.rb

@ -9,7 +9,7 @@ task :deps do
end end
task :build do task :build do
sh 'go build -o bin/linkcheck' sh 'go build -o bin/liche'
end end
task :fast_unit_test do task :fast_unit_test do

Loading…
Cancel
Save