Skip to content

Commit

Permalink
more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jul 22, 2014
1 parent 8e25a48 commit ef1c5e3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/dev/codebase-guide.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
A quick guide to the khmer codebase
===================================

The ChangeLog file lists changes to the codebase, most recent first.

The lib/ directory contains all of the C++ code.

The khmer/ directory contains the khmer package (khmer/khmer/__init__.py etc)
and the C++-to-Python bridge (khmer/_khmermodule.cc).

The scripts/ and sandbox/ directory contain command-line scripts.

The tests/ directory contains all of the tests.

73 changes: 73 additions & 0 deletions doc/dev/coding-guidelines-and-review.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Coding guidelines and code review checklist
===========================================

(Copied from :doc:`../development.txt`)

Coding standards
----------------

All plain-text files should have line widths of 80 characters or less unless
that is not supported for the particular file format.

For C++, we use `Todd Hoff's coding standard
<http://www.possibility.com/Cpp/CppCodingStandard.html>`__, and
`astyle -A10 / "One True Brace Style"
<http://astyle.sourceforge.net/astyle.html>`__ indentation and
bracing. Note: @CTB needs emacs settings that work for this.

Vim users may want to set the ARTISTIC_STYLE_OPTIONS shell variable to "-A10
--max-code-length=80" and run ```:%!astyle``` to reformat. The four space
indentation can be set with::

set expandtab
set shiftwidth=4
set softtabstop=4

For Python, `PEP 8 <http://www.python.org/dev/peps/pep-0008/>`__ is our
standard. The ```pep8``` and ```autopep8``` Makefile targets are helpful.

Code, scripts, and documentation must have its spelling checked. Vim users can
run::

:setlocal spell spelllang=en_us

Use `]s` and `[s` to navigate between misspellings and `z=` to suggest a
correctly spelled word. `zg` will add a word as a good word.

GNU's `aspell` can also be used to check the spelling in a single file::

aspell check --mode ccpp $filename

Code Review
-----------

Please read `11 Best Practices for Peer Code Review
<http://smartbear.com/SmartBear/media/pdfs/WP-CC-11-Best-Practices-of-Peer-Code-Review.pdf>`__.

See also `Code reviews: the lab meeting for code
<http://fperez.org/py4science/code_reviews.html>`__ and
`the PyCogent coding guidelines
<http://pycogent.org/coding_guidelines.html>`__.

Checklist
---------

Copy and paste the following into a pull-request when it is ready for review::

- [ ] Is it mergable
- [ ] Did it pass the tests?
- [ ] If it introduces new functionality in scripts/ is it tested?
Check for code coverage.
- [ ] Is it well formatted? Look at `pep8`/`pylint`, `cppcheck`, and
`make doc` output. Use `autopep8` and `astyle -A10 --max-code-length=80`
if needed.
- [ ] Is it documented in the Changelog?
- [ ] Was spellcheck run on the source code and documentation after changes
were made?

Testing
-------

``./setup.py nosetest`` is the canonical way to run the tests. This is what
``make test`` does.

8 changes: 8 additions & 0 deletions doc/dev/getting-started.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ Start by making your own copy of khmer and setting yourself up for
development; then, build khmer and run the tests; and finally, claim
an issue and start developing!

If you're unfamiliar with git and branching in particular, check out
the `git-scm book <http://git-scm.com/book/en/Git-Branching>`__.

We've provided a quick guide to the khmer code base here:
:doc:`codebase-guide`.

One-time Preparation
--------------------

Expand Down Expand Up @@ -127,6 +133,8 @@ Claiming an issue and starting to develop

This will be issue dependent ;).

You will need to visit and revisit :doc:`coding-guidelines-and-review`.

#. Run the tests and/or build the docs _after_ your changes have been committed::

make doc test
Expand Down

0 comments on commit ef1c5e3

Please sign in to comment.