2021-03-11 01:50:04 +01:00
|
|
|
Thanks for considering contributing your work to make Platypush a better product!
|
|
|
|
|
|
|
|
Contributions are more than welcome, and the follow the standard Gitlab procedure:
|
|
|
|
|
|
|
|
- [Fork the repo](https://git.platypush.tech/platypush/platypush).
|
|
|
|
- Prepare your changes.
|
|
|
|
- [Submit a merge request](https://git.platypush.tech/platypush/platypush/-/merge_requests).
|
|
|
|
|
|
|
|
Guidelines:
|
|
|
|
|
|
|
|
- The code should ideally have no LINT warnings/issues.
|
|
|
|
|
|
|
|
- Project conventions:
|
2021-03-12 01:17:29 +01:00
|
|
|
- 4 spaces to indent.
|
2021-03-11 01:50:04 +01:00
|
|
|
- RST format for classes and methods documentation
|
2021-03-12 01:17:29 +01:00
|
|
|
- Run `python generate_missing_docs.py` if you are adding new plugins/backends to automatically
|
|
|
|
generate the doc templates. Make sure that you don't accidentally remove lines elements from
|
|
|
|
the docs because of missing dependencies on the machine you use to generate the docs.
|
2021-03-11 01:50:04 +01:00
|
|
|
- Naming conventions: plugin classes are named `<Module>Plugin` and backend classes are
|
|
|
|
named `<Module>Backend`, with `<Module>` being the (camel-case) representation of the
|
|
|
|
Python module of the plugin without the prefix - for example, the plugin under
|
|
|
|
`platypush.plugins.light.hue` must be named `LightHuePlugin`.
|
|
|
|
|
|
|
|
- If possible, [add a test](https://git.platypush.tech/platypush/platypush/-/tree/master/tests)
|
|
|
|
for the new functionality. If you have built a new functionality that works with some specific
|
|
|
|
device or service then it's not required to write a test that mocks the whole service, but if
|
|
|
|
you are changing some of the core entities (e.g. requests, events, procedures, hooks, crons
|
|
|
|
or the bus) then make sure to add tests and not to break the existing tests.
|
|
|
|
|
|
|
|
- If the feature requires an optional dependency then make sure to document it:
|
|
|
|
|
2021-09-17 00:47:33 +02:00
|
|
|
- In the class docstring (see other plugins and backends for examples).
|
2021-03-11 01:50:04 +01:00
|
|
|
- In [`setup.py`](https://git.platypush.tech/platypush/platypush/-/blob/master/setup.py#L72) as
|
2021-09-17 00:47:33 +02:00
|
|
|
an `extras_require` entry.
|
|
|
|
- In the plugin/backend class pydoc string.
|
|
|
|
- In the `manifest.yaml` - refer to the Wiki (how to write
|
|
|
|
[plugins](https://git.platypush.tech/platypush/platypush/-/wikis/writing-your-own-plugins)
|
|
|
|
and [backends](https://git.platypush.tech/platypush/platypush/-/wikis/writing-your-own-backends))
|
|
|
|
for examples on how to write an extension manifest file.
|