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

golangci-lint is not reporting issues that golint catches #29

Closed
atc0005 opened this issue Jul 16, 2020 · 4 comments
Closed

golangci-lint is not reporting issues that golint catches #29

atc0005 opened this issue Jul 16, 2020 · 4 comments
Assignees
Labels
bug Something isn't working golang linting

Comments

@atc0005
Copy link
Owner

atc0005 commented Jul 16, 2020

See also #9 (comment)

While working on another project, I used a VSCode instance within a VM that did not have golangci-lint installed, and so defaulted to using golint for linting. It caught these issues that golangci-lint didn't report:

$ golint ./... | grep -v vendor
cmd/pkg1/constants.go:19:7: exported const MB should have comment or be unexported
cmd/pkg2/main.go:38:6: exported type AppConfig should have comment or be unexported
cmd/pkg3/main.go:32:6: exported type Results should have comment or be unexported
events/validate.go:24:1: exported function ValidatePayload should have comment or be unexported

I substituted the real package names with placeholders, but the rest is untouched.

Here is the entries in the .golangci.yml file:

linters:
  enable:
    - dogsled
    - goimports
    - gosec
    - stylecheck
    - goconst
    - depguard
    - prealloc
    - misspell
    - maligned
    - dupl
    - unconvert
    - gofmt
    - golint
    - gocritic
    - scopelint

This is with golangci-lint v1.28.3.

@atc0005 atc0005 added bug Something isn't working golang linting labels Jul 16, 2020
@atc0005
Copy link
Owner Author

atc0005 commented Jul 16, 2020

Rolling back to v1.25.0 didn't change anything.

@atc0005
Copy link
Owner Author

atc0005 commented Jul 16, 2020

Until I can figure this out, I might need to bring back the standalone golint command:

golint -set_exit_status $(go list -mod=vendor ./... | grep -v /vendor/)

@atc0005
Copy link
Owner Author

atc0005 commented Jul 16, 2020

Opened bug report:

golangci/golangci-lint#1249

For now, I'll add back the golint command until this can be sorted.

@atc0005 atc0005 self-assigned this Jul 16, 2020
atc0005 added a commit to atc0005/brick that referenced this issue Jul 22, 2020
- Remove golint call from Makefile
- Remove `--exclude-use-default` CLI flag
- Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

Note to self: Docker container sooner than later perhaps?

- refs #92
- refs atc0005/todo#29
- refs atc0005/todo#22
atc0005 added a commit to atc0005/brick that referenced this issue Jul 22, 2020
- Remove golint call from Makefile
- Remove `--exclude-use-default` CLI flag
- Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

Note to self: Docker container sooner than later perhaps?

- refs #92
- refs atc0005/todo#29
- refs atc0005/todo#22
@atc0005
Copy link
Owner Author

atc0005 commented Jul 22, 2020

As noted in the golangci-lint GH issue and on atc0005/brick#113, the "problem" is that some linting checks are disabled by default due to their high false-positive rate. You have to explicitly re-enable those checks.

atc0005/brick#113 did so for the atc0005/brick project. Other projects will need similar changes to run the (currently) disabled checks.

Yet another reason to push forward with the use of a custom Docker container for linting my Go projects.

atc0005 added a commit to atc0005/dnsc that referenced this issue Jul 28, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

Note to self: Docker container sooner than later perhaps?

- refs atc0005/todo#29
- refs atc0005/todo#22
atc0005 added a commit to atc0005/dnsc that referenced this issue Jul 28, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

Note to self: Docker container sooner than later perhaps?

- refs atc0005/todo#29
- refs atc0005/todo#22
atc0005 added a commit to atc0005/dnsc that referenced this issue Jul 31, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

Note to self: Docker container sooner than later perhaps?

- refs atc0005/todo#29
- refs atc0005/todo#22
atc0005 added a commit to atc0005/elbow that referenced this issue Aug 1, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

- refs #273
- refs atc0005/todo#29
atc0005 added a commit to atc0005/elbow that referenced this issue Aug 3, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

- refs #273
- refs atc0005/todo#29
atc0005 added a commit to atc0005/elbow that referenced this issue Aug 3, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

- refs #273
- refs atc0005/todo#29
atc0005 added a commit to atc0005/elbow that referenced this issue Aug 3, 2020
Add explicit config settings to disable default exclusions

This same config change will need to be pushed to all other
repos where I am using this config set.

- refs #273
- refs atc0005/todo#29
atc0005 added a commit to atc0005/bounce that referenced this issue Aug 4, 2020
atc0005 added a commit to atc0005/send2teams that referenced this issue Aug 21, 2020
atc0005 added a commit to atc0005/check-cert that referenced this issue Aug 21, 2020
atc0005 added a commit to atc0005/bridge that referenced this issue Aug 22, 2020
atc0005 added a commit to atc0005/bridge that referenced this issue Aug 22, 2020
atc0005 added a commit to atc0005/nagios-debug that referenced this issue Aug 22, 2020
atc0005 added a commit to atc0005/check-mail that referenced this issue Aug 23, 2020
atc0005 added a commit to atc0005/go-nagios that referenced this issue Aug 23, 2020
@atc0005 atc0005 closed this as completed Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working golang linting
Projects
None yet
Development

No branches or pull requests

1 participant