...
Ushahidi consists of two parts: a core application in the src/
directory and a delivery layer in the application/ directory
. The delivery layer is currently built using the Kohana Framework and has slightly different coding standards than the rest of the application. The Kohana coding standards are documented in the Kohana user guide. The rest of the application uses PSR-2 code style, but uses tabs instead of spaces to prevent mixing tabs and spaces across the application.
...
Class names in the core application are autoloaded using PSR-04 and all exist with within Ushahidi
namespaces, and the files are all located within the src/
directory.
...
- CamelCased class names should be used when it is undesirable to create a new directory level.
- All class file names and directory names must match the case of the class as per PSR-04.
- All classes should be in the
classes
directory. This may be at any level in the cascading filesystem.
...
Javascript should follow the Airbnb Javascript Style Guide with a few exceptions
- Whitespace
Use tabs for indentation. Smart Tabs are allowed Braces
Braces use BSD/Allman style to match the Kohana coding styleModules
We're currently not enforcing a strict module structure, but are mostly using RequireJS CommonJS style modulesModule file names use PascalCase to match Kohana PHP file names
Concerns:
- The Google JS coding style says "Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they're opening" - as far as I can figure, after reading this and this, this is rubbish so sticking with current style.
- Kohana insists PHP constants be upper case, including TRUE and FALSE. Javascript doesn't recognise these if uppercase - this might be worth changing style for.
All JS should also pass in JSHint (with our .jshintrc).
...