当前位置:网站首页>git 提交规范
git 提交规范
2020-11-06 23:23:00 【lemos】
格式
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
type
- feat: 新增/修改功能 (feature)。
- fix: 修補 bug (bug fix)。
- docs: 文件 (documentation)。
- style: 格式 (不影響程式碼運行的變動 white-space, formatting, missing semi colons, etc)。
- refactor: 重構 (既不是新增功能,也不是修補 bug 的程式碼變動)。
- perf: 改善效能 (A code change that improves performance)。
- test: 增加測試 (when adding missing tests)。
- chore: 建構程序或輔助工具的變動 (maintain)。
- revert: 撤銷回覆先前的 commit 例如:revert: type(scope): subject (回覆版本:xxxx)。
示例一:
① docs
docs: 新增註解
docs: 修正型別註解
讓 IDE 可以讀取到正確的類別
docs: 移除過期的註解
issue #1229
② style
style: message 頁面,對 Component 做 Beautifier
經 IE 瀏覽器測試後發現 Component 裡面仍然夾帶 ES6 語法,
但是目前 Component 的程式碼都被壓縮成一行,
為了日後修改程式方便,故先對所有被壓縮的程式碼做 Beautifier
調整項目:
1. 針對所有被壓縮的程式碼做 Beautifier
2. 移除被註解的程式碼,原本被註解的程式碼應該是壓縮前的程式碼,但是經測試後發現這些被註解的程式碼都是舊 Code,故移除。
issue #1219
issue #1028
style: 統一換行符號 CRLF to LF
統一換行符號
style: 調整 HTML 縮排
issue #964
③ chore
chore: 更新 testing 環境
更新 ci-phpunit-test 套件 0.16 => 0.17
for Request GET 帶參數功能。
chore:調整單元測試環境
調整項目:
1. MX/Modules
將客製化 Testing 的邏輯移除,否則在測試環境中無法正確存取檔案。
2. 加入 tests/unit 與 tests/integration 目錄,並將測試檔案移至合宜的位置。
3. AdminTestCase.php,繼承 TestCase,實作登入邏輯、setUp 與 tearDown,供其他測試案例繼承使用。
4. Bootstrap.php,引入 AdminTestCase.php 共測試案例繼承用。
5. Login.php,因測試案例中不能有 header 的設定,更動系統登入邏輯,在測試環境中改用 redirect 轉址。
6. phpunit.xml,取消嚴謹宣告覆蓋模式,避免造成測試不通過(若需知道你的測試案例覆蓋了哪些類別或邏輯,可自行打開)。
## 備註: unit 與 integration 目錄
分別為「單元測試目錄」與「整合測試目錄」,單元測試目錄負責測試 Api 與 Model,整合測試目錄則負責測試 Controller。
issue #709
④ perf
perf: 評核表單列表,優化取得受評者速度
原本取得受評者的邏輯會造成載入頁面緩慢(開發機約 52 秒),故做優化。
調整方式:
原程式碼每個表單迴圈進入 DB 取得受評者資料。
改成
進 DB 一次撈取全部受評者資料,再回到 PHP 分配資料。
結果:
開發機載入頁面時間 52 秒 => 5秒
issue #1272
⑤ refacotr
refactor: 每日通知信件,重構程式結構
考量將來可能會需要寄送多種資訊給使用者,
故重構程式結構,讓未來擴充功能時比較方便。
調整內容:
1. Send_today_notify_mail:
- 把取得「系統通知」邏輯搬移至 System_notify_handler.php
- 把取得「站內訊息」邏輯搬移至 Message_handler.php
- 引入 Pipeline,把取得各種系統資訊的邏輯注入進 Pipeline。
- 透過 Pipeline 取得每日通知信件內容,並建立信件 HTML
2. Daily_email 介面:
- 定義 每日信件處理器 Xxx_handler 的方法
- 之後要擴充新的功能,必須按照 Daily_email 介面的定義,實作方法。
3. message.php、system_notify.php:
- 將「系統通知」與「站內訊息」的 Email 頁面獨立出來。
issue #1308
⑥ feat
feat: 表單統計,多顯示計畫名稱欄位
因應需求做調整:
1. 列表資訊多加「計畫名稱」欄位,以利後續匯出資料處理。
調整項目:
1. Assessment_form.php,匯出表單統計時,新增訓練計畫名欄位。
2. customize.php,表單統計查詢時,多顯示訓練計畫名欄位。
3. Complex_assessment_form_api.php、Complex_assessment_form_model_api.php:
- 取得表單統計資料時,多取得計畫名稱。
issue #1200
⑦ fix
fix: 意見反應,信件看不到圖片問題
問題:
1. 客戶反應:意見反應的信件都看不到圖片。
原因:
1. 目前程式碼都會要求先登入後才可查看使用者上傳的檔案,
造成在信件上會看不見圖片的問題。
調整項目:
1. File.php,經討論後,開放讓意見反應頁面上傳的檔案,不用登入就可以查看/下載。
issue #1229
示例二:
① 文档调整
docs: correct spelling of CHANGELOG
② 包含作用域
feat(lang): add polish language
③ 为 fix 编写的提交说明,包含(可选的) issue 编号
fix: correct minor typos in code
see the issue for details on the typos fixed
closes issue #12
④ 包含了可选的 !
字符以提醒注意破坏性变更的提交说明
chore!: drop Node 6 from testing matrix
BREAKING CHANGE: dropping Node 6 which hits end of life in April
版权声明
本文为[lemos]所创,转载请带上原文链接,感谢
https://my.oschina.net/lemos/blog/4706955
边栏推荐
- 如何使用甘特图图层和筛选器
- Google browser realizes video playback acceleration function
- VARCHART XGantt入门教程
- 如何才能快速正确的部署甘特图
- 南京标志设计,logo设计公司
- How to start the hidden preferences in coda 2 on the terminal?
- 条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
- Python3 operating gitlab
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
猜你喜欢
测试攻城狮必备技能点!一文带你解读DevOps下的测试技术
cubemx做stm32 USB开发
Idea activation to 2089 failure
idea 激活到 2089 失效
2020-08-19: what mechanism does TCP ensure reliability?
图像处理工具包ImagXpress使用教程,如何查看事件
Google browser realizes video playback acceleration function
条形码识别性能低,如何优化Dynamsoft Barcode Reader解码性能
Benefits and functions of auto maintenance app development
A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
随机推荐
Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing
条形码识别器Dynamsoft Barcode Reader v7.5全新上线!
2020-09-04: do you understand the function call convention?
JS array the usage of array is all here (array method reconstruction, array traversal, array de duplication, array judgment and conversion)
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
jenkins pipline stage 设置超时
.NETCore3.1+ Vue.js Low code workflow engine
Detect certificate expiration script
南京标识标牌设计制作,导视VI系统设计
Image processing toolkit imagexpresshow to view events
Google browser realizes video playback acceleration function
Es create a new index database and copy the old index library, practice pro test effective!
How to optimize the decoding performance of dynamsoft barcode reader
Interviewer: how about shardingsphere
The essence of transaction and the principle of deadlock
ImageMagick - add watermark
To solve the problem that the data interface is not updated after WPF binding set
Getting started with varhart xgantt
Empty test suite appears in JUnit test
A good thing for working people -- to temper the will of iron and steel requires such an efficient computer