vendor: switch to using go1.11 modules
This commit is contained in:
-1
@@ -1 +0,0 @@
|
||||
go-md2man
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"Vendor": true,
|
||||
"Deadline": "2m",
|
||||
"Sort": ["linter", "severity", "path", "line"],
|
||||
"Enable": [
|
||||
"deadcode",
|
||||
"errcheck",
|
||||
"structcheck",
|
||||
"unused",
|
||||
"varcheck",
|
||||
"unconvert",
|
||||
"gofmt",
|
||||
"goimports",
|
||||
"golint",
|
||||
"ineffassign",
|
||||
"vet",
|
||||
"goconst",
|
||||
"megacheck"
|
||||
]
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- tip
|
||||
script:
|
||||
- script/setup/dev-tools
|
||||
- script/validate/vendor
|
||||
- go build -i .
|
||||
- make check
|
||||
- go build
|
||||
- go test -v ./...
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
FROM golang:1.8 AS build
|
||||
COPY . /go/src/github.com/cpuguy83/go-md2man
|
||||
WORKDIR /go/src/github.com/cpuguy83/go-md2man
|
||||
RUN CGO_ENABLED=0 go build
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/go-md2man /go-md2man
|
||||
ENTRYPOINT ["/go-md2man"]
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
|
||||
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/russross/blackfriday"
|
||||
packages = ["."]
|
||||
revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c"
|
||||
version = "v1.5"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "d4fdd599038b13752bbcaf722cac55d8e6d81b6fd60bb325df3e31d71aaf358c"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
|
||||
# Gopkg.toml example
|
||||
#
|
||||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
|
||||
# for detailed Gopkg.toml documentation.
|
||||
#
|
||||
# required = ["github.com/user/thing/cmd/thing"]
|
||||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project"
|
||||
# version = "1.0.0"
|
||||
#
|
||||
# [[constraint]]
|
||||
# name = "github.com/user/project2"
|
||||
# branch = "dev"
|
||||
# source = "github.com/myfork/project2"
|
||||
#
|
||||
# [[override]]
|
||||
# name = "github.com/x/y"
|
||||
# version = "2.4.0"
|
||||
|
||||
|
||||
[[constraint]]
|
||||
name = "github.com/russross/blackfriday"
|
||||
version = "1.4"
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
check:
|
||||
gometalinter --config .gometalinter.json ./...
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
go-md2man
|
||||
=========
|
||||
|
||||
** Work in Progress **
|
||||
This still needs a lot of help to be complete, or even usable!
|
||||
|
||||
Uses blackfriday to process markdown into man pages.
|
||||
|
||||
### Usage
|
||||
|
||||
./md2man -in /path/to/markdownfile.md -out /manfile/output/path
|
||||
|
||||
### How to contribute
|
||||
|
||||
We use [dep](https://github.com/golang/dep/) for vendoring Go packages.
|
||||
See dep documentation for how to update.
|
||||
|
||||
### TODO
|
||||
|
||||
- Needs oh so much testing love
|
||||
- Look into blackfriday's 2.0 API
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
go-md2man 1 "January 2015" go-md2man "User Manual"
|
||||
==================================================
|
||||
|
||||
# NAME
|
||||
go-md2man - Convert mardown files into manpages
|
||||
|
||||
# SYNOPSIS
|
||||
go-md2man -in=[/path/to/md/file] -out=[/path/to/output]
|
||||
|
||||
# Description
|
||||
go-md2man converts standard markdown formatted documents into manpages. It is
|
||||
written purely in Go so as to reduce dependencies on 3rd party libs.
|
||||
|
||||
By default, the input is stdin and the output is stdout.
|
||||
|
||||
# Example
|
||||
Convert the markdown file "go-md2man.1.md" into a manpage.
|
||||
|
||||
go-md2man -in=README.md -out=go-md2man.1.out
|
||||
|
||||
# HISTORY
|
||||
January 2015, Originally compiled by Brian Goff( cpuguy83@gmail.com )
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/cpuguy83/go-md2man/md2man"
|
||||
)
|
||||
|
||||
var inFilePath = flag.String("in", "", "Path to file to be processed (default: stdin)")
|
||||
var outFilePath = flag.String("out", "", "Path to output processed file (default: stdout)")
|
||||
|
||||
func main() {
|
||||
var err error
|
||||
flag.Parse()
|
||||
|
||||
inFile := os.Stdin
|
||||
if *inFilePath != "" {
|
||||
inFile, err = os.Open(*inFilePath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
defer inFile.Close() // nolint: errcheck
|
||||
|
||||
doc, err := ioutil.ReadAll(inFile)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
out := md2man.Render(doc)
|
||||
|
||||
outFile := os.Stdout
|
||||
if *outFilePath != "" {
|
||||
outFile, err = os.Create(*outFilePath)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
defer outFile.Close() // nolint: errcheck
|
||||
}
|
||||
_, err = outFile.Write(out)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
package md2man
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTitleBlock(t *testing.T) {
|
||||
r := &roffRenderer{}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
title := []byte("% stuff\n% more stuff\n% even more stuff")
|
||||
|
||||
r.TitleBlock(buf, title)
|
||||
expected := ".TH \"stuff\" \"more stuff\" \"even more stuff\" \n.nh\n.ad l\n"
|
||||
actual := buf.String()
|
||||
if expected != actual {
|
||||
t.Fatalf("expected:\n%s\nactual:\n%s", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBlockCode(t *testing.T) {
|
||||
r := &roffRenderer{}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
|
||||
code := []byte("$ echo hello world\nhello world\n")
|
||||
r.BlockCode(buf, code, "")
|
||||
|
||||
expected := `
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
$ echo hello world
|
||||
hello world
|
||||
|
||||
.fi
|
||||
.RE
|
||||
`
|
||||
result := buf.String()
|
||||
if expected != result {
|
||||
t.Fatalf("got incorrect output:\nexpected:\n%v\n\ngot:\n%v", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTableCell(t *testing.T) {
|
||||
r := &roffRenderer{}
|
||||
buf := bytes.NewBuffer(nil)
|
||||
cell := []byte{}
|
||||
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected := " "
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t "
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("*")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t*"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("this is a test with some really long string")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\tT{\nthis is a test with some really long string\nT}"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("some short string")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\tsome short string"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte{}
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t "
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
|
||||
cell = []byte("*")
|
||||
r.TableCell(buf, cell, 0)
|
||||
expected += "\t*"
|
||||
if buf.String() != expected {
|
||||
t.Fatalf("expected %q, got %q", expected, buf.String())
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
go get -u github.com/alecthomas/gometalinter
|
||||
gometalinter --install >/dev/null
|
||||
go get -u github.com/golang/dep/cmd/dep
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu -o pipefail
|
||||
|
||||
dep ensure
|
||||
|
||||
DIFF_PATH="vendor/"
|
||||
DIFF=$(git status --porcelain -- "$DIFF_PATH")
|
||||
|
||||
if [ "$DIFF" ]; then
|
||||
echo
|
||||
echo "These files were modified:"
|
||||
echo
|
||||
echo "$DIFF"
|
||||
echo
|
||||
exit 1
|
||||
else
|
||||
echo "$DIFF_PATH is correct"
|
||||
fi
|
||||
Reference in New Issue
Block a user