Description of problem:
If golangci-lint is not yet installed lint-fix .PHONY target may fail. Solution to this problem is makeing lint-fix rule depends on GOLANCI_LINT rule
Version-Release number of selected component (if applicable):
How reproducible:
remove golangci-lint from your binary and run make lint-fix
Steps to Reproduce:
1.rm $(which golangci-lint) # or where you can find it 2.make lint-fix
Actual results:
$ make lint-fix /home/sdminonne/dev/openshift/hypershift/src/github.com/openshift/hypershift/hack/tools/bin/golangci-lint run --config ./.golangci.yml --fix -v make: /home/sdminonne/dev/openshift/hypershift/src/github.com/openshift/hypershift/hack/tools/bin/golangci-lint: No such file or directory make: *** [Makefile:77: lint-fix] Error 127
Expected results:
$ make lint-fix /home/sdminonne/dev/openshift/hypershift/src/github.com/openshift/hypershift/hack/tools/bin/golangci-lint run --config ./.golangci.yml --fix -v INFO golangci-lint has version v1.63.4 built with go1.23.6 from (unknown, modified: ?, mod sum: "") on (unknown) INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 7 linters: [errcheck gci gosimple govet ineffassign staticcheck unused] INFO [loader] Go packages loading at mode 8767 (compiled_files|exports_file|types_sizes|deps|files|imports|name) took 1.376955679s INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 60.91472ms INFO [linters_context/goanalysis] analyzers took 1m18.12939347s with top 10 stages: buildir: 29.711864452s, gci: 1.852175294s, S1038: 1.540784437s, S1028: 1.131629708s, S1030: 1.102432755s, S1024: 1.009191464s, stdversion: 989.427657ms, S1005: 989.166183ms, unused: 961.130121ms, composites: 946.819401ms INFO [runner] Applying suggested fixes INFO [runner] fixer took 696ns with stages: all: 696ns INFO [runner] Issues before processing: 248, after processing:
Additional info:
- blocks
-
OCPBUGS-61799 lint-fix rule should ensure (depend on) golangci
-
- New
-
- is cloned by
-
OCPBUGS-61799 lint-fix rule should ensure (depend on) golangci
-
- New
-
- links to