-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --json option and completion sub command #9
Conversation
{ | ||
"number": 28, | ||
"state": "closed", | ||
"title": "Change golden pacakge import path", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[misspell] reported by reviewdog 🐶
"pacakge" is a misspelling of "package"
This comment has been minimized.
This comment has been minimized.
cmd/completion.go
Outdated
} | ||
|
||
if !file.IsDir(path) { | ||
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G301: Expect directory permissions to be 0750 or less (gosec)
cmd/completion.go
Outdated
return fmt.Errorf("can not create bash-completion file: %w", err) | ||
} | ||
} | ||
fp, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0664) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G302: Expect file permissions to be 0600 or less (gosec)
cmd/completion.go
Outdated
} | ||
|
||
path := fishCompletionFilePath() | ||
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G301: Expect directory permissions to be 0750 or less (gosec)
cmd/completion.go
Outdated
} | ||
|
||
path := zshCompletionFilePath() | ||
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G301: Expect directory permissions to be 0750 or less (gosec)
cmd/completion.go
Outdated
` | ||
zshrcPath := zshrcPath() | ||
if !file.IsFile(zshrcPath) { | ||
fp, err := os.OpenFile(zshrcPath, os.O_RDWR|os.O_CREATE, 0664) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G302: Expect file permissions to be 0600 or less (gosec)
cmd/completion.go
Outdated
return false | ||
} | ||
|
||
if bytes.Compare(currentFishCompletion.Bytes(), fishCompletionInLocal) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
S1004: should use !bytes.Equal(currentFishCompletion.Bytes(), fishCompletionInLocal) instead (gosimple)
cmd/completion.go
Outdated
return false | ||
} | ||
|
||
if bytes.Compare(currentZshCompletion.Bytes(), zshCompletionInLocal) != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
S1004: should use !bytes.Equal(currentZshCompletion.Bytes(), zshCompletionInLocal) instead (gosimple)
cmd/stat.go
Outdated
} | ||
|
||
func (dlts *DetailLeadTimeStat) json(w io.Writer, all bool) error { | ||
bytes := []byte{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
ineffectual assignment to bytes (ineffassign)
for _, v := range dlts.PullRequests { | ||
if v.User.Bot { | ||
fmt.Printf("|#%d|%s|%s|%d|%s|\n", v.Number, pointer.StringValue(v.User.Name), "yes", v.MergeTimeMinutes, v.Title) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
continue with no blank line before (nlreturn)
for _, v := range dlts.PullRequests { | ||
if v.User.Bot { | ||
fmt.Printf("#%d\t%s\t%s\t%d\t%s\n", v.Number, pointer.StringValue(v.User.Name), "yes", v.MergeTimeMinutes, v.Title) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
continue with no blank line before (nlreturn)
return fmt.Errorf("can not create bash-completion file: %w", err) | ||
} | ||
} | ||
fp, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0600) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G304: Potential file inclusion via variable (gosec)
` | ||
zshrcPath := zshrcPath() | ||
if !file.IsFile(zshrcPath) { | ||
fp, err := os.OpenFile(zshrcPath, os.O_RDWR|os.O_CREATE, 0600) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
G304: Potential file inclusion via variable (gosec)
} | ||
|
||
if !file.IsDir(path) { | ||
if err := os.MkdirAll(filepath.Dir(path), 0750); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 0750, in detected (gomnd)
} | ||
|
||
path := fishCompletionFilePath() | ||
if err := os.MkdirAll(filepath.Dir(path), 0750); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 0750, in detected (gomnd)
} | ||
|
||
path := zshCompletionFilePath() | ||
if err := os.MkdirAll(filepath.Dir(path), 0750); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 0750, in detected (gomnd)
Code Metrics Report
Details | | main (f33ce30) | #9 (f92443d) | +/- |
|---------------------|----------------|--------------|------|
| Coverage | 94.7% | 94.7% | 0.0% |
| Files | 3 | 3 | 0 |
| Lines | 95 | 95 | 0 |
| Covered | 90 | 90 | 0 |
+ | Test Execution Time | 54s | 48s | -6s | Reported by octocov |
No description provided.