Skip to content

Commit a1c9a41

Browse files
docs(CONTRIBUTING.md): add more info for contributors
Closes angular#4636
1 parent 8a3aba7 commit a1c9a41

File tree

1 file changed

+142
-20
lines changed

1 file changed

+142
-20
lines changed

CONTRIBUTING.md

Lines changed: 142 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,163 @@
1-
## Submitting issues
1+
#Contributing to AngularJS
22

3-
If you have questions about how to use AngularJS, please direct these to the
4-
[Google Group][groups] discussion list or [StackOverflow][stackoverflow]. We are
5-
also available on [IRC][irc].
3+
We'd love for you to contribute to our source code and to make AngularJS even better than it is
4+
today! Here are the guidelines we'd like you to follow:
65

7-
## Guidelines
6+
## Got a Question or Problem?
7+
8+
If you have questions about how to use AngularJS, please direct these to the [Google Group][groups]
9+
discussion list or [StackOverflow][stackoverflow]. We are also available on [IRC][irc].
10+
11+
## Found an Issue?
12+
If you find a bug in the source code or a mistake in the documentation, you can help us by
13+
submitting and issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
14+
with a fix.
15+
16+
***Localization Issue:*** *Angular.js uses the [Google Closure I18N library], to generate its own I18N files. This means that
17+
any changes to these files would be lost the next time that we import the library. The recommended
18+
approach is to submit a patch to the I18N project directly, instead of submitting it here.*
19+
20+
**Please see the Submission Guidelines below**.
21+
22+
## Want a Feature?
23+
You can request a new feature by submitting an issue to our [GitHub Repository][github]. If you
24+
would like to implement a new feature then consider what kind of change it is:
25+
26+
* **Major Changes** that you wish to contribute to the project should be discussed first on our
27+
[mailing list][groups] or [IRC][irc] so that we can better coordinate our efforts, prevent
28+
duplication of work, and help you to craft the change so that it is successfully accepted into the
29+
project.
30+
* **Small Changes** can be crafted and submitted to [GitHub Repository][github] as a Pull Request.
31+
32+
## Submission Guidelines
33+
34+
### Submitting an Issue
35+
Before you submit your issue follow the following guidelines:
836

937
* Search the archive first, it's likely that your question was already answered.
10-
* A live example demonstrating your problem or question, will get an answer faster.
11-
* Create one using this [template][template]
38+
* A live example demonstrating the issue, will get an answer faster.
39+
* Create one using [Plunker][plunker] or [JSFiddle][jsfiddle].
1240
* If you get help, help others. Good karma rulez!
1341

1442
If your issue appears to be a bug, and hasn't been reported, open a new issue.
1543
Help us to maximize the effort we can spend fixing issues and adding new
1644
features, by not reporting duplicate issues.
1745

