Skip to content

Repository files navigation

contribution-showcase

Preview image

GitHub Pages crates.io Build, Test, Audit & Coverage Release codecov License: GPL-3.0

一個 Rust CLI 工具,掃描多個 Git 儲存庫的提交紀錄,產生一頁式 HTML 貢獻總覽報告。

功能

  • 讀取 TOML 設定檔(showcase.toml),支援多專案、篩選條件與輸出設定
  • 解析 Conventional Commit 格式,依類型統計提交分佈
  • 統計程式碼異動行數(新增/刪除)
  • 收集 OpenSpec 提案清單
  • 產生獨立 HTML 報告,包含:
    • 提交時間軸視覺化
    • Conventional Commit 類型分佈圖
    • 各專案統計資訊
    • 測試覆蓋率資訊

線上展示

👉 查看線上範例

快速開始

前置需求

  • Rust 工具鏈(cargo)
  • Git

安裝與建置

從 crates.io 安裝(推薦):

cargo install contribution-showcase

從原始碼建置:

cargo build --release

編譯產物位於 target/release/contribution-showcase。

使用流程

  1. 建立起始設定檔:

    contribution-showcase init
  2. 編輯 showcase.toml,設定要掃描的儲存庫路徑與篩選條件。

  3. 產生報告:

    contribution-showcase generate

    報告預設輸出至 dist/index.html。

設定檔

設定檔為 TOML 格式,結構如下(完整範例請參考 showcase.example.toml):

# 報告標題(選填)
title = "My Contribution Showcase"

# 輸出設定(選填)
[output]
path = "dist/index.html"
# timeline_max_buckets = 14   # 時間軸最大分段數(預設:14)

# 全域篩選條件(選填)
[filters]
author = "Jane Doe"           # 依作者名稱篩選
since = "2025-01-01"          # 起始日期(YYYY-MM-DD)
until = "2025-06-30"          # 結束日期(YYYY-MM-DD)
types = ["feat", "fix"]       # 限定 Conventional Commit 類型
exclude_hashes = ["e3b0..."]  # 排除特定 commit SHA

# 專案清單(至少一筆)
[[projects]]
name = "my-backend"
path = "../my-backend"
description = "REST API server"
branch = "main"
coverage_command = "cargo llvm-cov --cobertura --output-path coverage.xml"
coverage_result_path = "coverage.xml"

必填欄位: name、path。其餘欄位皆為選填。

CLI 覆寫: --title、--types、--exclude-hashes 等 CLI 旗標會覆寫設定檔中的對應值。以逗號分隔的輸入會自動去除空白並轉為小寫。

CLI 用法

generate — 產生報告

contribution-showcase generate [OPTIONS]
選項 說明
-c, --config <FILE> 設定檔路徑(預設:showcase.toml)
-o, --output <FILE> 輸出路徑(覆寫設定檔中的值)
--author <NAME> 依作者篩選(覆寫設定檔中的值)
--since <DATE> 起始日期 YYYY-MM-DD(覆寫設定檔中的值)
--until <DATE> 結束日期 YYYY-MM-DD(覆寫設定檔中的值)
--title <TITLE> 報告標題(覆寫設定檔中的值,同時影響預設輸出檔名)
--types <TYPES> 以逗號分隔的 Conventional Commit 類型篩選(覆寫設定檔),例如 feat,fix,docs
--exclude-hashes <HASHES> 以逗號分隔的 commit SHA 排除清單(覆寫設定檔)
--timeline-max-buckets <N> 時間軸最大分段數,超過時自動提升時間粒度(預設:14)

init — 建立起始設定檔

contribution-showcase init [OPTIONS]
選項 說明
-o, --output <FILE> 設定檔輸出路徑(預設:showcase.toml)

License

gplv3

GNU GENERAL PUBLIC LICENSE Version 3

Copyright (C) 2026 Jim Chen Jim@ChenJ.im.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

About

掃描多個 Git 儲存庫的提交紀錄,產生一頁式 HTML 貢獻總覽報告 (Rust CLI)

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages