Skip to content

GitHub commit规范

xiaomaoaichiyu edited this page May 14, 2020 · 3 revisions

Commit Message Guidelines

选自 微软规范

We have adopted standards similar to Angular for how our git commit messages should be formatted. This leads to more readable messages, which are easier to follow when looking through the project history. Those messages are used to generate the change log.

Commit Message Format

Each commit message consists of a header, a body and a footer.

<type>: <short description>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Header

Type

Must be one of the following:

  • build: Changes that affect the build system or external dependencies
  • ci: Changes to our CI configuration files and scripts
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests
  • accessibility: Adding support for accessibility

Short Description

Contains a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize the first letter
  • no dot (.) at the end

Body

Just as in the short description, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about breaking changes and is also the place to reference Azure DevOps user stories/tasks or GitHub issues that this commit closes.

Commit Message Example

fix: add debouncing to asset scroller to correct browser scroll position

There is no debouncing when we store the asset container's scroll position.
This results in erratic, jumpy scrolling and a poor user experience. Improve
stability and usability with debouncing.

AB#17056

Style

  • This repo uses EditorConfig to maintain consistent styles across multiple platforms and IDEs. Please refer to this guide for more information.

Thank you!