Coder Social home page Coder Social logo

Comments (10)

quasilyte avatar quasilyte commented on May 4, 2024

Can you be more specific?
As specific as possible, please.

from go-critic.

fexolm avatar fexolm commented on May 4, 2024

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.

quasilyte avatar quasilyte commented on May 4, 2024

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.

quasilyte avatar quasilyte commented on May 4, 2024

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.

fexolm avatar fexolm commented on May 4, 2024
//TODO: Kind: message...
func f() ...

that case would fail on false positives.

from go-critic.

fexolm avatar fexolm commented on May 4, 2024

Maybe you are right

from go-critic.

quasilyte avatar quasilyte commented on May 4, 2024

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.

fexolm avatar fexolm commented on May 4, 2024

Oh, ok.

from go-critic.

quasilyte avatar quasilyte commented on May 4, 2024

We need to document this. :)

from go-critic.

quasilyte avatar quasilyte commented on May 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.