Make constructors of DatadogSite private#2010
Merged
0xnm merged 1 commit intoApr 26, 2024
Merged
Conversation
fuzzybinary
approved these changes
Apr 25, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2010 +/- ##
===========================================
+ Coverage 83.71% 83.77% +0.06%
===========================================
Files 488 488
Lines 17736 17767 +31
Branches 2659 2666 +7
===========================================
+ Hits 14846 14883 +37
+ Misses 2177 2169 -8
- Partials 713 715 +2
|
xgouchet
approved these changes
Apr 26, 2024
xgouchet
left a comment
Contributor
There was a problem hiding this comment.
That works, but it isn't an issue, as enum have a private init.
If someone tried to write the following, it wouldn't compile anyway :
val customSite = DatadogSite("custom", "custom-intake.example.com")This line triggers two compilation errors:
- Cannot access '<init>': it is private in 'DatadogSite'
- Enum types cannot be instantiated
Member
Author
|
@xgouchet yes, my concern was mostly the look of the API surface file, these custom constructors are declared there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Constructors of
DatadogSiteshouldn't be public.This may be see as a breaking change (removing items from public API), but this was never intended to be public.
Review checklist (to be filled by reviewers)