|
| 1 | + |
| 2 | +# Contributing to Sparta: Guidelines |
| 3 | + |
| 4 | +Bug fixes, enhancements are welcomed and encouraged. But there are a |
| 5 | +few rules... |
| 6 | + |
| 7 | +## Rules for Code Development |
| 8 | + |
| 9 | +* Rule1: Any bug fix/enhancement _must be accompanied_ with a test |
| 10 | + that illustrates the bug fix/enhancement. No test == no acceptance. |
| 11 | + Documentation fixes obviously don't require this... |
| 12 | + |
| 13 | +* Rule2: Adhere to [Sparta's Coding |
| 14 | + Style](sparta's-coding-style). Look at the existing code and mimic |
| 15 | + it. Don't mix another preferred style with Sparta's. Stick with |
| 16 | + Sparta's. |
| 17 | + |
| 18 | +## Sparta's Coding Style |
| 19 | + |
| 20 | +* There are simple style rules: |
| 21 | + 1. Class names are `CamelCase` with the Camel's head up: `class SpartaHandler` |
| 22 | + 1. Public class method names are `camelCase` with the camel's head down: `void myMethod()` |
| 23 | + 1. Private/protected class method names are `camelCase_` with the camel's head down and a trailing `_`: `void myMethod_()` |
| 24 | + 1. Member variable names that are `private` or `protected` must |
| 25 | + be all `lower_case_` with a trailing `_` so developers know a |
| 26 | + memory variable is private or protected. Placing an `_` |
| 27 | + between words: preferred. |
| 28 | + 1. Header file guards are `#pragma once` |
| 29 | + 1. Any function/class from `std` namespace must always be |
| 30 | + explicit: `std::vector` NOT `vector`. Never use `using |
| 31 | + namespace <blah>;` in *any* header file |
| 32 | + 1. Consider using source files for non-critical path code |
| 33 | + 1. Try to keep methods short and concise (yes, we break this rule a bit) |
| 34 | + 1. Do not go nuts with `auto`. This `auto foo(const auto & in)` is ... irritating |
| 35 | + 1. All public APIs *must be doxygenated*. No exceptions. |
0 commit comments