Files
ImageZoom-------/CONTRIBUTING.md
2025-07-28 22:43:00 +08:00

168 lines
3.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 貢獻指南
感謝您對 ImageZoom 專案的關注!我們歡迎所有形式的貢獻。
## 如何貢獻
### 報告 Bug
如果您發現了 Bug
1. 檢查 [Issues](https://github.com/your-username/imagezoom/issues) 是否已經有人報告過
2. 如果沒有,請建立新的 Issue並包含
- 詳細的 Bug 描述
- 重現步驟
- 預期行為和實際行為
- 作業系統和瀏覽器版本
- 錯誤訊息或截圖
### 功能請求
如果您有新的功能想法:
1. 檢查現有的 Issues 和 Pull Requests
2. 建立新的 Issue描述
- 功能需求
- 使用場景
- 預期效果
### 程式碼貢獻
#### 開發環境設定
1. **Fork 專案**
```bash
git clone https://github.com/your-username/imagezoom.git
cd imagezoom
```
2. **建立虛擬環境**
```bash
python -m venv venv
source venv/bin/activate # Linux/Mac
# 或
venv\Scripts\activate # Windows
```
3. **安裝依賴**
```bash
pip install -r requirements.txt
cd frontend && npm install
```
#### 開發流程
1. **建立功能分支**
```bash
git checkout -b feature/your-feature-name
```
2. **開發功能**
- 遵循現有的程式碼風格
- 撰寫測試(如果適用)
- 確保所有測試通過
3. **提交變更**
```bash
git add .
git commit -m "feat: 新增功能描述"
```
4. **推送到分支**
```bash
git push origin feature/your-feature-name
```
5. **建立 Pull Request**
- 前往 GitHub 建立 Pull Request
- 填寫 PR 模板
- 等待審查
#### 提交訊息規範
我們使用 [Conventional Commits](https://www.conventionalcommits.org/) 規範:
- `feat:` 新功能
- `fix:` Bug 修復
- `docs:` 文件更新
- `style:` 程式碼格式調整
- `refactor:` 重構
- `test:` 測試相關
- `chore:` 建置工具或輔助工具的變動
範例:
```
feat: 新增圖片縮放功能
fix: 修復上傳檔案大小限制問題
docs: 更新 API 文件
```
#### 程式碼風格
**Python (後端)**
- 遵循 PEP 8 規範
- 使用 4 個空格縮排
- 行長度限制在 79 字元內
- 使用有意義的變數和函數名稱
**JavaScript (前端)**
- 使用 ESLint 和 Prettier
- 遵循 React 最佳實踐
- 使用有意義的組件和函數名稱
#### 測試
**後端測試**
```bash
# 執行測試
python -m pytest
# 執行測試並顯示覆蓋率
python -m pytest --cov=app
```
**前端測試**
```bash
cd frontend
npm test
```
## Pull Request 審查流程
1. **自動檢查**
- CI/CD 流程會自動執行測試
- 程式碼風格檢查
- 安全性掃描
2. **人工審查**
- 至少需要一位維護者審查
- 可能需要修改或改進
3. **合併**
- 審查通過後會合併到主分支
- 會自動部署到測試環境
## 行為準則
我們致力於建立一個友善和包容的社群環境:
- 尊重所有貢獻者
- 使用友善和建設性的語言
- 接受建設性的批評
- 專注於問題本身,而非個人
## 聯絡方式
如果您有任何問題或建議:
- 建立 [Issue](https://github.com/your-username/imagezoom/issues)
- 發送 Email 至 [your-email@example.com]
- 加入我們的 [Discord 社群](https://discord.gg/your-server)
## 致謝
感謝所有為這個專案做出貢獻的開發者!
---
**注意:** 請確保您同意本專案的 [LICENSE](LICENSE) 條款。