Skip to content

Commit 22a420b

Browse files
authored
Create CONTRIBUTING.md
1 parent 7a77080 commit 22a420b

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

CONTRIBUTING.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Contributing
2+
3+
## Please Be Friendly
4+
5+
We strongly encourage everyone participating in gwt-material development to show courtesy and respect to others. Of course, being courteous should not prevent us from constructively disagreeing with each other. But if you are enumerating 42 technical reasons against a particular proposal, please don't make the criticism worse by ridiculing the person who proposed it. State your technical disagreement freely, but respect the person you disagree with. That person may be a great learner who soon will be making the best proposals of us all.
6+
7+
Respectful also doesn't mean "serious". Web application development may be hard work, but it's also a lot of fun! Being lighthearted and playful is welcome. Let's enjoy being one of the friendliest communities in the whole open source movement.
8+
9+
## Code Style
10+
11+
To keep the source consistent, readable, diffable and easy to merge, all patches will be expected to conform to the style outlined here. To keep things as simple as possible. If you're using Eclipse, we strongly recommend that you install and enable the [http://eclipse-cs.sourceforge.net/ Eclipse Checkstyle plugin] that is used by the provided eclipse configuration.
12+
13+
In general, the gwt-material style is based on the [http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html standard Java conventions].
14+
15+
For the record, we know that coding style is often a controversial topic. We acknowledge that plenty of great approaches exist out there. We're simply trying to pick one that is at least somewhat consistent with Sun's Java coding conventions, to codify it well, and stick to it.
16+
17+
## Indentation
18+
19+
We use 4-space indents for blocks. No tabs at all, anywhere.
20+
21+
We use 4-space indents after line wraps, including function calls and assignments. For example, this is correct (4 spaces after the newline):
22+
```
23+
LineWrapExample i =
24+
new LineWrapExample();
25+
```
26+
27+
and this is not correct (2 spaces after the newline):
28+
```
29+
LineWrapExample ex =
30+
new LineWrapExample();
31+
```
32+
33+
## Comments and Javadoc
34+
35+
Every file should have an Apache license header at the top underneath the package. A package statement and import statements should follow, each block separated by a blank line. Next is the class or interface declaration. In the Javadoc comments, describe what the class or interface does.
36+
37+
```java
38+
/*
39+
* #%L
40+
* GwtMaterial
41+
* %%
42+
* Copyright (C) 2015 GwtMaterialDesign
43+
* %%
44+
* Licensed under the Apache License, Version 2.0 (the "License");
45+
* you may not use this file except in compliance with the License.
46+
* You may obtain a copy of the License at
47+
*
48+
* http://www.apache.org/licenses/LICENSE-2.0
49+
*
50+
* Unless required by applicable law or agreed to in writing, software
51+
* distributed under the License is distributed on an "AS IS" BASIS,
52+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53+
* See the License for the specific language governing permissions and
54+
* limitations under the License.
55+
* #L%
56+
*/
57+
package ...
58+
59+
import ...
60+
```
61+
62+
## Naming Conventions
63+
64+
Some examples of class naming:
65+
```
66+
Good Bad
67+
XmlHttpRequest XMLHTTPRequest
68+
getCustomerId getCustomerID
69+
```
70+
This style rule also applies when an acronym or abbreviation is the entire name:
71+
72+
```
73+
Good Bad
74+
class Html class HTML
75+
String url; String URL;
76+
long id; long ID;
77+
```
78+
79+
TODO - complete this
80+
81+
## Updating your Fork
82+
First make sure you have an upstream remote:
83+
```
84+
git remote add https://github.com/GwtMaterialDesign/gwt-material.git upstream
85+
```
86+
87+
Next, fetch from the upstream remote:
88+
```
89+
git fetch upstream
90+
```
91+
92+
Then when changes are made to the official repository, make this call:
93+
```
94+
git pull --rebase upstream master # Note that this pulls from master branch (can be changed)
95+
```

0 commit comments

Comments
 (0)