aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

Add a semantic warning about unused, not enough, or incorrectly typed parameters to writef, writefln, and format #534

Open Orvid opened 10 years ago

Orvid commented 10 years ago

I propose to add a warning for code that calls std.stdio.writef, std.stdio.writefln, or std.string.format with a format string that either doesn't use all the parameters passed to it, or where there are not enough parameters passed to it, or else where the type of the parameter passed in is incompatible with the type of the value being expected.

This would likely require adding a framework to support adding these inspections, but once that framework is in place, the creation of this particular inspection itself should be fairly trivial. I'd be willing to implement the inspection itself if the framework is in place.

aBothe commented 10 years ago

Tbh, I'd even just invoke some dtool that checks code for smells etc. - this can be done fully independently of any parsing/resolution action.