Fetching contributors…
Cannot retrieve contributors at this time
60 lines (45 sloc) 2.61 KB
Guidelines for contributing
Coding guidelines
Like any well behaved python project out there, we are `PEP-8`_ compliant.
All the gory details are in the link, a quick way to find out whether your
code is complaint or not is via lints, such as `pylint`_ or `pep8`_.
.. _PEP-8:
.. _pylint:
.. _pep8:
Documentation guidelines
All the documentation must be written in `rst`_. From the API documentation
to developer documentation, everything must be written in this lightweight
.. _rst:
Project guidelines
* Testing: We have strived for a good coverage in the core, and we want not
only to keep it this way, but we want even better coverage. So every
testable feature to be added to the core must be comprehensively tested.
The `twisted tool`_ that we use for testing has a `coverage`_ switch that
is very handy to back up this bold statements.
.. _twisted tool:
.. _coverage:
* Databases: As we had some bad experiences with ORMs in the past, and our
models are not that complex, we chose to create our own ORM layer. No, we
are not suffering from NIH syndrome, it is a very simple piece of code.
Anyway all the DB related code is contained in `wader.common.provider` and
tested in `wader.test.test_provider`. The schema and all the ORM related
methods must be there. Client code should never deal with cursors,
connections, etc.
* Portability: A great deal of effort has been invested on making this
code base as portable as possible (runs on OSX and Linux). As such, you
can not add any coupling in the code to any OS. All the troublesome methods
are abstracted out via the `wader.common.oal` module. Similarly, there is
a backend system that contains all the modules required to deal with a given
environment. For example, if NetworkManager is present we will use its
profile system, while if we operate standalone, a custom one will be used.
Most of this abstractions are shown in `wader.common.interfaces`.
* Translating: No strings should be marked for translation in the core, all
the translated strings must be UI ones. The core and the UI will communicate
via exceptions that the core will raise and the UI will catch. It is here
where a localized dialog can be shown to the user.