Open Drake53 opened 1 year ago
@Drake53 This is correct. This analyzer supports banning user defined operator methods, but not built-in operators. For the above case, the correct declaration syntax for string equality check is M:System.String.op_Equality(System.String)
, but even that is not supported by this analyzer.
You are always welcome to submit a PR to implement this support.
@mavasani Do you know if not supporting that was because of a significant technical hurdle, or if it just didn't seem worth doing?
If I'm not mistaken, the analyzer currently doesn't support operators. I tried with the following in BannedSymbols.txt:
But I'm not seeing RS0030 when I try the following:
I'd like to ban this in my projects in favour of string.Equals(string, string, System.StringComparison), since in my opinion you should always explicitly define what type of StringComparison to use.