RUM-4120: Add Detekt rule to enforce copyright headers on Kotlin source files#3291
Conversation
This comment has been minimized.
This comment has been minimized.
5c34ab1 to
5b2e3e6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3291 +/- ##
===========================================
- Coverage 71.44% 71.40% -0.04%
===========================================
Files 943 943
Lines 34821 34821
Branches 5899 5899
===========================================
- Hits 24875 24862 -13
- Misses 8281 8292 +11
- Partials 1665 1667 +2
🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| @@ -0,0 +1,5 @@ | |||
| /* | |||
There was a problem hiding this comment.
We have it in https://github.com/DataDog/dd-sdk-android/blob/develop/.idea/copyright/Datadog.xml, maybe we can parse from there to have a single source of truth?
Upd: ah, I see, it is built-in rule which requires copyright in this format.
There was a problem hiding this comment.
it is built-in rule which requires copyright in this format.
Yeah, 😞
What I was unsure about is where to place the licence.template file. I don’t really like putting it in the root, but we already have other Detekt files there. If you have a strong opinion on this, let me know.
What does this PR do?
.ktsource file in the repository starts with the standard DataDog header.Motivation
Copyright headers were only enforced via the IDE's IDEA copyright profile, which relies on developers remembering to apply it. Several files had missing, incorrectly indented, or typoed headers with no automated safety net. This rule makes violations a CI failure.
Additional Notes
license.templatefile is added at the repo root — this is the single source of truth for the expected header, read by Detekt at analysis time.buildoutputs, auto-generated buildSrc model fixtures, NoOpFactory test resource fixtures, and vendored dd-trace-java test files..ktsfiles were already excluded from the Detekt Gradle task (-ex "**/*.kts"). The copyright headers on.ktsfiles have been added and are correct. We can dive deeper into this if needed.Review checklist (to be filled by reviewers)