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

Version 1.48.0 complains about gofmt -s #3088

Closed
4 tasks done
eisandbar opened this issue Aug 11, 2022 · 2 comments
Closed
4 tasks done

Version 1.48.0 complains about gofmt -s #3088

eisandbar opened this issue Aug 11, 2022 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@eisandbar
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

Lint job using golangci-lint started failing after upgrading to v1.48.0 with error

File is not `gofmt`-ed with `-s` (gofmt)

Running golangci-lint run --fix fixes the issues locally, but committing the changes still fails the job with the same errors on the same files.

Job description:

lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: 'latest'

Version of golangci-lint

$ golangci-lint --version
golangci-lint has version 1.48.0 built from 2d8fea81 on 2022-08-04T18:44:38Z

Configuration file

$ cat .golangci.yml
# paste output here

Go environment

$ go version && go env
go version go1.18.4 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/eisandbar/.cache/go-build"
GOENV="/home/eisandbar/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/eisandbar/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/eisandbar/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/eisandbar/Desktop/Projects/todocheck/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2174909878=/tmp/go-build -gno-record-gcc-switches"

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/eisandbar/Desktop/Projects/todocheck /home/eisandbar/Desktop/Projects /home/eisandbar/Desktop /home/eisandbar /home /] 
INFO [config_reader] Used config file .golangci.yaml 
INFO [lintersdb] Active 12 linters: [deadcode errcheck gofmt gosimple govet ineffassign revive staticcheck structcheck typecheck unused varcheck] 
INFO [loader] Go packages loading at mode 575 (compiled_files|deps|exports_file|files|imports|name|types_sizes) took 135.28109ms 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 4.718149ms 
INFO [linters context/goanalysis] analyzers took 12.00311277s with top 10 stages: buildir: 5.474656655s, the_only_name: 481.973733ms, ctrlflow: 446.961763ms, inspect: 433.87608ms, printf: 391.08121ms, fact_deprecated: 371.285583ms, fact_purity: 243.182326ms, SA5012: 213.759043ms, nilness: 180.251534ms, typedness: 180.055865ms 
INFO [runner] Issues before processing: 25, after processing: 0 
INFO [runner] Processors filtering stat (out/in): skip_dirs: 25/25, skip_files: 25/25, cgo: 25/25, path_prettifier: 25/25, autogenerated_exclude: 25/25, filename_unadjuster: 25/25, identifier_marker: 25/25, exclude: 25/25, exclude-rules: 0/25 
INFO [runner] processing took 4.412757ms with stages: exclude-rules: 2.131188ms, identifier_marker: 1.327565ms, path_prettifier: 431.587µs, autogenerated_exclude: 286.512µs, skip_dirs: 212.323µs, cgo: 9.854µs, filename_unadjuster: 5.063µs, nolint: 1.909µs, max_same_issues: 1.371µs, max_from_linter: 741ns, uniq_by_line: 596ns, skip_files: 568ns, source_code: 516ns, diff: 479ns, severity-rules: 474ns, exclude: 451ns, path_shortener: 439ns, max_per_file_from_linter: 424ns, sort_results: 419ns, path_prefixer: 278ns 
INFO [runner] linters took 2.223175549s with stages: goanalysis_metalinter: 2.218584806s 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 25 samples, avg is 272.4MB, max is 394.1MB 
INFO Execution took 2.367848277s            

Code example or link to a public repository

// add your code here

preslavmihaylov/todocheck#189

@eisandbar eisandbar added the bug Something isn't working label Aug 11, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 11, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez
Copy link
Member

ldez commented Aug 11, 2022

duplicate of golangci/golangci-lint-action#535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants