summaryrefslogtreecommitdiff
path: root/internal/showcase
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-07-08 22:52:51 +0300
committerPaul Buetow <paul@buetow.org>2025-07-08 22:52:51 +0300
commit81b6357a96e684d7588e499c8a7f3ab892c8c02a (patch)
tree7890b445befcf4b12af9d328a9aa2dd7a070431e /internal/showcase
parent5004ae7bf93e59e0e4992fa6c9640c427393f4a1 (diff)
feat: add obsolete project notice for inactive projects
- Add warning notice for projects with avg commit age > 2 years AND last commit > 1 year - Display "⚠️ Notice: This project appears to be finished, obsolete, or no longer maintained" - Also update abandoned branch threshold from 1 to 3 years in branch analyzer - Helps users identify potentially outdated or unmaintained projects 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/showcase')
-rw-r--r--internal/showcase/showcase.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/internal/showcase/showcase.go b/internal/showcase/showcase.go
index 60b0fb2..aa3e959 100644
--- a/internal/showcase/showcase.go
+++ b/internal/showcase/showcase.go
@@ -401,7 +401,20 @@ func (g *Generator) formatGemtext(summaries []ProjectSummary) string {
}
builder.WriteString(fmt.Sprintf("* Development Period: %s to %s\n", summary.Metadata.FirstCommitDate, summary.Metadata.LastCommitDate))
builder.WriteString(fmt.Sprintf("* Recent Activity: %.1f days (avg. age of last 42 commits)\n", summary.Metadata.AvgCommitAge))
- builder.WriteString(fmt.Sprintf("* License: %s\n\n", summary.Metadata.License))
+ builder.WriteString(fmt.Sprintf("* License: %s\n", summary.Metadata.License))
+
+ // Check if project might be obsolete (avg age > 2 years AND last commit > 1 year)
+ if summary.Metadata.AvgCommitAge > 730 && summary.Metadata.LastCommitDate != "" {
+ // Parse the last commit date
+ lastCommit, err := time.Parse("2006-01-02", summary.Metadata.LastCommitDate)
+ if err == nil {
+ daysSinceLastCommit := time.Since(lastCommit).Hours() / 24
+ if daysSinceLastCommit > 365 {
+ builder.WriteString("\n⚠️ **Notice**: This project appears to be finished, obsolete, or no longer maintained. Last meaningful activity was over 2 years ago. Use at your own risk.")
+ }
+ }
+ }
+ builder.WriteString("\n\n")
}
// Handle images and paragraphs