Skip to content

Commit 5c175b0

Browse files
authored
docs: add StackBlitz to provide live example (#32034)
1 parent 6d2560b commit 5c175b0

File tree

1 file changed

+106
-92
lines changed

1 file changed

+106
-92
lines changed

CONTRIBUTING.md

Lines changed: 106 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
We would love for you to contribute to Angular Material and help make it ever better!
44
As a contributor, here are the guidelines we would like you to follow:
55

6-
- [Code of Conduct](#coc)
7-
- [Question or Problem?](#question)
8-
- [Issues and Bugs](#issue)
9-
- [Feature Requests](#feature)
10-
- [Submission Guidelines](#submit-pr)
11-
- [Coding Rules](#rules)
12-
- [Commit Message Guidelines](#commit)
13-
- [Signing the CLA](#cla)
6+
- [Code of Conduct](#coc)
7+
- [Question or Problem?](#question)
8+
- [Issues and Bugs](#issue)
9+
- [Feature Requests](#feature)
10+
- [Submission Guidelines](#submit-pr)
11+
- [Coding Rules](#rules)
12+
- [Commit Message Guidelines](#commit)
13+
- [Signing the CLA](#cla)
1414

1515
## <a name="coc"></a> Code of Conduct
16+
1617
Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc].
1718

1819
## <a name="question"></a> Got a Question or Problem?
@@ -30,92 +31,96 @@ To save your and our time, we will be systematically closing all the issues that
3031
If you would like to chat about the question in real-time, you can reach out via [our gitter channel][gitter].
3132

3233
## <a name="issue"></a> Found an Issue?
34+
3335
If you find a bug in the source code or a mistake in the documentation, you can help us by
34-
[submitting an issue](#submit-issue) to our [GitHub Repository][github].
36+
[submitting an issue](#submit-issue) to our [GitHub Repository][github].
3537

3638
For bugs, include an issue reproduction (via your preferred REPL: StackBlitz, CodePen, JsBin,
3739
Plunkr, etc.) Our team has limited resources, and this allows us quickly diagnose issues and make
3840
optimal use of the time we dedicate to fixing them. Issues that do not include a REPL reproduction
3941
will be closed. If a REPL reproduction is not possible for your issue, please explain why and
40-
include any other information that may be helpful in debugger (link to a repo, error messages,
42+
include any other information that may be helpful in debugger (link to a repo, error messages,
4143
screenshots, etc.)
4244

4345
You can help the team even more and [submit a Pull Request](#submit-pr) with a fix.
4446

4547
## <a name="feature"></a> Want a Feature?
46-
You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub
47-
Repository][github]. If you would like to *implement* a new feature, please submit an issue with
48+
49+
You can _request_ a new feature by [submitting an issue](#submit-issue) to our [GitHub
50+
Repository][github]. If you would like to _implement_ a new feature, please submit an issue with
4851
a proposal for your work first, to be sure that we can use it.
4952
Please consider what kind of change it is:
5053

51-
* For a **Major Feature**, first open an issue and outline your proposal so that it can be
52-
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
53-
and help you to craft the change so that it is successfully accepted into the project.
54-
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
54+
- For a **Major Feature**, first open an issue and outline your proposal so that it can be
55+
discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,
56+
and help you to craft the change so that it is successfully accepted into the project.
57+
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
5558

5659
### <a name="submit-issue"></a> Submitting an Issue
60+
5761
Before you submit an issue, search the archive, maybe your question was already answered.
5862

5963
If your issue appears to be a bug, and hasn't been reported, open a new issue.
6064
Help us to maximize the effort we can spend fixing issues and adding new
61-
features by not reporting duplicate issues. Providing the following information will increase the
65+
features by not reporting duplicate issues. Providing the following information will increase the
6266
chances of your issue being dealt with quickly:
6367

64-
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
65-
* **Angular and Material Versions** - which versions of Angular and Material are affected
66-
(e.g. 2.0.0-alpha.53)
67-
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior
68-
is a bug for you
69-
* **Browsers and Operating System** - is this a problem with all browsers?
70-
* **Reproduce the Error** - provide a live example (using [CodePen][codepen], [JsBin][jsbin],
71-
[Plunker][plunker], etc.) or an unambiguous set of steps
72-
* **Screenshots** - Due to the visual nature of Angular Material, screenshots can help the team
73-
triage issues far more quickly than a text description.
74-
* **Related Issues** - has a similar issue been reported before?
75-
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
76-
causing the problem (line of code or commit)
68+
- **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
69+
- **Angular and Material Versions** - which versions of Angular and Material are affected
70+
(e.g. 2.0.0-alpha.53)
71+
- **Motivation for or Use Case** - explain what are you trying to do and why the current behavior
72+
is a bug for you
73+
- **Browsers and Operating System** - is this a problem with all browsers?
74+
- **Reproduce the Error** - provide a live example (using [CodePen][codepen], [JsBin][jsbin],
75+
[Plunker][plunker], [StackBlitz][stackBlitz], etc.) or an unambiguous set of steps
76+
- **Screenshots** - Due to the visual nature of Angular Material, screenshots can help the team
77+
triage issues far more quickly than a text description.
78+
- **Related Issues** - has a similar issue been reported before?
79+
- **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
80+
causing the problem (line of code or commit)
7781

7882
You can file new issues by providing the above information [here](https://github.com/angular/components/issues/new).
7983

80-
8184
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
85+
8286
Before you submit your Pull Request (PR) consider the following guidelines:
8387

84-
* Search [GitHub](https://github.com/angular/components/pulls) for an open or closed PR
88+
- Search [GitHub](https://github.com/angular/components/pulls) for an open or closed PR
8589
that relates to your submission. You don't want to duplicate effort.
86-
* Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
90+
- Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.
8791
We cannot accept code without this.
88-
* Make your changes in a new git branch:
92+
- Make your changes in a new git branch:
8993

90-
```shell
91-
git checkout -b my-fix-branch main
92-
```
94+
```shell
95+
git checkout -b my-fix-branch main
96+
```
9397

94-
* Create your patch, **including appropriate test cases**.
95-
* Follow our [Coding Rules](#rules).
96-
* Test your changes with our supported browsers and screen readers.
97-
* Run the full Angular Material test suite, as described in the [developer documentation][dev-doc],
98+
- Create your patch, **including appropriate test cases**.
99+
- Follow our [Coding Rules](#rules).
100+
- Test your changes with our supported browsers and screen readers.
101+
- Run the full Angular Material test suite, as described in the [developer documentation][dev-doc],
98102
and ensure that all tests pass.
99-
* Commit your changes using a descriptive commit message that follows our
103+
- Commit your changes using a descriptive commit message that follows our
100104
[commit message conventions](#commit). Adherence to these conventions
101105
is necessary because release notes are automatically generated from these messages.
102106

103-
```shell
104-
git commit -a
105-
```
107+
```shell
108+
git commit -a
109+
```
110+
106111
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
107112

108-
* Push your branch to GitHub:
113+
- Push your branch to GitHub:
109114

110-
```shell
111-
git push my-fork my-fix-branch
112-
```
115+
```shell
116+
git push my-fork my-fix-branch
117+
```
113118

114-
* In GitHub, send a pull request to `components:main`.
115-
* If we suggest changes then:
116-
* Make the required updates.
117-
* Re-run the Angular Material test suites to ensure tests are still passing.
118-
* Rebase your branch and force push to your GitHub repository (this will update your Pull
119+
- In GitHub, send a pull request to `components:main`.
120+
- If we suggest changes then:
121+
- Make the required updates.
122+
- Re-run the Angular Material test suites to ensure tests are still passing.
123+
- Rebase your branch and force push to your GitHub repository (this will update your Pull
119124
Request):
120125

121126
```shell
@@ -130,47 +135,49 @@ That's it! Thank you for your contribution!
130135
After your pull request is merged, you can safely delete your branch and pull the changes
131136
from the main (upstream) repository:
132137
133-
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as
134-
follows:
138+
- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as
139+
follows:
135140
136-
```shell
137-
git push my-fork --delete my-fix-branch
138-
```
141+
```shell
142+
git push my-fork --delete my-fix-branch
143+
```
139144
140-
* Check out the main branch:
145+
- Check out the main branch:
141146
142-
```shell
143-
git checkout main -f
144-
```
147+
```shell
148+
git checkout main -f
149+
```
145150
146-
* Delete the local branch:
151+
- Delete the local branch:
147152
148-
```shell
149-
git branch -D my-fix-branch
150-
```
153+
```shell
154+
git branch -D my-fix-branch
155+
```
151156
152-
* Update your local `main` with the latest upstream version:
157+
- Update your local `main` with the latest upstream version:
153158
154-
```shell
155-
git pull --ff upstream main
156-
```
159+
```shell
160+
git pull --ff upstream main
161+
```
157162
158163
## <a name="rules"></a> Coding Rules
164+
159165
To ensure consistency throughout the source code, keep these rules in mind as you are working:
160166
161-
* All features or bug fixes **must be tested** by one or more specs (unit-tests).
162-
* All public API methods **must be documented**. (Details TBD).
163-
* We follow [Google's TypeScript Style Guide][ts-style-guide], but wrap all code at
167+
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
168+
- All public API methods **must be documented**. (Details TBD).
169+
- We follow [Google's TypeScript Style Guide][ts-style-guide], but wrap all code at
164170
**100 characters**.
165171

166172
## <a name="commit"></a> Commit Message Guidelines
167173

168-
We have very precise rules over how our git commit messages can be formatted. This leads to **more
169-
readable messages** that are easy to follow when looking through the **project history**. But also,
174+
We have very precise rules over how our git commit messages can be formatted. This leads to **more
175+
readable messages** that are easy to follow when looking through the **project history**. But also,
170176
we use the git commit messages to **generate the Angular Material change log**.
171177

172178
### Commit Message Format
173-
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
179+
180+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
174181
format that includes a **type**, a **package**, a **scope** and a **subject**:
175182

176183
```
@@ -203,44 +210,51 @@ Fixes #1234
203210
```
204211
205212
### Revert
213+
206214
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of
207215
the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is
208216
the SHA of the commit being reverted.
209217
210218
### Type
219+
211220
Must be one of the following:
212221
213-
* **feat**: Creates a new feature
214-
* **fix**: Fixes a previously discovered failure/bug
215-
* **docs**: Changes which exclusively affects documentation
216-
* **refactor**: Refactor without any change in functionality or API (includes style changes)
217-
* **perf**: Improves performance without any change in functionality or API
218-
* **test**: Improvements or corrections made to the project's test suite
219-
* **build**: Changes to local repository build system and tooling
220-
* **ci**: Changes to CI configuration and CI specific tooling
221-
* **release**: A release point in the repository
222+
- **feat**: Creates a new feature
223+
- **fix**: Fixes a previously discovered failure/bug
224+
- **docs**: Changes which exclusively affects documentation
225+
- **refactor**: Refactor without any change in functionality or API (includes style changes)
226+
- **perf**: Improves performance without any change in functionality or API
227+
- **test**: Improvements or corrections made to the project's test suite
228+
- **build**: Changes to local repository build system and tooling
229+
- **ci**: Changes to CI configuration and CI specific tooling
230+
- **release**: A release point in the repository
222231
223232
### Package
233+
224234
The commit message should specify which package is affected by the change. For example:
225235
`material`, `cdk-experimental`, etc.
226236
227237
### Scope
238+
228239
The scope specifies place of the commit change. For example
229240
`material/datepicker`, `cdk/dialog`, etc.
230241
See full list [here][commit-message-scopes].
231242
232243
### Subject
244+
233245
The subject contains succinct description of the change:
234246
235-
* use the imperative, present tense: "change" not "changed" nor "changes"
236-
* don't capitalize first letter
237-
* no dot (.) at the end
247+
- use the imperative, present tense: "change" not "changed" nor "changes"
248+
- don't capitalize first letter
249+
- no dot (.) at the end
238250
239251
### Body
252+
240253
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
241254
The body should include the motivation for the change and contrast this with previous behavior.
242255
243256
### Footer
257+
244258
The footer should contain any information about **Breaking Changes** or **Deprecations** and
245259
is also the place to reference GitHub issues that this commit **Closes**.
246260
@@ -257,11 +271,10 @@ A detailed explanation can be found in this [document][commit-message-format].
257271
Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code
258272
changes to be accepted, the CLA must be signed. It's a quick process, we promise!
259273
260-
* For individuals, we have a [simple click-through form][individual-cla].
261-
* For corporations, we'll need you to
274+
- For individuals, we have a [simple click-through form][individual-cla].
275+
- For corporations, we'll need you to
262276
[print, sign and one of scan+email, fax or mail the form][corporate-cla].
263277
264-
265278
[material-group]: https://groups.google.com/forum/#!forum/angular-material2
266279
[coc]: https://github.com/angular/code-of-conduct/blob/main/CODE_OF_CONDUCT.md
267280
[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/preview
@@ -278,3 +291,4 @@ changes to be accepted, the CLA must be signed. It's a quick process, we promise
278291
[plunker]: https://plnkr.co/edit
279292
[runnable]: https://runnable.com/
280293
[stackoverflow]: https://stackoverflow.com/
294+
[stackBlitz]: https://stackblitz.com/

0 commit comments

Comments
 (0)