Cleaning up our code
The Launchpad code base has evolved quite a bit over its history, and as is true with any large software project, it needs weeding to keep it beautiful. We strongly encourage developers to clean up the code, both as small drive-bys in feature or bug branches, and in pure-cleanup branches. This page collects both procedures surrounding cleanups and lists all the potential cleanups that you want to do.
Finding things to clean up
You might want to start with addressing any XXX comments in the code, which according to our PolicyandProcess/XXXPolicy should be tied to an open bug report. Curtis publishes an XXX Report and you can do an XXX check in your own tree:
The script is found in lp:lp-dev-utils
% python -t <your local projects directory>/lp-dev-utils/xxxreport.py -f csv -o xxx-report.csv ./ % oocalc ./xxx-report.csv
How to clean up the code
XXX
Clean ups you want to do
bug # |
description |
relative size |
when you gonna do it?! |
pre-imp notes |
XXX |
add to LaunchpadObjectFactory a method to create a mailing list in a particular state |
medium |
2.1.10 |
Discussed w/cprov as part of bug 237210; would simplify lots of pagetests; eliminate most uses of removeSecurityProxy() in tests |
XXX |
move most of the mailing list page tests to -pages.txt view tests |
medium |
2.1.10 |
see work already done on branch reviewed by sinzui |
XXX |
Add test doubles for codehosting XML-RPC methods that back onto dictionaries, not the database |
medium |
|
|
XXX |
Change codehosting service tests to not rely on sample data, and use the factory instead |
medium |
|
|
XXX |
Re-organize the codehosting tests so that each 'thing' is tested only once. |
large |
|
|
XXX |
Add a helper that implements make_branch, make_branch_and_tree ala Bazaar's test case, but lacks the restrictions of same |
small |
|
|
Removing unused python code
If you found some piece of code that is currently unused, you are encouraged to remove it as long as it's comprised of methods/functions, one or more classes or a single module. If you found a whole package (i.e. a directory with python modules) that is unused, you should send an email to launchpad@ to notify other developers about the removal, as well as list that removal in DeadCode.