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

Godot removes comments not ending with dot when fix option is used #1082

Closed
3 tasks done
doriandekoning opened this issue May 12, 2020 · 3 comments · Fixed by #1084
Closed
3 tasks done

Godot removes comments not ending with dot when fix option is used #1082

doriandekoning opened this issue May 12, 2020 · 3 comments · Fixed by #1084
Labels
bug Something isn't working

Comments

@doriandekoning
Copy link

Thank you for creating the issue!

  • 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).

Please include the following information:

Version of golangci-lint
$ golangci-lint version                                                                                                                                                                                                                                                                                 
golangci-lint has version 1.26.0 built from 6bd10d0 on 2020-05-01T15:26:22Z
Config file
$ cat .golangci.yml
run:
  concurrency: 3
  timeout: 15m
  issues-exit-code: 1
  tests: true

  skip-dirs:
    - design
    - \.go
  skip-files:
    #TODO add generated models files
    # - ".*\\.my\\.go$

  modules-download-mode: readonly


# output configuration options
output:
  # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
  format: code-climate

  # print lines of code with issue, default is true
  print-issued-lines: true

  # print linter name in the end of issue text, default is true
  print-linter-name: true


# all available settings of specific linters
linters-settings:
  errcheck:
    check-type-assertions: false

    check-blank: true


    # path to a file containing a list of functions to exclude from checking
    # see https://github.com/kisielk/errcheck#excluding-functions for details
    # exclude: /path/to/file.txt
  govet:
    # report about shadowed variables
    check-shadowing: false

  golint:
    min-confidence: 0.8

  gofmt:
    simplify: true
  gocyclo:
    min-complexity: 18
  maligned:
    suggest-new: true
  dupl:
    threshold: 175
  goconst:
    min-len: 3
    min-occurrences: 3
  funlen:
    lines: 80
    statements: 50
  godox:
    keywords:
      - HACK
      - OPTIMIZE
      - TODO
      - BUG
  misspell:
    locale: US
    ignore-words:
  lll:
    line-length: 120
    tab-width: 2
  unused:
    check-exported: false

  unparam:
    check-exported: false

  nakedret:
    max-func-lines: 0
  prealloc:
    simple: true
    range-loops: true # Report preallocation suggestions on range loops, true by default
    for-loops: false # Report preallocation suggestions on for loops, false by default

  gocritic:
    enabled-checks:

    disabled-checks:
      - regexpMust

    enabled-tags:
      - performance

    settings: # settings passed to gocritic
      captLocal: # must be valid enabled check name
        paramsOnly: true
      rangeValCopy:
        sizeThreshold: 32

linters:
  enable-all: true
  disable:
    - maligned
    - prealloc
    - lll
    - goimports # incompatible with gofmt
    - depguard
    - wsl
    - dogsled
    - unused # Results in panic: https://github.com/golangci/golangci-lint/issues/979
    - godot
  disable-all: false
  fast: false


issues:
  exclude-rules:
    - path: _test\.go
      linters:
        - gocyclo
        - errcheck
        - dupl
        - gosec
        - scopelint
        - gocritic
        - funlen

    - linters:
        - staticcheck
      text: "SA9003:"


    - linters:
        - lll
      text: "^//go:generate "

  exclude-use-default: false

  max-issues-per-linter: 0

  max-same-issues: 0

  new: false
Go environment
$ go version && go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/doriandekoning/Library/Caches/go-build"
GOENV="/Users/doriandekoning/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB="[redacted]"
GOOS="darwin"
GOPATH="/Users/doriandekoning/go"
GOPRIVATE=""
GOPROXY="[redacted]"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jg/vbxtfryd1w35dgz8y1lmn1780000gn/T/go-build174249453=/tmp/go-build -gno-record-gcc-switches -fno-common"
Verbose output of running
$ golangci-lint cache clean
$ golangci-lint run -v > /dev/null
INFO [config_reader] Config search paths: [ redacted]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 40 linters: [asciicheck bodyclose deadcode dupl errcheck funlen gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot godox goerr113 gofmt golint gomnd gomodguard goprintffuncname gosec gosimple govet ineffassign interfacer misspell nakedret nestif nolintlint rowserrcheck scopelint staticcheck structcheck stylecheck testpackage typecheck unconvert unparam varcheck whitespace]
INFO [lintersdb] Active 40 linters: [asciicheck bodyclose deadcode dupl errcheck funlen gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot godox goerr113 gofmt golint gomnd gomodguard goprintffuncname gosec gosimple govet ineffassign interfacer misspell nakedret nestif nolintlint rowserrcheck scopelint staticcheck structcheck stylecheck testpackage typecheck unconvert unparam varcheck whitespace]
INFO [loader] Go packages loading at mode 575 (deps|exports_file|files|compiled_files|name|types_sizes|imports) took 3.059158791s
INFO [runner/enabledLinters] Active 40 linters: [asciicheck bodyclose deadcode dupl errcheck funlen gochecknoglobals gochecknoinits gocognit goconst gocritic gocyclo godot godox goerr113 gofmt golint gomnd gomodguard goprintffuncname gosec gosimple govet ineffassign interfacer misspell nakedret nestif nolintlint rowserrcheck scopelint staticcheck structcheck stylecheck testpackage typecheck unconvert unparam varcheck whitespace]
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 70.130328ms
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 1m7.66837039s with top 10 stages: buildssa: 7.828896021s, the_only_name: 6.281312445s, dupl: 5.625220845s, gofmt: 3.982930343s, unconvert: 3.091825946s, gosec: 2.797159842s, golint: 2.44611351s, ineffassign: 1.771837988s, mnd: 1.649124652s, SA4014: 1.64403339s
WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: [inspect@[redacted]: analysis skipped: errors in package: [-: group_test_helper_test.go:12:1: comment not terminated]]
INFO [runner] processing took 5.179µs with stages: nolint: 2.296µs, max_same_issues: 564ns, skip_dirs: 420ns, cgo: 261ns, max_from_linter: 243ns, path_prettifier: 212ns, identifier_marker: 162ns, filename_unadjuster: 158ns, skip_files: 156ns, diff: 153ns, autogenerated_exclude: 142ns, max_per_file_from_linter: 72ns, uniq_by_line: 70ns, path_shortener: 69ns, source_code: 68ns, exclude: 67ns, exclude-rules: 66ns
INFO [runner] linters took 4.760491768s with stages: goanalysis_metalinter: 4.76043924s
ERRO Running error: assign: failed prerequisites: [[redacted]: analysis skipped: errors in package: [-: group_test_helper_test.go:12:1: comment not terminated]]
INFO Memory: 80 samples, avg is 239.5MB, max is 476.2MB
INFO Execution took 7.906538791s

Sample of removed comment:

-// CustomActionPayloadToCustomAction payload to model
+
@doriandekoning doriandekoning added the bug Something isn't working label May 12, 2020
@ernado
Copy link
Member

ernado commented May 12, 2020

cc @tetafro
Seems like we should disable autofix for that linter and then think about a proper fix

@tetafro
Copy link

tetafro commented May 13, 2020

I'm trying to figure out why this is happening, auto-fix is disabled for godot.

@tetafro
Copy link

tetafro commented May 13, 2020

Yep, found a bug.

But still config option CanAutoFix looks a bit confusing. I thought it prevents linter from doing anything with autofixes. Is it used anywhere except help messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants