mirror of
https://github.com/conventional-commits/conventionalcommits.org.git
synced 2025-08-22 13:58:35 +00:00
parent
921a29db62
commit
32f6430a86
55
index.md
55
index.md
@ -7,7 +7,7 @@ redirect_from: /lang/en/
|
||||
|
||||
## Summary
|
||||
|
||||
As an open-source maintainer, squash feature branches onto `master` and write
|
||||
As a software developer, I want to squash feature branches onto `master` and write
|
||||
a standardized commit message while doing so.
|
||||
|
||||
The commit message should be structured as follows:
|
||||
@ -28,14 +28,14 @@ The commit contains the following structural elements, to communicate intent to
|
||||
consumers of your library:
|
||||
|
||||
1. **fix:** a commit of the _type_ `fix` patches a bug in your codebase (this correlates with [`PATCH`](http://semver.org/#summary) in semantic versioning).
|
||||
2. **feat:** a commit of the _type_ `feat` introduces a new feature to the codebase (this correlates
|
||||
with [`MINOR`](http://semver.org/#summary) in semantic versioning).
|
||||
3. **BREAKING CHANGE:** a commit that has the text `BREAKING CHANGE:` at the beginning of its optional body or footer section introduces a breaking API change (correlating with [`MAJOR`](http://semver.org/#summary) in semantic versioning). A breaking change can be
|
||||
part of commits of any _type_. e.g., a `fix:`, `feat:` & `chore:` types would all be valid, in addition to any other _type_.
|
||||
4. Others: commit _types_ other than `fix:` and `feat:` are allowed, for example [commitlint-config-conventional](https://github.com/marionebl/commitlint/tree/master/%40commitlint/config-conventional) (based on the [the Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)) recommends `chore:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others. We also recommend `improvement` for commits that improve a current implementation without adding a new feature or fixing a bug. Notice these types are not mandated by the conventional commits specification, and have no implicit effect in semantic versioning (unless they include a BREAKING CHANGE, which is NOT recommended).
|
||||
2. **feat:** a commit of the _type_ `feat` introduces a new feature to the codebase (this correlates with [`MINOR`](http://semver.org/#summary) in semantic versioning).
|
||||
3. **BREAKING CHANGE:** a commit that has the text `BREAKING CHANGE:` at the beginning of its optional body or footer section introduces a breaking API change (correlating with [`MAJOR`](http://semver.org/#summary) in semantic versioning).
|
||||
A breaking change can be part of commits of any _type_.
|
||||
4. Others: commit _types_ other than `fix:` and `feat:` are allowed, for example [commitlint-config-conventional](https://github.com/marionebl/commitlint/tree/master/%40commitlint/config-conventional) (based on the [the Angular convention](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines)) recommends `chore:`, `docs:`, `style:`, `refactor:`, `perf:`, `test:`, and others.
|
||||
We also recommend `improvement` for commits that improve a current implementation without adding a new feature or fixing a bug.
|
||||
Notice these types are not mandated by the conventional commits specification, and have no implicit effect in semantic versioning (unless they include a BREAKING CHANGE, which is NOT recommended).
|
||||
<br />
|
||||
A scope may be provided to a commit's type, to provide additional contextual information and
|
||||
is contained within parenthesis, e.g., `feat(parser): add ability to parse arrays`.
|
||||
A scope may be provided to a commit's type, to provide additional contextual information and is contained within parenthesis, e.g., `feat(parser): add ability to parse arrays`.
|
||||
|
||||
## Examples
|
||||
|
||||
@ -67,10 +67,8 @@ fixes issue #12
|
||||
|
||||
## Introduction
|
||||
|
||||
In software development, it's been my experience that bugs are most often introduced
|
||||
at the boundaries between applications. Unit testing works great for testing the interactions
|
||||
that an open-source maintainer knows about, but do a poor job of capturing all the
|
||||
interesting, often unexpected, ways that a community puts a library to use.
|
||||
In software development, it's been my experience that bugs are most often introduced at the boundaries between applications.
|
||||
Unit testing works great for testing the interactions that a maintainer knows about, but do a poor job of capturing all the interesting, often unexpected, ways that a community puts a library to use.
|
||||
|
||||
Anyone who has upgraded to a new patch version of a dependency, only to watch their
|
||||
application start throwing a steady stream of 500 errors, knows how important
|
||||
@ -89,22 +87,17 @@ debug issues across project boundaries.
|
||||
|
||||
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt).
|
||||
|
||||
1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc.,
|
||||
followed by a colon and a space.
|
||||
2. The type `feat` MUST be used when a commit adds a new feature to your application
|
||||
or library.
|
||||
1. Commits MUST be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed by a colon and a space.
|
||||
2. The type `feat` MUST be used when a commit adds a new feature to your application or library.
|
||||
3. The type `fix` MUST be used when a commit represents a bug fix for your application.
|
||||
4. An optional scope MAY be provided after a type. A scope is a phrase describing
|
||||
a section of the codebase enclosed in parenthesis, e.g., `fix(parser):`
|
||||
4. An optional scope MAY be provided after a type. A scope is a phrase describing a section of the codebase enclosed in parenthesis, e.g., `fix(parser):`
|
||||
5. A description MUST immediately follow the type/scope prefix.
|
||||
The description is a short description of the code changes, e.g.,
|
||||
_fix: array parsing issue when multiple spaces were contained in string._
|
||||
The description is a short description of the code changes, e.g., _fix: array parsing issue when multiple spaces were contained in string._
|
||||
6. A longer commit body MAY be provided after the short description, providing additional contextual information about the code changes. The body MUST begin one blank line after the description.
|
||||
7. A footer MAY be provided one blank line after the body (or after the description if body is missing).
|
||||
The footer SHOULD contain additional issue references about the code changes (such as the issues it fixes, e.g.,`Fixes #13`).
|
||||
8. Breaking changes MUST be indicated at the very beginning of the footer or body section of a commit. A breaking change MUST consist of the uppercase text `BREAKING CHANGE`, followed by a colon and a space.
|
||||
9. A description MUST be provided after the `BREAKING CHANGE: `, describing what
|
||||
has changed about the API, e.g., _BREAKING CHANGE: environment variables now take precedence over config files._
|
||||
9. A description MUST be provided after the `BREAKING CHANGE: `, describing what has changed about the API, e.g., _BREAKING CHANGE: environment variables now take precedence over config files._
|
||||
10. The footer MUST only contain `BREAKING CHANGE`, external links, issue references, and other meta-information.
|
||||
11. Types other than `feat` and `fix` MAY be used in your commit messages.
|
||||
|
||||
@ -156,27 +149,23 @@ In a worst case scenario, it's not the end of the world if a commit lands that d
|
||||
|
||||
### Do all my contributors need to use the conventional commit specification?
|
||||
|
||||
No! If you use a squash based workflow on Git lead maintainers can cleanup the commit messages as they're merged—adding no workload to casual committers. A common workflow for this is to have your git system automatically squash commits from a pull request and present a form for the lead maintainer to enter the proper git commit message for the merge.
|
||||
No! If you use a squash based workflow on Git lead maintainers can cleanup the commit messages as they're merged—adding no workload to casual committers.
|
||||
A common workflow for this is to have your git system automatically squash commits from a pull request and present a form for the lead maintainer to enter the proper git commit message for the merge.
|
||||
|
||||
## About
|
||||
|
||||
The Conventional Commit specification is inspired by, and based heavily on, the [Angular Commit Guidelines](https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines).
|
||||
|
||||
The first draft of this specification has been written in collaboration with some of the
|
||||
folks contributing to:
|
||||
The first draft of this specification has been written in collaboration with some of the folks contributing to:
|
||||
|
||||
* [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog): a
|
||||
set of tools for parsing conventional commit messages from git histories.
|
||||
* [unleash](https://github.com/netflix/unleash): a tool for automating the
|
||||
software release and publishing lifecycle.
|
||||
* [lerna](https://github.com/lerna/lerna): a tool for managing monorepos, which grew out
|
||||
of the Babel project.
|
||||
* [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog): a set of tools for parsing conventional commit messages from git histories.
|
||||
* [unleash](https://github.com/netflix/unleash): a tool for automating the software release and publishing lifecycle.
|
||||
* [lerna](https://github.com/lerna/lerna): a tool for managing monorepos, which grew out of the Babel project.
|
||||
|
||||
## Projects Using Conventional Commits
|
||||
|
||||
* [yargs](https://github.com/yargs/yargs): everyone's favorite pirate themed command line argument parser.
|
||||
* [istanbuljs](https://github.com/istanbuljs/istanbuljs): a collection of open-source tools
|
||||
and libraries for adding test coverage to your JavaScript tests.
|
||||
* [istanbuljs](https://github.com/istanbuljs/istanbuljs): a collection of open-source tools and libraries for adding test coverage to your JavaScript tests.
|
||||
* [standard-version](https://github.com/conventional-changelog/standard-version): Automatic versioning and CHANGELOG management, using GitHub's new squash button and the recommended Conventional Commits workflow.
|
||||
* [uPortal-home](https://github.com/UW-Madison-DoIT/angularjs-portal) and [uPortal-application-framework](https://github.com/UW-Madison-DoIT/uw-frame): Optional supplemental user interface enhancing [Apereo uPortal](https://www.apereo.org/projects/uportal).
|
||||
* [massive.js](https://github.com/dmfay/massive-js): A data access library for Node and PostgreSQL.
|
||||
|
Loading…
Reference in New Issue
Block a user