Skip to content

Commit 67991e3

Browse files
authored
chore: enforce conventional commits (#638)
1 parent 11a3f20 commit 67991e3

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

.github/semantic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
titleOnly: true

CONTRIBUTING.rst

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ Contributor License Agreement
99
Before a contribution can be merged into this project, please fill out
1010
the Contributor License Agreement (CLA) located at::
1111

12-
http://box.github.io/cla
12+
http://opensource.box.com/cla
1313

1414
To learn more about CLAs and why they are important to open source
1515
projects, please see the `Wikipedia
1616
entry <http://en.wikipedia.org/wiki/Contributor_License_Agreement>`_.
1717

18+
Code of Conduct
19+
------------------
20+
21+
This project adheres to the `Box Open Code of Conduct <http://opensource.box.com/code-of-conduct/>`_. By participating, you are expected to uphold this code.
22+
1823
How to contribute
1924
-----------------
2025

@@ -63,18 +68,59 @@ Create a branch with a descriptive name, such as ``add-search``.
6368
Step 5: Push your feature branch to your fork
6469
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6570

66-
As you develop code, continue to push code to your remote feature
67-
branch. Please make sure to include the issue number you're addressing
68-
in your commit message, such as:
71+
We use `semantic-versioning <https://semver.org/>`_ and the `conventional commit message format <https://www.conventionalcommits.org/en/v1.0.0/>`_.
72+
Keep a separate feature branch for each issue you want to address. As you develop code, continue to push code to your remote feature branch. Example:
6973

7074
.. code-block:: console
7175
72-
git commit -am "Adding search (fixes #123)"
76+
tag: short description
77+
longer description here if necessary.
78+
79+
The message summary should be a one-sentence description of the change, and it must be 72 characters in length or shorter. For a list of tags, please `click here <https://github.com/commitizen/conventional-commit-types/blob/master/index.json>`_. Note that you must include the `!` for breaking changes (e.g. `feat!: removed old apis`).
80+
81+
Shown below are examples of the release type that will be done based on a commit message.
82+
83+
Commit Types
84+
~~~~~~~~~~~~
85+
86+
"Semantic versioning" means that changes to the version number of the package (e.g. ``3.42.11`` to ``3.43.0``) are done according to rules that indicate how the change will affect consumers. Read more on the `semver page <https://semver.org/>`_.
87+
88+
The version number is broken into 3 positions ``Major.Minor.Patch``. In semantic release terms, changes to the numbers follow ``Breaking.Feature.Fix``. The ``release`` script parses commit messages and decides what type of release to make based on the types of commits detected since the last release.
89+
90+
The rules for commit types are:
91+
92+
- Anything that changes or removes an API, option, or output format is a breaking change denoted by ``!``.
93+
- Anything that adds new functionality in a backwards-compatible way is a feature (``feat``). Consumers have to upgrade to the new version to use the feature, but nothing will break if they do so.
94+
- Bugfixes (``fix``) for existing behavior are a patch. Consumers don't have to do anything but upgrade.
95+
- Other prefixes, such as ``docs`` or ``chore``, don't trigger releases and don't appear in the changelog. These tags signal that there are **no external changes to _any_ APIs** (including non-breaking ones).
96+
97+
In most cases, commits will be a ``feat`` or ``fix``. Make sure to include the ``!`` in the title if there are non-backwards-compatible changes in the commit.
7398

74-
This helps us out by allowing us to track which issue your commit
75-
relates to.
99+
.. list-table::
100+
:widths: 50 25 25
101+
:header-rows: 1
76102

77-
Keep a separate feature branch for each issue you want to address.
103+
* - Commit message
104+
- Release type
105+
- New version
106+
* - ``feat!: remove old files endpoints``
107+
- Major ("breaking")
108+
- ``X+1.0.0``
109+
* - ``feat: add new file upload endpoint``
110+
- Minor ("feature")
111+
- ``X.Y+1.0``
112+
* - ``fix: file streaming during download``
113+
- Patch ("fix")
114+
- ``X.Y.Z+1``
115+
* - ``docs: document files api``
116+
- No release
117+
- ``X.Y.Z``
118+
* - ``chore: remove commented code from file upload``
119+
- No release
120+
- ``X.Y.Z``
121+
* - ``refactor: rename a variable (invisible change)``
122+
- No release
123+
- ``X.Y.Z``
78124

79125
Step 6: Rebase
80126
~~~~~~~~~~~~~~
@@ -104,6 +150,4 @@ Keep in mind that we like to see one issue addressed per pull request,
104150
as this helps keep our git history clean and we can more easily track
105151
down issues.
106152

107-
Finally, please add a note in HISTORY.rst under the Upcoming section detailing what's new in your change.
108-
These will become the release notes for the next release.
109153
In addition, feel free to add yourself to AUTHORS.rst if you aren't already listed.

0 commit comments

Comments
 (0)