Roslyn analyzer for pubternal members
See original GitHub issueSome types and members in Sentry are public due to language limitations (like the fact that a public class cannot implement an internal interface with internal members) and are not meant to be used by users. Additionally, they may break in the future without a major version bump.
The suggestion is to add an attribute like [NotForPublicUse]
or similar and embed a Roslyn analyzer that will aggressively fail builds if any of these types are used from anywhere except Sentry projects.
This might already exist somewhere, I didn’t research. However, even if an analyzer like that exists, we would want to embed it directly into main Sentry package, so it makes sense to make our own regardless.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Microsoft.CodeAnalysis.PublicApiAnalyzers.md
All internal types and members should be declared in InternalAPI.txt. This draws attention to API changes in the code reviews and source control...
Read more >Roslyn analyzers and code-aware libraries for ...
Learn how to build a real world Roslyn analyzer to catch common errors when using the System.Collections.Immutable NuGet package.
Read more >C# - Adding a Code Fix to Your Roslyn Analyzer
Open up the Syntax Visualizer by choosing View | Other Windows | Syntax Visualizer and click anywhere within the code file to populate...
Read more >Roslyn Analyzers - YouTube
Mika Dumont and Andrew Hall show how you can use the Roslyn analyzers to inspect and improve your code, and also how to...
Read more >Check of Roslyn Analyzers
Roslyn Analyzers takes a curious approach to unit tests. Methods store long string literals, which contain classes for checking a certain ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
decided that we will settle on
[EditorBrowsable(EditorBrowsableState.Never)]
for cases when this is required.we do something similar on Java/Android using Jetbrain’s annotation ->
@ApiStatus.Internal