summaryrefslogtreecommitdiffstats
path: root/doc/developer
diff options
context:
space:
mode:
Diffstat (limited to 'doc/developer')
-rw-r--r--doc/developer/code-contribution.md46
-rw-r--r--doc/developer/style-guide.md19
2 files changed, 57 insertions, 8 deletions
diff --git a/doc/developer/code-contribution.md b/doc/developer/code-contribution.md
new file mode 100644
index 000000000..c796a82a5
--- /dev/null
+++ b/doc/developer/code-contribution.md
@@ -0,0 +1,46 @@
+# Code Contribution Guidelines
+
+Thank you for your interest in contributing to Mattermost. This guide provides an overview of important information for contributors to know.
+
+## Choose a Ticket
+
+1. Review the list of [Good First Contribution](https://mattermost.atlassian.net/issues/?filter=10206) tickets listed in Jira.
+
+2. These projects are intended to be a straight forward first pull requests from new contributors.
+If you don't find something appropriate for your interests, please see the full list of tickets [Accepting Pull Requests](https://mattermost.atlassian.net/issues/?filter=10101).
+
+3. If you have any questions at all about a ticket, please post to the [Contributor Discussion section](http://forum.mattermost.org/) of the Mattermost forum, or email the [Mattermost Developer Mailing list](https://groups.google.com/a/mattermost.com/forum/#!forum/developer/join).
+
+## Install Mattermost and set up a Fork
+
+1. Follow [developer setup instructions](https://github.com/mattermost/platform/blob/master/doc/install/dev-setup.md) to install Mattermost.
+
+2. Create a branch with <branch name> set to the ID of the ticket you're working on, for example ```PLT-394```, using command:
+
+```
+git checkout -b <branch name>
+```
+
+## Programming and Testing
+
+1. Please review the [Mattermost Style Guide](style-guide.md) prior to making changes.
+
+ To keep code clean and well structured, Mattermost uses ESLint to check that pull requests adhere to style guidelines for React. Code will need to follow Mattermost's React style guidelines in order to pass the automated build tests when a pull request is submitted.
+
+2. Please make sure to thoroughly test your change before submitting a pull request.
+
+## Submitting a Pull Request
+
+1. Please add yourself to the contributor list prior to submitting by completing the [contributor license agreement](http://www.mattermost.org/mattermost-contributor-agreement/).
+
+2. When you submit your pull request please include the Ticket ID at the beginning of your pull request comment, followed by a colon.
+
+ For example, for a ticket ID `PLT-394` start your comment with: `PLT-394:`. See [previously closed pull requests](https://github.com/mattermost/platform/pulls?q=is%3Apr+is%3Aclosed) for examples.
+
+3. Once submitted, your pull request will be checked via an automated build process and will be reviewed by the Mattermost core team, who may either accept the PR or follow-up with feedback.
+
+4. If you've included your mailing address in Step 1, you'll be receiving a [Limited Edition Mattermost Mug](http://forum.mattermost.org/t/limited-edition-mattermost-mugs/143) as a thank you gift after your first pull request has been accepted.
+
+
+
+
diff --git a/doc/developer/style-guide.md b/doc/developer/style-guide.md
index 470788cf5..a06f9e29b 100644
--- a/doc/developer/style-guide.md
+++ b/doc/developer/style-guide.md
@@ -14,11 +14,13 @@ In addition all code must be run though the official go formatter tool [gofmt](h
## Javascript
-Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors or warnings running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](https://github.com/mattermost/platform/blob/master/web/react/.eslintrc.json)
+Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](/web/react/.eslintrc)
Instructions on how to use ESLint with your favourite editor can be found here: [http://eslint.org/docs/user-guide/integrations](http://eslint.org/docs/user-guide/integrations)
-The following is an abridged version of the [Airbnb Javascript Style Guide](https://github.com/airbnb/javascript/blob/master/README.md#airbnb-javascript-style-guide-), with modifications. Anything that is unclear here follow that guide. If there is a conflict, follow what is said below.
+You can run eslint using the makefile by using `make check`
+
+The following is a subset of what ESLint checks for. ESLint is always the authority.
### Whitespace
@@ -53,10 +55,10 @@ function myFunction ( parm1, parm2 ){
```javascript
// Correct
-var x = 1;
+let x = 1;
// Incorrect
-var x = 1
+let x = 1
```
### Variables
@@ -110,7 +112,7 @@ if (something)
### Strings
-- Use template strings instead of concatenation.
+- Use of template strings is preferred instead of concatenation.
```javascript
// Correct
@@ -126,17 +128,18 @@ function wrongGetStr(stuff) {
## React-JSX
-Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors or warnings running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](https://github.com/mattermost/platform/blob/master/web/react/.eslintrc.json)
+Part of the build process is running ESLint. ESLint is the final authority on all style issues. PRs will not be accepted unless there are no errors running ESLint. The ESLint configuration file can be found in: [web/react/.eslintrc](/web/react/.eslintrc)
Instructions on how to use ESLint with your favourite editor can be found here: [http://eslint.org/docs/user-guide/integrations](http://eslint.org/docs/user-guide/integrations)
-This is an abridged version of the [Airbnb React/JSX Style Guide](https://github.com/airbnb/javascript/tree/master/react#airbnb-reactjsx-style-guide). Anything that is unclear here follow that guide. If there is a conflict, follow what is said below.
+You can run eslint using the makefile by using `make check`
+
+The following is a subset of what ESLint checks for. ESLint is always the authority.
### General
- Include only one React component per file.
- Use class \<name\> extends React.Component over React.createClass unless you need mixins
-- CapitalCamelCase with .jsx extension for component filenames.
- Filenames should be the component name.
### Alignment