-
Notifications
You must be signed in to change notification settings - Fork 27.4k
docs(CONTRIBUTING): centralize, update, improve #16297
Conversation
00917d7
to
e5bbe9c
Compare
- remove outdated info - add info about writing docs from Wiki - add info about development setup from docs contribute.md - add info about running tests on Saucelabs / Browserstack TODO: - add link to contributing.md to Contribung page - add link to changelog.md to dropdown in docs -- link to current version changelog entry? Closes angular#7303 Closes angular#9444
e5bbe9c
to
fee98e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 00 - Love the overhaul.
But I do think that all the docs related bits make CONTRIBUTING.md
quite overwhelming and intimidating. I would still keep it as a separate doc and link to it from CONTRIBUTING.md
. WDYT?
docs/content/misc/contribute.ngdoc
Outdated
|
||
For everything related to contributing, we have a document in our Git Repository that covers everything from submitting issues, setting up and building the code, to writing documentation, and much more: [Contributing](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, let me say this:
Super long lines in markdown files are evil, hard to review and hard to work with without special settings in your local editor. So why on earth would you write such lines in the first place when you can easily split them at 100 characters and get a nice readable, reviewable block of text? I hope this very long line forced you to scroll horizontally and helped you realize how unnecessarily unpleasant long lines can be. If you made it this far, thank you for allowing me to waste a small part of your time and for taking this comment into consideration.
(Yes, long lines can be fun, but only if you are me 😁)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have to scroll because I read it via email. 😛
But I will cut the lines. I did write this in an editor with word wrap ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arghhh... Well, it was worth a try 😛
CONTRIBUTING.md
Outdated
|
||
|
||
[Google Closure I18N library]: https://github.com/google/closure-library/tree/master/closure/goog/i18n | ||
[angular-dev]: https://groups.google.com/forum/?fromgroups#!forum/angular-dev | ||
[browserstack]: https://www.browserstack.com/ | ||
[closing-issues]: https://help.github.com/articles/closing-issues-via-commit-messages/ | ||
[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md | ||
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# | ||
[contribute]: http://docs.angularjs.org/misc/contribute | ||
[contributing]: http://docs.angularjs.org/misc/contribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can go now 😃
CONTRIBUTING.md
Outdated
|
||
## <a name="coc"></a> Code of Conduct | ||
|
||
Help us keep AngularJS open and inclusive. Please read and follow our [Code of Conduct][coc]. | ||
|
||
## <a name="requests"></a> Questions, Bugs, Features | ||
|
||
## <a name="question"></a> Got a Question or Problem? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and following sections should be ###
.
CONTRIBUTING.md
Outdated
If you have questions about how to use AngularJS, please direct these to the [Google Group][groups] | ||
discussion list or [StackOverflow][stackoverflow]. We are also available on [IRC][irc] and | ||
[Gitter][gitter]. | ||
Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on dedicated support platforms, the best being [Stack Overflow][stackoverflow]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[stackoverflow]:
--> [stackoverflow].
CONTRIBUTING.md
Outdated
* **Major Changes** that you wish to contribute to the project should be discussed first in an | ||
[GitHub issue][github-issues] that clearly outlines the changes and benefits of the feature. | ||
* **Small Changes** can directly be crafted and submitted to the [GitHub Repository][github] | ||
as a Pull Request. See the main section about [Documentation & Code Contributions](#code-contrib) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code-contrib --> contributions
CONTRIBUTING.md
Outdated
``` | ||
|
||
* In GitHub, send a pull request to `angular.js:master`. This will trigger the check of the | ||
(Contributor License Agreement)(#cla) and the Travis integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Contributor License Agreement)
--> [Contributor License Agreement]
CONTRIBUTING.md
Outdated
### Writing runnable (live) examples and e2e tests | ||
It is possible to embed examples in the documentation along with appropriate e2e tests. These | ||
examples and scenarios will be converted to runnable code within the documentation. So it is important | ||
that they work correctly. To ensure this, all these e2e scenarios are run as part the automated Travis tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as part the automated --> as part of the/our automated
CONTRIBUTING.md
Outdated
that they work correctly. To ensure this, all these e2e scenarios are run as part the automated Travis tests. | ||
|
||
If you are adding an example with an e2e test, you should [run the test locally](#e2e-tests). You can | ||
use `fit` to run only your test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expand a little bit on that, e.g.:
...you should run the test locally first to ensure it passes.
You can changeit(...)
tofit(...)
to run only your test, but make sure you change it back toit(...)
before committing.
CONTRIBUTING.md
Outdated
This tag identifies a block of HTML that will define a runnable example. It can take the following attributes: | ||
|
||
* `module` - specify an AngularJS module containing code that must be loaded to support this example. | ||
* `animation` - if set to `true` then this example uses ngAnimations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ngAnimations --> `ngAnimate`
CONTRIBUTING.md
Outdated
|
||
* `module` - specify an AngularJS module containing code that must be loaded to support this example. | ||
* `animation` - if set to `true` then this example uses ngAnimations. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the name
and deps
attributes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough review, @gkalpak !
I'll have to look into automatically checking the links. So many are wrong.
I don't know if separating "Writing docs" makes a lot of sense, as it's an important part of writing a PR. We could move it at the end of Code & Doc Contrib.
I've also seen some repos that have a special DEVELOPERS.md, which contains everything from project setup to coding rules.
CONTRIBUTING.md
Outdated
|
||
#### Throwing errors | ||
|
||
User-facing errors should be thrown with [`minErr`][minErr], a special error function that provides errors ids, templated error messages, and adds a link to a detailed error description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have many bollean provider config functions that don't end in enabled
:D
CONTRIBUTING.md
Outdated
* `@requires` - normally indicates that a JavaScript module is required; in an Angular service it is used to describe what other services this service relies on | ||
* `@property` - describes a property of an object | ||
* `@description` - used to provide a description of a component in markdown | ||
* `@link` - specifies a link to a URL or a type in the API reference. **NOTE**: to link to `ng.$rootScope.Scope#$on` insert `methods_` between `#` and the actual method name: `{@link ng.$rootScope.Scope#methods_$on listen}`. Same goes for properties and events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually didn't know about it either, this is copy and paste from the Wiki
docs/content/misc/contribute.ngdoc
Outdated
|
||
For everything related to contributing, we have a document in our Git Repository that covers everything from submitting issues, setting up and building the code, to writing documentation, and much more: [Contributing](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have to scroll because I read it via email. 😛
But I will cut the lines. I did write this in an editor with word wrap ...
07d9abb
to
a81da61
Compare
Here is my reasoning: Since I don't necessarily suggest moving everything that could be irrelevant to first-time contributors to other files, but the docs authoring section seemed/felt substantial in size and quite dense. Maybe moving dev related things to I don't feel too strongly about it, so happy to go either way. |
CONTRIBUTING.md
Outdated
globally with: | ||
|
||
```shell | ||
yarn global add grunt-cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be a better idea to avoid global installation of grunt by default ?
People unfamiliar with yarn/npm will follow the guideline and install it globally. I think people should not install this globally unless they know why.
Sorry, I'm a bit sensitive on the global npm package installations 🙈 It's an "anti-pattern" used in to many projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in #16276, this is something we can do: document yarn ...
as the default and list global installing of grunt as an alternative. But I think this can be part of a follow-up PR, as there may be more files that are affected by this.
I agree with @gkalpak that we should move some of the more technical stuff to |
Ok. I think putting these 3 into the DEVELOPERS.md is a good separation, with links from CONTRIBUTING.md where it's appropriate:
|
a006250
to
8f7ef70
Compare
I've created the new DEVELOPERS.md, which contains the following sections:
I've added the commit message guidelines, because ...
|
082b8d8
to
d3d257d
Compare
|
||
```shell | ||
yarn global add grunt-cli | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we not decide to avoid installing grunt globally?
Instead people can just use yarn grunt ...
to run grunt tasks.
|
||
```shell | ||
sudo yarn global add grunt-cli | ||
sudo yarn global add bower |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have ditched bower
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need it for a few things. @mgol will switch us to yarn aliases some time in the future.
`grunt` and `bower`: | ||
|
||
```shell | ||
sudo yarn global add grunt-cli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use local grunt then this whole note can be removed.
DEVELOPERS.md
Outdated
|
||
* `docs/` — A directory that contains a standalone version of the docs | ||
(same as served in `docs.angularjs.org`). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we ought to mention it also contains all the other core module files too? (e.g. angular-mocks.js, angular-route.js etc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use local grunt and drop the global installs of grunt and bower.
Otherwise LGTM
I think we can add the local grunt changes in a follow-up commit (and also note that you can still install globally grunt if you want ... that saves keystrokes!) |
We should avoid global packages but since the relevant doc was just ported from an existing one, I'm fine doing that in a followup PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check the links in CONTRIBUTING.md
and DEVELOPERS.md
and ensure they are valid before merging?
CONTRIBUTING.md
Outdated
[commit message conventions](#commit) and passes our commit message presubmit hook | ||
(`validate-commit-msg.js`). Adherence to the [commit message conventions](#commit) is required, | ||
because release notes are automatically generated from these messages. | ||
[commit message conventions][developers.commits]. Adherence to the [commit message conventions](#commit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#commit
is no longer a valid link.
CONTRIBUTING.md
Outdated
@@ -129,27 +146,33 @@ Before you submit your pull request consider the following guidelines: | |||
* Push your branch to GitHub: | |||
|
|||
```shell | |||
git push origin my-fix-branch | |||
git push <remote> my-fix-branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not origin
. I'm afraid <remote>
will confuse git beginners (and the instructions do not matter for experiences users, because they already know their way around).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, origin is better. I was thinking of my setup where angular/angular.js is the origin, and my fork just a remote.
Technically, since git now uses "simple" as the default push strategy, should git push be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for branches created in the way we show here, you need to have set the upstream once before you can just git push
. I.e. you need to have run git push --set-upstream origin my-fix-branch
the first time.
4da38bc
to
01c31b3
Compare
01c31b3
to
a027fa5
Compare
CONTRIBUTING.md - focus on basic info about issues and pull requests for new contributors - move development heavy info to DEVELOPERS.md + add links - remove outdated info DEVELOPERS.md - contains info about project setup, coding rules, and commit message guidelines from CONTRIBUTING.md - add and update info about writing docs from Wiki - add info about development setup from docs contribute.md - add info about running tests on Saucelabs / Browserstack Closes #7303 Closes #9444 Closes #16297
Closes #7303
Closes #9444
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change?
Please check if the PR fulfills these requirements
Other information: