# Contributing to Astro

Communication happens in the [`Team Astro`](https://mobify.hipchat.com/chat/room/1087226) Hipchat room. 

All work is managed in [Jira](https://mobify.atlassian.net/secure/RapidBoard.jspa?rapidView=90&projectKey=HYB)

When contributing a PR in Astro, please branch off of `develop` and open up a pull request.
Please make sure to use the [Astro Pull Request template](./PULL-REQUEST-TEMPLATE.md)
when opening up a pull request.

## Coding Guidelines

The following section sets out some guidelines for code being submitted to the 
Astro project.  These are not hard-and-fast rules but rather guidelines that 
help to make for a consistent and easy-to-learn codebase.

### JavaScript

[Mobify JavaScript Code Style Guidelines](https://github.com/mobify/mobify-code-style/tree/master/javascript)

JS can be manually run through our code style linter (eslint) with the command `grunt lint`. Please note that JS will be linted automatically during each build.

### Android (Java)

[Mobify Java Code Style Guidelines](https://github.com/mobify/mobify-code-style/tree/master/java)

### iOS (Swift)

[Mobify Swift Code Style Guidelines](https://github.com/mobify/mobify-code-style/tree/master/swift)

## Plugins

### Guidelines

In general, for RPC methods that operate on boolean states such as showing and
hiding a plugin's view, prefer separate methods over a single method that takes
a boolean argument.

e.g. Prefer `show()` and `hide()` over `setVisible(boolean visible)`.

### Platform-specific considerations

#### iOS

All RPC methods on plugins should be pseudo-annotated with a leading comment 
following this format:

    // @RpcMethod
    func navigate(url: String, respond: RpcMethodCallback) { ... }

Currently all RPC methods need to be manually registered using the addRpcShim() 
method, but in the future when this process is automated, it will be much 
easier to automate if we have some formalized marker in the source that calls 
out each RPC method.

#### Android

#### Documentation

Currently, our documentation is in a state of flux - the most up-to-date
documentation can be found in `/docs`, but it is not in sync with astro.mobify.com.
Eventually it will, but for now, just ensure that any feature/change you're making
that requires a documentation update is updated in the markdown files within
`/docs`. See the README for instructions on how to preview your docs changes.