18-
## Contributing to Source Code
46+
### Submitting a Pull Request
47+
Before you submit your pull request follow the following guidelines:
48+
49+
* Search GitHub for an open or closed Pull Request that relates to your submission. You don't want
50+
to duplicate effort.
51+
* Make your changes in a new git branch
52+
* Follow our Coding Rules
53+
* Follow our Git Commit Guidelines
54+
* Build your changes locally and on Travis (by pushing to GitHub) to ensure all the tests pass.
55+
* Sign the Contributor License Agreement (CLA). We cannot accept code without this.
56+
* If we suggest changes then you can modify your branch, rebase and force a new push to your GitHub
57+
repository to update the Pull Request.
58+
59+
## Coding Rules
60+
To ensure consistency throughout the source code, keep these rules in mind as you are working:
61+
62+
* All features or bug fixes **must be tested** by one or more [specs][unit-testing].
63+
* All public API methods **must be documented** with ngdoc, an extended version of jsdoc (we added
64+
support for markdown and templating via @ngdoc tag). To see how we document our APIs, please check
65+
out the existing ngdocs and see [this wiki page][ngDocs].
66+
* With the exceptions listed below, we follow the rules contained in
67+
[Google's JavaScript Style Guide][js-style-guide]:
68+
* **Do not use namespaces**: Instead, wrap the entire angular code base in an anonymous closure and
69+
export our API explicitly rather than implicitly.
70+
* Wrap all code at **100 characters**.
71+
* Instead of complex inheritance hierarchies, we **prefer simple objects**. We use prototypical
72+
inheritance only when absolutely necessary.
73+
* We **love functions and closures** and, whenever possible, prefer them over objects.
74+
* To write concise code that can be better minified, we **use aliases internally** that map to the
75+
external API. See our existing code to see what we mean.
76+
* We **don't go crazy with type annotations** for private internal APIs unless it's an internal API
77+
that is used throughout AngularJS. The best guidance is to do what makes the most sense.
78+
79+
## Git Commit Guidelines
80+
81+
We have very precise rules over how our git commit messages can be formatted. This leads to **more
82+
readable messages** that are easy to follow when looking through the **project history**. But also,
83+
we use the git commit messages to **generate the AngularJS change log**.
1984

20-
We'd love for you to contribute to our source code and to make AngularJS even
21-
better than it is today!
85+
### Commit Message Format
86+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
87+
format that includes a **type**, a **scope** and a **subject**:
2288

23-
Please read the [contribution guidelines][contribute] to learn about how to submit code
24-
as well as other useful info like how to build and test AngularJS code.
89+
```
90+
<type>(<scope>): <subject>
91+
<BLANK LINE>
92+
<body>
93+
<BLANK LINE>
94+
<footer>
95+
```
2596

26-
### Note to Localization Pull Requests
97+
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
98+
to read on github as well as in various git tools.
2799

28-
Angular.js currently uses the
29-
[Google Closure I18N library], to generate its own I18N files. This means that any
30-
changes to these files would be lost the next time that we import the library. The
31-
recommended approach is to submit a patch to the I18N project directly, instead of
32-
submitting it here.
100+
### Type
101+
Must be one of the following:
33102

103+
* **feat**: A new feature
104+
* **fix**: A bug fix
105+
* **docs**: Documentation only changes
106+
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
107+
semi-colons, etc)
108+
* **refactor**: A code change that neither fixes a bug or adds a feature
109+
* **test**: Adding missing tests
110+
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
111+
generation
112+
113+
### Scope
114+
The scope could be anything specifying place of the commit change. For example `$location`,
115+
`$browser`, `$compile`, `$rootScope`, `ngHref`, `ngClick`, `ngView`, etc...
116+
117+
### Subject
118+
The subject contains succinct description of the change:
119+
120+
* use the imperative, present tense: "change" not "changed" nor "changes"
121+
* don't capitalize first letter
122+
* no dot (.) at the end
123+
124+
###Body
125+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes"
126+
The body should include the motivation for the change and contrast this with previous behavior.
127+
128+
###Footer
129+
The footer should contain any information about **Breaking Changes** and is also the place to
130+
reference GitHub issues that this commit **Closes**.
131+
132+
133+
A detailed explanation can be found in this [document][commit-message-format].
134+
135+
## Signing the CLA
136+
137+
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
138+
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
139+
140+
* For individuals we have a [simple click-through form][individual-cla].
141+
* For corporations we'll need you to
142+
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
143+
144+
## Further Information
145+
You can find out more detailed information about contributing in the
146+
[AngularJS documentation][contributing].
147+
148+
[github]: https://github.com/angular/angular.js
34149
[Google Closure I18N library]: https://code.google.com/p/closure-library/source/browse/closure/goog/i18n/
35150
[list]: https://groups.google.com/forum/?fromgroups#!forum/angular
36151
[contribute]: http://docs.angularjs.org/misc/contribute
37152
[stackoverflow]: http://stackoverflow.com/questions/tagged/angularjs
38153
[groups]: https://groups.google.com/forum/?fromgroups#!forum/angular
39154
[irc]: http://webchat.freenode.net/?channels=angularjs&uio=d4
40-
[template]: http://plnkr.co/edit/gist:3510140
41-
155+
[plunker]: http://plnkr.co/edit
156+
[jsfiddle]: http://jsfiddle.net/
157+
[ngDocs]: https://github.com/angular/angular.js/wiki/Writing-AngularJS-Documentation
158+
[unit-testing]: http://docs.angularjs.org/guide/dev_guide.unit-testing
159+
[js-style-guide]: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
160+
[contributing]: http://docs.angularjs.org/misc/contribute
161+
[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html
162+
[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html
163+
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#

0 commit comments

Comments
 (0)