On 9/15/22 14:32, Ali Çehreli wrote:

> (However, like all linters it's not perfect but I still like having that
> power.)

The following code is flagged because it catches Error:

unittest
{
    try
    {
        assert(false);
    }
    catch (Error)
    {
        // Cool...
    }
}

[warn]: Catching Error or Throwable is almost always a bad idea.

Is there a way to silence specific 'dub lint' warnings? For example, the code above is actually similar to assertThrown!Error, which knows what it's doing. :)

  https://dub.pm/commandline.html#lint

Ali

  • dub lint Ali Çehreli via Digitalmars-d-learn
    • Re: dub lint Ali Çehreli via Digitalmars-d-learn

Reply via email to