The Wayback Machine - https://web.archive.org/web/20221027091531/https://github.com/Coding/coding-docs
Skip to content

Coding/coding-docs

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CODING 帮助中心

CI Commitizen friendly

本仓库是 CODING 帮助中心的文档,采用 Hexo 框架,Markdown 格式,通过持续集成强制检查下列规范:

参与本项目之前,建议先学习视频课程:DevOps 代码质量实战:代码规范与 Git Flow

目录结构

├── Jenkinsfile
├── _config.yml # Hexo 配置
├── generate-overview.js
├── patches
│   └── hexo-renderer-marked.patch # 中文锚点补丁
├── source # 所有文档
│   ├── _data
│   │   └── navigation.yml # 导航配置
│   ├── foo
│   └── bar
└── themes
    └── coding-help

本地构建

npm install

# 本地预览
hexo serve
open http://127.0.0.1:4000/docs/start/new.html
最佳实践:http://localhost:4000/docs/best-practices/overview.html

# 生成 HTML
hexo generate

# 最佳实践的概览页
# 注意 json 文件的 image 字段和 link 字段的格式,image 字段只需写图片名字,图片放在 themes/coding-help/source/images/best-practices

vi source/_data/best-practices.json
npm run best
npm run dev
open http://localhost:4000/docs/best-practices/overview.html

本地开发

git checkout master
git pull
git checkout -b issue-123
vi xxx.md
git add xxx.md

# 运行标准化提交插件,按照提示输入信息
npm install -g commitizen cz-conventional-changelog
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
git cz

git push origin issue-123

# 网页创建合并请求

持续集成

合并请求会触发持续集成,强制检查规范,如果失败,修改后重新提交。

如果持续集成报错:git commit 不规范,参考文章进行修改:修改 git 历史提交 commit 信息(重写历史)

commit 修改难度较高,也可回到 master,重新创建分支(注意不要重名),复制文件,重新提交。

Code Review

持续集成通过后,由同事进行 code review,如果有问题,修改后重新提交。

code review 原则:

  • 每次合并请求都必须经过 review;
  • 及时进行:不要跨天;
  • 必须通读,大部分时候都会发现问题;如果从来发现不了问题,随意批准,将被吊销 review 资格。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published