dotnet / roslyn-analyzers

MIT License
1.59k stars 466 forks source link

Banned API Analyzer: Ban all overloads once. #4670

Open Youssef1313 opened 3 years ago

Youssef1313 commented 3 years ago

@Youssef1313 That would be a feature request for the Banned API analyzer. Feel free to file one on the roslyn-analyzers repo.

_Originally posted by @mavasani in https://github.com/dotnet/roslyn/pull/50031#discussion_r552092400_

Youssef1313 commented 3 years ago

The asterisk * may be used to denote that, the same way it's done for xref links in documentation repos (e.g. dotnet/docs)

mavasani commented 3 years ago

Another couple of possible approaches:

  1. Treat doc IDs beginning with M:, i.e. methods, but without any parentheses ( and ), as indicating all overloads.
  2. Allow complete wild-card pattern matching: @Evangelink implemented a regex based mechanism for matching doc comment IDs in https://github.com/dotnet/roslyn-analyzers/blob/master/src/Utilities/Compiler/Options/SymbolNamesWithValueOption.cs, so probably he is the best one to guide/implement such a feature.

I personally don't have any strong preference here - anything that is easiest to implmenent/re-use would be good.

mavasani commented 3 years ago

@Youssef1313 @Evangelink Feel free to pick it up if you are interested.

Evangelink commented 6 months ago

I think using the regex pattern would be the most flexible solution