nunnatsa / ginkgolinter

golang linter for ginkgo and gomega
MIT License
24 stars 6 forks source link

Add new rule: disallow focus containers #97

Closed nunnatsa closed 1 year ago

nunnatsa commented 1 year ago

Description

Focus ginkgo containers (FDescribe, FContext, FWhen, and FIt) should only be used locally, on debug.

This PR introduces a new rule to prevent the leaking of this kind of debug code into the source code in the repo.

New suppress comment to suppress this new rule: // ginkgo-linter:ignore-focus-container-warning

New command line flag to suppress this new rule: --suppress-focus-container

Fixes https://github.com/kubevirt/kubevirt/issues/10120

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

@nunnatsa

nunnatsa commented 1 year ago

/cc @lyarwood @iholder101

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 5577287155


Changes Missing Coverage Covered Lines Changed/Added Lines %
types/config.go 2 3 66.67%
ginkgo_linter.go 47 49 95.92%
ginkgohandler/handler.go 12 28 42.86%
<!-- Total: 61 80 76.25% -->
Files with Coverage Reduction New Missed Lines %
types/config.go 1 34.15%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 5542098039: -0.7%
Covered Lines: 898
Relevant Lines: 1070

💛 - Coveralls
iholder101 commented 1 year ago

Sorry for the late response. Thanks a lot @nunnatsa!!