Skip to content
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

Merged
merged 3 commits into from
Mar 5, 2023
Merged

Conversation

nao1215
Copy link
Owner

@nao1215 nao1215 commented Mar 5, 2023

No description provided.

{
"number": 28,
"state": "closed",
"title": "Change golden pacakge import path",
Copy link

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"

@github-actions

This comment has been minimized.

}

if !file.IsDir(path) {
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil {
Copy link

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)

return fmt.Errorf("can not create bash-completion file: %w", err)
}
}
fp, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, 0664)
Copy link

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)

}

path := fishCompletionFilePath()
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil {
Copy link

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)

}

path := zshCompletionFilePath()
if err := os.MkdirAll(filepath.Dir(path), 0775); err != nil {
Copy link

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)

`
zshrcPath := zshrcPath()
if !file.IsFile(zshrcPath) {
fp, err := os.OpenFile(zshrcPath, os.O_RDWR|os.O_CREATE, 0664)
Copy link

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)

return false
}

if bytes.Compare(currentFishCompletion.Bytes(), fishCompletionInLocal) != 0 {
Copy link

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)

return false
}

if bytes.Compare(currentZshCompletion.Bytes(), zshCompletionInLocal) != 0 {
Copy link

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{}
Copy link

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
Copy link

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
Copy link

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)
Copy link

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)
Copy link

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 {
Copy link

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 {
Copy link

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 {
Copy link

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)

@github-actions
Copy link

github-actions bot commented Mar 5, 2023

Code Metrics Report

main (f33ce30) #9 (f92443d) +/-
Coverage 94.7% 94.7% 0.0%
Test Execution Time 54s 48s -6s
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

@nao1215 nao1215 merged commit 86e9756 into main Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant