tito/HACKING
Paul Morgan 3be5a2d1b6 provide config for editorconfig plugins
* If a dev adds an editorconfig plugin to their editor,
  automatically configure their editor for code style.

* Specify 4-space softtabs so new code will be compatible
  with Python 3.

* Put the same settings in .gitattributes so git diff
  highlights whitespace errors.
2014-02-27 21:22:05 +00:00

54 lines
1.3 KiB
Text

Hacking
=======
Python versions
---------------
Tito supports Python versions 2.4 (RHEL 5) and up.
See http://docs.python.org/dev/howto/pyporting.html
and http://python3porting.com/differences.html
for tips on writing portable Python code.
Tests
-----
To run all tests, install the python-nose and python3-nose
packages, then from the root of the project:
python ./runtests.py
When developing code for tito there are a couple ways you can test:
"bin/tito-dev" is a script that will run code from the local checkout
rather than what is installed on the system.
And of course, you can always use the installed tito to replace
itself with a test build of the latest *committed* code in your
git HEAD.
tito build --rpm --test -i
If you screw anything up inside tito itself, you can just:
rpm -e tito
yum install tito
Code style
----------
Python3 does not allow mixing tabs and spaces for indentation.
http://docs.python.org/3.3/reference/lexical_analysis.html
You can force your editor to do the right thing by installing
a plugin for your editor from http://editorconfig.org/#download
For example, add the EditorConfig plugin for vim like this:
cd /tmp/
wget https://github.com/editorconfig/editorconfig-vim/archive/master.zip
unzip master.zip
mkdir ~/.vim
cp -r editorconfig-vim-master/* ~/.vim/