当前位置:网站首页>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
边栏推荐
- Design of NAND flash interface control
- 南京标志设计,logo设计公司
- WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
- jenkins pipline stage 设置超时
- How to add modules to nginx image?
- Qt音视频开发46-视频传输UDP版
- 2020-08-19: what mechanism does TCP ensure reliability?
- How to write plug-in code of small program mall system? How to use code to check whether the plug-in is successfully added?
- The essence of transaction and the principle of deadlock
- C calls SendMessage to refresh the taskbar icon (the icon does not disappear at the end of forcing)
猜你喜欢
10000! Ideal car recalls all defective cars: 97 accidents have occurred and losses will be expanded
Logo design company, Nanjing
Benefits and functions of auto maintenance app development
失眠一个整晚上
How to use Gantt chart layers and filters
The Interpreter pattern of behavior pattern
Points to be considered when deleting mapping field of index in ES
In 2020, how can wechat seal numbers be quickly lifted?
2020-08-17: how to solve data skew in detail?
甘特图对活动进行分组教程
随机推荐
插件Bilibili新版0.5.5
Win7 how to quickly type CMD and get to the required directory
Stm32f030c6t6 compatible to replace mm32spin05pf
Js字符串-String字符串对象方法
如何解决谷歌Chrome浏览器空白页的问题
8.Swarm创建维护和水平扩展Service
Es create a new index database and copy the old index library, practice pro test effective!
Detect certificate expiration script
The memorandum model of behavior model
2020-08-20: the difference between go and python?
10000! Ideal car recalls all defective cars: 97 accidents have occurred and losses will be expanded
南京标志设计,logo设计公司
失眠一个整晚上
20个XR项目路演,近20个资本机构出席!诚邀您参加2020 Qualcomm XR生态合作伙伴大会
Common syntax corresponding table of mongodb and SQL
Stm32f030k6t6 compatible replacement smart mm32f031k6t6
Benefits and functions of auto maintenance app development
汽车维修app开发的好处与功能
Zhou Jie: database system of East China Normal University
How to optimize the decoding performance of dynamsoft barcode reader