Skip to content

Comments

Remove email addresses from contributors and de-dupe them#212

Merged
timtebeek merged 2 commits intomainfrom
strip-email
Aug 12, 2025
Merged

Remove email addresses from contributors and de-dupe them#212
timtebeek merged 2 commits intomainfrom
strip-email

Conversation

@mike-solomon
Copy link
Contributor

No description provided.

writeln("## Contributors\n")
// Extract unique contributor names (removing duplicates)
val uniqueNames = recipeDescriptor.contributors
.map { contributor -> contributor.name }
Copy link
Member

Choose a reason for hiding this comment

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

We might want to remove accents here as well:
https://www.baeldung.com/java-remove-accents-from-text

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it would be better to already remove these accents in openrewrite/rewrite, just to avoid duplicating the logic in the platform.

Copy link
Member

Choose a reason for hiding this comment

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

Now normalizing author names in openrewrite/rewrite-build-gradle-plugin@9343d65
We'll see if we need to make adjustments here, but I'd not expect so.

val uniqueNames = recipeDescriptor.contributors
.map { contributor -> contributor.name }
.distinct()
.sorted()
Copy link
Member

Choose a reason for hiding this comment

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

The order or distinct & sorted matters, I think; distinct only removes duplicates that are next to each other.

Apart from that I would not change the order by sorting, as by default we sort by who has contributed the most lines of code(!), which I'd want to retain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that distinct() removes all duplicates from the collection - not just ones next to each other.

Good call out on sorted - removed that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've confirmed that distinct removes dupes from the whole collection by running and looking at the spring boot 3.5 recipe:

image

Copy link
Member

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks!

@github-project-automation github-project-automation bot moved this from In Progress to Ready to Review in OpenRewrite Aug 12, 2025
@timtebeek timtebeek merged commit c587915 into main Aug 12, 2025
1 check passed
@timtebeek timtebeek deleted the strip-email branch August 12, 2025 17:02
@github-project-automation github-project-automation bot moved this from Ready to Review to Done in OpenRewrite Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants