Skip to content

Pretty Print: goanalysis_metalinter output #1820

Closed
@hmajid2301

Description

@hmajid2301

I run golangci-lint like golangci-lint run -c .golangci.yml --timeout 5m ./...

Where my .golangci.yml looks like this:

run:
  skip-dirs:
    - tests/data
    - internal/server/models
linters:
  # please, do not use `enable-all`: it's deprecated and will be removed soon.
  # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
  disable-all: true
  enable:
    - bodyclose
    - deadcode
    - depguard
    - dogsled
    - dupl
    - errcheck
    - funlen
    - gochecknoinits
    - goconst
    - gocritic
    - gocyclo
    - gofmt
    - goimports
    - golint
    - gomnd
    - goprintffuncname
    - gosec
    - gosimple
    - govet
    - ineffassign
    - interfacer
    - lll
    - misspell
    - nakedret
    - nolintlint
    - rowserrcheck
    - staticcheck
    - structcheck
    - stylecheck
    - typecheck
    - unconvert
    - unparam
    - unused
    - varcheck
    - whitespace

service:
  golangci-lint-version: 1.32.2

Is there a way to pretty print the output from the goanalysis_metalinter:. Currently my output is messy and looks something like:

WARN [runner] Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites: [buildssa@gitlab.com/banter-bus/banter-bus-management-api/internal/service: analysis skipped: errors in package: [/home/haseeb/projects/personal/banter-bus/banter-bus-server/internal/service/user_service.go:336:20: q.getQuestionPath undefined (type QuestionService has no field or method getQuestionPath)]] 
WARN [runner] Can't run linter unused: buildir: analysis skipped: errors in package: [/home/haseeb/projects/personal/banter-bus/banter-bus-server/internal/service/user_service.go:336:20: q.getQuestionPath undefined (type QuestionService has no field or method getQuestionPath)] 
ERRO Running error: buildir: analysis skipped: errors in package: [/home/haseeb/projects/personal/banter-bus/banter-bus-server/internal/service/user_service.go:336:20: q.getQuestionPath undefined (type QuestionService has no field or method getQuestion

It doesn't wrap very nicely in the VSCode terminal

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions