views:

72

answers:

1

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 everything EXCEPT event handlers?

+1  A: 

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.

idursun