From e37e4e3a18c37513664cdf35cbb804dabfcbe196 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Mon, 13 Apr 2026 23:12:52 -0400 Subject: [PATCH] feat(scoring): add language-specific causes of death MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #10. Extends determineCauseOfDeath() with 7 new language-specific rules beyond the existing JavaScript one: - PHP → Died of PHP fatigue - Ruby → Gemfile.lock never unlocked - Python → Pip froze, then everything else did - Perl → Nobody could read it, including the author - CoffeeScript → Outlived by the thing it inspired - Objective-C → Swift happened - Scala → Compilation finished, interest did not Language-specific rules follow the existing isJS pattern: score 5 when the repo's primary language matches and daysSince > 365 (except CoffeeScript, which is punished on language alone because it's dead by definition). Existing 32 tests still pass; no rule changes to the universal checks. --- src/lib/scoring.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/lib/scoring.ts b/src/lib/scoring.ts index 25cab40..e1b049c 100644 --- a/src/lib/scoring.ts +++ b/src/lib/scoring.ts @@ -92,6 +92,34 @@ export function determineCauseOfDeath(repo: RepoData): string { score: isJS && daysSince > 365 ? 5 : 0, cause: 'Lost in dependency hell', }, + { + score: repo.language?.toLowerCase() === 'php' && daysSince > 365 ? 5 : 0, + cause: 'Died of PHP fatigue', + }, + { + score: repo.language?.toLowerCase() === 'ruby' && daysSince > 365 ? 5 : 0, + cause: 'Gemfile.lock never unlocked', + }, + { + score: repo.language?.toLowerCase() === 'python' && daysSince > 365 ? 5 : 0, + cause: 'Pip froze, then everything else did', + }, + { + score: repo.language?.toLowerCase() === 'perl' && daysSince > 365 ? 5 : 0, + cause: 'Nobody could read it, including the author', + }, + { + score: repo.language?.toLowerCase() === 'coffeescript' ? 5 : 0, + cause: 'Outlived by the thing it inspired', + }, + { + score: repo.language?.toLowerCase() === 'objective-c' && daysSince > 365 ? 5 : 0, + cause: 'Swift happened', + }, + { + score: repo.language?.toLowerCase() === 'scala' && daysSince > 365 ? 5 : 0, + cause: 'Compilation finished, interest did not', + }, { score: descLower.includes('microservice') || descLower.includes('enterprise') ? 5 : 0, cause: 'Killed by overengineering',