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

re-enable golangci-lint's godoc comment checking #501

Closed
DirectXMan12 opened this issue Jun 25, 2019 · 9 comments · Fixed by #885
Closed

re-enable golangci-lint's godoc comment checking #501

DirectXMan12 opened this issue Jun 25, 2019 · 9 comments · Fixed by #885
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@DirectXMan12
Copy link
Contributor

golangci-lint disables the godoc comment checking because the author considers it annoying. We should make sure it's on, because we've got a couple of issues with our godocs.

@DirectXMan12
Copy link
Contributor Author

#477 has the fix in the first commit

@mengqiy mengqiy added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jul 2, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 30, 2019
@DirectXMan12
Copy link
Contributor Author

/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 30, 2019
DirectXMan12 pushed a commit that referenced this issue Jan 31, 2020
book: added generating CRD documentation
@vincepri vincepri added this to the Next milestone Feb 21, 2020
@vincepri
Copy link
Member

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Feb 21, 2020
@kensipe
Copy link

kensipe commented Feb 21, 2020

@DirectXMan12 @vincepri I think this is resolved. #773 updated linters... included with that is golint which enables godoc checking.

#773 just merged!

@vincepri
Copy link
Member

vincepri commented Feb 21, 2020

I don't think golint is enough to have godoc comments. It appears that golangci-lint has default exclusions. To re-enable godoc errors we'll need to add:

issues:
  exclude-use-default: false
  exclude:
    # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok
    - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked
    # golint: False positive when tests are defined in package 'test'
    - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this
    # govet: Common false positives
    - (possible misuse of unsafe.Pointer|should have signature)
    # staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore
    - ineffective break statement. Did you mean to break out of the outer loop
    # gosec: Too many false-positives on 'unsafe' usage
    - Use of unsafe calls should be audited
    # gosec: Too many false-positives for parametrized shell calls
    - Subprocess launch(ed with variable|ing should be audited)
    # gosec: Duplicated errcheck checks
    - G104
    # gosec: Too many issues in popular repos
    - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
    # gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
    - Potential file inclusion via variable

to .golangci.yml

@kensipe
Copy link

kensipe commented Feb 21, 2020

perhaps I misunderstood based on my reading of golangci/golangci-lint#456

I'll look into it

@DirectXMan12
Copy link
Contributor Author

My experience is that you have to do what @vincepri mentioned as well. Should be easy to check though :-)

@camilamacedo86
Copy link
Member

camilamacedo86 commented Apr 3, 2020

/assign @camilamacedo86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants