Skip to content

linting is failing on a file that should be ignored #998

Closed
@sjansen

Description

@sjansen
  • 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.24.0 built from 6fd4383 on 2020-03-15T11:38:02Z
Config file
$ cat .golangci.yml
run:
    deadline: 3m
    issues-exit-code: 1
    tests: true
    build-tags:
    - integration

linters:
    enable:
    - deadcode
    - gocritic
    - gocyclo
    - gofmt
    - goimports
    - golint
    - gosimple
    - govet
    - ineffassign
    - lll
    - maligned
    - megacheck
    - misspell
    - structcheck
    - typecheck
    - varcheck
    disable:
    - errcheck  # configurable ignore
    fast: false

linters-settings:
    gocyclo:
        min-complexity: 15
    golint:
        min-confidence: 0
    lll:
        tab-width: 8
    maligned:
        suggest-new: true
Go environment
$ go version && go env
go version go1.14 linux/amd64
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/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"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/go/src/github.com/sjansen/lolcode-go/go.mod"
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-build526291357=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint run -v
level=info msg="[config_reader] Config search paths: [./ /go/src/github.com/sjansen/lolcode-go /go/src/github.com/sjansen /go/src/github.com /go/src /go /]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[lintersdb] Active 17 linters: [deadcode gocritic gocyclo gofmt goimports golint gosimple govet ineffassign lll maligned misspell staticcheck structcheck typecheck unused varcheck]"
level=info msg="[lintersdb] Active 17 linters: [deadcode gocritic gocyclo gofmt goimports golint gosimple govet ineffassign lll maligned misspell staticcheck structcheck typecheck unused varcheck]"
level=info msg="[loader] Go packages loading at mode 575 (imports|types_sizes|compiled_files|deps|exports_file|files|name) took 3.3095437s"
level=info msg="[runner/filename_unadjuster] Pre-built 1 adjustments in 106.1512ms"
level=info msg="[runner/unused/goanalysis] analyzers took 14.8542788s with top 10 stages: buildir: 14.6545166s, U1000: 199.7622ms"
level=info msg="[runner/goanalysis_metalinter/goanalysis] analyzers took 13.9142218s with top 10 stages: buildir: 9.4871235s, inspect: 563.8907ms, ctrlflow: 405.926ms, fact_purity: 290.5132ms, printf: 266.2469ms, SA4006: 255.7499ms, golint: 230.6868ms, misspell: 215.715ms, fact_deprecated: 211.0386ms, ineffassign: 206.1673ms"
level=warning msg="[runner] Can't run linter goanalysis_metalinter: gofmt: /go/src/github.com/sjansen/lolcode-go/internal/ast/ast_parser.rl:5:1: expected declaration, found '%' (and 29 more errors)"
level=info msg="[runner] Issues before processing: 3, after processing: 0"
level=info msg="[runner] Processors filtering stat (out/in): path_prettifier: 3/3, skip_dirs: 3/3, cgo: 3/3, filename_unadjuster: 3/3, skip_files: 3/3, autogenerated_exclude: 0/3"
level=info msg="[runner] processing took 9.808ms with stages: path_prettifier: 5.59ms, autogenerated_exclude: 2.3726ms, skip_dirs: 1.4726ms, max_per_file_from_linter: 42.1µs, nolint: 39.6µs, max_from_linter: 38.8µs, uniq_by_line: 34µs, max_same_issues: 31.3µs, filename_unadjuster: 29.8µs, identifier_marker: 20.9µs, path_shortener: 20.5µs, exclude-rules: 20.2µs, source_code: 20µs, skip_files: 19.5µs, exclude: 19.5µs, diff: 19.1µs, cgo: 17.5µs"
level=info msg="[runner] linters took 16.0783729s with stages: unused: 11.4166413s, goanalysis_metalinter: 4.6499064s"
level=error msg="Running error: gofmt: /go/src/github.com/sjansen/lolcode-go/internal/ast/ast_parser.rl:5:1: expected declaration, found '%' (and 29 more errors)"
level=info msg="Memory: 164 samples, avg is 556.3MB, max is 1282.1MB"
level=info msg="Execution took 19.5140635s"

Linting is failing on a file that should be ignored: ast_parser.rl

Running error: gofmt: /go/src/github.com/sjansen/lolcode-go/internal/ast/ast_parser.rl:5:1: expected declaration, found '%' (and 29 more errors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions