Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:guidelines [2014/05/12 13:29] – gkazhoya | doc:guidelines [2019/05/16 13:43] – [Copyright notices] gkazhoya | ||
---|---|---|---|
Line 7: | Line 7: | ||
* Always use the GIT version control system when developing | * Always use the GIT version control system when developing | ||
* One commit per feature with a meaningful commit message | * One commit per feature with a meaningful commit message | ||
+ | * Use square brackets to annotate for which package the commit is. E.g.: ''" | ||
* Send a //pull request// through GitHub, when: | * Send a //pull request// through GitHub, when: | ||
* you want somebody to review your code | * you want somebody to review your code | ||
* you want your code to be tested on a different machine than yours | * you want your code to be tested on a different machine than yours | ||
* When sending pull requests always try to include a person who you'd like to review it in the comment to the request | * When sending pull requests always try to include a person who you'd like to review it in the comment to the request | ||
- | * In the unlikely case that your pull request gets ignored for 10 working days you can merge it in yourself | ||
If you want to introduce major interface changes through you code, make an announcement on the [[https:// | If you want to introduce major interface changes through you code, make an announcement on the [[https:// | ||
Line 17: | Line 17: | ||
==== Development of Roslisp Packages ==== | ==== Development of Roslisp Packages ==== | ||
- | **package.xml/ | + | **package.xml** |
Relevant documentation: | Relevant documentation: | ||
- | | + | * As a ''< |
- | | + | |
* Use ''< | * Use ''< | ||
* The license for all CRAM code should be BSD / Public Domain | * The license for all CRAM code should be BSD / Public Domain | ||
Line 29: | Line 28: | ||
**my-package-name.asd files** | **my-package-name.asd files** | ||
* Put it into the root of your source directory, no need for symbolic links and asdf directories | * 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? | + | * 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). |
Line 36: | Line 35: | ||
**Lisp** | **Lisp** | ||
- | * Pay attention to the indentation! | + | * Pay attention to the indentation!!! |
* Try not to exceed 80 symbols in width in your code | * 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 | + | * Lisp names (variables, classes, methods, packages) are all lowercase with dashes in between: |
- | * Do you usually get that feeling that something is underdocumented? | + | * Do you usually get that feeling that something is underdocumented? |
+ | * Try not to '' | ||
+ | * Don't use '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
**Ros-related** | **Ros-related** | ||
- | * ROS packages' | + | * ROS packages' |
- | ==== Lisp Programming | + | ==== Copyright notices |
- | Some Lisp patterns and stuff would be nice, like tail recursive functions | + | CRAM is open source software licensed under the BSD licence. |
+ | This means the code can be used by any third party without having to contribute anything back and having to mention | ||
+ | Our copyright notice is there to allow others to use our software without being afraid of being sued. | ||
- | ==== Testing ==== | + | An example copyright notice can be found in the header of most '' |
- | The preferred Lisp package for writing simple unit tests is [[http:// | + | Here are some guidelines on how to deal with the copyright notice of your code: |
+ | * When you create a new '' | ||
+ | * If you simply copy pasted a file, please keep the original notice intact. | ||
+ | * For non-sourcecode files such as a '' | ||
+ | * When editing an existing file, you can add your name into the header if you made a substantial contribution to the code. | ||
- | **Running existing tests** | + | A contribution is considered substantial if: |
+ | | ||
+ | | ||
- | Just do | + | A contribution is considered not substantial if: |
+ | * you fixed a typo, | ||
+ | * fixed indentation, | ||
+ | * slightly improved a documentation string, | ||
+ | * other minor contributions such as minor refactoring and nicification, | ||
+ | * minor bug fixes, | ||
+ | * copy paste of existing code with minor tweaks. | ||
- | < | + | This definition is, of course, not quantitative. If you are unsure, ask the current main maintainer of the software for an advice or look on the Internet for some inspiration, |
- | The asdf system for tests usually has either the '' | ||
- | And then: | + | ==== Lisp Programming ==== |
- | + | Todo: Some Lisp patterns and stuff would be nice, like tail recursive functions and optimization flags, making sure the functions have no side effects, etcetc... | |
- | < | + | |
- | ,!p asdf-system-to-test-tests | + | |
- | (run-tests) | + | |
- | </ | + | |
- | or | + | |
- | < | + | |
- | ... | + | |
- | (run-tests my-define-tests-function-name) | + | |
- | </ | + | |
- | + | ||
- | 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 '' |