当前位置:网站首页>git 提交规范
git 提交规范
2020-11-06 23:23:59 【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
边栏推荐
- C++ 数字、string和char*的转换
- C++学习——centos7上部署C++开发环境
- C++学习——一步步学会写Makefile
- C++学习——临时对象的产生与优化
- C++学习——对象的引用的用法
- C++编程经验(6):使用C++风格的类型转换
- Won the CKA + CKS certificate with the highest gold content in kubernetes in 31 days!
- C + + number, string and char * conversion
- C + + Learning -- capacity() and resize() in C + +
- C + + Learning -- about code performance optimization
猜你喜欢
-
C + + programming experience (6): using C + + style type conversion
-
Latest party and government work report ppt - Park ppt
-
在线身份证号码提取生日工具
-
Online ID number extraction birthday tool
-
️野指针?悬空指针?️ 一文带你搞懂!
-
Field pointer? Dangling pointer? This article will help you understand!
-
HCNA Routing&Switching之GVRP
-
GVRP of hcna Routing & Switching
-
Seq2Seq实现闲聊机器人
-
【闲聊机器人】seq2seq模型的原理
随机推荐
- LeetCode 91. 解码方法
- Seq2seq implements chat robot
- [chat robot] principle of seq2seq model
- Leetcode 91. Decoding method
- HCNA Routing&Switching之GVRP
- GVRP of hcna Routing & Switching
- HDU7016 Random Walk 2
- [Code+#1]Yazid 的新生舞会
- CF1548C The Three Little Pigs
- HDU7033 Typing Contest
- HDU7016 Random Walk 2
- [code + 1] Yazid's freshman ball
- CF1548C The Three Little Pigs
- HDU7033 Typing Contest
- Qt Creator 自动补齐变慢的解决
- HALCON 20.11:如何处理标定助手品质问题
- HALCON 20.11:标定助手使用注意事项
- Solution of QT creator's automatic replenishment slowing down
- Halcon 20.11: how to deal with the quality problem of calibration assistant
- Halcon 20.11: precautions for use of calibration assistant
- “十大科学技术问题”揭晓!|青年科学家50²论坛
- "Top ten scientific and technological issues" announced| Young scientists 50 ² forum
- 求反转链表
- Reverse linked list
- js的数据类型
- JS data type
- 记一次文件读写遇到的bug
- Remember the bug encountered in reading and writing a file
- 单例模式
- Singleton mode
- 在这个 N 多编程语言争霸的世界,C++ 究竟还有没有未来?
- In this world of N programming languages, is there a future for C + +?
- es6模板字符
- js Promise
- js 数组方法 回顾
- ES6 template characters
- js Promise
- JS array method review
- 【Golang】️走进 Go 语言️ 第一课 Hello World
- [golang] go into go language lesson 1 Hello World