no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | doc:guidelines [2014/01/15 15:25] – gkazhoya | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== CRAM Programming Guidelines ===== | ||
+ | ==== Collaborative Development ==== | ||
+ | |||
+ | If you're working on a package that other people are working on / are using, please try to stick to the following guidelines: | ||
+ | |||
+ | * Always use the GIT version control system when developing | ||
+ | * One commit per feature with a meaningful commit message | ||
+ | * Send a //pull request// through GitHub, when: | ||
+ | * you want somebody to review your code | ||
+ | * you want your code to be tested on a different machine than yours | ||
+ | * you want to notify people of changes in the interface (?) <- do we want to do it this way, or announce interface changes differently | ||
+ | * ... | ||
+ | |||
+ | |||
+ | ==== Development of Roslisp Packages ==== | ||
+ | |||
+ | **package.xml/ | ||
+ | |||
+ | Relevant documentation: | ||
+ | |||
+ | * No manifest.xml' | ||
+ | * As a ''< | ||
+ | * Use ''< | ||
+ | * ... | ||
+ | * The license for all CRAM code should be BSD | ||
+ | * Put links to github into the ''< | ||
+ | * ... | ||
+ | |||
+ | **my-package-name.asd files** | ||
+ | * Put it into the root of your source directory, no need for symbolic links and asdf directories | ||
+ | * Always explicitly specify dependencies on //all// the Lisp packages, symbols of which you use in your code (even if the dependency is transitive and is automatically added by other packages that you depend on because of hierarchical dependencies) <- is this actually clear? | ||
+ | * ... | ||
+ | |||
+ | |||
+ | ==== Coding Style ==== | ||
+ | |||
+ | **Lisp** | ||
+ | |||
+ | * Pay attention to the indentation! :D | ||
+ | * Try not to exceed 80 symbols in width in your code | ||
+ | * Lisp names (variables, classes, methods, packages) are all lowercase with dashes in between: my-awesome-lisp-variable | ||
+ | * Do you usually get that feeling that something is underdocumented? | ||
+ | * ... | ||
+ | |||
+ | **Ros-related** | ||
+ | |||
+ | * ROS packages' | ||
+ | * ... | ||
+ | |||
+ | |||
+ | ==== Lisp Programming ==== | ||
+ | Some Lisp patterns and stuff would be nice, like tail recursive functions and accumulators, | ||
+ | |||
+ | ==== Testing ==== | ||
+ | |||
+ | The preferred Lisp package for writing simple unit tests is [[http:// | ||
+ | |||
+ | **Running existing tests** | ||
+ | |||
+ | Just do | ||
+ | |||
+ | < | ||
+ | |||
+ | The asdf system for tests usually has either the '' | ||
+ | |||
+ | And then: | ||
+ | |||
+ | < | ||
+ | ,!p asdf-system-to-test-tests | ||
+ | (run-tests) | ||
+ | </ | ||
+ | |||
+ | That's all. | ||
+ | |||
+ | **Writing unit tests for your functions** | ||
+ | |||
+ | TODO: here should go a link with some testing tutorial | ||
+ | |||
+ | **FiveAM** | ||
+ | If lisp-unit isn't expressive enough for you, consider using [[http:// | ||
+ | To run tests written with FiveAM (1) load the tests asdf package, (2) change to the corresponding Lisp package in the REPL and (3) execute '' |