Skip to content

Commit

Permalink
chore: Update golangci-lint to 1.41.1 (ankitpokhrel#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitpokhrel authored Aug 28, 2021
1 parent 904aba4 commit ebdb775
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ linters:
- gocyclo
- gofmt
- goimports
- golint
- revive
- godot
- gofumpt
- gomnd
- gosimple
- govet
- ineffassign
- interfacer
- prealloc
- unparam
- varcheck
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ install:
lint:
@if ! command -v golangci-lint > /dev/null 2>&1; then
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b "$$(go env GOPATH)/bin" v1.31.0
sh -s -- -b "$$(go env GOPATH)/bin" v1.41.1
fi
golangci-lint run ./...

Expand Down
4 changes: 3 additions & 1 deletion internal/cmd/issue/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ $ jira issue list -tEpic -sDone
# List issues in status other than "Open" and is assigned to no one
$ jira issue list -s~Open -ax`

defaultLimit = 100
)

// NewCmdList is a list command.
Expand Down Expand Up @@ -143,7 +145,7 @@ func SetFlags(cmd *cobra.Command) {
cmd.Flags().String("updated-before", "", "Filter by issues updated before certain date")
cmd.Flags().StringP("jql", "q", "", "Run a raw JQL query in a given project context")
cmd.Flags().Bool("reverse", false, "Reverse the display order (default is DESC)")
cmd.Flags().Uint("limit", 100, "Number of results to return")
cmd.Flags().Uint("limit", defaultLimit, "Number of results to return")
cmd.Flags().Bool("plain", false, "Display output in plain mode")
cmd.Flags().Bool("no-headers", false, "Don't display table headers in plain mode. Works only with --plain")
cmd.Flags().Bool("no-truncate", false, "Show all available columns in plain mode. Works only with --plain")
Expand Down
4 changes: 3 additions & 1 deletion internal/config/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,10 @@ func shallOverwrite() bool {
}

func create(path, name string) error {
const perm = 0700

if !Exists(path) {
if err := os.MkdirAll(path, 0700); err != nil {
if err := os.MkdirAll(path, perm); err != nil {
return err
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/view/board.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewBoard(data []*jira.Board, opts ...BoardOption) *Board {
data: data,
buf: new(bytes.Buffer),
}
b.writer = tabwriter.NewWriter(b.buf, 0, 8, 1, '\t', 0)
b.writer = tabwriter.NewWriter(b.buf, 0, tabWidth, 1, '\t', 0)

for _, opt := range opts {
opt(&b)
Expand Down
1 change: 1 addition & 0 deletions internal/view/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

const (
wordWrap = 120
tabWidth = 8
helpText = `USAGE
-----
Expand Down
2 changes: 1 addition & 1 deletion internal/view/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type IssueList struct {
// Render renders the view.
func (l IssueList) Render() error {
if l.Display.Plain {
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
w := tabwriter.NewWriter(os.Stdout, 0, tabWidth, 1, '\t', 0)
return l.renderPlain(w)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/view/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewProject(data []*jira.Project, opts ...ProjectOption) *Project {
data: data,
buf: new(bytes.Buffer),
}
p.writer = tabwriter.NewWriter(p.buf, 0, 8, 1, '\t', 0)
p.writer = tabwriter.NewWriter(p.buf, 0, tabWidth, 1, '\t', 0)

for _, opt := range opts {
opt(&p)
Expand Down
2 changes: 1 addition & 1 deletion internal/view/sprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (sl SprintList) Render() error {
// RenderInTable renders the list in table view.
func (sl SprintList) RenderInTable() error {
if sl.Display.Plain {
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0)
w := tabwriter.NewWriter(os.Stdout, 0, tabWidth, 1, '\t', 0)
return sl.renderPlain(w)
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/jira/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ func dump(req *http.Request, res *http.Response) {
}

func prettyPrintDump(heading string, data []byte) {
const separatorWidth = 60

fmt.Printf("\n\n%s", strings.ToUpper(heading))
fmt.Printf(fmt.Sprintf("\n%s\n\n", strings.Repeat("-", 60)))
fmt.Printf(fmt.Sprintf("\n%s\n\n", strings.Repeat("-", separatorWidth)))
fmt.Print(string(data))
}

Expand Down

0 comments on commit ebdb775

Please sign in to comment.