having resharper give errors for all unused parameters except on events
we want to have resharper complain and show errors every time we have a unused parameter to make sure the developers keep code clean and remove stuff that is not being used
the one area where this falls over is events, because we have a lot of case where you are not using the sender object in the basic pattern.
(object sender, EventArgs args)
is there anyway to have resharper complain on everythin开发者_如何学JAVAg EXCEPT event handlers?
As far as I remember inspection severity of 'Unused parameter' is set to warning by default, however you can change this to Error in Resharper>Options>Inspection Severity>Redundancies in Symbol Declarations>Unused Parameter
.
When you start solution wide analysis, these are shown as error.
ReSharper is smart enough not to complain about sender parameter because it is part of the event signature.
I have tried this using ReSharper 5 EAP, so options can have different names in the previous version.
精彩评论