question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Roslyn analyzer for pubternal members

See original GitHub issue

Some 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonCroppcommented, Jun 21, 2022

decided that we will settle on [EditorBrowsable(EditorBrowsableState.Never)] for cases when this is required.

1reaction
marandanetocommented, Jan 26, 2021

we do something similar on Java/Android using Jetbrain’s annotation -> @ApiStatus.Internal

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found