Skip to content

Commit 68ba7aa

Browse files
authored
Drop contributors from individual recipe pages (#220)
* Drop contributors from individual recipe pages We had some concerns reported to us that not every contributor has signed up to be listed here, so to avoid issues we're for now removing their names here. The metadata is retained, and we continue to appreciate the work done previously and going forward! * Drop contributors from individual recipe pages We had some concerns reported to us that not every contributor has signed up to be listed here, so to avoid issues we're for now removing their names here. The metadata is retained, and we continue to appreciate the work done previously and going forward!
1 parent 4e9e3a5 commit 68ba7aa

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

src/main/kotlin/org/openrewrite/ListsOfRecipesWriter.kt

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -109,62 +109,6 @@ class ListsOfRecipesWriter(
109109
}
110110
}
111111

112-
fun createRecipeAuthors() {
113-
// Collect contributors
114-
val allContributors = TreeMap<String, MutableSet<RecipeDescriptor>>()
115-
for (recipeDescriptor in allRecipeDescriptors) {
116-
for (contributor in recipeDescriptor.contributors) {
117-
val recipeSet = allContributors.computeIfAbsent(contributor.name) { mutableSetOf() }
118-
recipeSet.add(recipeDescriptor)
119-
}
120-
}
121-
122-
val recipeAuthorsPath = outputPath.resolve("recipe-authors.md")
123-
Files.newBufferedWriter(recipeAuthorsPath, StandardOpenOption.CREATE).useAndApply {
124-
writeln(
125-
"""
126-
---
127-
description: An autogenerated list of all recipe authors ranked by their contributions.
128-
---
129-
""".trimIndent()
130-
)
131-
writeln("\n# Recipe Authors\n")
132-
133-
writeln(
134-
"_This table lists all recipe authors ranked by the number of recipes they have contributed, from most to least._\n"
135-
)
136-
137-
writeln("**Total authors:** ${allContributors.size}\n")
138-
139-
// Sort authors by number of recipes (descending), then by name for ties
140-
val sortedAuthors = allContributors.entries.sortedWith(
141-
compareByDescending<Map.Entry<String, MutableSet<RecipeDescriptor>>> { it.value.size }
142-
.thenByDescending { linesContributed(it.key, it.value) }
143-
.thenBy { it.key }
144-
)
145-
146-
// Create table header
147-
writeln("| Rank | Author | Number of Recipes | Number of Lines |")
148-
writeln("|------|--------|-------------------|-----------------|")
149-
150-
// Create table rows
151-
var rank = 1
152-
for ((author, recipes) in sortedAuthors) {
153-
val recipeCount = recipes.size
154-
val lineCount = linesContributed(author, recipes)
155-
writeln("| $rank | $author | $recipeCount | $lineCount |")
156-
rank++
157-
}
158-
}
159-
}
160-
161-
private fun linesContributed(name: String, recipes: MutableSet<RecipeDescriptor>): Int =
162-
recipes.sumOf { recipeDescriptor ->
163-
recipeDescriptor.contributors
164-
.filter { contributor -> contributor.name.equals(name) }
165-
.sumOf { contributor -> contributor.lineCount }
166-
}
167-
168112
fun createRecipesByTag() {
169113
val tagToRecipes = TreeMap<String, TreeSet<RecipeDescriptor>>(String.CASE_INSENSITIVE_ORDER)
170114

src/main/kotlin/org/openrewrite/RecipeMarkdownGenerator.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ class RecipeMarkdownGenerator : Runnable {
207207
val listWriter = ListsOfRecipesWriter(allRecipeDescriptors, outputPath)
208208
listWriter.createModerneRecipes(moderneProprietaryRecipes)
209209
listWriter.createRecipesWithDataTables()
210-
listWriter.createRecipeAuthors()
211210
listWriter.createRecipesByTag()
212211
listWriter.createScanningRecipes(
213212
allRecipes.filter { it is ScanningRecipe<*> && it !is DeclarativeRecipe },

0 commit comments

Comments
 (0)