Comments (10)
Can you be more specific?
As specific as possible, please.
from go-critic.
Right now i found a bug in parenthesis_checker. I have wrote a test to reproduce it. But I can not commit it, because it would fail the build.
It would be better to add option to expect incorrect output on some cases, but not to fail the build.
from go-critic.
Still don't understand what you mean.
How exactly does it fail?
If you want to handle new case in checker do this:
//TODO: Kind: message...
func f() ...
Note the double slashes instead of ///
.
When checker can handle that, remove TODO and add slash.
If you have code that breaks your linter, add it like this:
/*
TODO: this makes checker panic. Uncomment when fixed.
func veryBad() ...
*/
from go-critic.
You usually fix a bug and then write a test that checks that it's never happens again.
I see no real benefit of skipping tests here.
from go-critic.
//TODO: Kind: message...
func f() ...
that case would fail on false positives.
from go-critic.
Maybe you are right
from go-critic.
False positives should be added as a normal test case with a TODO note to remove warning directive after it's fixed.
// TODO: should not trigger. Remove directive when fixed.
///Checker: blah-blah.
func f() {}
If false positive happens ever again, it will cause test to fail (as we removed directive at that time).
from go-critic.
Oh, ok.
from go-critic.
We need to document this. :)
from go-critic.
It can also be useful to leave issue reference near TODO, if there are any.
It could be in form of #ID
or issueXXX
or even a full link to github.
from go-critic.
Related Issues (20)
- Compilation error under Go 1.20 HOT 3
- Non zero exit code in case of issues
- Ignore generated files or specific directory? HOT 2
- New release? HOT 6
- How to speed it up HOT 18
- redundantSprint false positive with err.Error() when err is nil HOT 1
- new check: mismatching format HOT 1
- httpNoBody: also warn on using "nil" instead of "http.NoBody" on (net/http/httptest).NewRequest HOT 3
- go1.21: load rules: parse rules file: typechecker error: ...: could not import HOT 5
- sloppyTestFuncName incorrectly identifies helper function HOT 2
- new check: find identical condition
- bug: `rangeValCopy` still panics on code with generics HOT 3
- new check: I/O find close twice HOT 1
- go1.21: load embedded ruleguard rules: rules/rules.go:13: can't load fmt HOT 14
- unlambda: false positive HOT 1
- timeCmpSimplify: false positive, not before is unequal to after HOT 2
- dynamicFmtString: use rather fix errors.New than fmt.Errorf("%s" HOT 2
- new check: detect unnecessary gomock controller Finish call HOT 1
- `gocritic check` panics with invalid memory address or nil pointer dereference HOT 4
- emptyStringTest: handle len(s) > 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-critic.