Skip to content

Commit

Permalink
Improve docs (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmenezes authored Jul 28, 2020
1 parent 98509d0 commit b1e54ae
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
[![Go](https://github.com/fmenezes/codeowners/workflows/Go/badge.svg)](https://github.com/fmenezes/codeowners/actions?query=branch%3Amaster)
[![Go Report Card](https://goreportcard.com/badge/github.com/fmenezes/codeowners)](https://goreportcard.com/report/github.com/fmenezes/codeowners)
[![Coverage](https://coveralls.io/repos/github/fmenezes/codeowners/badge.svg?branch=master)](https://coveralls.io/github/fmenezes/codeowners?branch=master)
[![Godoc](https://godoc.org/github.com/fmenezes/codeowners?status.svg)](https://godoc.org/github.com/fmenezes/codeowners)

# CODEOWNERS

CodeOwners coder provides funcionality to evaluate CODEOWNERS file in Go. Also provices linter CLI.
CodeOwners coder provides funcionality to evaluate CODEOWNERS file in Go. Also provides linter CLI.

## Documentation

### Package

To find package documentation follow https://godoc.org/github.com/fmenezes/codeowners

### CLI

#### Installation

Simply run `go get -u github.com/fmenezes/codeowners/cmd/codeowners`

#### Usage

Simply calling `codeowners` will quick off the cli on the current directory.

##### Options

| Option | Default Value | Description |
| ------------- | ------------- | ------------------------------------------------------------------------------ |
| d | . | Directory: specifies the directory you want to use to lint the CODEOWNERS file |
| f | | Format: specifies the format you want to return lint results |

## Compatibility

:warning: This module is on a v0 mode and it is not ready to be used, once it reaches the v1 we will lock the API.
File renamed without changes.
10 changes: 5 additions & 5 deletions cmd/linter_test.go → cmd/codeowners/linter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func testRun(opt options) (string, error) {

func TestPass(t *testing.T) {
opt := options{
directory: "../test/data/pass",
directory: "../../test/data/pass",
format: "",
}

Expand All @@ -34,7 +34,7 @@ func TestPass(t *testing.T) {

func TestNoOwners(t *testing.T) {
opt := options{
directory: "../test/data/no_owners",
directory: "../../test/data/no_owners",
format: "",
}

Expand All @@ -52,7 +52,7 @@ func TestNoOwners(t *testing.T) {

func TestCustomFormat(t *testing.T) {
opt := options{
directory: "../test/data/noowners",
directory: "../../test/data/noowners",
format: "test",
}

Expand All @@ -69,7 +69,7 @@ func TestCustomFormat(t *testing.T) {

func TestInvalidFormat(t *testing.T) {
opt := options{
directory: "../test/data/noowners",
directory: "../../test/data/noowners",
format: " {{template \"one\"}} ",
}

Expand All @@ -79,7 +79,7 @@ func TestInvalidFormat(t *testing.T) {
}

opt = options{
directory: "../test/data/noowners",
directory: "../../test/data/noowners",
format: " {{ . ",
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go → cmd/codeowners/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
)

func main() {
dir := flag.String("d", ".", "Specifies the directory you want to use to lint the CODEOWNERS file")
format := flag.String("f", "", "Specifies the format you want to return lint results")
dir := flag.String("d", ".", "Directory: specifies the directory you want to use to lint the CODEOWNERS file")
format := flag.String("f", "", "Format: specifies the format you want to return lint results")
flag.Parse()

opt := options{
Expand Down

0 comments on commit b1e54ae

Please sign in to comment.