update CONTRIBUTING.md

This commit is contained in:
Sebastian McKenzie 2015-07-15 13:51:24 +01:00
parent 4656801673
commit a36496ee2d

View File

@ -1,4 +1,4 @@
# NOTE: BEFORE OPENING AN ISSUE PLEASE SEE THE [README](https://github.com/babel/babel#readme). # NOTE: BEFORE OPENING AN ISSUE READ SEE THE [README](https://github.com/babel/babel#readme).
---- ----
@ -28,32 +28,53 @@ contributing, please read the
#### Setup #### Setup
#### Code Standards ```sh
$ git clone https://github.com/babel/babel
$ cd babel
$ make bootstrap
```
* **General** Then you can either run:
* Max of five arguments for functions
* Max depth of four nested blocks
* 2-spaced soft tabs
* **Naming** ```sh
* CamelCase all class names $ make build
* camelBack all variable names ```
* **Spacing** to build Babel **once** or:
* Spaces after all keywords
* Spaces before all left curly braces
* **Comments** ```sh
* Use JSDoc-style comments for methods $ make watch
* Single-line comments for ambiguous code ```
* **Quotes** to have Babel build itself then incrementally build files on change.
* Always use double quotes
* Only use single quotes when the string contains a double quote
* **Declaration** If you wish to build a copy of Babel for distribution then run:
* No unused variables
* No pollution of global variables and prototypes ```sh
$ make build-dist
```
and access the files from `packages/babel/dist`.
#### Running tests
You can run tests for all packages via:
```sh
$ make test
```
This is mostly overkill and you can limit the package to a select by using the `TEST_ONLY` environment variable:
```sh
$ TEST_ONLY=babel-cli make test
```
Use the `TEST_GREP` variable to run a subset of tests by name:
```sh
$ TEST_GREP=transformation make test
```
#### Internals #### Internals