dub lint

Ali Çehreli acehreli at yahoo.com
Thu Sep 15 22:04:03 UTC 2022


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



More information about the Digitalmars-d-learn mailing list