Update the DeclarePublicAPI analyzer to consider return types
The DeclarePublicAPI draws attention to changes to the public API surface area in order to prevent breaking changes and to encourage careful design when adding new APIs. It requires that every project with a public API capture the public types and members in a file called PublicAPI.txt, and creates errors when this file does not match the actual symbols in the project. This makes changes very obvious in code reviews and source control history. Currently PublicAPI.txt does not capture the return types of members (field, properties, methods, and events) so these can changes without it being caught by the tool. This changes updates the analyzer to include the return type. A nice feature of the associated code fix is that it sorts PublicAPI.txt alphabetically, and since type names are fully qualified this naturally groups together types in the same namespace, members in the same type, overloads, etc. To preserve this property we put the return type at the end of the line, after the type and member name.
Showing
想要评论请 注册 或 登录