1 | ## Git Commit Guidelines
|
2 | (stolen from https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md)
|
3 |
|
4 | We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history.
|
5 |
|
6 | The commit message formatting can be added using a typical git workflow or through the use of a CLI wizard (Commitizen). To use the wizard, run npm run commit in your terminal after staging your changes in git.
|
7 |
|
8 | ### Commit Message Format
|
9 | Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
|
10 |
|
11 | `<type>: <subject>`
|
12 |
|
13 | Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
|
14 |
|
15 | ## Revert
|
16 | If the commit reverts a previous commit, it should begin with revert:, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.
|
17 |
|
18 | ### Type
|
19 | Must be one of the following:
|
20 |
|
21 | feat: A new feature
|
22 | fix: A bug fix
|
23 | revert: Revert a previous commit
|
24 | docs: Documentation only changes
|
25 | style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
26 | refactor: A code change that neither fixes a bug nor adds a feature
|
27 | perf: A code change that improves performance
|
28 | test: Adding missing tests
|
29 | chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
30 |
|
31 | ## Code Style
|
32 | ```javascript
|
33 | class CamelCaseClasses {
|
34 |
|
35 | constructor(options) {
|
36 | super(options);
|
37 | }
|
38 |
|
39 | get value() {
|
40 | return this._value;
|
41 | }
|
42 |
|
43 | set value(value) {
|
44 | this._value = value;
|
45 | }
|
46 |
|
47 | /** @ignore **/
|
48 | privateMethod() {
|
49 |
|
50 | }
|
51 |
|
52 | camelCaseMethods(arg1, arg2) {
|
53 |
|
54 | // 2.D.1.1
|
55 | if (condition) {
|
56 | // statements
|
57 | }
|
58 |
|
59 | while (condition) {
|
60 | // statements
|
61 | }
|
62 |
|
63 | for (var i = 0; i < 100; i++) {
|
64 | // statements
|
65 | }
|
66 |
|
67 | if (true) {
|
68 | // statements
|
69 | } else {
|
70 | // statements
|
71 | }
|
72 | }
|
73 | }
|
74 | ```
|