Skip to content

Commit

Permalink
Sync with template content
Browse files Browse the repository at this point in the history
  • Loading branch information
fabaff committed Feb 27, 2016
1 parent 2ec141b commit f8f0ed8
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The process is straight-forward.

- Fork the Home Assistant [git repository](https://github.com/balloob/home-assistant).
- Write the code for your device, notification service, sensor, or IoT thing.
- Ensure tests work
- Ensure tests work.
- Create a Pull Request against the [**dev**](https://github.com/balloob/home-assistant/tree/dev) branch of Home Assistant.

Still interested? Then you should read the next sections and get more details.
Expand All @@ -17,12 +17,13 @@ For help on building your component, please see the [developer documentation](ht

After you finish adding support for your device:

- Check that all dependencies are included via the `REQUIREMENTS` variable in your platform/component and only imported inside functions that use them.
- Add any new dependencies to `requirements_all.txt` if needed. Use `script/gen_requirements_all.py`.
- Update the `.coveragerc` file to exclude your platform if there are no tests available.
- Update the `.coveragerc` file to exclude your platform if there are no tests available or your new code uses a 3rd party library for communication with the device/service/sensor.
- Provide some documentation for [home-assistant.io](https://home-assistant.io/). It's OK to just add a docstring with configuration details (sample entry for `configuration.yaml` file and alike) to the file header as a start. Visit the [website documentation](https://home-assistant.io/developers/website/) for further information on contributing to [home-assistant.io](https://github.com/balloob/home-assistant.io).
- Make sure all your code passes ``pylint`` and ``flake8`` (PEP8 and some more) validation. To check your repository, run `./script/lint`.
- Make sure all your code passes ``pylint`` and ``flake8`` (PEP8 and some more) validation. To check your repository, run `tox` or `script/lint`.
- Create a Pull Request against the [**dev**](https://github.com/balloob/home-assistant/tree/dev) branch of Home Assistant.
- Check for comments and suggestions on your Pull Request and keep an eye on the [Travis output](https://travis-ci.org/balloob/home-assistant/).
- Check for comments and suggestions on your Pull Request and keep an eye on the [CI output](https://travis-ci.org/balloob/home-assistant/).

If you add a platform for an existing component, there is usually no need for updating the frontend. Only if you've added a new component that should show up in the frontend, there are more steps needed:

Expand Down Expand Up @@ -75,20 +76,12 @@ To test your code before submission, used the `tox` tool.
> tox
```

This will run unit tests against python 3.4 and 3.5 (if both are
available locally), as well as run a set of tests which validate
`pep8` and `pylint` style of the code.
This will run unit tests against python 3.4 and 3.5 (if both are available locally), as well as run a set of tests which validate `pep8` and `pylint` style of the code.

You can optionally run tests on only one tox target using the `-e`
option to select an environment.
You can optionally run tests on only one tox target using the `-e` option to select an environment.

For instance `tox -e lint` will run the linters only, `tox -e py34`
will run unit tests only on python 3.4.
For instance `tox -e lint` will run the linters only, `tox -e py34` will run unit tests only on python 3.4.

### Notes on PyLint and PEP8 validation

In case a PyLint warning cannot be avoided, add a comment to disable
the PyLint check for that line. This can be done using the format
`# pylint: disable=YOUR-ERROR-NAME`. Example of an unavoidable PyLint
warning is if you do not use the passed in datetime if you're
listening for time change.
In case a PyLint warning cannot be avoided, add a comment to disable the PyLint check for that line. This can be done using the format `# pylint: disable=YOUR-ERROR-NAME`. Example of an unavoidable PyLint warning is if you do not use the passed in datetime if you're listening for time change.

0 comments on commit f8f0ed8

Please sign in to comment.