Skip to content

Hexo theme material #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions libs/hexo-theme-material/1.5.2/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@


# Commit message format

*Read this in other languages: [English](CONTRIBUTING.md), [简体中文](CONTRIBUTING.zh-cn.md).*

## 1. Title (Header)

**(1)type**

`type` is used to describe the commit class. It must be one of the following:

>- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Adding missing tests or correcting existing tests
- chore: Changes that affect the build system or external dependencies


**(2)scope**

`scope` is used to describe the scope of the impact of commit, such as sns, lang, share.

`scope` is placed after `type` and within parenthesis (`()`).

**(3)subject**

`subject` is a short description of the commit purpose, not more than 50 characters.

> - starts with a verb and uses the first person present, such as change, not changed or changes
- The first letter is lowercase
- End without a period (.)

---
See #119 `refactor(sns): simplify conditional display` for example.

## 2. Body

Body is a detailed description that can be divided into multiple lines. The following is an example.

>More detailed explanatory text, if necessary. Wrap it around
72 characters or so.

>Further paragraphs come after blank lines.

>- Bullet points are okay, too
- Use a hanging indent

There are two points to note:

(1) Use the first person present, such as `change` instead of `changed` or `changes`.

(2) The motivation for the code change should be stated, as well as the comparison with the previous behavior.

## 3. Footer

The Footer section is used only in two cases.

** (1) Incompatible changes **

If the current code is incompatible with the previous version, the Footer section begins with `BREAKING CHANGE`, followed by a description of the change, along with the reason for the change and the migration method.

BREAKING CHANGE: isolate scope bindings definition has changed.

To migrate the code follow the example below:

Before:

scope: {
myAttr: 'attribute',
}

After:

scope: {
myAttr: '@',
}

The removed `inject` wasn't generally useful for directives so there should be no code using it.

** (2) Close Issue **

If the current commit is for an issue, then you can close the issue in the Footer section.

Closes #234

You can also close more than one issue at a time.

Closes #123, #245, #992.

## 4. Revert

There is also a special case that if the current commit is used to revoke a previous commit, it must begin with `revert:` followed by the commit header.

revert: feat(pencil): add 'graphiteWidth' option

This reverts commit 667ecc1654a317a13331b17617d973392f415f02.

Body part of the format is fixed, must be written as `This reverts commit <hash>.`, Where `hash` is revoked SHA identifier of the commit.

If the current commit is in the same release as the revoked commit, they will not appear in the Change log. If the two are in different releases, the current commit will appear in the Change log under the `Reverts` subtitle.
102 changes: 102 additions & 0 deletions libs/hexo-theme-material/1.5.2/CONTRIBUTING.zh-cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@


# Commit message format

*其他语言版本: [English](CONTRIBUTING.md), [简体中文](CONTRIBUTING.zh-cn.md).*

## 1. Title (Header)

**(1)type**

`type` 用于说明 commit 的类别,只允许使用下面 7 个标识。

>- feat: New feature 新功能
- fix: Fix bug 修补 bug
- docs: Documentation 文档
- style: Format 格式(不影响代码运行的变动)
- refactor: Refactor 重构(即不是新增功能,也不是修改 bug 的代码变动)
- test: Test 增加测试
- chore: 构建过程或辅助工具的变动

**(2)scope**

`scope` 用于说明 commit 影响的范围,比如 sns,lang,share。

`scope` 紧接 `type` 置于 `()` 之内。

**(3)subject**

`subject` 是 commit 目的的简短描述,不超过 50 个字符。

>- 以动词开头,使用第一人称现在时,比如change,而不是changed或changes
- 第一个字母小写
- 结尾不加句号(.)

---
Title 可参考 #119 `refactor(sns): simplify conditional display`

## 2. Body

Body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。

>More detailed explanatory text, if necessary. Wrap it to
about 72 characters or so.

>Further paragraphs come after blank lines.

>- Bullet points are okay, too
- Use a hanging indent

有两个注意点:

(1)使用第一人称现在时,比如使用 `change` 而不是 `changed` 或 `changes`。

(2)应该说明代码变动的动机,以及与以前行为的对比。

## 3. Footer

Footer 部分只用于两种情况。

**(1)不兼容变动**

如果当前代码与上一个版本不兼容,则 Footer 部分以 `BREAKING CHANGE` 开头,后面是对变动的描述、以及变动理由和迁移方法。

BREAKING CHANGE: isolate scope bindings definition has changed.

To migrate the code follow the example below:

Before:

scope: {
myAttr: 'attribute',
}

After:

scope: {
myAttr: '@',
}

The removed `inject` wasn't generally useful for directives so there should be no code using it.

**(2)关闭 Issue**

如果当前 commit 针对某个 issue,那么可以在 Footer 部分关闭这个 issue 。

Closes #234

也可以一次关闭多个 issue 。

Closes #123, #245, #992

## 4. Revert

还有一种特殊情况,如果当前 commit 用于撤销以前的 commit,则必须以 `revert:` 开头,后面跟着被撤销 Commit 的 Header。

revert: feat(pencil): add 'graphiteWidth' option

This reverts commit 667ecc1654a317a13331b17617d973392f415f02.

Body 部分的格式是固定的,必须写成 `This reverts commit <hash>.`,其中的 `hash` 是被撤销 commit 的 SHA 标识符。

如果当前 commit 与被撤销的 commit,在同一个发布(release)里面,那么它们都不会出现在 Change log 里面。如果两者在不同的发布,那么当前 commit,会出现在 Change log 的 `Reverts` 小标题下面。
Loading