Skip to content

Create package name consistency rule#2032

Merged
xgouchet merged 2 commits into
developfrom
xgouchet/sr_packages
May 15, 2024
Merged

Create package name consistency rule#2032
xgouchet merged 2 commits into
developfrom
xgouchet/sr_packages

Conversation

@xgouchet

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR include a new Detekt rule enforcing our package naming policy:

  • A top level named declaration (ie: (enum|data|sealed)? class, object, interface, fun, val|var) which is marked as internal must be in a package matching /**.internal.**/
  • A top level named declaration (ie: (enum|data|sealed)? class, object, interface, fun, val|var) which is not marked as internal must not be in a package matching /**.internal.**/
  • this rule ignores issues on annotated declarations

@xgouchet
xgouchet requested review from a team as code owners May 14, 2024 17:04
@codecov-commenter

codecov-commenter commented May 14, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 91.70984% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 83.27%. Comparing base (e77c5f5) to head (f284941).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2032      +/-   ##
===========================================
+ Coverage    83.21%   83.27%   +0.06%     
===========================================
  Files          486      495       +9     
  Lines        17716    17718       +2     
  Branches      2688     2688              
===========================================
+ Hits         14742    14754      +12     
+ Misses        2238     2226      -12     
- Partials       736      738       +2     
Files Coverage Δ
...ore/src/main/kotlin/com/datadog/android/Datadog.kt 76.25% <ø> (ø)
.../main/kotlin/com/datadog/android/_InternalProxy.kt 63.64% <ø> (ø)
...n/kotlin/com/datadog/android/api/InternalLogger.kt 100.00% <ø> (ø)
...in/kotlin/com/datadog/android/core/SdkReference.kt 77.27% <ø> (ø)
...android/core/constraints/DatadogDataConstraints.kt 91.84% <ø> (ø)
...n/com/datadog/android/core/internal/DatadogCore.kt 81.98% <ø> (ø)
...tadog/android/core/internal/NoOpInternalSdkCore.kt 9.09% <ø> (ø)
.../android/core/internal/data/upload/UploadWorker.kt 86.49% <ø> (ø)
...g/android/core/internal/logger/LogcatLogHandler.kt 25.00% <ø> (ø)
.../android/core/internal/logger/SdkInternalLogger.kt 87.91% <ø> (ø)
... and 97 more

... and 16 files with indirect coverage changes

@xgouchet
xgouchet force-pushed the xgouchet/sr_packages branch from 0094d06 to 6595593 Compare May 15, 2024 06:06

@0xnm 0xnm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup! I left some comments. My concern is about the usage of @InternalApi on the interfaces/non-final classes directly, because it is a limitation of the check, but if we are sure that implementation of the interface/class extension won't land in the legit public API, this is fine.

@xgouchet
xgouchet force-pushed the xgouchet/sr_packages branch from 6595593 to f284941 Compare May 15, 2024 10:03
@xgouchet
xgouchet requested a review from 0xnm May 15, 2024 10:07
@xgouchet
xgouchet merged commit 34b4ff3 into develop May 15, 2024
@xgouchet
xgouchet deleted the xgouchet/sr_packages branch May 15, 2024 11:45
@xgouchet xgouchet added this to the 2.10.x milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants