Skip to content

Commit

Permalink
Replace all dependencies on github.com/princjef/gomarkdoc with github…
Browse files Browse the repository at this point in the history
….com/Weborama/gomarkdoc (fighting with go module forks).
  • Loading branch information
gglachant committed Jan 10, 2023
1 parent e97b68a commit 526bd7b
Show file tree
Hide file tree
Showing 32 changed files with 243 additions and 197 deletions.
8 changes: 4 additions & 4 deletions .gomarkdoc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
output: "{{.Dir}}/README.md"
header: |+
[![Go Report Card](https://goreportcard.com/badge/github.com/princjef/gomarkdoc)](https://goreportcard.com/report/github.com/princjef/gomarkdoc)
[![GitHub Actions](https://github.com/princjef/gomarkdoc/workflows/Test/badge.svg)](https://github.com/princjef/gomarkdoc/actions?query=workflow%3ATest+branch%3Amaster)
[![Go Reference](https://pkg.go.dev/badge/github.com/princjef/gomarkdoc.svg)](https://pkg.go.dev/github.com/princjef/gomarkdoc)
[![Go Report Card](https://goreportcard.com/badge/github.com/Weborama/gomarkdoc)](https://goreportcard.com/report/github.com/Weborama/gomarkdoc)
[![GitHub Actions](https://github.com/Weborama/gomarkdoc/workflows/Test/badge.svg)](https://github.com/Weborama/gomarkdoc/actions?query=workflow%3ATest+branch%3Amaster)
[![Go Reference](https://pkg.go.dev/badge/github.com/Weborama/gomarkdoc.svg)](https://pkg.go.dev/github.com/Weborama/gomarkdoc)
[![codecov](https://codecov.io/gh/princjef/gomarkdoc/branch/master/graph/badge.svg?token=171XNH5XLT)](https://codecov.io/gh/princjef/gomarkdoc)
repository:
url: https://github.com/princjef/gomarkdoc
url: https://github.com/Weborama/gomarkdoc
defaultBranch: master
path: /
10 changes: 5 additions & 5 deletions cmd/gomarkdoc/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/princjef/gomarkdoc"
"github.com/princjef/gomarkdoc/format"
"github.com/princjef/gomarkdoc/lang"
"github.com/princjef/gomarkdoc/logger"
"github.com/Weborama/gomarkdoc"
"github.com/Weborama/gomarkdoc/format"
"github.com/Weborama/gomarkdoc/lang"
"github.com/Weborama/gomarkdoc/logger"
)

// PackageSpec defines the data available to the --output option's template.
Expand Down Expand Up @@ -72,7 +72,7 @@ func buildCommand() *cobra.Command {

// cobra.OnInitialize(func() { buildConfig(configFile) })

var command = &cobra.Command{
command := &cobra.Command{
Use: "gomarkdoc [package ...]",
Short: "generate markdown documentation for golang code",
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
28 changes: 14 additions & 14 deletions cmd/gomarkdoc/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestCommand(t *testing.T) {
os.Args = []string{
"gomarkdoc", "./simple",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -44,7 +44,7 @@ func TestCommand_check(t *testing.T) {
"gomarkdoc", "./simple",
"-c",
"-o", "{{.Dir}}/README.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -62,7 +62,7 @@ func TestCommand_nested(t *testing.T) {
os.Args = []string{
"gomarkdoc", "./nested/...",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -85,7 +85,7 @@ func TestCommand_unexported(t *testing.T) {
"gomarkdoc", "./unexported",
"-u",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestCommand_invalidCheck(t *testing.T) {
os.Args = []string{
"gomarkdoc", "./simple",
"-c",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -149,7 +149,7 @@ func TestCommand_defaultDirectory(t *testing.T) {
os.Args = []string{
"gomarkdoc",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/simple/",
}
Expand All @@ -169,7 +169,7 @@ func TestCommand_nonexistant(t *testing.T) {
os.Args = []string{
"gomarkdoc", "./nonexistant",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -190,7 +190,7 @@ func TestCommand_tags(t *testing.T) {
"gomarkdoc", "./tags",
"--tags", "tagged",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -214,7 +214,7 @@ func TestCommand_tagsWithGOFLAGS(t *testing.T) {
"gomarkdoc", "./tags",
"--config", "../.gomarkdoc-empty.yml",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -240,7 +240,7 @@ func TestCommand_tagsWithGOFLAGSNoTags(t *testing.T) {
"gomarkdoc", "./tags",
"--config", "../.gomarkdoc-empty.yml",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -266,7 +266,7 @@ func TestCommand_tagsWithGOFLAGSNoParse(t *testing.T) {
"gomarkdoc", "./tags",
"--config", "../.gomarkdoc-empty.yml",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -289,7 +289,7 @@ func TestCommand_embed(t *testing.T) {
"gomarkdoc", "./embed",
"--embed",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand All @@ -298,7 +298,7 @@ func TestCommand_embed(t *testing.T) {
data, err := os.ReadFile("./embed/README-template.md")
is.NoErr(err)

err = os.WriteFile("./embed/README-test.md", data, 0664)
err = os.WriteFile("./embed/README-test.md", data, 0o664)
is.NoErr(err)

main()
Expand All @@ -315,7 +315,7 @@ func TestCommand_untagged(t *testing.T) {
os.Args = []string{
"gomarkdoc", "./untagged",
"-o", "{{.Dir}}/README-test.md",
"--repository.url", "https://github.com/princjef/gomarkdoc",
"--repository.url", "https://github.com/Weborama/gomarkdoc",
"--repository.default-branch", "master",
"--repository.path", "/testData/",
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/gomarkdoc/doc.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package gomarkdoc provides a command line interface for writing golang
// documentation in markdown format.
//
// See https://github.com/princjef/gomarkdoc for full documentation of this
// See https://github.com/Weborama/gomarkdoc for full documentation of this
// tool.
package main
10 changes: 5 additions & 5 deletions cmd/gomarkdoc/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"path/filepath"
"regexp"

"github.com/princjef/gomarkdoc"
"github.com/princjef/gomarkdoc/lang"
"github.com/princjef/gomarkdoc/logger"
"github.com/Weborama/gomarkdoc"
"github.com/Weborama/gomarkdoc/lang"
"github.com/Weborama/gomarkdoc/logger"
)

func writeOutput(specs []*PackageSpec, opts commandOptions) error {
Expand Down Expand Up @@ -82,12 +82,12 @@ func writeFile(fileName string, text string) error {
folder := filepath.Dir(fileName)

if folder != "" {
if err := os.MkdirAll(folder, 0755); err != nil {
if err := os.MkdirAll(folder, 0o755); err != nil {
return fmt.Errorf("failed to create folder %s: %w", folder, err)
}
}

if err := ioutil.WriteFile(fileName, []byte(text), 0664); err != nil {
if err := ioutil.WriteFile(fileName, []byte(text), 0o664); err != nil {
return fmt.Errorf("failed to write file %s: %w", fileName, err)
}

Expand Down
Loading

0 comments on commit 526bd7b

Please sign in to comment.