Skip to content

gofmt error reports are always reported assuming simplify: true #513

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

Closed
puellanivis opened this issue Apr 24, 2019 · 1 comment
Closed

Comments

@puellanivis
Copy link

When linters-settings.gofmt.simplify: false is set, gofmt issues are still reported as File is not 'gofmt'-ed with '-s'

Run on this file:

package main

type S struct{
	I int
}

func main() {
}

Please include the following information:

  1. Version of golangci-lint: golangci-lint --version (or git commit if you don't use binary distribution)
always-reports-simplify$ golangci-lint --version
Error: unknown flag: --version
golangci-lint$ git rev-parse HEAD
39f46be46090828834b920f59994c97767694238
  1. Config file: cat .golangci.yml
linters:
  disable-all: true
  enable:
    - gofmt
linters-settings:
  gofmt:
    simplify: false
  1. Go environment: go version && go env
go version go1.12.2 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/snowgirl/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/snowgirl/Work/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib64/go/1.12"
GOTMPDIR=""
GOTOOLDIR="/usr/lib64/go/1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build111587924=/tmp/go-build -gno-record-gcc-switches"
  1. Verbose output of running: golangci-lint run -v
always-reports-simplify$ golangci-lint run -v
INFO [config_reader] Config search paths: [./ /home/snowgirl/Work/tmp/golangci-proof-of-errors/always-reports-simplify /home/snowgirl/Work/tmp/golangci-proof-of-errors /home/snowgirl/Work/tmp /home/snowgirl/Work /home/snowgirl /home /] 
INFO [config_reader] Used config file .golangci.yml 
INFO [lintersdb] Active 1 linters: [gofmt]        
INFO [loader] Go packages loading at mode load files took 42.368372ms 
INFO [loader/astcache] Parsed AST of all pkg.GoFiles: [/home/snowgirl/Work/tmp/golangci-proof-of-errors/always-reports-simplify/main.go] for 84.867µs 
INFO [runner] worker.3 took 8.775µs               
INFO [runner] worker.4 took 61.597µs              
INFO [runner] worker.1 took 43.13µs               
INFO [runner] worker.2 took 3.056678ms with stages: gofmt: 3.042321ms 
INFO [runner] Workers idle times: #1: 2.86681ms, #3: 2.878608ms, #4: 2.871404ms 
INFO [runner] processing took 232.957µs with stages: exclude: 56.768µs, identifier_marker: 44.263µs, source_code: 34.938µs, path_prettifier: 24.372µs, autogenerated_exclude: 23.187µs, cgo: 18.009µs, nolint: 16.044µs, skip_dirs: 6.207µs, uniq_by_line: 2.083µs, max_same_issues: 1.835µs, path_shortener: 1.363µs, max_per_file_from_linter: 1.317µs, max_from_linter: 1.051µs, replacement_builder: 577ns, diff: 398ns, skip_files: 295ns, exclude-rules: 250ns 
main.go:3: File is not `gofmt`-ed with `-s` (gofmt)
type S struct{
INFO File cache stats: 1 entries of total size 55B 
INFO Memory: 3 samples, avg is 68.7MB, max is 68.9MB 
INFO Execution took 104.937873ms                  
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
jirfag added a commit that referenced this issue Jun 9, 2019
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
@jirfag jirfag closed this as completed in 6508d16 Jun 9, 2019
@jirfag
Copy link
Contributor

jirfag commented Jun 9, 2019

Hi, thank you for reporting! Fixed in the linked pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants