Catel / Catel.Fody

Catel.Fody
MIT License
19 stars 9 forks source link

Attribute to suppress message #543

Open SelvinPL opened 7 months ago

SelvinPL commented 7 months ago

Add attribute to suppress message

Method 'XXXX' matches automatic change method name but has parameters and will not be used as automatic change callback. Rename the method to remove this warning or remove parameters to use as automatic callback method. fx I had class


class SomeBaseViewModel<T> : ViewModelBase
{
public T SelectedItem { get; set; }
protected virtual void OnSelectedItemChanged(T item) { }

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Used by generator")]
private void OnSelectedItemChanged()
{
    OnSelectedItemChanged(SelectedItem);
}

}



I would like to my build be silent

resolution:

add some code here https://github.com/Catel/Catel.Fody/blob/0cd6d5c677ded6d48b3d8ace2a8b894e5a015c63/src/Catel.Fody/Core/Models/CatelTypeProperty.cs#L47

to not take method with some attribute into account 
SelvinPL commented 7 months ago

It can be NoWeavingAttribute or more contextual