D-Scanner icon indicating copy to clipboard operation
D-Scanner copied to clipboard

Skip lint on given line / function / class ..

Open ricardaxel opened this issue 1 year ago • 1 comments

Would you be open to add some mechanism to skip linting a given line / function / ... ?

For example through UDAs, following code wouldn't raise any warning.

@("NOLINT(useless_initializer)")
bool b = false;

I can work on a POC if you're ok with the concept

ricardaxel avatar Oct 06 '23 14:10 ricardaxel

awesome! Yes this would be very much appreciated. Also it would be great if this worked both with @("nolint(...)") as well as @nolint("...") (for future compatibility or big projects that declare this)

We had the idea before that dub packages could provide files that are always implicitly imported by the compiler, such as object is already, which could provide exactly UDA definitions like this and help the compiler statically check for wrongly used attributes. However these UDA files will still need compiler flag support, which wasn't merged yet / didn't have a compelling use-case yet.

WebFreak001 avatar Oct 09 '23 22:10 WebFreak001