docker / sbom-cli-plugin

Plugin for Docker CLI to support SBOM creation using Syft
Apache License 2.0
150 stars 15 forks source link

golangci-lint 1.45.0 - as referenced in Makefile - panics #29

Open davidhay1969 opened 1 year ago

davidhay1969 commented 1 year ago

What happened:

Having run make bootstrap-tools to install the requisite version of golangci-lint - 1.45.0 - into .tmp/golangci-lint other make commands lead to a panicfrom golangci-lint : -

panic: load embedded ruleguard rules: rules/rules.go:13: can't load fmt

goroutine 1 [running]:
github.com/go-critic/go-critic/checkers.init.22()
        github.com/go-critic/go-critic@v0.6.2/checkers/embedded_rules.go:46 +0x494

In fact, merely running .tmp/golangci-lint results in the same panic.

This is due to an issue with golangci-lint itself, as per this - go-critic/ruleguard: load embedded ruleguard rules: rules/rules.go:13: can't load fmt #3107 - and occurs with versions 1.45.0, 1.46.0 and 1.47.0.

Later versions from 1.48.0 through the current latest - 1.50.1 - work OK

What you expected to happen: make etc. that leverages golangci-lint should run to completion; also golangci-lint commands such .tmp/golangci-lint --version should just work: -

golangci-lint has version 1.50.1 built from 8926a95f on 2022-10-22T10:50:47Z

How to reproduce it (as minimally and precisely as possible):

  1. Clone the sbom-cli-plugin repo
  2. Run make bootstrap-tools
  3. Test the downloaded/installed version of golangci-lint via .tmp/golangci-lint --version or just run make
  4. Watch the panic

Anything else we need to know?:

Environment: go version

go version go1.19.4 darwin/arm64

sw_vers

ProductName:            macOS
ProductVersion:         13.1
BuildVersion:           22C65

I've also reproduced the same on Ubuntu

I'll create a PR from my own fork, updating golangci-lint to the (current) latest - 1.50.1 - as per that project's releases page